aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikael Magnusson <mikachu@gmail.com>2011-09-19 16:24:43 (GMT)
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-10-07 00:13:50 (GMT)
commitfd8692a5d12a97e81f0771bd1a20d2e1a8e9b4a5 (patch)
treed197fb174a3a4a0bf53295c4991141b04cffb6d6
parent2b4e4dce86396389e98cb94d3cb90555cdbac059 (diff)
broken aspect hint setting
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--src/xcommon.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/xcommon.c b/src/xcommon.c
index fa24222..865d612 100644
--- a/src/xcommon.c
+++ b/src/xcommon.c
@@ -339,6 +339,19 @@ static int xv_get_height_for_width( int window_width )
return rounded_int_division( window_width * n, d );
}
+static void x11_aspect_hint( Display *dpy, Window win, int aspect_width, int aspect_height )
+{
+ XSizeHints hints;
+
+ hints.flags = PAspect;
+ hints.min_aspect.x = aspect_width;
+ hints.min_aspect.y = aspect_height;
+ hints.max_aspect.x = aspect_width;
+ hints.max_aspect.y = aspect_height;
+
+ XSetWMNormalHints( dpy, win, &hints );
+}
+
static void x11_northwest_gravity( Display *dpy, Window win )
{
hint.flags |= PWinGravity;
@@ -1077,6 +1090,7 @@ int xcommon_open_display( const char *user_geometry, int aspect, int verbose )
XSetWMProtocols( display, wm_window, &wm_delete_window, 1 );
calculate_video_area();
+ x11_aspect_hint( display, wm_window, video_area.width, video_area.height );
XMapWindow( display, output_window );
XMapWindow( display, wm_window );
@@ -1357,6 +1371,7 @@ int xcommon_toggle_aspect( void )
{
output_aspect = !output_aspect;
calculate_video_area();
+ x11_aspect_hint( display, wm_window, video_area.width, video_area.height );
xcommon_clear_screen();
return output_aspect;
}
@@ -1796,6 +1811,11 @@ void xcommon_set_fullscreen_position( int pos )
void xcommon_set_matte( int width, int height )
{
+ if( width ) {
+ x11_aspect_hint( display, wm_window, width, height );
+ } else {
+ x11_aspect_hint( display, wm_window, video_area.width, video_area.height );
+ }
matte_width = width;
matte_height = height;
calculate_video_area();

Privacy Policy