summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2011-09-30 13:09:06 +0000
committerManolo Gouy <Manolo>2011-09-30 13:09:06 +0000
commit2df4196d8b29fdb3d4708741c9b76805a9bb6241 (patch)
treef85c740ca3be84baf9915b325db66f49156adc4b
parent7694e9b0a650c0a724db0415579a56cb2ad13e74 (diff)
About STR#2600 : some code factorization.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9101 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--FL/Fl.H1
-rw-r--r--FL/mac.H1
-rw-r--r--src/Fl_cocoa.mm2
-rw-r--r--src/Fl_win32.cxx1
-rw-r--r--src/screen_xywh.cxx9
5 files changed, 8 insertions, 6 deletions
diff --git a/FL/Fl.H b/FL/Fl.H
index ed6b7c56b..0a5016f9a 100644
--- a/FL/Fl.H
+++ b/FL/Fl.H
@@ -133,6 +133,7 @@ public: // should be private!
static Fl_Window* modal_;
static Fl_Window* grab_;
static int compose_state;
+ static void call_screen_init(); // recompute screen number and dimensions
#endif
/**
If true then flush() will do something.
diff --git a/FL/mac.H b/FL/mac.H
index c53824ea7..3fd52669d 100644
--- a/FL/mac.H
+++ b/FL/mac.H
@@ -126,7 +126,6 @@ public:
static CGContextRef none_cursor_image(void);
static void *get_carbon_function(const char *name);
static void screen_work_area(int &X, int &Y, int &W, int &H, int n); // compute work area of a given screen
- static void mac_screen_init(void); // recompute screen number and dimensions
private:
static void relink(Fl_Window*, Fl_Window*);
bool subwindow;
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index 876426b43..b38c652d1 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -1088,7 +1088,7 @@ void fl_open_callback(void (*cb)(const char *)) {
- (void)applicationDidChangeScreenParameters:(NSNotification *)unused
{ // react to changes in screen numbers and positions
main_screen_height = [[[NSScreen screens] objectAtIndex:0] frame].size.height;
- Fl_X::mac_screen_init();
+ Fl::call_screen_init();
// FLTK windows have already been notified they were moved,
// but they had the old main_screen_height, so they must be notified again.
NSArray *windows = [NSApp windows];
diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx
index 9adbfc9dd..44613a666 100644
--- a/src/Fl_win32.cxx
+++ b/src/Fl_win32.cxx
@@ -1204,6 +1204,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
if (fl_msg.message == WM_RENDERALLFORMATS) CloseClipboard();
return 1;}
case WM_DISPLAYCHANGE: // occurs when screen configuration (number, position) changes
+ Fl::call_screen_init();
Fl::handle(FL_SCREEN_CONFIGURATION_CHANGED, NULL);
return 0;
diff --git a/src/screen_xywh.cxx b/src/screen_xywh.cxx
index 878b9bf9a..aa7719eb0 100644
--- a/src/screen_xywh.cxx
+++ b/src/screen_xywh.cxx
@@ -142,10 +142,6 @@ static void screen_init() {
num_screens = count;
}
-void Fl_X::mac_screen_init() {
- screen_init();
- }
-
#elif HAVE_XINERAMA
# include <X11/extensions/Xinerama.h>
@@ -189,6 +185,11 @@ static void screen_init() {
}
#endif // WIN32
+#ifndef FL_DOXYGEN
+void Fl::call_screen_init() {
+ screen_init();
+}
+#endif
/**
Gets the number of available screens.