You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

fltk-1_v2.3.0-modal.patch 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. diff -bur fltk-1.3.0r9619.org/src/Fl_cocoa.mm fltk-1.3.0r9619/src/Fl_cocoa.mm
  2. --- fltk-1.3.0r9619.org/src/Fl_cocoa.mm 2012-06-19 12:54:43.694231638 +0200
  3. +++ fltk-1.3.0r9619/src/Fl_cocoa.mm 2012-06-19 12:57:05.899048602 +0200
  4. @@ -697,12 +697,9 @@
  5. return NO; // prevent the caption to be redrawn as active on click
  6. // when another modal window is currently the key win
  7. - return !(w->tooltip_window() || w->menu_window());
  8. + return !w->tooltip_window();
  9. }
  10. -// TODO see if we really need a canBecomeMainWindow ...
  11. -#if 0
  12. -
  13. - (BOOL)canBecomeMainWindow
  14. {
  15. if (Fl::modal_ && (Fl::modal_ != w))
  16. @@ -711,7 +708,6 @@
  17. return !(w->tooltip_window() || w->menu_window());
  18. }
  19. -#endif
  20. @end
  21. diff -bur fltk-1.3.0r9619.org/src/Fl_win32.cxx fltk-1.3.0r9619/src/Fl_win32.cxx
  22. --- fltk-1.3.0r9619.org/src/Fl_win32.cxx 2012-06-19 12:54:43.696231735 +0200
  23. +++ fltk-1.3.0r9619/src/Fl_win32.cxx 2012-06-19 12:54:43.803236862 +0200
  24. @@ -1065,6 +1065,10 @@
  25. break;
  26. case WM_SETFOCUS:
  27. + if ((Fl::modal_) && (Fl::modal_ != window)) {
  28. + SetFocus(fl_xid(Fl::modal_));
  29. + return 0;
  30. + }
  31. Fl::handle(FL_FOCUS, window);
  32. break;
  33. @@ -1826,6 +1830,11 @@
  34. Fl::e_number = old_event;
  35. w->redraw(); // force draw to happen
  36. }
  37. +
  38. + // Needs to be done before ShowWindow() to get the correct behaviour
  39. + // when we get WM_SETFOCUS.
  40. + if (w->modal()) {Fl::modal_ = w; fl_fix_focus();}
  41. +
  42. // If we've captured the mouse, we dont want to activate any
  43. // other windows from the code, or we lose the capture.
  44. ShowWindow(x->xid, !showit ? SW_SHOWMINNOACTIVE :
  45. @@ -1843,7 +1852,6 @@
  46. }
  47. }
  48. - if (w->modal()) {Fl::modal_ = w; fl_fix_focus();}
  49. return x;
  50. }
  51. diff -bur fltk-1.3.0r9619.org/src/Fl_x.cxx fltk-1.3.0r9619/src/Fl_x.cxx
  52. --- fltk-1.3.0r9619.org/src/Fl_x.cxx 2012-06-19 12:54:43.697231783 +0200
  53. +++ fltk-1.3.0r9619/src/Fl_x.cxx 2012-06-19 12:54:43.804236911 +0200
  54. @@ -2101,6 +2101,12 @@
  55. while (wp->parent()) wp = wp->window();
  56. XSetTransientForHint(fl_display, xp->xid, fl_xid(wp));
  57. if (!wp->visible()) showit = 0; // guess that wm will not show it
  58. + if (win->modal()) {
  59. + Atom net_wm_state = XInternAtom (fl_display, "_NET_WM_STATE", 0);
  60. + Atom net_wm_state_skip_taskbar = XInternAtom (fl_display, "_NET_WM_STATE_MODAL", 0);
  61. + XChangeProperty (fl_display, xp->xid, net_wm_state, XA_ATOM, 32,
  62. + PropModeAppend, (unsigned char*) &net_wm_state_skip_taskbar, 1);
  63. + }
  64. }
  65. // Make sure that borderless windows do not show in the task bar