Author: manolo
Date: 2011-09-30 01:03:22 -0700 (Fri, 30 Sep 2011)
New Revision: 9087
Log:
Fix STR#2600 for the MSWindow and Mac OS platforms.

A new event FL_SCREEN_CONFIGURATION_CHANGED is introduced.
Fl::add_handler() allows to register a callback for this event.
The unix/X11 implementation is still missing.

Modified:
   branches/branch-1.3/FL/Enumerations.H
   branches/branch-1.3/src/Fl.cxx
   branches/branch-1.3/src/Fl_cocoa.mm
   branches/branch-1.3/src/Fl_win32.cxx

Modified: branches/branch-1.3/FL/Enumerations.H
===================================================================
--- branches/branch-1.3/FL/Enumerations.H       2011-09-29 21:10:59 UTC (rev 
9086)
+++ branches/branch-1.3/FL/Enumerations.H       2011-09-30 08:03:22 UTC (rev 
9087)
@@ -283,7 +283,11 @@
       If the widget returns 1, it will receive the data in the immediately 
       following FL_PASTE event.
    */
-  FL_DND_RELEASE       = 23
+  FL_DND_RELEASE       = 23,
+  /** The screen configuration (number, positions) was changed.
+   Use Fl::add_handler() to be notified of this event.
+   */
+  FL_SCREEN_CONFIGURATION_CHANGED = 24
 };
 
 /** \name When Conditions */

Modified: branches/branch-1.3/src/Fl.cxx
===================================================================
--- branches/branch-1.3/src/Fl.cxx      2011-09-29 21:10:59 UTC (rev 9086)
+++ branches/branch-1.3/src/Fl.cxx      2011-09-30 08:03:22 UTC (rev 9087)
@@ -776,8 +776,9 @@
   them returns non-zero then the event is ignored.  Events that cause
   this to be called are:
 
-  - FL_SHORTCUT events that are not recognized by any widget.
+  - \ref FL_SHORTCUT events that are not recognized by any widget.
     This lets you provide global shortcut keys.
+  - \ref FL_SCREEN_CONFIGURATION_CHANGED events (not implemented on the X11 
platform).
   - System events that FLTK does not recognize.  See fl_xevent.
   - \e Some other events when the widget FLTK selected returns
     zero from its handle() method.  Exactly which ones may change

Modified: branches/branch-1.3/src/Fl_cocoa.mm
===================================================================
--- branches/branch-1.3/src/Fl_cocoa.mm 2011-09-29 21:10:59 UTC (rev 9086)
+++ branches/branch-1.3/src/Fl_cocoa.mm 2011-09-30 08:03:22 UTC (rev 9087)
@@ -1099,6 +1099,7 @@
       [[NSNotificationCenter defaultCenter] 
postNotificationName:NSWindowDidMoveNotification object:win];
       }
     }
+  Fl::handle(FL_SCREEN_CONFIGURATION_CHANGED, NULL);
 }
 - (void)applicationWillResignActive:(NSNotification *)notify
 {

Modified: branches/branch-1.3/src/Fl_win32.cxx
===================================================================
--- branches/branch-1.3/src/Fl_win32.cxx        2011-09-29 21:10:59 UTC (rev 
9086)
+++ branches/branch-1.3/src/Fl_win32.cxx        2011-09-30 08:03:22 UTC (rev 
9087)
@@ -1203,6 +1203,9 @@
     // unclear on what is correct:
     if (fl_msg.message == WM_RENDERALLFORMATS) CloseClipboard();
     return 1;}
+  case WM_DISPLAYCHANGE: // occurs when screen configuration (number, 
position) changes
+    Fl::handle(FL_SCREEN_CONFIGURATION_CHANGED, NULL);
+    return 0;
 
   default:
     if (Fl::handle(0,0)) return 0;

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to