Commit Graph

89 Commits

Author SHA1 Message Date
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
Adel Gadllah
75d1230dd1 AppSwitcher: Delay activating appIcons when the thumbnail list is open
When aiming for the thumbnails with the mouse one might cross an
icon by accident which causes the thumbnail list to be closed, which is
frustrating.

Fix this by delaying the icon activation when the thumbnail list is
open.

https://bugzilla.gnome.org/show_bug.cgi?id=636650
2011-01-24 19:33:22 +01:00
Adel Gadllah
f4572eedd0 altTab: Query the correct monitor's size
We always display the appSwitcher on the primary monitor,
so always query for its size rather than that of the focused
one.
2011-01-16 20:38:43 +01:00
Dan Winship
a46baeed0b altTab: fix destroy-without-showing case
If the switcher is destroyed without ever being fully shown (either
because it couldn't get a keyboard grab, or just because there are no
apps to display), destroy it immediately rather than tweening it
towards destruction, since its contents haven't been built yet and
_allocate() will throw errors if it runs.
2011-01-06 13:38:41 -05:00
Dan Winship
7d44c666ff altTab: use 'selected' pseudo-style for selected item
This makes it consistent with other parts of the UI and will let the
a11y code use the rule "has_style_pseudo_class('selected') =>
ATK_STATE_SELECTED"

https://bugzilla.gnome.org/show_bug.cgi?id=637830
2010-12-23 09:50:40 -05:00
Dan Winship
4dd4c9f99f Use more actor.grab_key_focus() and less stage.connect('key-press-event')
Until recently, the clutter keyboard focus was almost always kept on
the stage, and bits of code that wanted to do stuff with the keyboard
would just watch for key-press-events on the stage. In several places,
the code wasn't even bothering to ensure that the focus was on the
stage, which caused problems with other actors that explicitly grabbed
focus.

A previous fix for this (f21403fd) was to always reset the focus to
the stage after calling pushModal(), but a better fix is to just
actually make use of the keyboard focus everywhere rather than having
everyone try to read events off the stage.

Now pushModal(actor) also does actor.grab_key_focus(), and various
bits of code have been changed to read key events off their own
toplevels rather than off the stage, meaning there's no chance of them
accidentally getting someone else's events.

https://bugzilla.gnome.org/show_bug.cgi?id=618885
2010-12-20 17:32:07 -05:00
Dan Winship
8886b7433c StThemeNode: simplify use of get_color/get_double/get_length
Although within St itself there are situations where the semantics of
these functions (return TRUE or FALSE and return the actual value in
an out parameter) is useful, it's mostly just annoying at the
application level, where you generally know that the CSS property is
going to specified, and there is no especially sane fallback if it's
not.

So rename the current methods to lookup_color, lookup_double, and
lookup_length, and add new get_color, get_double, and get_length
methods that don't take an "inherit" parameter, and return their
values directly. (Well, except for get_color, due to the lack of (out
caller-allocates) in gjs.)

And update the code to use either the old or new methods as appropriate.

https://bugzilla.gnome.org/show_bug.cgi?id=632590
2010-10-21 15:02:33 -04:00
Dan Winship
dc5ceffe40 Remove Alt+W/A/S/D hack
This was just for use within Xephyr, and gnome-shell doesn't work in
Xephyr any more anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=624858
2010-09-23 15:17:06 -04:00
Adel Gadllah
907dd4381b [appSwitcher] Check the modifier state rather than assuming Meta
It isn't guaranteed that Alt+Shift equals to Meta, so we have to check
the modifier instead.

https://bugzilla.gnome.org/show_bug.cgi?id=629368
2010-09-11 22:41:59 +02:00
Adel Gadllah
246d9f1357 [appSwitcher] Close the switcher on Meta_L/R release
The keyReleaseEvent handler does not take into account that a
user might release Alt while still holding shift
(the keycode becomes Meta_L/R in that case).

The result is that the switcher stays open which is unexpected.

https://bugzilla.gnome.org/show_bug.cgi?id=629368
2010-09-11 19:01:42 +02:00
Dan Winship
b9f9dd948a [AltTab] fix Alt-Shift-Tab again
In Clutter 1.2, clutter_event_get_keysym() ignored the state of the
Shift key. In 1.4, it does not, so we have to adjust our comparisons
accordingly.

https://bugzilla.gnome.org/show_bug.cgi?id=627782
2010-08-30 12:28:00 -04:00
Florian Müllner
4632db177a Clean up unused includes
Some late spring cleaning ...
2010-07-19 01:46:01 +02:00
Adel Gadllah
362fc78dcf Revert "[appSwitcher] Remove unneeded workaround"
This reverts commit a1bfaac5a2.

https://bugzilla.gnome.org/show_bug.cgi?id=613194
2010-06-17 17:17:57 +02:00
Florian Müllner
6e09cc5fc8 Fade in alt-tab popup, adjust timings
The design calls for item to not appear abruptly, but not too slow
either - 100ms seems to be a good sweet spot for elements which are
supposed to appear "instantly".
Add a fade effect to the alt-tab popup and set the timings for other
fade effects to 100ms.

https://bugzilla.gnome.org/show_bug.cgi?id=621247
2010-06-16 20:55:26 +02:00
Adel Gadllah
d31e905978 [appSwitcher] Display on primary monitor
Displaying it on the focused monitor seems to confuse users so revert back to
using the primary monitor as per designer's request.

https://bugzilla.gnome.org/show_bug.cgi?id=619854
2010-05-27 20:09:59 +02:00
Adel Gadllah
a1bfaac5a2 [appSwitcher] Remove unneeded workaround
SwitcherList.actor is no longer a St.BoxLayout but a
GenericContainer now, so the hack in AppSwitcher._getPreferredHeight is no
longer needed (it is called with the correct width now).

https://bugzilla.gnome.org/show_bug.cgi?id=613194
2010-05-24 16:52:38 +02:00
Colin Walters
1af392b5f0 Allow selection of individual windows
Per design discussion, change things back so that when choosing
an individual window, we raise only that window.  However
when we select an application, raise all windows.

A behavioral change required to clearly differentiate these
is that when the window thumbnail list is popped up, it no
longer has the first window selected by default.  Therefore
the user has to explicitly press the down arrow or use the
mouse to enter individual window selection mode.

https://bugzilla.gnome.org/show_bug.cgi?id=617959
2010-05-17 13:17:56 -04:00
Marina Zhurakhinskaya
703b21cef0 Don't use double quotes for things that don't need to be translated
This is our convention.

The only exceptions are double quotes for words in comments that give
them a special meaning (though beware that these quotes are not truly
necessary most of the time) and double quotes that need to be a part
of the output string.
2010-05-13 16:00:38 -04:00
Joseph Scheuhammer
62afd2ffa3 Reorganize stage in terms of a UI Group actor and everything else
In preparation for adding magnification, "uiGroup.patch", organizes the stage
along the following lines:

Stage
  *Magnifier
  UI group
    Window group
    Chrome group
    Overlay group
    Alt tab
    App display
    Chrome
    ...

This allows a magnifier actor to clone and magnify the UI group.  The magnifier
is a sibling of the UI Group in this stage oraganization -- see the next patch,
"Magnifier.patch".
2010-05-06 17:18:10 -04:00
Colin Walters
37692513cf [altTab] Update for renamed ShellApp method 2010-05-06 12:15:08 -04:00
Colin Walters
35bf6b0d36 [altTab] Raise all windows for an app
https://bugzilla.gnome.org/show_bug.cgi?id=616051
2010-05-06 11:19:44 -04:00
Maxim Ermilov
df43352441 Fix Clutter warnings
https://bugzilla.gnome.org/show_bug.cgi?id=614905
2010-04-19 01:16:49 +04:00
Dan Winship
d42263c1bc Change shell_global_get_modifier_keys to shell_global_get_pointer.
We can't use gdk_display_get_pointer/gdk_window_get_pointer from gjs
when XKB is active. We already had a wrapper that did the
get-modifier-state part of that, but some places also need the
get-pointer-location part of it. So update our wrapper to return both,
and update js code to use it.

https://bugzilla.gnome.org/show_bug.cgi?id=613428
2010-04-08 14:51:45 -04:00
Dan Winship
b4c3ab6726 [StDrawingArea] further CSS-ify StDrawingArea users
Make shell_draw_box_pointer() use CSS colors, and set the app well
menu arrow width based on its own CSS rather than its parent's.

https://bugzilla.gnome.org/show_bug.cgi?id=614516
2010-04-06 08:22:10 -04:00
Dan Winship
cfea0649d8 remove some Big references from places that don't need them any more
https://bugzilla.gnome.org/show_bug.cgi?id=614516
2010-04-06 08:17:33 -04:00
Adel Gadllah
6461db9df6 AppSwitcher: Make sure we always get the correct icon position
Call stage.get_actor_at_pos before calling icon.get_transformed_position.
2010-03-26 18:13:18 +01:00
Adel Gadllah
5ff609ed49 AppSwitcher: Use CSS instead of the hardcoded POPUP_LIST_SPACING constant
The POPUP_LIST_SPACING constant was used for the AltTabPopup.actor's padding,
AltTabPopup.actor's spacing and SwitcherList._list's spacing.

Switch to CSS and remove the constant.

https://bugzilla.gnome.org/show_bug.cgi?id=613195
2010-03-26 17:49:02 +01:00
Adel Gadllah
f53bf17331 appSwitcher: Fix multiscreen positioning issues
We need to take the screens position into account when allocating.

https://bugzilla.gnome.org/show_bug.cgi?id=613944
2010-03-25 21:58:48 +01:00
Adel Gadllah
367eaf9161 Prevent from being partly offscreen
Limit the AppSwitcher to the screen size by either downscaling or
scrolling.

We scale the icons down up from 96, 64, 48, 32 to 22 and start scrolling
if we still fail to fit on screen.

The thumbnail box is shifted to either left or right, when failing to
fit we scroll here to.
To prevent from being offscreen at the buttom we adjust the thumbnail
height to fit.

The old positioning logic is replaced with a ShellGenericContainer to
implement a custom allocation system.

https://bugzilla.gnome.org/show_bug.cgi?id=597983
2010-03-17 21:34:13 +01:00
Dan Winship
3ce89e3c80 Add missing semicolons noted by jslint
Taken from a patch by Lex Hider on the mailing list
2010-03-15 09:50:05 -04:00
Owen W. Taylor
33dca51650 Rework StDrawingArea not to use ClutterCairoTexture
Having StDrawingArea use ClutterCairoTexture causes circularity
problems with sizing - StDrawingArea wants to use its allocation for
the size of the texture, but ClutterTexture wants to use the size of
the texture to determine the requited size.

Avoid this by making StDrawingArea directly use Cairo and CoglTexture;
while doing this, the API is changed a bit for simplicity and to
match our use case:

 - Instead of clutter_cairo_texture_create(), we have
   st_drawing_area_get_context() to retrieve an already created
   context. This can only be called in the ::repaint signal.

 - The ::redraw signal is changed to ::repaint so we can have
   st_drawing_area_queue_repaint() that doesn't collide with
   clutter_actor_queue_redraw()

 - ::repaint is now emitted lazily when painting the actor rather
   than synchronously at various different points.

https://bugzilla.gnome.org/show_bug.cgi?id=611750
2010-03-11 15:08:48 -05:00
Adel Gadllah
6aa02c5edc [AppSwitcher] Make sure that fallback icons have correct box sizes
Fallback icons (i.e icons < requested size) cause the box in the switcher
to be a smaller rectangular item instead of the normal sized square one.

Fix that by putting the icons in a St.Bin with the correct size.

https://bugzilla.gnome.org/show_bug.cgi?id=609777
2010-02-17 10:52:11 +01:00
Adel Gadllah
a74cef9d2f [altTab] Position on the currently focused monitor
Show the popup on the currently focused monitor rather than on the primary.

https://bugzilla.gnome.org/show_bug.cgi?id=609257
2010-02-07 19:28:35 +01:00
Dan Winship
54d385a0a9 [AppSwitcher] tweak the sizing code, which depended on the previous bug 2010-02-01 12:31:26 -05:00
Dan Winship
df48e9d1c0 Fix misuse of ShellGenericContainerAllocation in two places 2010-02-01 11:54:47 -05:00
magcius
9423cc7fae Fix application thumbnail sizing when the height is greater than the width of a window.
This bug happened because the thumbnail box was only maxed, not set to 256x256.
Standard window thumbnails would max out only the width to 256. Having a window with
its height greater than its width meant that the height would max out, but not the
width, causing thumbnails to look uneven.

https://bugzilla.gnome.org/show_bug.cgi?id=604963
2010-01-04 20:21:28 -05:00
Colin Walters
907fc2f067 Port AppWell to CSS; delete appIcon.js
The altTab.js and app well code weren't sharing really
any functionality anymore; un-merge the appIcon code back
into appWell, and have a simple icon + text display for
altTab.

Port AppWell to St and CSS.

https://bugzilla.gnome.org/show_bug.cgi?id=602131
2009-11-23 14:33:49 -05:00
Colin Walters
2f1ca7bf28 Remove ShellButtonBox, button.js; Use St.Clickable in panel.js
StClickable replaces ShellButtonBox.  Reduce the number of
button-like things by deleting button.js.

To do so, add CSS style for the actitivies button.

https://bugzilla.gnome.org/show_bug.cgi?id=602131
2009-11-23 14:33:49 -05:00
Colin Walters
f815844eb4 Move ShellDrawingArea to StDrawingArea
It's nicer to have ShellDrawingArea as a St widget so it can
participate more cleanly in CSS styling, such as queuing a redraw
automatically on style changes, and allowing subclasses to use
CSS styling.

https://bugzilla.gnome.org/show_bug.cgi?id=602131
2009-11-23 14:33:48 -05:00
Dan Winship
8334b063f1 Deal with title-less windows
https://bugzilla.gnome.org/show_bug.cgi?id=601290
2009-11-13 16:04:17 -05:00
Steve Frécinaux
dc232d4631 [AppSwitcher] Add a separator between windows in current and other workspaces.
This make it is easier for the user to figure out on which workspace the
windows are. For instance, terminals related to various activities and put on
different workspaces were previously displayed as an uniform list, with no
visible distinction between the ones from the current workspace and the others.
Now they are physically separated by a thin gray line.

This is also consistent with the way applications are displayed in the
AppSwitcher.

https://bugzilla.gnome.org/show_bug.cgi?id=597944
2009-11-04 19:25:37 +01:00