diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2024-10-31 15:15:33 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2024-10-31 15:15:33 +0100 |
| commit | 0ac13799853e87c331fc99f7387a5d5603c5820b (patch) | |
| tree | d410ba13a067dae013191fbd664a7281a135dd8d /test/fullscreen.cxx | |
| parent | 0cab095b3c5485a06767966a1e080432db81eb3e (diff) | |
macOS: prevent changing window border while window is fullscreen
Diffstat (limited to 'test/fullscreen.cxx')
| -rw-r--r-- | test/fullscreen.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/fullscreen.cxx b/test/fullscreen.cxx index 780eae32d..32cc95582 100644 --- a/test/fullscreen.cxx +++ b/test/fullscreen.cxx @@ -174,10 +174,12 @@ void double_cb(Fl_Widget *o, void *p) { void double_cb(Fl_Widget *, void *) {} #endif -void border_cb(Fl_Widget *o, void *p) { - Fl_Window *w = (Fl_Window *)p; - int d = ((Fl_Button *)o)->value(); + +void border_cb(Fl_Button *b, Fl_Window *w) { + int d = b->value(); w->border(d); + // border change may have been refused (e.g. with fullscreen window) + if (w->border() != d) b->value(w->border()); } @@ -337,7 +339,7 @@ int main(int argc, char **argv) { y+=30; Fl_Toggle_Light_Button b2(50,y,window.w()-60,30,"Border"); - b2.callback(border_cb,w); + b2.callback((Fl_Callback*)border_cb,w); b2.set(); border_button = &b2; y+=30; |
