summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Fl_cocoa.mm11
-rw-r--r--test/fullscreen.cxx10
2 files changed, 17 insertions, 4 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index 9b4e004ce..01995984b 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -3403,6 +3403,17 @@ void Fl_Cocoa_Window_Driver::use_border() {
if (!shown() || pWindow->parent()) return;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
if (fl_mac_os_version >= 100600) {
+ if (pWindow->fullscreen_active()) {
+ // prevent changing border while window is fullscreen
+ static bool active = false;
+ if (!active) {
+ active = true;
+ bool b = !border();
+ pWindow->border(b);
+ active = false;
+ }
+ return;
+ }
[fl_xid(pWindow) setStyleMask:calc_win_style(pWindow)]; // 10.6
if (border()) restore_window_title_and_icon(pWindow, icon_image);
pWindow->redraw();
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;