GNOME Bugzilla – Bug 651620
Additional implementation of Alt-Tab + bugfix
Last modified: 2011-08-01 14:10:30 UTC
Created attachment 188977 [details] [review] output of git format-patch origin Hi, Here is a patch for the implementation of a new behavior of Alt+Tab. The choice is proposed on the first alt+tab hit, and can be modified thru gsettings. It also has a bugfix for the old behavior. Thanks, Thomas
Created attachment 188978 [details] [review] output of git format-patch origin (CORRECTED)
I wanted to comment my 2nd attachment, but it didn't work as expected. I had forgotten a git add before the first git format-patch. The second patch is the one to be considered.
Review of attachment 188978 [details] [review]: Mostly fine with some minor comments, although not tested yet. ::: extensions/alternate-tab/extension.js @@ +21,3 @@ +const Gio = imports.gi.Gio; + +const ModalDialog = imports.ui.modalDialog; Why aren't these mixed with the other imports? @@ +23,3 @@ +const ModalDialog = imports.ui.modalDialog; + +const Gettext = imports.gettext.domain('gnome-shell'); 'gnome-shell-extensions', I suppose. @@ +51,3 @@ + This mode is the native GNOME 3 behaviour or in other words: Clicking \n\ + native switches the Alternate Tab extension off. \n\ +"; MESSAGE should be translatable. Use _N() if you don't want to call gettext every time your extension is loaded, otherwise _() is fine. @@ +156,3 @@ + if (title) { + this.label = new St.Label({ text: title }); + // St.Label doesn't support text-align so use a Bin St.Label supports text-align, if you expand it. @@ +538,2 @@ function main() { + let MODES = { const? ::: extensions/alternate-tab/org.gnome.shell.extensions.alternate-tab.gschema.xml.in @@ +1,3 @@ +<schemalist gettext-domain="gnome-shell-extensions"> + <schema id="org.gnome.shell.extensions.alternate-tab" path="/org/gnome/shell/extensions/alternate-tab/"> + <key type="s" name="behaviour"> I think that this should be an enumeration, so that you can change it easily in dconf-editor.
Hi Giovanni, thanks for the suggestions. Since most of the issues are in the piece of code I wrote, I'll try to take care of them within the next two weeks. I'll drop the patch on this page. Cheers, Joachim
Hey Giovanni thanks for referring me to this bug. When I applied the second patch I got the following message: "Applying: New implementation + bugfixes /opt/git/gnome-shell-extensions/.git/rebase-apply/patch:379: trailing whitespace. appIcons.push(ap1); warning: 1 line adds whitespace errors." and when I try to make I get this error: "Makefile:434: *** missing separator. Stop." I'd really like to try this new alt-tab implementation. I'd like for alt-tab to only include windows in the current workspace and hopefully have a small application icon in the bottom corner of each preview window.
Created attachment 190197 [details] [review] First bunch of bugfixes for the new alternate tab behaviour
Here the patch of the first bunch of bugfixes suggested by Giovanni. @Giovanni: Somehow I don't get what you meant with the _() and _N() functions. I can find _N() nowhere in the code of gnome shell, so how am I supposed to use it or is there documentation available?
(In reply to comment #6) > Created an attachment (id=190197) [details] [review] > First bunch of bugfixes for the new alternate tab behaviour Please squash this with the other, given that it hasn't been merged yet. (In reply to comment #7) > Here the patch of the first bunch of bugfixes suggested by Giovanni. > > @Giovanni: > Somehow I don't get what you meant with the _() and _N() functions. I can find > _N() nowhere in the code of gnome shell, so how am I supposed to use it or is > there documentation available? _() and _N() come from gettext usage. _() is usually defined as a call to gettext (in JS, it is defined as the gettext function itself), while _N() is a macro/function that does nothing (in JS, this would be _N = function(x) { return x; }). They're used so that xgettext can extract translatable strings to place in template files. Usually, you write _("My message"), and that evaluates to the translated message. You need to use _N("My message") if you want to call gettext manually at a later time (for example, because the message is defined at global scope, and thus is evaluated before main() is called). So _("My message") evaluates to "Mio messaggio" in it, _N("My message") evaluates to "My message", and gettext("My message") evaluates to "Mio messaggio".
*** Bug 654645 has been marked as a duplicate of this bug. ***
Created attachment 192081 [details] [review] New alternate tab implementation and bugfixes for the old one. So, I squashed all patches into one file, including the bugfixes of Thomas and the gettext functionality.
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.