X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fframe.c;h=211a275c75024bbd002aab55c8da3d0f1ad037e6;hb=2b2beddc7447197d12fcbcae96772e1f38eef138;hp=765c4b59bca0e1473ad993872ebb7d897af117f7;hpb=5cf61ee02354c1c9f80c11f3796afc4b948055d6;p=chaz%2Fopenbox diff --git a/openbox/frame.c b/openbox/frame.c index 765c4b59..211a275c 100644 --- a/openbox/frame.c +++ b/openbox/frame.c @@ -119,11 +119,13 @@ Frame *frame_new() self->iconify = createWindow(self->title, mask, &attrib); self->handle = createWindow(self->window, mask, &attrib); mask |= CWCursor; - attrib.cursor = ob_cursors.ll_angle; + attrib.cursor = ob_cursors.bl; self->lgrip = createWindow(self->handle, mask, &attrib); - attrib.cursor = ob_cursors.lr_angle; + attrib.cursor = ob_cursors.br; self->rgrip = createWindow(self->handle, mask, &attrib); + self->focused = FALSE; + /* the other stuff is shown based on decor settings */ XMapWindow(ob_display, self->plate); XMapWindow(ob_display, self->lgrip); @@ -140,7 +142,7 @@ Frame *frame_new() XResizeWindow(ob_display, self->iconify, theme_button_size, theme_button_size); XResizeWindow(ob_display, self->icon, - theme_button_size, theme_button_size); + theme_button_size + 2, theme_button_size + 2); XResizeWindow(ob_display, self->close, theme_button_size, theme_button_size); XResizeWindow(ob_display, self->desk, @@ -386,8 +388,9 @@ void frame_adjust_state(Frame *self) framerender_frame(self); } -void frame_adjust_focus(Frame *self) +void frame_adjust_focus(Frame *self, gboolean hilite) { + self->focused = hilite; framerender_frame(self); } @@ -427,20 +430,20 @@ void frame_grab_client(Frame *self, Client *client) frame_adjust_area(self, TRUE, TRUE); - /* set all the windows for the frame in the client_map */ - g_hash_table_insert(client_map, &self->window, client); - g_hash_table_insert(client_map, &self->plate, client); - g_hash_table_insert(client_map, &self->title, client); - g_hash_table_insert(client_map, &self->label, client); - g_hash_table_insert(client_map, &self->max, client); - g_hash_table_insert(client_map, &self->close, client); - g_hash_table_insert(client_map, &self->desk, client); - g_hash_table_insert(client_map, &self->shade, client); - g_hash_table_insert(client_map, &self->icon, client); - g_hash_table_insert(client_map, &self->iconify, client); - g_hash_table_insert(client_map, &self->handle, client); - g_hash_table_insert(client_map, &self->lgrip, client); - g_hash_table_insert(client_map, &self->rgrip, client); + /* set all the windows for the frame in the window_map */ + g_hash_table_insert(window_map, &self->window, client); + g_hash_table_insert(window_map, &self->plate, client); + g_hash_table_insert(window_map, &self->title, client); + g_hash_table_insert(window_map, &self->label, client); + g_hash_table_insert(window_map, &self->max, client); + g_hash_table_insert(window_map, &self->close, client); + g_hash_table_insert(window_map, &self->desk, client); + g_hash_table_insert(window_map, &self->shade, client); + g_hash_table_insert(window_map, &self->icon, client); + g_hash_table_insert(window_map, &self->iconify, client); + g_hash_table_insert(window_map, &self->handle, client); + g_hash_table_insert(window_map, &self->lgrip, client); + g_hash_table_insert(window_map, &self->rgrip, client); } void frame_release_client(Frame *self, Client *client) @@ -453,8 +456,12 @@ void frame_release_client(Frame *self, Client *client) if (XCheckTypedWindowEvent(ob_display, client->window, ReparentNotify, &ev)) { XPutBackEvent(ob_display, &ev); + /* re-map the window since the unmanaging process unmaps it */ - XMapWindow(ob_display, client->window); + + /* XXX ... um no it doesnt it unmaps its parent, the window itself + retains its mapped state, no?! XXX + XMapWindow(ob_display, client->window); */ } else { /* according to the ICCCM - if the client doesn't reparent itself, then we will reparent the window to root for them */ @@ -463,20 +470,20 @@ void frame_release_client(Frame *self, Client *client) client->area.y); } - /* remove all the windows for the frame from the client_map */ - g_hash_table_remove(client_map, &self->window); - g_hash_table_remove(client_map, &self->plate); - g_hash_table_remove(client_map, &self->title); - g_hash_table_remove(client_map, &self->label); - g_hash_table_remove(client_map, &self->max); - g_hash_table_remove(client_map, &self->close); - g_hash_table_remove(client_map, &self->desk); - g_hash_table_remove(client_map, &self->shade); - g_hash_table_remove(client_map, &self->icon); - g_hash_table_remove(client_map, &self->iconify); - g_hash_table_remove(client_map, &self->handle); - g_hash_table_remove(client_map, &self->lgrip); - g_hash_table_remove(client_map, &self->rgrip); + /* remove all the windows for the frame from the window_map */ + g_hash_table_remove(window_map, &self->window); + g_hash_table_remove(window_map, &self->plate); + g_hash_table_remove(window_map, &self->title); + g_hash_table_remove(window_map, &self->label); + g_hash_table_remove(window_map, &self->max); + g_hash_table_remove(window_map, &self->close); + g_hash_table_remove(window_map, &self->desk); + g_hash_table_remove(window_map, &self->shade); + g_hash_table_remove(window_map, &self->icon); + g_hash_table_remove(window_map, &self->iconify); + g_hash_table_remove(window_map, &self->handle); + g_hash_table_remove(window_map, &self->lgrip); + g_hash_table_remove(window_map, &self->rgrip); frame_free(self); } @@ -497,7 +504,7 @@ static void layout_title(Frame *self) if (!(self->client->decorations & Decor_Icon)) break; if (n) { *lc = ' '; break; } /* rm duplicates */ n = TRUE; - self->label_width -= theme_button_size + theme_bevel + 1; + self->label_width -= theme_button_size + 2 + theme_bevel + 1; break; case 'D': if (!(self->client->decorations & Decor_AllDesktops)) break; @@ -555,10 +562,10 @@ static void layout_title(Frame *self) if (!n) break; self->icon_x = x; RECT_SET(self->a_icon->area, 0, 0, - theme_button_size, theme_button_size); + theme_button_size + 2, theme_button_size + 2); XMapWindow(ob_display, self->icon); - XMoveWindow(ob_display, self->icon, x, theme_bevel + 1); - x += theme_button_size + theme_bevel + 1; + XMoveWindow(ob_display, self->icon, x, theme_bevel); + x += theme_button_size + 2 + theme_bevel + 1; break; case 'D': if (!d) break; @@ -646,12 +653,15 @@ Context frame_context_from_string(char *name) return Context_None; } -Context frame_context(Frame *self, Window win) +Context frame_context(Client *client, Window win) { + Frame *self; + if (win == ob_root) return Context_Root; - if (self == NULL) return Context_None; - if (win == self->client->window) return Context_Client; + if (client == NULL) return Context_None; + if (win == client->window) return Context_Client; + self = client->frame; if (win == self->window) return Context_Frame; if (win == self->plate) return Context_Client; if (win == self->title) return Context_Titlebar;