diff options
| author | Manolo Gouy <Manolo> | 2011-09-30 08:03:22 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2011-09-30 08:03:22 +0000 |
| commit | c029bba113a2a28d858ac6d25607ccb870a6928a (patch) | |
| tree | 13b49313aa24bba2415161c4cd4161436f51214e /src | |
| parent | 9f9c16ac16e14a3a94fe3aef363f549cd4c6b3bf (diff) | |
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.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9087 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl.cxx | 3 | ||||
| -rw-r--r-- | src/Fl_cocoa.mm | 1 | ||||
| -rw-r--r-- | src/Fl_win32.cxx | 3 |
3 files changed, 6 insertions, 1 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx index 597fa2942..6264c4a30 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -776,8 +776,9 @@ static handler_link *handlers = 0; 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 diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 801c848c2..67cae882c 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -1099,6 +1099,7 @@ void fl_open_callback(void (*cb)(const char *)) { [[NSNotificationCenter defaultCenter] postNotificationName:NSWindowDidMoveNotification object:win]; } } + Fl::handle(FL_SCREEN_CONFIGURATION_CHANGED, NULL); } - (void)applicationWillResignActive:(NSNotification *)notify { diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index 1774c416b..9adbfc9dd 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -1203,6 +1203,9 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar // 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; |
