event: do not store resize events of banned clients

This should fix the problem seen with Firefox. When clicking on a
file that will launch a "Save as" dialog, and switching tag quickly,
the client is banned and move off of the viewport.
Then FF send a ConfigureRequest to re-move it to this negative
coordinates, which we did handle and set as its geometries.
Now we just honor the (bad and useless) move but we do not use
client_resize()

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-01-30 15:20:04 +01:00
parent b878e1491f
commit f45cdee4eb
1 changed files with 66 additions and 50 deletions

102
event.c
View File

@ -220,48 +220,8 @@ event_handle_button(void *data, xcb_connection_t *connection, xcb_button_press_e
return 0;
}
/** The configure event handler.
* \param data currently unused.
* \param connection The connection to the X server.
* \param ev The event.
*/
static int
event_handle_configurerequest(void *data __attribute__ ((unused)),
xcb_connection_t *connection, xcb_configure_request_event_t *ev)
{
client_t *c;
area_t geometry;
if((c = client_getbywin(ev->window)))
{
geometry = c->geometry;
if(ev->value_mask & XCB_CONFIG_WINDOW_X)
geometry.x = ev->x;
if(ev->value_mask & XCB_CONFIG_WINDOW_Y)
geometry.y = ev->y;
if(ev->value_mask & XCB_CONFIG_WINDOW_WIDTH)
geometry.width = ev->width;
if(ev->value_mask & XCB_CONFIG_WINDOW_HEIGHT)
geometry.height = ev->height;
/** Configure request are sent with size relative to real (internal)
* window size, i.e. without titlebars and borders. */
geometry = titlebar_geometry_add(c->titlebar, c->border, geometry);
if(geometry.x != c->geometry.x || geometry.y != c->geometry.y
|| geometry.width != c->geometry.width || geometry.height != c->geometry.height)
{
client_resize(c, geometry, false);
/* All the wiboxes (may) need to be repositioned. */
if(client_hasstrut(c))
wibox_update_positions();
client_need_arrange(c);
}
else
window_configure(c->win, geometry, c->border);
}
else
static void
event_handle_configurerequest_configure_window(xcb_configure_request_event_t *ev)
{
uint16_t config_win_mask = 0;
uint32_t config_win_vals[7];
@ -303,9 +263,65 @@ event_handle_configurerequest(void *data __attribute__ ((unused)),
config_win_vals[i++] = ev->stack_mode;
}
xcb_configure_window(connection, ev->window, config_win_mask, config_win_vals);
xcb_configure_window(globalconf.connection, ev->window, config_win_mask, config_win_vals);
}
/** The configure event handler.
* \param data currently unused.
* \param connection The connection to the X server.
* \param ev The event.
*/
static int
event_handle_configurerequest(void *data __attribute__ ((unused)),
xcb_connection_t *connection, xcb_configure_request_event_t *ev)
{
client_t *c;
area_t geometry;
if((c = client_getbywin(ev->window)))
{
geometry = c->geometry;
if(ev->value_mask & XCB_CONFIG_WINDOW_X)
geometry.x = ev->x;
if(ev->value_mask & XCB_CONFIG_WINDOW_Y)
geometry.y = ev->y;
if(ev->value_mask & XCB_CONFIG_WINDOW_WIDTH)
geometry.width = ev->width;
if(ev->value_mask & XCB_CONFIG_WINDOW_HEIGHT)
geometry.height = ev->height;
/** Configure request are sent with size relative to real (internal)
* window size, i.e. without titlebars and borders. */
geometry = titlebar_geometry_add(c->titlebar, c->border, geometry);
if(geometry.x != c->geometry.x
|| geometry.y != c->geometry.y
|| geometry.width != c->geometry.width
|| geometry.height != c->geometry.height)
{
if(c->isbanned)
{
window_configure(c->win, geometry, c->border);
event_handle_configurerequest_configure_window(ev);
}
else
{
client_resize(c, geometry, false);
/* All the wiboxes (may) need to be repositioned. */
if(client_hasstrut(c))
wibox_update_positions();
client_need_arrange(c);
return 0;
}
}
else
window_configure(c->win, geometry, c->border);
}
else
event_handle_configurerequest_configure_window(ev);
return 0;
}