Don’t assign ->container for dock-windows
This commit is contained in:
parent
8b0bc8c3ff
commit
07b92c2792
|
@ -89,6 +89,8 @@ static void focus_window(xcb_connection_t *connection, direction_t direction) {
|
|||
*/
|
||||
static bool move_current_window_in_container(xcb_connection_t *connection, Client *client,
|
||||
direction_t direction) {
|
||||
assert(client->container != NULL);
|
||||
|
||||
Client *other = (direction == D_UP ? CIRCLEQ_PREV(client, clients) :
|
||||
CIRCLEQ_NEXT(client, clients));
|
||||
|
||||
|
|
|
@ -141,6 +141,11 @@ int handle_button_press(void *ignored, xcb_connection_t *conn, xcb_button_press_
|
|||
*second = NULL;
|
||||
enum { O_HORIZONTAL, O_VERTICAL } orientation = O_VERTICAL;
|
||||
|
||||
if (con == NULL) {
|
||||
printf("dock. done.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
printf("event->event_x = %d, client->rect.width = %d\n", event->event_x, client->rect.width);
|
||||
|
||||
if (!border_click) {
|
||||
|
@ -310,15 +315,16 @@ int handle_unmap_notify_event(void *data, xcb_connection_t *c, xcb_unmap_notify_
|
|||
client = table_remove(byChild, e->window);
|
||||
|
||||
printf("UnmapNotify for 0x%08x (received from 0x%08x): ", e->window, e->event);
|
||||
if(client == NULL) {
|
||||
if (client == NULL) {
|
||||
printf("not a managed window. Ignoring.\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if (client->container->currently_focused == client)
|
||||
client->container->currently_focused = NULL;
|
||||
CIRCLEQ_REMOVE(&(client->container->clients), client, clients);
|
||||
if (client->container != NULL) {
|
||||
if (client->container->currently_focused == client)
|
||||
client->container->currently_focused = NULL;
|
||||
CIRCLEQ_REMOVE(&(client->container->clients), client, clients);
|
||||
}
|
||||
|
||||
printf("child of 0x%08x.\n", client->frame);
|
||||
xcb_reparent_window(c, client->child, root, 0, 0);
|
||||
|
|
11
src/layout.c
11
src/layout.c
|
@ -89,6 +89,10 @@ void decorate_window(xcb_connection_t *conn, Client *client) {
|
|||
text_color,
|
||||
border_color;
|
||||
|
||||
/* Clients without a container (docks) won’t get decorated */
|
||||
if (client->container == NULL)
|
||||
return;
|
||||
|
||||
if (client->container->currently_focused == client) {
|
||||
background_color = get_colorpixel(conn, client->frame, "#285577");
|
||||
text_color = get_colorpixel(conn, client->frame, "#ffffff");
|
||||
|
@ -207,13 +211,6 @@ static void render_container(xcb_connection_t *connection, Container *container)
|
|||
|
||||
int current_client = 0;
|
||||
CIRCLEQ_FOREACH(client, &(container->clients), clients) {
|
||||
/* TODO: currently, clients are assigned to the current container.
|
||||
Therefore, we need to skip them here. Does anything harmful happen
|
||||
if clients *do not* have a container. Is this the more desired
|
||||
situation? Let’s find out… */
|
||||
if (client->dock)
|
||||
continue;
|
||||
|
||||
/* Check if we changed client->x or client->y by updating it…
|
||||
* Note the bitwise OR instead of logical OR to force evaluation of both statements */
|
||||
if (client->force_reconfigure |
|
||||
|
|
10
src/mainx.c
10
src/mainx.c
|
@ -141,9 +141,6 @@ void reparent_window(xcb_connection_t *conn, xcb_window_t child,
|
|||
uint32_t mask = 0;
|
||||
uint32_t values[3];
|
||||
|
||||
/* Insert into the currently active container */
|
||||
CIRCLEQ_INSERT_TAIL(&(CUR_CELL->clients), new, clients);
|
||||
|
||||
/* Update the data structures */
|
||||
CUR_CELL->currently_focused = new;
|
||||
new->container = CUR_CELL;
|
||||
|
@ -222,7 +219,8 @@ void reparent_window(xcb_connection_t *conn, xcb_window_t child,
|
|||
new->dock = true;
|
||||
new->titlebar_position = TITLEBAR_OFF;
|
||||
new->force_reconfigure = true;
|
||||
SLIST_INSERT_HEAD(&(new->container->workspace->dock_clients), new, dock_clients);
|
||||
new->container = NULL;
|
||||
SLIST_INSERT_HEAD(&(c_ws->dock_clients), new, dock_clients);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -238,6 +236,10 @@ void reparent_window(xcb_connection_t *conn, xcb_window_t child,
|
|||
printf("the client wants to be %d pixels height\n", new->desired_height);
|
||||
}
|
||||
|
||||
/* Insert into the currently active container, if it’s not a dock window */
|
||||
if (!new->dock)
|
||||
CIRCLEQ_INSERT_TAIL(&(CUR_CELL->clients), new, clients);
|
||||
|
||||
render_layout(conn);
|
||||
}
|
||||
|
||||
|
|
10
src/util.c
10
src/util.c
|
@ -16,6 +16,7 @@
|
|||
#include <string.h>
|
||||
#include <sys/wait.h>
|
||||
#include <stdarg.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "i3.h"
|
||||
#include "data.h"
|
||||
|
@ -113,6 +114,12 @@ void check_error(xcb_connection_t *connection, xcb_void_cookie_t cookie, char *e
|
|||
*
|
||||
*/
|
||||
void set_focus(xcb_connection_t *conn, Client *client) {
|
||||
/* The dock window cannot be focused */
|
||||
/* TODO: does this play well with dzen2’s popup menus? or do we just need to set the input
|
||||
focus but not update our internal structures? */
|
||||
if (client->dock)
|
||||
return;
|
||||
|
||||
/* TODO: check if the focus needs to be changed at all */
|
||||
/* Store current_row/current_col */
|
||||
c_ws->current_row = current_row;
|
||||
|
@ -154,6 +161,9 @@ void warp_pointer_into(xcb_connection_t *connection, Client *client) {
|
|||
*
|
||||
*/
|
||||
void toggle_fullscreen(xcb_connection_t *conn, Client *client) {
|
||||
/* clients without a container (docks) cannot be focused */
|
||||
assert(client->container != NULL);
|
||||
|
||||
Workspace *workspace = client->container->workspace;
|
||||
|
||||
workspace->fullscreen_client = (client->fullscreen ? NULL : client);
|
||||
|
|
Loading…
Reference in New Issue