Bugfix: Fix fullscreen for floating clients, fix window name updates for floating clients

This commit is contained in:
Michael Stapelberg 2009-05-26 16:46:50 +02:00
parent 5b8e2ecb18
commit ac5c2fcf19
2 changed files with 23 additions and 14 deletions

View File

@ -635,7 +635,7 @@ int handle_windowname_change(void *data, xcb_connection_t *conn, uint8_t state,
if (client->dock) if (client->dock)
return 1; return 1;
if (client->container->mode == MODE_STACK) if (client->container != NULL && client->container->mode == MODE_STACK)
render_container(conn, client->container); render_container(conn, client->container);
else decorate_window(conn, client, client->frame, client->titlegc, 0); else decorate_window(conn, client, client->frame, client->titlegc, 0);
xcb_flush(conn); xcb_flush(conn);
@ -703,7 +703,7 @@ int handle_windowname_change_legacy(void *data, xcb_connection_t *conn, uint8_t
if (client->dock) if (client->dock)
return 1; return 1;
if (client->container->mode == MODE_STACK) if (client->container != NULL && client->container->mode == MODE_STACK)
render_container(conn, client->container); render_container(conn, client->container);
else decorate_window(conn, client, client->frame, client->titlegc, 0); else decorate_window(conn, client, client->frame, client->titlegc, 0);
xcb_flush(conn); xcb_flush(conn);

View File

@ -447,10 +447,10 @@ void switch_layout_mode(xcb_connection_t *conn, Container *container, int mode)
* *
*/ */
void toggle_fullscreen(xcb_connection_t *conn, Client *client) { void toggle_fullscreen(xcb_connection_t *conn, Client *client) {
/* clients without a container (docks) cannot be focused */ /* dock clients cannot enter fullscreen mode */
assert(client->container != NULL); assert(!client->dock);
Workspace *workspace = client->container->workspace; Workspace *workspace = client->workspace;
if (!client->fullscreen) { if (!client->fullscreen) {
if (workspace->fullscreen_client != NULL) { if (workspace->fullscreen_client != NULL) {
@ -491,12 +491,21 @@ void toggle_fullscreen(xcb_connection_t *conn, Client *client) {
LOG("leaving fullscreen mode\n"); LOG("leaving fullscreen mode\n");
client->fullscreen = false; client->fullscreen = false;
workspace->fullscreen_client = NULL; workspace->fullscreen_client = NULL;
if (client->floating) {
/* For floating clients its enough if we just reconfigure that window (in fact,
* re-rendering the layout will not update the client.) */
reposition_client(conn, client);
resize_client(conn, client);
/* redecorate_window flushes */
redecorate_window(conn, client);
} else {
/* Because the coordinates of the window havent changed, it would not be /* Because the coordinates of the window havent changed, it would not be
re-configured if we dont set the following flag */ re-configured if we dont set the following flag */
client->force_reconfigure = true; client->force_reconfigure = true;
/* We left fullscreen mode, redraw the whole layout to ensure enternotify events are disabled */ /* We left fullscreen mode, redraw the whole layout to ensure enternotify events are disabled */
render_layout(conn); render_layout(conn);
} }
}
xcb_flush(conn); xcb_flush(conn);
} }