diff options
Diffstat (limited to 'button.c')
-rw-r--r-- | button.c | 22 |
1 files changed, 20 insertions, 2 deletions
@@ -23,6 +23,7 @@ #include <config.h> +#include <assert.h> #include <xcb/xcb.h> #include "gwm.h" @@ -30,6 +31,23 @@ #include "button.h" #include "window-table.h" +#define BUTTON_SIZE 12 /* size of buttons in title bar; excludes X border */ +#define BUTTON_X_BORDER 1 + +extern int button_size( struct gwm_window *window, int include_x_border ) { + + assert( window->type == WINDOW_BUTTON ); + + return BUTTON_SIZE + ( include_x_border ? BUTTON_X_BORDER << 1 : 0 ); +} + +extern int button_xb( struct gwm_window *window ) { + + assert( window->type == WINDOW_BUTTON ); + + return BUTTON_X_BORDER; +} + static int button_active; static void set_button_active( struct gwm_window *window, int new ) { @@ -44,8 +62,8 @@ static void set_button_active( struct gwm_window *window, int new ) { COL_BUTTON_INACTIVE ]; xcb_change_window_attributes( c, window->w, XCB_CW_BACK_PIXEL, &n ); - queue_window_update( window, 0, 0, FRAME_BUTTON_SIZE, FRAME_BUTTON_SIZE, - FALSE ); + queue_window_update( window, 0, 0, button_size( window, FALSE ), + button_size( window, FALSE ), FALSE ); } static void button_button_press( struct gwm_window *window, |