diff options
author | Gary Wong <gtw@gnu.org> | 2009-09-06 21:59:21 -0600 |
---|---|---|
committer | Gary Wong <gtw@gnu.org> | 2009-09-06 21:59:21 -0600 |
commit | a27cb02b63564bee708e946c1d0bd37d87896496 (patch) | |
tree | cc04f36f56d62155930e37d2fb66ccb3fa3fa011 | |
parent | e17bff21252f44383198037a68c902d708a83569 (diff) |
Set _NET_FRAME_EXTENTS property.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | frame.c | 13 | ||||
-rw-r--r-- | frame.h | 3 | ||||
-rw-r--r-- | gwm.c | 4 | ||||
-rw-r--r-- | gwm.h | 1 | ||||
-rw-r--r-- | managed.c | 2 |
6 files changed, 28 insertions, 1 deletions
@@ -1,5 +1,11 @@ 2009-09-06 Gary Wong <gtw@gnu.org> + * frame.c (update_frame_extents): New function. + * gwm.c (start_managing_window): Update _NET_FRAME_EXTENTS property. + * managed.c (managed_property_change): Likewise. + +2009-09-06 Gary Wong <gtw@gnu.org> + * gwm.c (setup_display): Add various EWMH properties to the root and fake windows. (shutdown_display): Remove EWMH root properties. @@ -97,6 +97,19 @@ extern int frame_xb( struct gwm_window *window ) { return window->u.frame.decoration & DEC_BORDER ? FRAME_X_BORDER : 0; } +extern void update_frame_extents( struct gwm_window *window ) { + + uint32_t extents[ 4 ]; + + extents[ 0 ] = frame_l( window, TRUE ); + extents[ 1 ] = frame_r( window, TRUE ); + extents[ 2 ] = frame_t( window, TRUE ); + extents[ 3 ] = frame_b( window, TRUE ); + xcb_change_property( c, XCB_PROP_MODE_REPLACE, window->u.frame.child->w, + atoms[ ATOM__NET_FRAME_EXTENTS ], CARDINAL, 32, + 4, extents ); +} + extern void translate_child_to_frame( struct gwm_window *frame, int *fx, int *fy, int *fwidth, int *fheight, int cx, int cy, @@ -10,6 +10,9 @@ extern int frame_l( struct gwm_window *window, int include_x_border ); extern int frame_r( struct gwm_window *window, int include_x_border ); extern int frame_xb( struct gwm_window *window ); +/* Change the _NET_FRAME_EXTENTS property on the client. */ +extern void update_frame_extents( struct gwm_window *window ); + extern void translate_child_to_frame( struct gwm_window *frame, int *fx, int *fy, int *fwidth, int *fheight, int cx, int cy, @@ -89,6 +89,7 @@ static const char *const atom_names[ NUM_ATOMS ] = { "_NET_CURRENT_DESKTOP", "_NET_DESKTOP_GEOMETRY", "_NET_DESKTOP_VIEWPORT", + "_NET_FRAME_EXTENTS", "_NET_NUMBER_OF_DESKTOPS", "_NET_SUPPORTED", "_NET_SUPPORTING_WM_CHECK", @@ -1091,6 +1092,8 @@ static void start_managing_window( struct gwm_window *window, for( i = 0; i < NUM_PROPS; i++ ) managed_property_change( window, i, props[ i ] ); + update_frame_extents( frame ); + translate_child_to_frame( frame, &frame->u.frame.x, &frame->u.frame.y, &frame->u.frame.width, &frame->u.frame.height, geom->x, geom->y, geom->width, geom->height, @@ -1673,7 +1676,6 @@ static void setup_display( void ) { free( r ); } - /* FIXME Also set _NET_FRAME_EXTENTS. */ prop_atoms[ PROP__MOTIF_WM_HINTS ] = atoms[ ATOM__MOTIF_WM_HINTS ]; prop_atoms[ PROP__NET_WM_ICON ] = atoms[ ATOM__NET_WM_ICON ]; prop_atoms[ PROP__NET_WM_NAME ] = atoms[ ATOM__NET_WM_NAME ]; @@ -71,6 +71,7 @@ enum gwm_atom { ATOM__NET_CURRENT_DESKTOP, ATOM__NET_DESKTOP_GEOMETRY, ATOM__NET_DESKTOP_VIEWPORT, + ATOM__NET_FRAME_EXTENTS, ATOM__NET_NUMBER_OF_DESKTOPS, ATOM__NET_SUPPORTED, ATOM__NET_SUPPORTING_WM_CHECK, @@ -376,6 +376,8 @@ extern void managed_property_change( struct gwm_window *window, int prop, XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT | XCB_CONFIG_WINDOW_BORDER_WIDTH, n ); + + update_frame_extents( window->u.managed.frame ); } break; |