summaryrefslogtreecommitdiff
path: root/button.c
diff options
context:
space:
mode:
Diffstat (limited to 'button.c')
-rw-r--r--button.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/button.c b/button.c
index 8b0d572..4bd2617 100644
--- a/button.c
+++ b/button.c
@@ -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,