mirror of
https://github.com/fltk/fltk.git
synced 2026-05-31 22:04:26 +08:00
About STR#2600 : some code factorization.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9101 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
@@ -133,6 +133,7 @@ public: // should be private!
|
|||||||
static Fl_Window* modal_;
|
static Fl_Window* modal_;
|
||||||
static Fl_Window* grab_;
|
static Fl_Window* grab_;
|
||||||
static int compose_state;
|
static int compose_state;
|
||||||
|
static void call_screen_init(); // recompute screen number and dimensions
|
||||||
#endif
|
#endif
|
||||||
/**
|
/**
|
||||||
If true then flush() will do something.
|
If true then flush() will do something.
|
||||||
|
|||||||
@@ -126,7 +126,6 @@ public:
|
|||||||
static CGContextRef none_cursor_image(void);
|
static CGContextRef none_cursor_image(void);
|
||||||
static void *get_carbon_function(const char *name);
|
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 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:
|
private:
|
||||||
static void relink(Fl_Window*, Fl_Window*);
|
static void relink(Fl_Window*, Fl_Window*);
|
||||||
bool subwindow;
|
bool subwindow;
|
||||||
|
|||||||
+1
-1
@@ -1088,7 +1088,7 @@ void fl_open_callback(void (*cb)(const char *)) {
|
|||||||
- (void)applicationDidChangeScreenParameters:(NSNotification *)unused
|
- (void)applicationDidChangeScreenParameters:(NSNotification *)unused
|
||||||
{ // react to changes in screen numbers and positions
|
{ // react to changes in screen numbers and positions
|
||||||
main_screen_height = [[[NSScreen screens] objectAtIndex:0] frame].size.height;
|
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,
|
// FLTK windows have already been notified they were moved,
|
||||||
// but they had the old main_screen_height, so they must be notified again.
|
// but they had the old main_screen_height, so they must be notified again.
|
||||||
NSArray *windows = [NSApp windows];
|
NSArray *windows = [NSApp windows];
|
||||||
|
|||||||
@@ -1204,6 +1204,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
|
|||||||
if (fl_msg.message == WM_RENDERALLFORMATS) CloseClipboard();
|
if (fl_msg.message == WM_RENDERALLFORMATS) CloseClipboard();
|
||||||
return 1;}
|
return 1;}
|
||||||
case WM_DISPLAYCHANGE: // occurs when screen configuration (number, position) changes
|
case WM_DISPLAYCHANGE: // occurs when screen configuration (number, position) changes
|
||||||
|
Fl::call_screen_init();
|
||||||
Fl::handle(FL_SCREEN_CONFIGURATION_CHANGED, NULL);
|
Fl::handle(FL_SCREEN_CONFIGURATION_CHANGED, NULL);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|||||||
+5
-4
@@ -142,10 +142,6 @@ static void screen_init() {
|
|||||||
num_screens = count;
|
num_screens = count;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Fl_X::mac_screen_init() {
|
|
||||||
screen_init();
|
|
||||||
}
|
|
||||||
|
|
||||||
#elif HAVE_XINERAMA
|
#elif HAVE_XINERAMA
|
||||||
# include <X11/extensions/Xinerama.h>
|
# include <X11/extensions/Xinerama.h>
|
||||||
|
|
||||||
@@ -189,6 +185,11 @@ static void screen_init() {
|
|||||||
}
|
}
|
||||||
#endif // WIN32
|
#endif // WIN32
|
||||||
|
|
||||||
|
#ifndef FL_DOXYGEN
|
||||||
|
void Fl::call_screen_init() {
|
||||||
|
screen_init();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Gets the number of available screens.
|
Gets the number of available screens.
|
||||||
|
|||||||
Reference in New Issue
Block a user