GNOME Bugzilla – Bug 339293
Happy Holidays patch for the pager
Last modified: 2006-07-29 12:44:23 UTC
In my holidays I hacked on libwnck and especially on the pager. The result is this patch, which does the following: - Do Drag and Drop on the pager using real Gtk Drag and Drop. There's a bug 96675 about this already, which I used as a starting point. - better graphics when doing dnd Dragging around windows in the pager didn't seem right to me since you don't reposition the window, but switch its workspace. So now the dragged window is drawn semi-transparent and the workspace is dragged to is highlighted like all dnd widgets are. - dnd icons I implemented code to draw nice icons during dnd, so you can see what you drag. In the rare case of you moving changing windows, it'll crash. A patch for this is in bug 339224. - better graphics First I implemented prelight. So now the workspace the mouse is hovering over is prelit (be sure to use a theme that draws prelit backgrounds really different) Then I worked on the colors for windows and background, trying to get nice prelight and selection display done There's bug 161542 about this. It's only subtle changes, but makes a difference. - better redraws I implemented wnck_pager_queue_draw_(workspace|window), which only redraw the parts of the pager that really did change. I've been using this patch and the patch from bug 302398 for all my holidays and it hasn't crashed or otherwise bugged me yet, so I'm quite confident in the code.
Created attachment 64039 [details] [review] happy holidays
Comments: + what's the point of the change in get_window_rect()? + I don't like the color of unselected windows in the selected workspace and they all have white borders. This is because of GTK_STATE_SELECTED. Not sure what's the best way to improve this. + GdkRectangle *clip_rect is not used in wnck_pager_draw_workspace(), and I believe it will not be that easy to make use of it. + is window_name_changed_callback() useful? (not from your patch, but I'm reading the whole source ;-)) + I don't understand why window_state_changed_callback() should redraw the all pager. + I'm not sure that wnck_window_set_as_drag_icon() should be public. And it lives in pager.c because of draw_window, but it'd be better to have it in window.c... + are the "wnck-drag-pixmap" and "wnck-drag-window" things useful? So, I committed a modified version of your patch, changing stuff according to those comments since it's better to test the patch ASAP :-) Can you check if everything is okay?
Wow, great stuff. > + what's the point of the change in get_window_rect()? > I think I tried to fix rounding issues there. I was particularly annoyed by the fact the the bottommost and rightmost pixel of the workspace never belonged to the window. There's another problem with the pager drawing windows based on the size of the content Window which doesn't include decorations. This causes problems on bigger pagers, where windows never touch the top border. (I should probably open a new bug about this). > + I don't like the color of unselected windows in the selected workspace and > they all have white borders. This is because of GTK_STATE_SELECTED. Not sure > what's the best way to improve this. > The different/white border color was on purpose to improve the difference between the active workspace and other workspaces in the case outlined in https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=143154 (lots of small windows and a small pager). In that case pretty much only the borders are visible. In general I tried to find a way to distinguish the active workspace better from other workspaces by using colors that looked different in as much themes as possible. Since there's lots of combinations possible of what may be visible where, this wasn't easy and resulted in some less ideal colors. > + I don't understand why window_state_changed_callback() should redraw the > all pager. > I think that was on purpose because I didn't understand the effects of state changes fully and I wasn't sure that more changes could be added later. ("show on all workspaces" or similar). I tried to be on the safe side I guess. :) > + I'm not sure that wnck_window_set_as_drag_icon() should be public. And it > lives in pager.c because of draw_window, but it'd be better to have it in > window.c... > Not sure there either, but I liked the idea to export a common way to draw windows as drag icons, so different apps that allowed window dnd looked the same. At least the tasklist should be able to allow dragging from it and then use that function. > + are the "wnck-drag-pixmap" and "wnck-drag-window" things useful? > It was supposed to be a nice feature that changed the drag icon when the window changes. Currently it only does stuff when the window resizes (which does not happen really often ;)), but originally I intended it to work with X damage tracking, but since that is too hard I skipped it. So I guess currently it's not really "useful", but it worked, so I left it in.
*** Bug 349131 has been marked as a duplicate of this bug. ***