1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-26 00:42:57 +00:00

x11_common.c: Move orig_layer and old_gravity to x11 struct

This commit is contained in:
Uoti Urpala 2008-04-21 04:37:46 +03:00
parent 49ac1f06ca
commit 52b3c6097b
2 changed files with 9 additions and 8 deletions

View File

@ -69,8 +69,6 @@
extern int enable_mouse_movements; extern int enable_mouse_movements;
int fs_layer = WIN_LAYER_ABOVE_DOCK; int fs_layer = WIN_LAYER_ABOVE_DOCK;
static int orig_layer = 0;
static int old_gravity = NorthWestGravity;
int stop_xscreensaver = 0; int stop_xscreensaver = 0;
@ -1129,7 +1127,7 @@ int vo_x11_check_events(struct vo *vo)
} }
break; break;
case MapNotify: case MapNotify:
x11->vo_hint.win_gravity = old_gravity; x11->vo_hint.win_gravity = x11->old_gravity;
XSetWMNormalHints(display, x11->window, &x11->vo_hint); XSetWMNormalHints(display, x11->window, &x11->vo_hint);
vo_fs_flip = 0; vo_fs_flip = 0;
break; break;
@ -1372,8 +1370,8 @@ void vo_x11_setlayer(struct vo *vo, Window vo_window, int layer)
{ {
XClientMessageEvent xev; XClientMessageEvent xev;
if (!orig_layer) if (!x11->orig_layer)
orig_layer = vo_x11_get_gnome_layer(x11, vo_window); x11->orig_layer = vo_x11_get_gnome_layer(x11, vo_window);
memset(&xev, 0, sizeof(xev)); memset(&xev, 0, sizeof(xev));
xev.type = ClientMessage; xev.type = ClientMessage;
@ -1381,7 +1379,7 @@ void vo_x11_setlayer(struct vo *vo, Window vo_window, int layer)
xev.window = vo_window; xev.window = vo_window;
xev.message_type = x11->XA_WIN_LAYER; xev.message_type = x11->XA_WIN_LAYER;
xev.format = 32; xev.format = 32;
xev.data.l[0] = layer ? fs_layer : orig_layer; // if not fullscreen, stay on default layer xev.data.l[0] = layer ? fs_layer : x11->orig_layer; // if not fullscreen, stay on default layer
xev.data.l[1] = CurrentTime; xev.data.l[1] = CurrentTime;
mp_msg(MSGT_VO, MSGL_V, mp_msg(MSGT_VO, MSGL_V,
"[x11] Layered style stay on top (layer %ld).\n", "[x11] Layered style stay on top (layer %ld).\n",
@ -1540,9 +1538,9 @@ void vo_x11_fullscreen(struct vo *vo)
XGetWMNormalHints(x11->display, x11->window, &x11->vo_hint, &dummy); XGetWMNormalHints(x11->display, x11->window, &x11->vo_hint, &dummy);
if (!(x11->vo_hint.flags & PWinGravity)) if (!(x11->vo_hint.flags & PWinGravity))
old_gravity = NorthWestGravity; x11->old_gravity = NorthWestGravity;
else else
old_gravity = x11->vo_hint.win_gravity; x11->old_gravity = x11->vo_hint.win_gravity;
} }
if (vo_wm_type == 0 && !(vo_fsmode & 16)) if (vo_wm_type == 0 && !(vo_fsmode & 16))
{ {
@ -2552,5 +2550,6 @@ void vo_x11_init_state(struct vo_x11_state *s)
.olddecor = MWM_DECOR_ALL, .olddecor = MWM_DECOR_ALL,
.oldfuncs = MWM_FUNC_MOVE | MWM_FUNC_CLOSE | MWM_FUNC_MINIMIZE | .oldfuncs = MWM_FUNC_MOVE | MWM_FUNC_CLOSE | MWM_FUNC_MINIMIZE |
MWM_FUNC_MAXIMIZE | MWM_FUNC_RESIZE, MWM_FUNC_MAXIMIZE | MWM_FUNC_RESIZE,
.old_gravity = NorthWestGravity,
}; };
} }

View File

@ -24,6 +24,8 @@ struct vo_x11_state {
XSizeHints vo_hint; XSizeHints vo_hint;
unsigned int mouse_timer; unsigned int mouse_timer;
int mouse_waiting_hide; int mouse_waiting_hide;
int orig_layer;
int old_gravity;
unsigned int olddecor; unsigned int olddecor;
unsigned int oldfuncs; unsigned int oldfuncs;