Commit Graph

38 Commits

Author SHA1 Message Date
Owen W. Taylor
0080440118 workspaceThumbnail: fix window tracking bugs
- We should only call workspaceRemoved() for workspaces that are
  are actually being removed.
- When we have multiple monitors, a window on a secondary monitor is
  on all workspaces, so it ends up in all workspaces _allWindows
  lists, so we can't use previous presence in that list to determine
  whether we need to go ahead and add the actor; allWindows is simply
  the list of windows where we are listening  to notify::minimized.

https://bugzilla.gnome.org/show_bug.cgi?id=667652
2012-01-18 10:20:53 -05:00
Owen W. Taylor
301bacec9f workspaceThumbnail: improve handling of notify::minimized signal
There were various cases where we could lose track of a window and
leave the notify::minimized signal connect after the actor was destroyed
or the workspace removed. This could result in operations on a removed
workspace and assertion failures inside Mutter.

https://bugzilla.redhat.com/show_bug.cgi?id=773059
https://bugzilla.gnome.org/show_bug.cgi?id=667652
2012-01-17 10:53:07 -05:00
Owen W. Taylor
8943b3b0e9 workspaceThumbnail: disconnect handlers when workspace is removed
We need to remove the handlers when the workspace is removed, not
when the animation of it being removed finishes, or we can access
a destroyed workspace and triggger an assertion failure in Mutter.

https://bugzilla.redhat.com/show_bug.cgi?id=705664
https://bugzilla.gnome.org/show_bug.cgi?id=667652
2012-01-17 10:53:07 -05:00
Stefano Facchini
f59018f2d7 workspaceThumbnail: clear the drop placeholder on pointer leave
We add a drag monitor to check whether the pointer is inside
the workspace selector, and update the visibility of the drop
placeholder consequently.

https://bugzilla.gnome.org/show_bug.cgi?id=664201
2012-01-17 15:45:23 +01:00
Florian Müllner
47b55e29d4 workspace-thumbnails: Emit 'window-drag-cancelled'
The dash handles 'window-drag-cancelled', to be able to do the
animations for drag snap-back and size changes in parallel. As
the signal is not emitted for previews in the workspace switcher,
it does not work in that case.
2011-12-02 17:08:39 +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
b1064cbe50 WorkspaceThumnail: fix typo
An if is missing, causing the subsequent expression to evaluate to
nothing, and the invocation it should be protect to be unconditional.
2011-11-21 21:59:09 +01:00
Jasper St. Pierre
703d2ead33 workspaceThumbnail: Allow users to create workspaces at any position
Allow a user to create a new workspace by dragging a window or a launcher in
the middle of two existing ones.

https://bugzilla.gnome.org/show_bug.cgi?id=646409
2011-11-07 14:36:06 -05: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
Rui Matos
82ce8fe3ff Use Meta.BackgroundActor instances instead of cloning global.background_actor
Instances of this class share a single CoglTexture behind the scenes which
allows us to show the background with different rendering options without
duplicating the texture data.

https://bugzilla.gnome.org/show_bug.cgi?id=656433
2011-08-29 19:17:01 +01:00
Colin Walters
4886275df4 ShellApp: Change activation API
Since almost all of the callers of shell_app_activate were using the
default workspace (by passing -1), remove that parameter.

Add a new shell_app_activate_full() API which takes a workspace as
well as a timestamp; previously we might have been ignoring event
timestamps from elsewhere.

https://bugzilla.gnome.org/show_bug.cgi?id=648149
2011-08-11 05:35:23 -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
Florian Müllner
a34071e1c3 workspaceThumbnail: Handle minimized windows
Workspace thumbnails are supposed to be miniatures of the "real"
workspace they represent, but currently they show minimized windows
like the window picker.
Instead, hide minimized windows and track changes to update the
thumbnail accordingly.

https://bugzilla.gnome.org/show_bug.cgi?id=651569
2011-06-22 13:10:50 +02:00
Dan Winship
e38d83fd44 workspace: avoid an assertion in a new window/deleted workspace race
If a window appeared on a workspace that was then quickly removed, we
could hit an assertion in mutter. Avoid that.

https://bugzilla.gnome.org/show_bug.cgi?id=648132
2011-04-25 16:44:18 -04:00
Alexander Larsson
8282db456b Use the new meta_window_move_to_monitor function
https://bugzilla.gnome.org/show_bug.cgi?id=645032
2011-03-22 00:58:56 +01:00
Adel Gadllah
528fc9bc47 XDND: Allow workspace switching using the thumbnails
Currently activating a window on a different workspace requires very
long drag distances, which is very inconvenient to use.

Fix that by allowing switching workspaces using the thumbnails which is
consistent with window and launcher dnd and much easier to use.

https://bugzilla.gnome.org/show_bug.cgi?id=643945
2011-03-22 00:05:17 +01:00
Alexander Larsson
0e6458a630 Only show windows from the primary monitor in the workspace thumbnails
Also, if windows are dropped on the thumbnail, move them to the primary
monitor.

https://bugzilla.gnome.org/show_bug.cgi?id=609258
2011-03-17 14:13:55 +01:00
Alexander Larsson
a1a068a377 Only show the primary monitor region in the workspace thumbnails
Make the thumbnail the size of the primary monitor and only show
the windows from that area.

https://bugzilla.gnome.org/show_bug.cgi?id=609258
2011-03-17 14:13:55 +01:00
Florian Müllner
8ed191283a Remove manually added :rtl pseudo classes
To deal with different CSS in RTL locales, we used to manually add
an :rtl pseudo class to some actors. With automatically assigned
:ltr/:rtl selectors this is no longer necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=643835
2011-03-05 19:40:56 +01:00
Giovanni Campagna
15ec185be5 Don't declare global variables
Fix a typo in panel.js, and ensure that all variables used in
functions are scoped to the block (using let), to avoid polluting
the global namespace.

https://bugzilla.gnome.org/show_bug.cgi?id=643210
2011-02-24 21:22:44 +01:00
Owen W. Taylor
01097ac954 Fix cursor when dragging a window over its current workspace
When we are dragging a window over its current workspace or workspace
thumbnail, we show show "no drop possible" feedback instead
of "move here" feedback.

https://bugzilla.gnome.org/show_bug.cgi?id=642329
2011-02-20 12:38:10 -05:00
Owen W. Taylor
45fe44da85 workspaceThumbnail: forbid manipulations of removed workspaces
Don't allow dragging onto a removed workspace or activating it.

https://bugzilla.gnome.org/show_bug.cgi?id=642329
2011-02-20 12:38:10 -05:00
Owen W. Taylor
89cc6807e0 workspaceThumbnail: fix stacking for newly added actors
We don't necessarily get a syncStacking call when an actor is added
at the top of the workspace, so make sure to set the stackAbove value
for it correctly.

https://bugzilla.gnome.org/show_bug.cgi?id=642329
2011-02-20 12:38:10 -05:00
Owen W. Taylor
ef983480c0 Be more careful with workspace thumbnail scale
- When tweening a workspace to collapse it, round the multiplied
  height so that we don't change other workspace sizes via rounding
  differences.
- Use separate horizontal and vertical scales, so that every thumbnail
  has the same horizontal scale.

https://bugzilla.gnome.org/show_bug.cgi?id=641881
2011-02-18 11:36:33 -05:00
Owen W. Taylor
bff027c1f7 Fix workspace thumbnails in RTL locales
We need slightly different CSS and positioning logic for
the workspace thumbnails list when it is on the left side of the
screen.

https://bugzilla.gnome.org/show_bug.cgi?id=642672
2011-02-18 11:36:33 -05:00
Owen W. Taylor
1473a66862 Omit the panel area from the previewed workspaces
Allow defining a "porthole" that is the visible area of a workspace
thumbnail, and use this to clip the portion under the panel off the
workspace thumbnails. (This is wrong for fullscreen windows, but not
very wrong, and hopefullly the few missing pixels will be
unnoticeable.)

https://bugzilla.gnome.org/show_bug.cgi?id=641880
2011-02-18 11:36:33 -05:00
Owen W. Taylor
53516733f7 Fix position of indicator while tweening
Because the overall parent allocation width immediately when the workspace
count changes, we were sometimes drawing the indicator in the wrong place
in the indicator animation that proceeded the remove-workspace animation.
Fix this by tweening only the Y position of the indicator and computing
the X position and size in our allocate() method. This also is considerably
simpler than switching the indicator between fixed position and geometry
managed.

https://bugzilla.gnome.org/show_bug.cgi?id=641881
2011-02-18 11:36:33 -05:00
Owen W. Taylor
e9a45190e4 Animate workspace indicator before adding/removing workspaces
Rather than killing the workspace indicator indicator when we remove
workspaces because the source and target locations might have changed,
do it as a separate first step. This provides a better explanation
than doing it simultaneously with the addition/removal or not at all
and also keeps our computations simple.

https://bugzilla.gnome.org/show_bug.cgi?id=641881
2011-02-18 11:36:33 -05:00
Owen W. Taylor
649ed3332f Fix background to animate with thumbnails
When we animating the scale for the thumbnails, the border and
background should wrap around the current size of the thumbails.
The technique that we are using to animate the scale breaks that
since we don't animate the overall size of the thumbnails box -
we just animate our child actors within the allocation.

To fix this, switch from drawing the background by packing in another
container to drawing the background with a separate actor that
is under the other actors and allocated by our custom logic.

https://bugzilla.gnome.org/show_bug.cgi?id=641881
2011-02-18 11:36:33 -05:00
Owen W. Taylor
7598fd4581 Slide workspace thumbnails in when added and out when removed
To explain to the user what is happening, instead of abruptly changing
updating the workspace thumbnail list, slide thubmnails in and out
as they are added and removed.

To implement this, we track a state for each thumbnail and when things
change go through a process of first sliding removed thumbnails out,
then ollapsing the left-over spaces and rescaling the thumbnails, then
finally sliding newly added thumbnails in.

https://bugzilla.gnome.org/show_bug.cgi?id=641881
2011-02-18 11:36:33 -05:00
Owen W. Taylor
aaf94ea8f9 Animate scale changes to workspace thumbnails
When we change the overall scale of the workspace thumbnail container, instead of
doing it abruptly, animate the transition.

https://bugzilla.gnome.org/show_bug.cgi?id=641881
2011-02-18 11:36:33 -05:00
Owen W. Taylor
0ef3f999d2 Scale thumbnails to fit in the vertical space
When we have more thumbnails than can fit in the vertical space, scale
them down. This is implemented by using a generic container so we can
compute positions and sizes on the fly and do the appropriate
width-for-height behavior.

The usage of clutter constraints to position the indicator is droppped
since it less complicated to just position the indicator in the right
place ourselves.

https://bugzilla.gnome.org/show_bug.cgi?id=641879
2011-02-17 11:34:30 -05:00
Owen W. Taylor
ae5131f902 Make a separate class for workspace thumbnails box
Add WorkspaceThumbnail.ThumbnailsBox to handle managing the array
of workspace thumbnails; the logic will get more complex as we add
scaling and animation.

https://bugzilla.gnome.org/show_bug.cgi?id=641879
2011-02-17 11:34:30 -05:00
Owen W. Taylor
914e5d30c7 workpaceThumbnail: Fix accidental propagation of button releases
A right click was propagating through to the parent actor meaning
that a right click would activate the workspace twice and leave the
overview instead of just switching to it.

https://bugzilla.gnome.org/show_bug.cgi?id=641973
2011-02-11 12:14:27 -05:00
Owen W. Taylor
2d716041f1 Make clicking on the active workspace thumbnail go to the main view
If you want to select a workspace and go there, having to go back to
the main part of the window selector and click on a window is annoying,
so make a second click on the active workspace go to the main view.

https://bugzilla.gnome.org/show_bug.cgi?id=641973
2011-02-11 12:13:35 -05:00
Owen W. Taylor
7496a7ff3b Handle changes in window position for workspace thumbnails
Connect to the 'position-set' signal of MetaWindowActor and move
actors when the source windows move.

https://bugzilla.gnome.org/show_bug.cgi?id=640996
2011-02-08 19:43:21 -05:00
Owen W. Taylor
0d32017ffc Don't switch to a workspace when dragging it to launch on that workspace
With workspace thumbnails, we don't switch workspaces when dragging windows
between workspaces or adding new workspaces, so we also shouldn't switch
on launch.

 * Add workspace parameters to shell_doc_system_open(),
   shell_app_activate, shell_app_open_new_window()

 * Pass a 'params' object when activating items in the overview with
   two currently defined parameters: workspace and timestamp. (timestamp
   is only implemented where it is easy and doesn't require interface
   changes - using the global current timestamp for the shell is almost
   always right or at least good enough.)

https://bugzilla.gnome.org/show_bug.cgi?id=640996
2011-02-08 19:43:21 -05:00
Owen W. Taylor
6514bc845f Add workspace thumbnails to the overview
Add workspace thumbnails to the workspace controls area. The user can
click on the thumbnail to switch workspaces and can also drag windows
out of the thumbnail to other workspaces.

https://bugzilla.gnome.org/show_bug.cgi?id=640996
2011-02-08 19:43:20 -05:00