From d3d7597484394d43f9b88dbdcfa2e993d14621d3 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Sat, 16 Apr 2016 11:02:35 +0000 Subject: [PATCH] Continue removing non window-related member-functions from class Fl_X. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11630 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- FL/x.H | 1 - src/Fl_x.cxx | 14 +++++++------- src/drivers/X11/Fl_X11_Screen_Driver.H | 1 + src/drivers/X11/Fl_X11_Screen_Driver.cxx | 2 +- src/drivers/X11/Fl_X11_Window_Driver.cxx | 3 ++- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/FL/x.H b/FL/x.H index 1daa3ba0e..e5e5d8471 100644 --- a/FL/x.H +++ b/FL/x.H @@ -135,7 +135,6 @@ public: void flush() {w->flush();} static void x(Fl_Window* wi, int X) {wi->x(X);} static void y(Fl_Window* wi, int Y) {wi->y(Y);} - static int ewmh_supported(); static void activate_window(Window w); static void copy_image(const unsigned char* data, int W, int H, int destination = 0); }; diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx index cdcbfe4f6..5a784be71 100644 --- a/src/Fl_x.cxx +++ b/src/Fl_x.cxx @@ -2172,7 +2172,7 @@ static void send_wm_state_event(Window wnd, int add, Atom prop) { add ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE, prop); } -int Fl_X::ewmh_supported() { +int Fl_X11_Screen_Driver::ewmh_supported() { static int result = -1; if (result == -1) { @@ -2215,7 +2215,7 @@ char Fl_Xlib_Graphics_Driver::can_do_alpha_blending() { extern Fl_Window *fl_xfocus; void Fl_X::activate_window(Window w) { - if (!ewmh_supported()) + if (!Fl_X11_Screen_Driver::ewmh_supported()) return; Window prev = 0; @@ -2233,7 +2233,7 @@ void Fl_X::activate_window(Window w) { /* Change an existing window to fullscreen */ void Fl_X11_Window_Driver::fullscreen_on() { - if (Fl_X::ewmh_supported()) { + if (Fl_X11_Screen_Driver::ewmh_supported()) { int top, bottom, left, right; top = fullscreen_screen_top(); @@ -2262,7 +2262,7 @@ void Fl_X11_Window_Driver::fullscreen_on() { } void Fl_X11_Window_Driver::fullscreen_off(int X, int Y, int W, int H) { - if (Fl_X::ewmh_supported()) { + if (Fl_X11_Screen_Driver::ewmh_supported()) { send_wm_state_event(fl_xid(pWindow), 0, fl_NET_WM_STATE_FULLSCREEN); } else { pWindow->_clear_fullscreen(); @@ -2403,7 +2403,7 @@ void Fl_X::make_xid(Fl_Window* win, XVisualInfo *visual, Colormap colormap) // since we do not want save_under, do not want to turn off the // border, and cannot grab without an existing window. Besides, // there is no clear_override(). - if (win->fullscreen_active() && !Fl_X::ewmh_supported()) { + if (win->fullscreen_active() && !Fl_X11_Screen_Driver::ewmh_supported()) { int sx, sy, sw, sh; attr.override_redirect = 1; mask |= CWOverrideRedirect; @@ -2493,7 +2493,7 @@ void Fl_X::make_xid(Fl_Window* win, XVisualInfo *visual, Colormap colormap) } // If asked for, create fullscreen - if (win->fullscreen_active() && Fl_X::ewmh_supported()) { + if (win->fullscreen_active() && Fl_X11_Screen_Driver::ewmh_supported()) { unsigned long data[4]; data[0] = fullscreen_top; data[1] = fullscreen_bottom; @@ -2559,7 +2559,7 @@ void Fl_X::make_xid(Fl_Window* win, XVisualInfo *visual, Colormap colormap) } // non-EWMH fullscreen case, need grab - if (win->fullscreen_active() && !Fl_X::ewmh_supported()) { + if (win->fullscreen_active() && !Fl_X11_Screen_Driver::ewmh_supported()) { XGrabKeyboard(fl_display, xp->xid, 1, GrabModeAsync, GrabModeAsync, fl_event_time); } diff --git a/src/drivers/X11/Fl_X11_Screen_Driver.H b/src/drivers/X11/Fl_X11_Screen_Driver.H index b974901c0..cc202e881 100644 --- a/src/drivers/X11/Fl_X11_Screen_Driver.H +++ b/src/drivers/X11/Fl_X11_Screen_Driver.H @@ -44,6 +44,7 @@ protected: float dpi[MAX_SCREENS][2]; public: + static int ewmh_supported(); // --- display management virtual void display(const char *disp); virtual int visual(int flags); diff --git a/src/drivers/X11/Fl_X11_Screen_Driver.cxx b/src/drivers/X11/Fl_X11_Screen_Driver.cxx index 881cdcf57..be26205e7 100644 --- a/src/drivers/X11/Fl_X11_Screen_Driver.cxx +++ b/src/drivers/X11/Fl_X11_Screen_Driver.cxx @@ -474,7 +474,7 @@ void Fl_X11_Screen_Driver::grab(Fl_Window* win) } else { if (Fl::grab()) { // We must keep the grab in the non-EWMH fullscreen case - if (!fullscreen_win || Fl_X::ewmh_supported()) { + if (!fullscreen_win || ewmh_supported()) { XUngrabKeyboard(fl_display, fl_event_time); } XUngrabPointer(fl_display, fl_event_time); diff --git a/src/drivers/X11/Fl_X11_Window_Driver.cxx b/src/drivers/X11/Fl_X11_Window_Driver.cxx index 7cd0c2823..c6784c9cb 100644 --- a/src/drivers/X11/Fl_X11_Window_Driver.cxx +++ b/src/drivers/X11/Fl_X11_Window_Driver.cxx @@ -19,6 +19,7 @@ #include "../../config_lib.h" #include "Fl_X11_Window_Driver.H" +#include "Fl_X11_Screen_Driver.H" #include "../Xlib/Fl_Xlib_Graphics_Driver.H" #include @@ -187,7 +188,7 @@ int Fl_X11_Window_Driver::decorated_w() void Fl_X11_Window_Driver::take_focus() { Fl_X *i = Fl_X::i(pWindow); - if (!Fl_X::ewmh_supported()) + if (!Fl_X11_Screen_Driver::ewmh_supported()) pWindow->show(); // Old WMs, XMapRaised else if (i) // New WMs use the NETWM attribute: Fl_X::activate_window(i->xid);