File tree Expand file tree Collapse file tree 2 files changed +20
-21
lines changed Expand file tree Collapse file tree 2 files changed +20
-21
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,26 @@ bool fltk::grab_,
88
88
fltk::exit_modal_;
89
89
90
90
91
+ static Window *xfocus; // which window X thinks has focus
92
+ static Window *xmousewin; // which window X thinks has ENTER
93
+ // Update focus() in response to anything that might change it.
94
+ // This is called whenever a window is added or hidden, and whenever
95
+ // X says the focus window has changed.
96
+ static void fix_focus () {
97
+ Widget* w = xfocus;
98
+ // Modal overrides whatever the system says the focus is:
99
+ if (grab_ || w && modal_) w = modal_;
100
+ if (w) {
101
+ if (w->contains (focus ())) return ; // already has it
102
+ unsigned saved = e_keysym;
103
+ e_keysym = 0 ; // make widgets not think a keystroke moved focus
104
+ if (w->take_focus ()) {e_keysym = saved; return ;}
105
+ e_keysym = saved;
106
+ }
107
+ // give nothing the focus:
108
+ focus (0 );
109
+ }
110
+
91
111
extern " C" {
92
112
// This function is here because Window::label() uses it:
93
113
// Make sure fltk/string.h is included above. Without it it appears
Original file line number Diff line number Diff line change 66
66
using namespace fltk ;
67
67
68
68
69
- static Window *xfocus; // which window X thinks has focus
70
- static Window *xmousewin; // which window X thinks has ENTER
71
-
72
- // Update focus() in response to anything that might change it.
73
- // This is called whenever a window is added or hidden, and whenever
74
- // X says the focus window has changed.
75
- static void fix_focus () {
76
- Widget* w = xfocus;
77
- // Modal overrides whatever the system says the focus is:
78
- if (grab_ || w && modal_) w = modal_;
79
- if (w) {
80
- if (w->contains (focus ())) return ; // already has it
81
- unsigned saved = e_keysym;
82
- e_keysym = 0 ; // make widgets not think a keystroke moved focus
83
- if (w->take_focus ()) {e_keysym = saved; return ;}
84
- e_keysym = saved;
85
- }
86
- // give nothing the focus:
87
- focus (0 );
88
- }
89
-
90
69
// //////////////////////////////////////////////////////////////
91
70
// interface to poll/select call:
92
71
You can’t perform that action at this time.
0 commit comments