Commit Graph

129 Commits

Author SHA1 Message Date
Florian Müllner
b50702dd52 altTab: Ignore workspaces in popups
Currently both the app switcher and the thumbnail list divide items
first into two groups (based on whether the item is located on the
current workspace or not), and then sort each group individually
by MRU.
The resulting behavior is often confusing, e.g. when using alt-tab
a second time does not switch back to the original window when the first
invocation involved a workspace switch and the workspace contains
windows of more than one application.
Instead, make the behavior more predictable by sorting both lists
strictly by MRU.

https://bugzilla.gnome.org/show_bug.cgi?id=661156
2013-03-04 15:28:37 +01:00
Jasper St. Pierre
7ff7ced504 switcherPopup: Add a timestamp argument to _finish()
And use it elsewhere.

https://bugzilla.gnome.org/show_bug.cgi?id=689653
2012-12-06 12:25:37 -05:00
Florian Müllner
e725f8a0fe altTab: Re-implement 'switch-windows' keybinding
Now that we use the new 'switch-applications' keybinding for the
application-based alt-tab popup, we can use the 'switch-windows'
keybinding for a more traditional switcher.

Based heavily on the alternate-tab extension from Giovanni Campagna.

https://bugzilla.gnome.org/show_bug.cgi?id=688913
2012-12-05 18:42:08 +01:00
Florian Müllner
525d3c2619 altTab: Factor out thumbnail creation
https://bugzilla.gnome.org/show_bug.cgi?id=688913
2012-12-05 18:42:08 +01:00
Florian Müllner
aba46720c0 altTab: Rename AltTabPopup to AppSwitcherPopup
We will add support for a window-based popup in addition to the
current application-based one, so use a more descriptive name.

https://bugzilla.gnome.org/show_bug.cgi?id=688913
2012-12-05 18:42:08 +01:00
Florian Müllner
2fb1d707fe altTab: Use 'switch-applications' for app switcher
The Shell's alt-tab popup is application-based, so using the
'switch-windows' keybinding for it never really made sense.
Use the newly added 'switch-applications' keybinding instead.

https://bugzilla.gnome.org/show_bug.cgi?id=688913
2012-12-05 18:42:07 +01:00
Rui Matos
5faeaa2028 AppSwitcher: Remove a lost timeout on destroy
Doesn't look harmful but there's no point in running this code after
we're destroyed.

https://bugzilla.gnome.org/show_bug.cgi?id=689528
2012-12-04 10:06:37 +01:00
Rui Matos
00338bbc4b switcherPopup: Factor out altTab and ctrlAltTab's common code
https://bugzilla.gnome.org/show_bug.cgi?id=689528
2012-12-04 10:06:37 +01:00
Florian Müllner
cb08bd2e2e altTab: Minor code cleanup
https://bugzilla.gnome.org/show_bug.cgi?id=688913
2012-11-30 20:04:22 +01:00
Florian Müllner
c2065cc3e2 main: Use Params for optional parameters to pushModal()
As the number of optional parameters grows, it gets more convenient
to use Params instead of passing in a lot of undefined/null/0 values.

https://bugzilla.gnome.org/show_bug.cgi?id=688202
2012-11-17 01:44:22 +01:00
Stefano Facchini
066d44636a altTab: take into account all windows when computing app icon ordering
https://bugzilla.gnome.org/show_bug.cgi?id=667552
2012-03-18 14:52:29 +01:00
Alejandro Piñeiro
d7e2b0a771 a11y: added EXPANDABLE and EXPANDED state on Alt+Tab popup menu
https://bugzilla.gnome.org/show_bug.cgi?id=670719
2012-03-15 19:57:32 +01:00
Jasper St. Pierre
bea5c6f4e6 altTab: Fix scrolling
This hack was part of the custom scroll view code that allowed for
proper scrolling when the actor was near the screen edges. Since
the port to St.ScrollView, it's unnecessary and downright wrong,
causing portions of actors to be clipped. Remove it.

https://bugzilla.gnome.org/show_bug.cgi?id=613194
2012-03-01 06:28:57 -05:00
Jasper St. Pierre
8d854d5f1a altTab: Disable mouse scrolling on the new ScrollView
We handle scroll events ourselves, so we don't want the scroll view
to attempt to scroll on it.
2012-02-28 16:54:47 -05:00
Rui Matos
aa5d352a06 Remove the shell_get_event_state() wrapper
The bug that this wrapper was working around has been fixed for quite some
time: https://bugzilla.gnome.org/show_bug.cgi?id=650329.
2012-02-28 18:11:36 +01:00
Adel Gadllah
714ffc5ef1 altTab: Port to St.ScrollView
The appSwitcher has been using a custom scrolling implementation because
St.ScrollView was buggy when it was written. The bugs have been fixed
so remove the custom implementation and move to St.ScrollView.

https://bugzilla.gnome.org/show_bug.cgi?id=613194
2012-02-28 14:58:33 +01:00
Marius Gedminas
00ed2973b2 altTab: Fix thumbnail size calculation for some dual-head setups
The old formula worked only when the primary monitor was positioned at the
top of the virtual desktop.  When that was not the case, the available
space was miscalculated sometimes resulting in negative numbers, which in
the end produced strangely vertically stretched window thumbnails.

https://bugzilla.gnome.org/show_bug.cgi?id=651130
2012-02-23 19:54:16 +01:00
Giovanni Campagna
17c46c2452 Port everything to class framework
The last patch in the sequence. Every place that was previously
setting prototype has been ported to Lang.Class, to make code more
concise and allow for better toString().

https://bugzilla.gnome.org/show_bug.cgi?id=664436
2011-11-24 09:50:04 +01:00
Giovanni Campagna
d6b6f814d3 Port all classes with inheritance to class framework
All classes that have at least one other derived class (and thus
benefit from the framework) have been now ported. These includes
NMDevice, SearchProvider, AltTab.SwitcherList, and some other
stuff around.

https://bugzilla.gnome.org/show_bug.cgi?id=664436
2011-11-24 09:50:04 +01:00
Florian Müllner
a9ab8784c4 Adapt to mutter moving to GSettings
https://bugzilla.gnome.org/show_bug.cgi?id=663429
2011-11-11 20:32:43 +01:00
Adel Gadllah
f4d8a35b9d altTab: Don't refuse to work when a pointer grab is in place
Allow push_modal to optionally only work with a keyboard only grab and
use that in altTab as a fallback to allow switching windows while a pointer grab
is in effect (like during DND operations).

https://bugzilla.gnome.org/show_bug.cgi?id=660457
2011-10-21 09:12:17 +02:00
Dan Winship
928fbee15b altTab: fix app ordering in certain edge cases
Because we were sorting the Alt+Tab list by user_time rather than
stacking order / MRU, it was possible for the currently-focused window
to sometimes not be the first app in the list. Fix this by using
meta_display_get_tab_list() to get the proper MRU ordering of windows
on the current workspace, and then convert that to an ordered list of
apps.

https://bugzilla.gnome.org/show_bug.cgi?id=645026
2011-10-17 12:54:03 -04:00
Dan Winship
75b824d032 *.js: Make emacs modelines consistent
js2-mode is no longer developed and we recommend js-mode these days,
so switch the modelines to specify that, and make them consistent
across all files.

https://bugzilla.gnome.org/show_bug.cgi?id=660358
2011-10-11 08:05:12 -04:00
Florian Müllner
566d566f26 alt-tab: Do not hardcode ALT modifier
While we allow for arbitrary modifiers in keybindings, both the
alt-tab and ctrl-alt-tab popups close when ALT is not present in
the modifier mask, resulting in ALT being de-facto hardcoded.
Instead, pass the actual modifier mask when invoking the popups.

https://bugzilla.gnome.org/show_bug.cgi?id=645200
2011-09-20 21:07:19 +02:00
Jasper St. Pierre
0f4ce5dd4e altTab: Fix icon scrolling
Don't depend on the primary monitor position for determining whether we should
scroll, just use our own container's size.

https://bugzilla.gnome.org/show_bug.cgi?id=658239
2011-09-19 10:50:54 -04:00
Rui Matos
28bb0c1fb2 altTab: make thumbnails scroll to right if needed at first Alt+Shift+Above_Tab
Force an allocation at thumbnails creation so we can figure out whether we
need to scroll when selecting.

We also need to show() the whole AltTabPopup before calling _select() so that,
when computing the scrolling offset, the widgets already have their styles
loaded. Otherwise we will miss the switcher list item container's spacing.

https://bugzilla.gnome.org/show_bug.cgi?id=655069
2011-09-06 19:28:51 +01:00
Colin Walters
0af108211c apps: Ensure running apps override new .desktop file data
This patch fixes the "apps vanish from alt-TAB bug".

If a "package system" rips away and possibly replaces .desktop files
at some random time, we have historically used inotify to detect this
and reread state (in a racy way, but...).  In GNOME 2, this was
generally not too problematic because the menu widget was totally
separate from the list of windows - and the data they operate on was
disjoint as well.

In GNOME 3 we unify these, and this creates architectural problems
because the windows are tied to the app.

What this patch tries to do is, when rereading the application state,
if we have a running application, we keep that app around instead of
making a new instance.  This ensures we preserve any state such as the
set of open windows.

This requires moving the running state into ShellAppSystem.  Adjust
callers as necessary, and while we're at it drop the unused "contexts"
stuff.

This is just a somewhat quick band-aid; a REAL fix would require us
having low-level control over application installation.  As long as
we're on top of random broken tar+wget wrappers, it will be gross.

A slight future improvement to this patch would add an explicit
"merge" between the old and new data.  I think probably we always keep
around the ShellApp corresponding to a given ID, but replace its
GMenuTreeEntry.

https://bugzilla.gnome.org/show_bug.cgi?id=657990
2011-09-05 17:29:41 -04:00
Rui Matos
10a0f2b614 altTab: do a step transition instead of fading in
Commit 7596fdb460 makes the popup feel slow.
Instead of fading the popup in we wait a bit and show it instantly.

https://bugzilla.gnome.org/show_bug.cgi?id=652346
2011-08-03 16:23:35 +01:00
Dan Winship
aed50e2a39 shell-global: add a "display" property
and update callers to fetch that rather than doing
"global.screen.get_display()"

https://bugzilla.gnome.org/show_bug.cgi?id=654639
2011-08-03 09:09:55 -04:00
Dan Winship
7596fdb460 altTab: try to avoid showing the switcher when "flipping"
Use a longer fade-in time, but with an inout transition, so that the
dialog starts fading in very slowly and then picks up speed after
150ms or so. That way if the user releases Alt+Tab right away, they'll
never actually see the dialog.

https://bugzilla.gnome.org/show_bug.cgi?id=652346
2011-07-06 09:03:42 -04:00
Rui Matos
8db1ff8aef altTab: honor switch_*_backward key binding actions
https://bugzilla.gnome.org/show_bug.cgi?id=650452
2011-07-06 08:45:31 -04:00
Dan Winship
64b2b4a7d4 layout: new file handling shell layout
Remove ShellGlobal's monitor-related methods, and have
Main.layoutManager provide that information instead. Move
Main._relayout() to LayoutManager, and have other objects connect to
the layout manager's 'monitors-changed' signal to know when the screen
geometry has changed.

https://bugzilla.gnome.org/show_bug.cgi?id=636963
2011-07-06 08:38:35 -04:00
Rui Matos
17672accfe altTab.js: remove the rest of Alt+Tab's special case
Remove the other case in the App Switcher where Tab vs Above_Tab
behaved inconsistently.

https://bugzilla.gnome.org/show_bug.cgi?id=647907
2011-05-19 09:20:55 -04:00
Dan Winship
71dfab9711 altTab: remove erroneous/superflous pick
AltTabPopup was calling global.stage.get_actor_at_pos() "to force a
stage relayout", but that function does not actually have that effect.
It was also occasionally causing Clutter warnings (possibly due to a
clutter pick-buffer-caching bug?). So just remove the call.

https://bugzilla.gnome.org/show_bug.cgi?id=650317
2011-05-17 15:39:44 -04:00
Alejandro Piñeiro
6934e4db26 Setting StWidget::label-actor on some ui elements
Specifically:
  * Icons on Alt+Tab menu
  * Icons on Ctrl+Alt+Tab menu
  * Icons on the list of applications
2011-04-27 02:09:11 +02:00
Dan Winship
fe08edbe2b altTab: fix Alt+Tab scrolling on initial display
The initial selection of the Alt+Tab dialog was happening before the
dialog was shown and allocated, and so the "do we need to scroll"
check used bogus coordinates. Fix by showing the dialog (and forcing
an allocation) first.

https://bugzilla.gnome.org/show_bug.cgi?id=647807
2011-04-26 21:10:46 +02:00
Adel Gadllah
d2a16bca10 altTab: Fix the appSwitcher's allocation
A typo in AltTabPopup._allocate was causing the allocation to be wrong
which broke icon scrolling, so fix that.

https://bugzilla.gnome.org/show_bug.cgi?id=647807
2011-04-26 21:10:45 +02:00
Rui Matos
092e1a691d altTab.js: remove Alt+Tab's special case
Alt+Tab's special case of "switch to the most-recently-used window even if
it's in the same app" is actually an hindrance for users to get a firm mental
model of Alt+Tab. Now that we have Alt+Above_Tab the special case is no longer
needed.

https://bugzilla.gnome.org/show_bug.cgi?id=647907
2011-04-20 14:43:14 -04:00
Dan Winship
1e366aa56e altTab: popModal before fading out
This lets the user start typing in the newly-selected window right
away, without any characters possibly getting eaten during the
animation.

https://bugzilla.gnome.org/show_bug.cgi?id=644857
2011-03-21 14:26:08 -04:00
Maxim Ermilov
3944df1bd2 altTab: fix incorrect positioning with multiple monitors
Calculate the position of the alt-tab popup correctly when primary.x != 0.
This was accidentally broken by 614176b269
https://bugzilla.gnome.org/show_bug.cgi?id=644206
2011-03-08 20:21:07 +03:00
Adel Gadllah
614176b269 appSwitcher: Fix logic error in AltTabPopup._allocate 2011-03-04 17:07:45 +01:00
Florian Müllner
c72241df5b alt-tab: Enforce icon size
For applications with no proper desktop file, the window icon is
used as application icon in the tab switcher, but it won't have
the correct icon size. The current approach is to add additional
padding to these icons - the size turns out inconsistent with
other icons, but the icon appears sharp. For the dash it has been
decided that unsharp icons are less evil than differing icon sizes,
so icons are scaled up to the "right" size - for consistency, do the
same in the alt-tab switcher.

https://bugzilla.gnome.org/show_bug.cgi?id=643300
2011-02-26 00:06:44 +01:00
Adel Gadllah
294490f77b altTab: Properly query the themenode's color when painting the arrows 2011-02-15 20:58:21 +01:00
Rui Matos
1bc805206b altTab: use keybinding actions instead of clutter keysym comparison
Use keybinding actions instead of clutter keysym comparisons to select
next/prev application and next/prev window.

https://bugzilla.gnome.org/show_bug.cgi?id=639341
2011-02-15 13:43:35 -05:00
Rui Matos
a047132a2f altTab: enable the switch_group keybinding action
Allows the user to bring up the Alt+Tab popup with the current application's
window thumbnails selected.

https://bugzilla.gnome.org/show_bug.cgi?id=639341
2011-02-15 13:43:32 -05:00
Dan Winship
0c0e2cc689 shell-drawing: remove shell_draw_box_pointer()
This was originally done in C because it used cairo, but that can be
done from JS now. Since it was only used by altTab.js, move it there.

https://bugzilla.gnome.org/show_bug.cgi?id=642059
2011-02-14 09:38:27 -05:00
Adel Gadllah
a52ec8f286 appSwitcher: Don't create thumbnails for destroyed windows 2011-02-09 20:54:37 +01:00
Dan Winship
c86a977564 St: drop StClickable, add some functionality to StButton
For historical reasons, we had both StClickable and StButton, which
were nearly identical. StButton was more widely-used, so keep that and
port all StClickable users to that.

https://bugzilla.gnome.org/show_bug.cgi?id=640583
2011-02-07 12:45:48 -05:00
Adel Gadllah
17a0b27109 appSwitcher: Use shorter icon hover timeout
Using a timeout of 750ms seems to be too long,
a shorter one like 200ms still solves the original problem
without getting in the way of other uses.
2011-01-30 20:29:27 +01:00
Adel Gadllah
d2a40d6885 appSwitcher: Make sure we don't leave a stale timeout handler 2011-01-25 15:32:43 +01:00