From fb822997b3914f30e788f0be3f6bc62a1e4d8272 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Fri, 23 May 2008 13:11:47 +0200 Subject: [PATCH] [client] Remove ismax attribute. Signed-off-by: Julien Danjou --- client.c | 11 +---------- ewmh.c | 2 -- layouts/fibonacci.c | 1 - layouts/floating.c | 2 +- mouse.c | 3 --- screen.c | 38 ++------------------------------------ structs.h | 2 -- tag.h | 2 +- widgets/tasklist.c | 4 ++-- 9 files changed, 7 insertions(+), 58 deletions(-) diff --git a/client.c b/client.c index a9a8879f..b46d1485 100644 --- a/client.c +++ b/client.c @@ -399,7 +399,7 @@ client_manage(xcb_window_t w, xcb_get_geometry_reply_t *wgeom, int screen) && !(xcb_size_hints_get_flags(u_size_hints) & (XCB_SIZE_US_POSITION_HINT | XCB_SIZE_P_POSITION_HINT))) { - if(c->isfloating && !c->ismax) + if(c->isfloating) client_resize(c, globalconf.floating_placement(c), false); else c->f_geometry = globalconf.floating_placement(c); @@ -539,11 +539,7 @@ client_resize(client_t *c, area_t geometry, bool hints) * maximized */ if(c->ismoving || c->isfloating || layout_get_current(new_screen) == layout_floating) - { - if(!c->ismax) - c->f_geometry = geometry; titlebar_update_geometry_floating(c); - } xcb_configure_window(globalconf.connection, c->win, XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | @@ -573,11 +569,6 @@ client_setfloating(client_t *c, bool floating, layer_t layer) { if((c->isfloating = floating)) client_resize(c, c->f_geometry, false); - else if(c->ismax) - { - c->ismax = false; - client_resize(c, c->m_geometry, false); - } if(client_isvisible(c, c->screen)) globalconf.screens[c->screen].need_arrange = true; widget_invalidate_cache(c->screen, WIDGET_CACHE_CLIENTS); diff --git a/ewmh.c b/ewmh.c index 17a4a997..8e7df2c1 100644 --- a/ewmh.c +++ b/ewmh.c @@ -287,7 +287,6 @@ ewmh_process_state_atom(client_t *c, xcb_atom_t state, int set) xcb_map_window(globalconf.connection, c->titlebar_sw->window); } c->border = c->oldborder; - c->ismax = false; client_setfloating(c, c->wasfloating, c->oldlayer); } else if(set == _NET_WM_STATE_ADD) @@ -304,7 +303,6 @@ ewmh_process_state_atom(client_t *c, xcb_atom_t state, int set) } c->oldborder = c->border; c->border = 0; - c->ismax = true; client_setfloating(c, true, LAYER_FULLSCREEN); } widget_invalidate_cache(c->screen, WIDGET_CACHE_CLIENTS); diff --git a/layouts/fibonacci.c b/layouts/fibonacci.c index 9b712f50..48275220 100644 --- a/layouts/fibonacci.c +++ b/layouts/fibonacci.c @@ -42,7 +42,6 @@ layout_fibonacci(int screen, int shape) for(c = globalconf.clients; c; c = c->next) if(IS_TILED(c, screen)) { - c->ismax = false; if((i % 2 && geometry.height / 2 > 2 * c->border) || (!(i % 2) && geometry.width / 2 > 2 * c->border)) { diff --git a/layouts/floating.c b/layouts/floating.c index 592589b0..6e5d275b 100644 --- a/layouts/floating.c +++ b/layouts/floating.c @@ -31,7 +31,7 @@ layout_floating(int screen) client_t *c; for(c = globalconf.clients; c; c = c->next) - if(client_isvisible(c, screen) && !c->ismax) + if(client_isvisible(c, screen)) client_resize(c, c->f_geometry, false); } // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 diff --git a/mouse.c b/mouse.c index de833641..a6feefef 100644 --- a/mouse.c +++ b/mouse.c @@ -228,8 +228,6 @@ mouse_client_move(int snap) if(!(grab_pointer_r = xcb_grab_pointer_reply(globalconf.connection, grab_pointer_c, NULL))) return; - c->ismax = false; - p_delete(&grab_pointer_r); query_pointer_r = xcb_query_pointer_reply(globalconf.connection, query_pointer_c, NULL); @@ -345,7 +343,6 @@ mouse_client_resize(void) { ocx = c->geometry.x; ocy = c->geometry.y; - c->ismax = false; sw = mouse_resizebar_new(c->phys_screen, c->border, c->geometry, &ctx); } diff --git a/screen.c b/screen.c index 1ad852a8..71afe4b3 100644 --- a/screen.c +++ b/screen.c @@ -143,7 +143,7 @@ move_client_to_screen(client_t *c, int new_screen, bool doresize) /* resize the windows if it's floating */ if(doresize && old_screen != c->screen) { - area_t new_geometry, new_f_geometry; + area_t new_f_geometry; new_f_geometry = c->f_geometry; to = screen_get_area(c->screen, NULL, NULL); @@ -163,42 +163,8 @@ move_client_to_screen(client_t *c, int new_screen, bool doresize) if(new_f_geometry.y + new_f_geometry.height >= to.y + to.height) new_f_geometry.y = to.y + to.height - new_f_geometry.height - 2 * c->border; - if(c->ismax) - { - new_geometry = c->geometry; - - /* compute new coords in new screen */ - new_geometry.x = (c->geometry.x - from.x) + to.x; - new_geometry.y = (c->geometry.y - from.y) + to.y; - - /* check that new coords are still in the screen */ - if(new_geometry.width > to.width) - new_geometry.width = to.width; - if(new_geometry.height > to.height) - new_geometry.height = to.height; - if(new_geometry.x + new_geometry.width >= to.x + to.width) - new_geometry.x = to.x + to.width - new_geometry.width - 2 * c->border; - if(new_geometry.y + new_geometry.height >= to.y + to.height) - new_geometry.y = to.y + to.height - new_geometry.height - 2 * c->border; - - /* compute new coords for max in new screen */ - c->m_geometry.x = (c->m_geometry.x - from.x) + to.x; - c->m_geometry.y = (c->m_geometry.y - from.y) + to.y; - - /* check that new coords are still in the screen */ - if(c->m_geometry.width > to.width) - c->m_geometry.width = to.width; - if(c->m_geometry.height > to.height) - c->m_geometry.height = to.height; - if(c->m_geometry.x + c->m_geometry.width >= to.x + to.width) - c->m_geometry.x = to.x + to.width - c->m_geometry.width - 2 * c->border; - if(c->m_geometry.y + c->m_geometry.height >= to.y + to.height) - c->m_geometry.y = to.y + to.height - c->m_geometry.height - 2 * c->border; - - client_resize(c, new_geometry, false); - } /* if floating, move to this new coords */ - else if(c->isfloating) + if(c->isfloating) client_resize(c, new_f_geometry, false); /* otherwise just register them */ else diff --git a/structs.h b/structs.h index de35b5b7..68227ad4 100644 --- a/structs.h +++ b/structs.h @@ -242,8 +242,6 @@ struct client_t bool isfloating; /** true if the window is fixed */ bool isfixed; - /** true if the window is maximized */ - bool ismax; /** true if the client must be skipped from client list */ bool skip; /** true if the client is moving */ diff --git a/tag.h b/tag.h index d6b0a614..fec70b14 100644 --- a/tag.h +++ b/tag.h @@ -26,7 +26,7 @@ #include "common/refcount.h" /** Check if a client is tiled */ -#define IS_TILED(client, screen) (client && !client->isfloating && !client->ismax && client_isvisible(client, screen)) +#define IS_TILED(client, screen) (client && !client->isfloating && client_isvisible(client, screen)) /* Contructor, destructor and referencors */ tag_t * tag_new(const char *, LayoutArrange *, double, int, int); diff --git a/widgets/tasklist.c b/widgets/tasklist.c index 1854fc5d..549e9467 100644 --- a/widgets/tasklist.c +++ b/widgets/tasklist.c @@ -159,11 +159,11 @@ tasklist_draw(widget_node_t *w, statusbar_t *statusbar, int offset, int used) p_delete(&text); - if(c->isfloating || c->ismax) + if(c->isfloating) draw_circle(statusbar->ctx, w->area.x + icon_width + box_width * i, w->area.y, (globalconf.font->height + 2) / 4, - c->ismax, statusbar->colors.fg); + false, statusbar->colors.fg); i++; }