Christopher Halse Rogers
2007-Feb-15 01:37 UTC
[compiz] [PATCH]Application-window switcher, and comments for switcher.c
As promised, here's a patch to switcher.c to add "Application window" switching to the switcher, default keybinding Super+Tab (and Shift+Super+Tab for reverse). Works (and fails to work*) in the same conditions Scale's "group" mode does. Also, two patches for doxygen-compatible comments for some of switcher, which I added while working out what was going on. It turned out to be *extremely* easy to follow the switcher.c code, so I'm not sure quite how useful the comments are, but they're now available. I've only really looked at the switcher & scale code, but both of those generate a window list filtered by a filter function, most of the code of which is identical between the two plugins, and the various modes each plugin supports. Might it be worthwhile factoring out a "createWindowList" and "createFIlteredWindowList" (and possibly a "freeWindowList")? Finally, now that I've touched switcher.c, there's a lot of duplication in the setup of each of the modes (allwindows, normal, no-popup, appswitch). Would a patch that factors this code out be smiled upon? * The group code obviously relies on some form of application support. Gnome-terminals work, Epiphany works, emacs and texmacs don't. This is probably related to https://bugs.launchpad.net/ubuntu/+source/gnome-terminal/+bug/72732
Christopher Halse Rogers
2007-Feb-15 03:23 UTC
[compiz] Re: [PATCH]Application-window switcher, and comments for switcher.c
Sorry, this time with the actual patches attached! -------------- next part -------------- A non-text attachment was scrubbed... Name: app-switch.patch Type: text/x-patch Size: 8728 bytes Desc: not available Url : http://lists.freedesktop.org/archives/compiz/attachments/20070215/6bc3bc08/app-switch.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: comments-part-1.patch Type: text/x-patch Size: 1234 bytes Desc: not available Url : http://lists.freedesktop.org/archives/compiz/attachments/20070215/6bc3bc08/comments-part-1.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: comments-part-2.patch Type: text/x-patch Size: 1301 bytes Desc: not available Url : http://lists.freedesktop.org/archives/compiz/attachments/20070215/6bc3bc08/comments-part-2.bin
David Reveman
2007-Feb-26 11:34 UTC
[compiz] Re: [PATCH]Application-window switcher, and comments for switcher.c
(I assume that you didn't actually want to take this off the list) On Thu, 2007-02-22 at 11:09 +1100, Christopher Halse Rogers wrote:> On 2/21/07, David Reveman <davidr@novell.com> wrote: > > On Thu, 2007-02-15 at 22:23 +1100, Christopher Halse Rogers wrote: > > > Sorry, this time with the actual patches attached! > > > > Great work! > Thanks :). > > > > > Wouldn't it make sense to have an enum for the switch type currently > > used instead of two boolean values (allWindows and appWindows)? It seems > > that allWindows is currently always FALSE when appWindows is TRUE, which > > btw is different from the scale plugin where scaling a group will always > > include group windows from all viewports. > > I considered using an enum, but decided against it. First, because > they're not really mutually exclusive - the reason there's not an > allWindows + appWindows mode is that I'm not quite sure the best way > to display the windows not on the current viewport (it would probably > need to use the popup-switcher or change the viewport).Isn't how allWindows currently work good enough? Why should allWindows + appWindows be different then allWindows? The scale plugin is doing "allWindows + appWindows" for initiate_group and it seems more useful to me than just doing allWindows.> Secondly, I > wanted my first patch to be minimally invasive, and this seemed the > best way.OK, we can put this in first.> > I do hope to extend this a bit further: I'd like to add an appWindows > + allWindows mode, and also add some extra animation stuff to the > app-switcher, so it's easy to distinguish the possible switch-targets > from the windows from all other applications (I'd be interested in > hearing feedback as to what the best way to do this would be). It > might be worthwhile changing the appWindows/allWindows to a set of > flags, though.Do you mean some other animations then the current zoom animation? - David