Fix fullscreening when client has bogus aspect ratio hints.
Just ignore aspect ratio hints when entering fullscreen mode. Fixes trouble with mplayer for certain combinations of movie format and screen size. Noted by James Bowlin. SVN revision: 51470
This commit is contained in:
parent
7d24995988
commit
22306dfe2b
|
@ -1303,6 +1303,8 @@ EwinOpFullscreen(EWin * ewin, int source __UNUSED__, int on)
|
|||
}
|
||||
ScreenGetAvailableArea(EoGetX(ewin), EoGetY(ewin), &x, &y, &w, &h);
|
||||
|
||||
ewin->state.fullscreen = 1;
|
||||
|
||||
/* Fixup if available space doesn't match ICCCM size constraints */
|
||||
ICCCM_SizeMatch(ewin, w, h, &ww, &hh);
|
||||
if (w == ww && h == hh)
|
||||
|
@ -1334,7 +1336,6 @@ EwinOpFullscreen(EWin * ewin, int source __UNUSED__, int on)
|
|||
ewin->state.maximizing = 1;
|
||||
EwinMoveResize(ewin, x, y, w, h);
|
||||
ewin->state.maximizing = 0;
|
||||
ewin->state.fullscreen = 1;
|
||||
EwinStateUpdate(ewin);
|
||||
}
|
||||
else
|
||||
|
|
23
src/icccm.c
23
src/icccm.c
|
@ -167,11 +167,16 @@ ICCCM_SizeMatch(const EWin * ewin, int wi, int hi, int *pwo, int *pho)
|
|||
h = ewin->icccm.height_min;
|
||||
if (h > ewin->icccm.height_max)
|
||||
h = ewin->icccm.height_max;
|
||||
|
||||
if (w <= 0 || h <= 0)
|
||||
return;
|
||||
|
||||
w -= ewin->icccm.base_w;
|
||||
h -= ewin->icccm.base_h;
|
||||
if ((w > 0) && (h > 0))
|
||||
{
|
||||
w -= ewin->icccm.base_w;
|
||||
h -= ewin->icccm.base_h;
|
||||
if ((w > 0) && (h > 0))
|
||||
/* Ignore aspect ratio constraints when fullscreening */
|
||||
if (!ewin->state.fullscreen)
|
||||
{
|
||||
aspect = ((double)w) / ((double)h);
|
||||
dw = ewin->icccm.w_inc / 4.;
|
||||
|
@ -207,14 +212,14 @@ ICCCM_SizeMatch(const EWin * ewin, int wi, int hi, int *pwo, int *pho)
|
|||
w = (int)((double)h * ewin->icccm.aspect_max + dw);
|
||||
}
|
||||
}
|
||||
i = w / ewin->icccm.w_inc;
|
||||
j = h / ewin->icccm.h_inc;
|
||||
w = i * ewin->icccm.w_inc;
|
||||
h = j * ewin->icccm.h_inc;
|
||||
}
|
||||
w += ewin->icccm.base_w;
|
||||
h += ewin->icccm.base_h;
|
||||
i = w / ewin->icccm.w_inc;
|
||||
j = h / ewin->icccm.h_inc;
|
||||
w = i * ewin->icccm.w_inc;
|
||||
h = j * ewin->icccm.h_inc;
|
||||
}
|
||||
w += ewin->icccm.base_w;
|
||||
h += ewin->icccm.base_h;
|
||||
|
||||
*pwo = w;
|
||||
*pho = h;
|
||||
|
|
Loading…
Reference in New Issue