X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fclient.c;h=1b010e4b263acc452d45771bd654738b4e5d63b1;hb=9116b124daa4ddff07918ab4d0e871f6d086cd09;hp=cccc59dbae593b9440ec48f1c5d62f86dfff70e8;hpb=29d595b1783240f2ff63fb8b3bbc6054d909d858;p=chaz%2Fopenbox diff --git a/openbox/client.c b/openbox/client.c index cccc59db..1b010e4b 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -437,6 +437,10 @@ void client_manage(Window window, ObPrompt *prompt) client_apply_startup_state(self, place.x, place.y, place.width, place.height); + /* set the initial value of the desktop hint, when one wasn't requested + on map. */ + OBT_PROP_SET32(self->window, NET_WM_DESKTOP, CARDINAL, self->desktop); + /* grab mouse bindings before showing the window */ mouse_grab_for_client(self, TRUE); @@ -2792,9 +2796,6 @@ static void client_apply_startup_state(ObClient *self, self->area = oldarea; client_configure(self, x, y, w, h, FALSE, TRUE, FALSE); - /* set the desktop hint, to make sure that it always exists */ - OBT_PROP_SET32(self->window, NET_WM_DESKTOP, CARDINAL, self->desktop); - /* nothing to do for the other states: skip_taskbar skip_pager @@ -2874,6 +2875,13 @@ void client_try_configure(ObClient *self, gint *x, gint *y, gint *w, gint *h, the updated frame dimensions. */ frame_adjust_area(self->frame, FALSE, TRUE, TRUE); + /* cap any X windows at the size of an unsigned short */ + *w = MIN(*w, + G_MAXUSHORT - self->frame->size.left - self->frame->size.right); + *h = MIN(*h, + G_MAXUSHORT - self->frame->size.top - self->frame->size.bottom); + + /* gets the frame's position */ frame_client_gravity(self->frame, x, y); @@ -4318,32 +4326,26 @@ void client_find_edge_directional(ObClient *self, ObDirection dir, } /* search for edges of clients */ - if (((dir == OB_DIRECTION_NORTH || dir == OB_DIRECTION_SOUTH) && - !self->max_vert) || - ((dir == OB_DIRECTION_EAST || dir == OB_DIRECTION_WEST) && - !self->max_horz)) - { - for (it = client_list; it; it = g_list_next(it)) { - ObClient *cur = it->data; + for (it = client_list; it; it = g_list_next(it)) { + ObClient *cur = it->data; - /* skip windows to not bump into */ - if (cur == self) - continue; - if (cur->iconic) - continue; - if (self->desktop != cur->desktop && cur->desktop != DESKTOP_ALL && - cur->desktop != screen_desktop) - continue; + /* skip windows to not bump into */ + if (cur == self) + continue; + if (cur->iconic) + continue; + if (self->desktop != cur->desktop && cur->desktop != DESKTOP_ALL && + cur->desktop != screen_desktop) + continue; - ob_debug("trying window %s", cur->title); + ob_debug("trying window %s", cur->title); - detect_edge(cur->frame->area, dir, my_head, my_size, my_edge_start, - my_edge_size, dest, near_edge); - } - dock_get_area(&dock_area); - detect_edge(dock_area, dir, my_head, my_size, my_edge_start, + detect_edge(cur->frame->area, dir, my_head, my_size, my_edge_start, my_edge_size, dest, near_edge); } + dock_get_area(&dock_area); + detect_edge(dock_area, dir, my_head, my_size, my_edge_start, + my_edge_size, dest, near_edge); g_slice_free(Rect, a); }