Revert "[client] Remove ismax attribute."

This reverts commit fb822997b3.

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-05-25 17:42:20 +02:00
parent bdc8382474
commit d9dd1fba8e
9 changed files with 55 additions and 7 deletions

View File

@ -536,6 +536,7 @@ client_resize(client_t *c, area_t geometry, bool hints)
|| layout_get_current(new_screen) == layout_floating)
{
titlebar_update_geometry_floating(c);
if(!c->ismax)
c->f_geometry = geometry;
}
@ -567,6 +568,11 @@ 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);

2
ewmh.c
View File

@ -287,6 +287,7 @@ 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)
@ -303,6 +304,7 @@ 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);

View File

@ -42,6 +42,7 @@ 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))
{

View File

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

View File

@ -228,6 +228,8 @@ 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);
@ -343,6 +345,7 @@ 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);
}

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 */
if(doresize && old_screen != c->screen)
{
area_t new_f_geometry;
area_t new_geometry, new_f_geometry;
new_f_geometry = c->f_geometry;
to = screen_get_area(c->screen, NULL, NULL);
@ -163,8 +163,42 @@ 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 */
if(c->isfloating)
else if(c->isfloating)
client_resize(c, new_f_geometry, false);
/* otherwise just register them */
else

View File

@ -244,6 +244,8 @@ 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 */

2
tag.h
View File

@ -26,7 +26,7 @@
#include "common/refcount.h"
/** Check if a client is tiled */
#define IS_TILED(client, screen) (client && !client->isfloating && client_isvisible(client, screen))
#define IS_TILED(client, screen) (client && !client->isfloating && !client->ismax && client_isvisible(client, screen))
/* Contructor, destructor and referencors */
tag_t * tag_new(const char *, layout_t *, 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);
if(c->isfloating)
if(c->isfloating || c->ismax)
draw_circle(statusbar->ctx, w->area.x + icon_width + box_width * i,
w->area.y,
(globalconf.font->height + 2) / 4,
false, statusbar->colors.fg);
c->ismax, statusbar->colors.fg);
i++;
}