Skip to content

Commit d40b1c4

Browse files
committed
fix: undo some changes in fix for 2024, for mingw/windows builds
1 parent 697978f commit d40b1c4

File tree

2 files changed

+20
-21
lines changed

2 files changed

+20
-21
lines changed

vendor/fltk2/src/run.cxx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,26 @@ bool fltk::grab_,
8888
fltk::exit_modal_;
8989

9090

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+
91111
extern "C" {
92112
// This function is here because Window::label() uses it:
93113
// Make sure fltk/string.h is included above. Without it it appears

vendor/fltk2/src/x11/run.cxx

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -66,27 +66,6 @@
6666
using namespace fltk;
6767

6868

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-
9069
////////////////////////////////////////////////////////////////
9170
// interface to poll/select call:
9271

0 commit comments

Comments
 (0)