Commit Graph

226 Commits

Author SHA1 Message Date
Florian Müllner
1939e22c22 workspace: Focus clone when highlighting
We don't use different hover- and focus indications for window previews,
so using keyboard navigation after hovering a clone often has surprising
results when the previous focus window wasn't the selected one. Address
this by simply moving the keyboard focus with the highlight.

https://bugzilla.gnome.org/show_bug.cgi?id=786546
2017-10-04 18:12:27 +02:00
Florian Müllner
8143f734f8 workspace: Fix tab navigation order
By default the focus chain uses the same order as the list returned
by clutter_actor_get_children(), which corresponds to the z-order.
This doesn't work well in the window picker, where clones follow
the stacking of windows to ensure a correct overview transition,
but previews are laid out purely based on space efficiency. As
a result, the order in which window previews are navigated when
tabbing around is essentially random. Fix this by providing a
focus chain implementation that is based on the visual layout
of the previews rather than the stacking.

https://bugzilla.gnome.org/show_bug.cgi?id=786546
2017-10-04 18:12:26 +02:00
Florian Müllner
ecddf1fffd Fix some more undefined property warnings
https://bugzilla.gnome.org/show_bug.cgi?id=787907
2017-09-19 20:07:21 +02:00
Sebastian Keller
a02399eea4 workspace: Align window previews with the pixel grid
Now that full-sized window previews are allowed again it makes sense to
align the window previews with the pixel grid to prevent unscaled
windows from looking blurry in the overview.
2017-08-23 18:12:09 +02:00
Florian Müllner
6c472d8889 workspace: Show window chrome on long-press
Pointer hover and keyboard focus aren't available on touch devices,
so add long-press as alternative to reveal preview title and close
button.

https://bugzilla.gnome.org/show_bug.cgi?id=783953
2017-08-10 20:16:06 +02:00
Florian Müllner
6816aea906 workspace: Move decision to show/hide chrome to clone
Currently the chrome layer decides itself which events on the window
clone should show or hide the chrome, which makes it harder to extent.
Instead, move the decision to the window clone by letting it emit
show/hide-chrome events when appropriate.

https://bugzilla.gnome.org/show_bug.cgi?id=783953
2017-08-10 20:16:06 +02:00
Florian Müllner
1218e68b93 workspace: Allow full-sized window previews
Previews are currently limited to at most 70% of the actual window
size. This was done to indicate more clearly that the overview is
active and the window cannot be interacted with. However since then
other indications like the vignette effect have been added, so
artificially limiting the preview size doesn't look necessary anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=783953
2017-08-10 20:16:06 +02:00
Florian Müllner
b3b30f239d workspace: Don't restrict title width to window preview
Now that only one window title is visible at any time, it no longer
matters if a title extends into other window previews, so we can
always show the full title.

https://bugzilla.gnome.org/show_bug.cgi?id=783953
2017-08-10 20:16:06 +02:00
Florian Müllner
4fd5eee2c6 workspace: Only reveal title captions on hover
While the new title position gives the previews more space, they now
overlay the content which may hide valuable information. Address this
by only revealing the title as additional information on hover, like
we do for other auxiliary elements.

https://bugzilla.gnome.org/show_bug.cgi?id=783953
2017-08-10 20:16:06 +02:00
Florian Müllner
8a911cdb5d workspace: Move window captions
We consider the window previews the primary way to identify a window,
so it makes sense to give them as much space as possible. So in order
to not have title captions take up too much vertical space, overlay
them on top of the preview borders.

https://bugzilla.gnome.org/show_bug.cgi?id=783953
2017-08-10 20:16:06 +02:00
Florian Müllner
734511a9ae workspace: Switch back to using the :has-pointer property
In case where a method- and property name overlap, using the method
is less unambiguous than I thought - mozjs52-based gjs will only see
the method, while mozjs38-based gjs will only see the property. We
are in luck though, and the real property name contains dashes that
allow us to refer to the property in a way that works for all gjs
versions.

https://bugzilla.gnome.org/show_bug.cgi?id=785090
2017-07-22 20:31:46 +02:00
Florian Müllner
6878ee99d9 workspace: Use has_pointer() method instead of property
ClutterActor has both a has_pointer() method and a :has-pointer
property (that we represent as 'has_pointer'). So far gjs was
able to deal with the name overlap, but now trying to use the
property will instead test for the availability of the method.
Just avoid the conflict by switching to the method, which is
unambiguous.

https://bugzilla.gnome.org/show_bug.cgi?id=785090
2017-07-19 10:49:54 +02:00
Florian Müllner
033277b68f Define externally accessible contants with 'var' instead of 'const'
Just as we did with classes, define other constants that are (or
may be) used from other modules with 'var' to cut down on warnings.

https://bugzilla.gnome.org/show_bug.cgi?id=785084
2017-07-18 21:52:06 +02:00
Florian Müllner
2582d16ca7 Define classes with 'var' instead of 'const'
Any symbols (including class properties) that should be visible
outside the module it's defined in need to be defined as global.
For now gjs still allows the access for 'const', but get rid of
the warnings spill now by changing it.

https://bugzilla.gnome.org/show_bug.cgi?id=785084
2017-07-18 21:52:06 +02:00
Florian Müllner
358133e82f Initialize properties in _init()
While we've always considered it good style to initialize JS properties,
some code that relies on uninitialized properties having an implicit
value of 'undefined' has slipped in over time. The updated SpiderMonkey
version used by gjs now warns when accessing those properties, so we
should make sure that they are properly initialized to avoid log spam,
even though all warnings addressed here occur in conditionals that
produce the correct result with 'undefined'.

https://bugzilla.gnome.org/show_bug.cgi?id=781471
2017-07-13 17:23:54 +02:00
Mario Sanchez Prada
5221744d1d workspace: Reset source IDs to zero after removing them
There were some source IDs that were not being reset to zero when
removing the associated sources, resulting on some critical errors
being dumped when _realRecalculateWindowPositions() got called
after that point, via _delayedWindowRepositioning().
2017-06-27 10:10:40 +01:00
Florian Müllner
d15b46f5cb workspace: Hide preview overlays from picks
Dragging and dropping app icons is expected to work anywhere over a
workspace, however overlaid elements are added to a separate hierarchy
and can thus block valid drop targets. This wasn't much of an issue
while we had just the window title, but since the addition of the
focus border, drops on window previews stopped working entirely.

Fix this by hiding all non-reactive overlay elements from picks.

https://bugzilla.gnome.org/show_bug.cgi?id=737166
2017-03-20 19:02:07 +01:00
Rui Matos
7746f1a5c4 Make all our window clones use the MetaWindowActor as source
Using a MetaWindowActor's shaped texture as the source for window
clones means that if there are further MetaSurfaceActor children
(e.g. a wayland client using sub-surfaces) they don't get cloned.

This obviously wasn't an issue until wayland clients introduced the
possibility of having multiple MetaSurfaceActors under a
MetaWindowActor but there's no fundamental reason we can't clone the
toplevel actor.

WorkspaceThumbnail.WindowClone is the one class that was already using
the MetaWindowActor instead of the texture although it seems to have
been an unintended change in commit
8b99617513.

https://bugzilla.gnome.org/show_bug.cgi?id=756715
2017-02-02 14:28:00 +01:00
Carlos Garnacho
9d203ddc0f workspace: Keep track of the dragging touch sequence
draggable.startDrag() is called directly here (i.e. manualMode is not set),
we must keep track of the touch event and pass it to startDrag() then.

https://bugzilla.gnome.org/show_bug.cgi?id=756748
2015-12-04 12:16:56 +01:00
Sebastian Keller
b4bfe9a0c6 workspace: Prevent overlapping windows when scaling to fit the screen
The previous code was applying the per row scaling factor of the current
row to the cumulative sum of all previous rows when calculating the y
position of a row. This resulted in the row being shifted up so it would
overlap other windows when the previous rows were not using the same
scaling as the current one.

Also the previous code was not considering that the spacing does not get
scaled when calculating the scaling factor. This is wrong as well and
could result in the overview overlapping the workspace switcher in
situations with lots of windows open.

This fix gives each row the appropriate height according to its scaling
factor and then ensures that the grid remains vertically centered after
losing some of its height.

https://bugzilla.gnome.org/show_bug.cgi?id=744883
2015-03-03 23:00:10 +01:00
Rui Matos
fdd6fc976c Revert "workspace: Grab the key focus when hovering over a window"
Turns out this makes interaction with the OSK or candidate popups
using a mouse basically impossible since they get dismissed when the
key focus is captured by a window in the overview.

This reverts commit aeb9f5775f.

https://bugzilla.gnome.org/show_bug.cgi?id=745245
2015-03-02 15:49:31 +01:00
Florian Müllner
2b9645b268 Use MetaWindow.get_frame_rect()
get_outer_rect() has been deprecated for a while, use the new
function instead.
2014-10-09 12:17:15 +02:00
Carlos Garnacho
33e35f269f overview: Use a MetaWindow argument in window-drag-* signals/API
It is quite weird to have those calls/signals using WindowClone as an
argument, it is neater to pass MetaWindows around, and have each user
deal with their own representations of these.

https://bugzilla.gnome.org/show_bug.cgi?id=735972
2014-09-12 00:57:40 +02:00
Carlos Garnacho
b886656f61 workspace: Take a MetaWindow as argument to setReservedSlot()
And use it to lookup the local WindowClone that applies. Otherwise,
WorkspaceThumbnail.WindowClone objects may be mistakenly set, which
are not usable interchangeably with Workspace.WindowClone ones. This
may lead to several misbehaviors as fields available in the second
object but not in the first one are accessed, some those undefined
values get used in math ops, which result in NaNs over the place.

Likewise, the similar functions in WorkspacesViewBase subclasses take
now MetaWindow arguments too.

https://bugzilla.gnome.org/show_bug.cgi?id=735972
2014-09-12 00:57:40 +02:00
Florian Müllner
c9f3afc38f workspace: Always remove removed windows
Since mutter commit 527c53a2a0582eba, MetaWorkspace::window-removed
is emitted *before* MetaWindow:workspace is updated, so the test
whether the removed window should still be on the workspace in
question will always return true.
Assume the test is no longer necessary nowadays to fix this very
obvious regression.

https://bugzilla.gnome.org/show_bug.cgi?id=735608
2014-08-28 16:57:29 +02:00
Carlos Soriano
079809af1d workspace: Remove tweens of overlay.title before animate again
Currently we are removing tweens of the button and border, but not from
the title. That causes the title to be in wrong positions sometimes when
dragging windows on the overview, given that the slider is moving and
therefore the windows + overlay are moving too.
To avoid that, remove tweens of the title as well.
2014-08-26 19:35:25 +02:00
Carlos Soriano
687e1ebf69 workspace: Fade in instead of zoom to return desktop
The zooming animation of the windows looks nice when animating
from the workspace display page, but looks weird from other pages
like apps page or search page since the windows come from nowhere
with an initial position not known to the user.

Instead of that just fade the desktop with the windows in its
original position.

https://bugzilla.gnome.org/show_bug.cgi?id=732901
2014-08-08 16:40:41 +02:00
Florian Müllner
8c6a2874ff workspace: Fix style 2014-08-06 15:23:21 +02:00
Florian Müllner
557130d2f2 workspace: Remove unused parameter 2014-08-06 15:23:20 +02:00
Carlos Soriano
4bb2a364d3 overview: Avoid repositioning windows while returning to desktop
When returning to the desktop from overview we always show the
workspaceDisplay, given that is which have the windows clones to allow
animations.
The problem becomes when previous that we were at some other
page, like Search or AppDisplay. The problem is that when showing the
workspaceDisplay the windows are repositioned. That's wanted except
when returning from overview, since that causes unwanted animations
of the windows.
To avoid that just not reposition the windows if leaving the overview.
2014-07-07 17:37:24 +02:00
Giovanni Campagna
7d7b92419f Workspace: ignore actual geometry changes while unmapped
If unmapped, ignore geometry changes. This avoids doing useless
layout work on invisible workspaces during the slider control
animations.

https://bugzilla.gnome.org/show_bug.cgi?id=729823
2014-06-26 19:20:17 +02:00
Giovanni Campagna
02718357da workspace: avoid GObject overhead while computing the clone layout
We already have the width and height information cached in JS,
let's avoid going through gjs-gobject-clutter to retrieve them
again. As a plus, with normal properties the optimizer should
be able to generate better code.

https://bugzilla.gnome.org/show_bug.cgi?id=729823
2014-06-26 19:20:17 +02:00
Jasper St. Pierre
c36ca625e6 workspace: Adapt to mutter API change 2014-06-17 11:12:15 -04:00
Florian Müllner
3ff4277f86 workspace: Don't allow closing windows with attached modals
Modal dialogs prevent the parent from being closed in "normal mode",
so it makes sense to not allow it in the overview either.

https://bugzilla.gnome.org/show_bug.cgi?id=729886
2014-05-28 22:01:54 +02:00
Bastien Nocera
cd2bd7685a js: Name all the timeouts and idles
With very uninventive names. Names now, good names later.

https://bugzilla.gnome.org/show_bug.cgi?id=727983
2014-04-10 21:08:16 +02:00
Alejandro Piñeiro
df305314c1 a11y: setting accessible role and label for windows at the overview
https://bugzilla.gnome.org/show_bug.cgi?id=726670
2014-04-01 13:56:53 +02:00
Adel Gadllah
8f1b8909dc Fix position/size changed disconnects
Commit 3f7a989d38 changed the signals to match mutter api changes,
but did not update disconnects, so do that.
2014-02-15 13:07:14 +01:00
Jasper St. Pierre
3f7a989d38 Update to changes for MetaWindow size-changed / position-changed signals
These have changed upstream to be on the MetaWindow, rather than
the MetaWindowActor. Follow suit.
2014-02-14 23:49:54 -05:00
Florian Müllner
b4680a5c25 Use meta_window_is_skip_taskbar() directly
Rather than going through ShellWindowTracker, we can just clean up
the code to use the underlying MetaWindow property directly.

https://bugzilla.gnome.org/show_bug.cgi?id=723308
2014-01-31 13:49:07 +01:00
Giovanni Campagna
3a26f7f4d5 WindowManager: WORKAROUND: disable dimming in the overview
Clones and effects don't mix, due to a bug in Clutter we don't
know how to fix, and sometimes the clone is clipped completely.
As a workaround, undim windows with dialogs in the overview.

Clutter bug: https://bugzilla.gnome.org/show_bug.cgi?id=659523

https://bugzilla.gnome.org/show_bug.cgi?id=650843
2014-01-19 16:38:19 +01:00
Giovanni Campagna
587655f063 Workspace: show attached modal dialog
Windows in the overview should be like they appear in the workspace,
including modal dialogs that are attached above them.
In addition, hiding the dialogs in the overview causes a flash as
dialog appears at the end of the transition.

Based on a patch by Maxim Ermilov <zaspire@rambler.ru>

https://bugzilla.gnome.org/show_bug.cgi?id=650843
2014-01-19 16:37:17 +01:00
Florian Müllner
deb2f30b37 js: Use EVENT_PROPAGATE/EVENT_STOP constants in event handlers
Just as SOURCE_CONTINUE/SOURCE_REMOVE in source functions, these
constants increase code clarity over plain true/false.

https://bugzilla.gnome.org/show_bug.cgi?id=719567
2013-12-16 18:27:19 +01:00
Florian Müllner
751a3f0e94 js: Use SOURCE_CONTINUE/SOURCE_REMOVE constants in source functions
With support for boolean constants in g-i, we can finally use the
more readable constants instead of true/false.

https://bugzilla.gnome.org/show_bug.cgi?id=719567
2013-12-16 18:27:19 +01:00
Jasper St. Pierre
aeb9f5775f workspace: Grab the key focus when hovering over a window
This is simply an experiment. I'm not sure I like the result, but it was
worth trying out regardless.

https://bugzilla.gnome.org/show_bug.cgi?id=644306
2013-12-04 11:22:55 -05:00
Jasper St. Pierre
47a20756b9 workspace: Implement key navigation on the workspaces page
Simply use St's existing key navigation system by making all the window
clones StWidgets, and making the WorkspacesView a focus group.

Since the workspace view is effectively "fake", we need to add a focus
delegator so that when key focus is assigned to the fake workspaces page,
we can keynav inside it properly.

https://bugzilla.gnome.org/show_bug.cgi?id=644306
2013-12-04 11:22:55 -05:00
Florian Müllner
554d5aeb7c More invalid source fixes
https://bugzilla.gnome.org/show_bug.cgi?id=711732
2013-11-09 17:58:59 +01:00
Florian Müllner
01dbfddb64 workspace: Remove unused includes and constants 2013-11-04 10:32:17 +01:00
Jasper St. Pierre
e4c07875a3 overview: Send the clone with the window-drag events
This allows clients that care about the actual item we're dragging to
make smarter decisions without adding a drag monitor themselves.
2013-10-30 13:17:38 -04:00
Jasper St. Pierre
026fd4cf35 workspace: Punt the geometry-fizzling-out logic here 2013-10-30 13:17:38 -04:00
Jasper St. Pierre
37c8132632 workspace: Adapt to mutter API changes 2013-10-15 15:46:36 -04:00