After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 651620 - Additional implementation of Alt-Tab + bugfix
Additional implementation of Alt-Tab + bugfix
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: extensions
3.0.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 654645 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-06-01 09:08 UTC by Thomas Bouffon
Modified: 2011-08-01 14:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
output of git format-patch origin (14.68 KB, patch)
2011-06-01 09:08 UTC, Thomas Bouffon
none Details | Review
output of git format-patch origin (CORRECTED) (15.86 KB, patch)
2011-06-01 09:13 UTC, Thomas Bouffon
reviewed Details | Review
First bunch of bugfixes for the new alternate tab behaviour (5.03 KB, patch)
2011-06-19 11:49 UTC, Joachim Bargsten
none Details | Review
New alternate tab implementation and bugfixes for the old one. (16.44 KB, patch)
2011-07-16 10:58 UTC, Joachim Bargsten
committed Details | Review

Description Thomas Bouffon 2011-06-01 09:08:51 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
Comment 1 Thomas Bouffon 2011-06-01 09:13:35 UTC
Created attachment 188978 [details] [review]
output of git format-patch  origin (CORRECTED)
Comment 2 Thomas Bouffon 2011-06-01 09:15:35 UTC
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.
Comment 3 Giovanni Campagna 2011-06-02 14:40:04 UTC
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.
Comment 4 Joachim Bargsten 2011-06-08 02:28:50 UTC
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
Comment 5 Diego 2011-06-15 21:53:10 UTC
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.
Comment 6 Joachim Bargsten 2011-06-19 11:49:29 UTC
Created attachment 190197 [details] [review]
First bunch of bugfixes for the new alternate tab behaviour
Comment 7 Joachim Bargsten 2011-06-19 11:50:56 UTC
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?
Comment 8 Giovanni Campagna 2011-07-03 23:03:01 UTC
(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".
Comment 9 Giovanni Campagna 2011-07-15 11:57:00 UTC
*** Bug 654645 has been marked as a duplicate of this bug. ***
Comment 10 Joachim Bargsten 2011-07-16 10:58:26 UTC
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.
Comment 11 Giovanni Campagna 2011-08-01 14:10:11 UTC
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.