Skip to content

Commit

Permalink
fix: undo some changes in fix for 2024, for mingw/windows builds
Browse files Browse the repository at this point in the history
  • Loading branch information
jochumdev committed Oct 14, 2024
1 parent 697978f commit d40b1c4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 21 deletions.
20 changes: 20 additions & 0 deletions vendor/fltk2/src/run.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,26 @@ bool fltk::grab_,
fltk::exit_modal_;


static Window *xfocus; // which window X thinks has focus
static Window *xmousewin; // which window X thinks has ENTER
// Update focus() in response to anything that might change it.
// This is called whenever a window is added or hidden, and whenever
// X says the focus window has changed.
static void fix_focus() {
Widget* w = xfocus;
// Modal overrides whatever the system says the focus is:
if (grab_ || w && modal_) w = modal_;
if (w) {
if (w->contains(focus())) return; // already has it
unsigned saved = e_keysym;
e_keysym = 0; // make widgets not think a keystroke moved focus
if (w->take_focus()) {e_keysym = saved; return;}
e_keysym = saved;
}
// give nothing the focus:
focus(0);
}

extern "C" {
// This function is here because Window::label() uses it:
// Make sure fltk/string.h is included above. Without it it appears
Expand Down
21 changes: 0 additions & 21 deletions vendor/fltk2/src/x11/run.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -66,27 +66,6 @@
using namespace fltk;


static Window *xfocus; // which window X thinks has focus
static Window *xmousewin; // which window X thinks has ENTER

// Update focus() in response to anything that might change it.
// This is called whenever a window is added or hidden, and whenever
// X says the focus window has changed.
static void fix_focus() {
Widget* w = xfocus;
// Modal overrides whatever the system says the focus is:
if (grab_ || w && modal_) w = modal_;
if (w) {
if (w->contains(focus())) return; // already has it
unsigned saved = e_keysym;
e_keysym = 0; // make widgets not think a keystroke moved focus
if (w->take_focus()) {e_keysym = saved; return;}
e_keysym = saved;
}
// give nothing the focus:
focus(0);
}

////////////////////////////////////////////////////////////////
// interface to poll/select call:

Expand Down

0 comments on commit d40b1c4

Please sign in to comment.