[client] Remove ismax attribute.

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-05-23 13:11:47 +02:00
parent 419cc99161
commit fb822997b3
9 changed files with 7 additions and 58 deletions

View File

@ -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_hints_get_flags(u_size_hints) & (XCB_SIZE_US_POSITION_HINT |
XCB_SIZE_P_POSITION_HINT))) XCB_SIZE_P_POSITION_HINT)))
{ {
if(c->isfloating && !c->ismax) if(c->isfloating)
client_resize(c, globalconf.floating_placement(c), false); client_resize(c, globalconf.floating_placement(c), false);
else else
c->f_geometry = globalconf.floating_placement(c); c->f_geometry = globalconf.floating_placement(c);
@ -539,11 +539,7 @@ client_resize(client_t *c, area_t geometry, bool hints)
* maximized */ * maximized */
if(c->ismoving || c->isfloating if(c->ismoving || c->isfloating
|| layout_get_current(new_screen) == layout_floating) || layout_get_current(new_screen) == layout_floating)
{
if(!c->ismax)
c->f_geometry = geometry;
titlebar_update_geometry_floating(c); titlebar_update_geometry_floating(c);
}
xcb_configure_window(globalconf.connection, c->win, xcb_configure_window(globalconf.connection, c->win,
XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | 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)) if((c->isfloating = floating))
client_resize(c, c->f_geometry, false); 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)) if(client_isvisible(c, c->screen))
globalconf.screens[c->screen].need_arrange = true; globalconf.screens[c->screen].need_arrange = true;
widget_invalidate_cache(c->screen, WIDGET_CACHE_CLIENTS); widget_invalidate_cache(c->screen, WIDGET_CACHE_CLIENTS);

2
ewmh.c
View File

@ -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); xcb_map_window(globalconf.connection, c->titlebar_sw->window);
} }
c->border = c->oldborder; c->border = c->oldborder;
c->ismax = false;
client_setfloating(c, c->wasfloating, c->oldlayer); client_setfloating(c, c->wasfloating, c->oldlayer);
} }
else if(set == _NET_WM_STATE_ADD) 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->oldborder = c->border;
c->border = 0; c->border = 0;
c->ismax = true;
client_setfloating(c, true, LAYER_FULLSCREEN); client_setfloating(c, true, LAYER_FULLSCREEN);
} }
widget_invalidate_cache(c->screen, WIDGET_CACHE_CLIENTS); widget_invalidate_cache(c->screen, WIDGET_CACHE_CLIENTS);

View File

@ -42,7 +42,6 @@ layout_fibonacci(int screen, int shape)
for(c = globalconf.clients; c; c = c->next) for(c = globalconf.clients; c; c = c->next)
if(IS_TILED(c, screen)) if(IS_TILED(c, screen))
{ {
c->ismax = false;
if((i % 2 && geometry.height / 2 > 2 * c->border) if((i % 2 && geometry.height / 2 > 2 * c->border)
|| (!(i % 2) && geometry.width / 2 > 2 * c->border)) || (!(i % 2) && geometry.width / 2 > 2 * c->border))
{ {

View File

@ -31,7 +31,7 @@ layout_floating(int screen)
client_t *c; client_t *c;
for(c = globalconf.clients; c; c = c->next) 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); client_resize(c, c->f_geometry, false);
} }
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80

View File

@ -228,8 +228,6 @@ mouse_client_move(int snap)
if(!(grab_pointer_r = xcb_grab_pointer_reply(globalconf.connection, grab_pointer_c, NULL))) if(!(grab_pointer_r = xcb_grab_pointer_reply(globalconf.connection, grab_pointer_c, NULL)))
return; return;
c->ismax = false;
p_delete(&grab_pointer_r); p_delete(&grab_pointer_r);
query_pointer_r = xcb_query_pointer_reply(globalconf.connection, query_pointer_c, NULL); 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; ocx = c->geometry.x;
ocy = c->geometry.y; ocy = c->geometry.y;
c->ismax = false;
sw = mouse_resizebar_new(c->phys_screen, c->border, c->geometry, &ctx); sw = mouse_resizebar_new(c->phys_screen, c->border, c->geometry, &ctx);
} }

View File

@ -143,7 +143,7 @@ move_client_to_screen(client_t *c, int new_screen, bool doresize)
/* resize the windows if it's floating */ /* resize the windows if it's floating */
if(doresize && old_screen != c->screen) if(doresize && old_screen != c->screen)
{ {
area_t new_geometry, new_f_geometry; area_t new_f_geometry;
new_f_geometry = c->f_geometry; new_f_geometry = c->f_geometry;
to = screen_get_area(c->screen, NULL, NULL); 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) 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; 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 */ /* if floating, move to this new coords */
else if(c->isfloating) if(c->isfloating)
client_resize(c, new_f_geometry, false); client_resize(c, new_f_geometry, false);
/* otherwise just register them */ /* otherwise just register them */
else else

View File

@ -242,8 +242,6 @@ struct client_t
bool isfloating; bool isfloating;
/** true if the window is fixed */ /** true if the window is fixed */
bool isfixed; bool isfixed;
/** true if the window is maximized */
bool ismax;
/** true if the client must be skipped from client list */ /** true if the client must be skipped from client list */
bool skip; bool skip;
/** true if the client is moving */ /** true if the client is moving */

2
tag.h
View File

@ -26,7 +26,7 @@
#include "common/refcount.h" #include "common/refcount.h"
/** Check if a client is tiled */ /** 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 */ /* Contructor, destructor and referencors */
tag_t * tag_new(const char *, LayoutArrange *, double, int, int); tag_t * tag_new(const char *, LayoutArrange *, double, int, int);

View File

@ -159,11 +159,11 @@ tasklist_draw(widget_node_t *w, statusbar_t *statusbar, int offset, int used)
p_delete(&text); p_delete(&text);
if(c->isfloating || c->ismax) if(c->isfloating)
draw_circle(statusbar->ctx, w->area.x + icon_width + box_width * i, draw_circle(statusbar->ctx, w->area.x + icon_width + box_width * i,
w->area.y, w->area.y,
(globalconf.font->height + 2) / 4, (globalconf.font->height + 2) / 4,
c->ismax, statusbar->colors.fg); false, statusbar->colors.fg);
i++; i++;
} }