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
This commit is contained in:
Manolo Gouy 2016-04-16 11:02:35 +00:00
parent 083e9ed06a
commit d3d7597484
5 changed files with 11 additions and 10 deletions

1
FL/x.H
View File

@ -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);
};

View File

@ -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);
}

View File

@ -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);

View File

@ -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);

View File

@ -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 <FL/Fl_Shared_Image.H>
@ -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);