mirror of https://github.com/mpv-player/mpv
x11: fix border toggling
Trying to toggle the border during fullscreen (with "cycle border") would leave the window stuck without border, and it couldn't be restored. This was because vo_x11_decoration() always excepted to be called when toggling the state, and thus confusing the contents of the olddecor variable. Add got_motif_hints to hopefully prevent this. Also, when changing the border, don't take fs in account. May break on older/broken WMs, but all in all is in fact more robust and simpler, because you do not need to update the border state manually when returning from fullscreen.
This commit is contained in:
parent
6e1eb8add9
commit
f2d438a1fd
|
@ -605,7 +605,7 @@ static void vo_x11_decoration(struct vo *vo, int d)
|
|||
|
||||
vo_MotifHints = XInternAtom(x11->display, "_MOTIF_WM_HINTS", 0);
|
||||
if (vo_MotifHints != None) {
|
||||
if (!d) {
|
||||
if (!x11->got_motif_hints) {
|
||||
MotifWmHints *mhints = NULL;
|
||||
|
||||
XGetWindowProperty(x11->display, x11->window,
|
||||
|
@ -620,6 +620,7 @@ static void vo_x11_decoration(struct vo *vo, int d)
|
|||
XFree(mhints);
|
||||
}
|
||||
}
|
||||
x11->got_motif_hints = true;
|
||||
|
||||
memset(&vo_MotifWmHints, 0, sizeof(MotifWmHints));
|
||||
vo_MotifWmHints.flags =
|
||||
|
@ -1498,7 +1499,7 @@ static void vo_x11_ontop(struct vo *vo)
|
|||
static void vo_x11_border(struct vo *vo)
|
||||
{
|
||||
vo->opts->border = !vo->opts->border;
|
||||
vo_x11_decoration(vo, vo->opts->border && !vo->x11->fs);
|
||||
vo_x11_decoration(vo, vo->opts->border);
|
||||
}
|
||||
|
||||
int vo_x11_control(struct vo *vo, int *events, int request, void *arg)
|
||||
|
|
|
@ -90,8 +90,10 @@ struct vo_x11_state {
|
|||
bool size_changed_during_fs;
|
||||
bool pos_changed_during_fs;
|
||||
|
||||
bool got_motif_hints;
|
||||
unsigned int olddecor;
|
||||
unsigned int oldfuncs;
|
||||
|
||||
XComposeStatus compose_status;
|
||||
|
||||
/* XShm stuff */
|
||||
|
|
Loading…
Reference in New Issue