Commit Graph

88 Commits

Author SHA1 Message Date
Florian Müllner
8d1b7962d8 workspace: Fix layout errors caused by window zoom
Commit 64b2b4a7d4 changed the monitor layout handling, resulting
in some layout errors due to a subtle change in memory handling:
when zooming a window in the overview, the available zoom area is
calculated by subtracting the panel height from the primary monitor
area. This area used to be a copy of the monitor rect, but as now
the rect itself is returned, zooming a window on the primary monitor
repeatedly modifies the monitor rect, leading to layout errors in
various parts of the shell.
Fix by using a copy when calculating the available zoom area.

https://bugzilla.gnome.org/show_bug.cgi?id=654105
2011-07-06 22:06:45 +02: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
Adel Gadllah
96dca48b3b overview: Allow dropping icons on windows
Currently the user has to find an empty spot in the workspace
to be able to launcha new instance of an app using dnd.

This is unnecessary hard, so just allow dropping on windows too.

https://bugzilla.gnome.org/show_bug.cgi?id=652079
2011-06-13 22:30:52 +02:00
Maxim Ermilov
efc194e36c workspace: reposition windows on workspace resize
initial window position was broken (part of close button was clipped)
https://bugzilla.gnome.org/show_bug.cgi?id=651012
2011-06-11 17:40:12 +04:00
Florian Müllner
ea1e5a5210 workspace: Make close button respect button_layout
Make the close button in the overview follow the user preference
for the window button layout.

https://bugzilla.gnome.org/show_bug.cgi?id=620105
2011-06-07 20:54:45 +02:00
Florian Müllner
45c1a9eafb workspaces-view: Simplify handling of removed workspaces
Workspaces used to contain the desktop background, so when a
workspace was removed, we animated its actor to an off-screen
position before destroying it. As the background has been
removed a while ago, we can destroy the actor directly.

https://bugzilla.gnome.org/show_bug.cgi?id=645031
2011-06-03 19:56:33 +02:00
Jasper St. Pierre
6e6b1e6052 workspace: End zooming when starting a window drag
The mouse-wheel zooming "easter egg" breaks horribly when you
drag a window, due to ugly lightbox reparenting tricks it uses.

For now, just end any zoom before we drag the window around.

https://bugzilla.gnome.org/show_bug.cgi?id=649632
2011-05-12 11:04:37 -04:00
Jasper St. Pierre
bc2b47974d workspace: Use Main.uiGroup instead of global.stage
The mouse-wheel zoom "easter egg" broke when using the magnifier
because it was using global.stage. Fix it to use Main.uiGroup instead.

https://bugzilla.gnome.org/show_bug.cgi?id=649632
2011-05-12 11:04:37 -04:00
Jasper St. Pierre
2e02918323 WindowOverlay: Show close button after an animation
If a user is fast and mouses over a window while the workspace thumbnail
animations are playing, it can be frustrating when the close button won't
appear at the end of the animation.

https://bugzilla.gnome.org/show_bug.cgi?id=645848
2011-04-26 17:16:53 -04: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
Owen W. Taylor
c81c564941 overview: Don't pick for every overlay
Don't do an individual hover fixup for every window overlay, instead
just use the new global.sync_hover() to fix up hovers once we have
finished showing the overview.

Based on a patch from Adel Gadllah <adel.gadllah@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=638613
2011-03-21 17:45:51 -04:00
Alexander Larsson
df440496ee Constrain zoomed overview windows to the current monitor
Additionally, the constraint to not overlap the panel should only happen
on the primary monitor.

https://bugzilla.gnome.org/show_bug.cgi?id=609258
2011-03-17 14:13:55 +01:00
Alexander Larsson
e5f05bc9d8 Add workspaces on non-primary monitors
We create a Workspace with a null metaWorkspace for each
non-primary monitor, showing the windows on these monitors.
These are saved in WorkspaceView.extraWorkspaces.

https://bugzilla.gnome.org/show_bug.cgi?id=609258
2011-03-17 14:13:55 +01:00
Alexander Larsson
cdd1209b55 Only show windows from the primary monitor on the overview workspace
This means a bunch of windows will not be visible at all in the overview.
Those will be added back with per-screen workspaces on the non-primary
monitors.

https://bugzilla.gnome.org/show_bug.cgi?id=609258
2011-03-17 14:13:55 +01:00
Owen W. Taylor
e8eec2d357 Use points for font sizes
Do a basic job of converting font sizes from pixels to points, so they
will scale will the global GNOME scale factor. Some other sizes that are
clearly related to the font sizes are changed to ems, but no comprehensive
attempt is made to get rid of px units.

https://bugzilla.gnome.org/show_bug.cgi?id=636868
2011-03-15 12:01:40 -04:00
Alexander Larsson
16a675b7ce Bail early from check over all permutations
If we're already doing worse than the best so far there is
no need to continue checking this particular permutation.

https://bugzilla.gnome.org/show_bug.cgi?id=609258
2011-03-09 10:45:21 +01:00
Alexander Larsson
5743224817 Don't rearrange dragged window when repositioning windows
If we're dragging a window around and we need to reposition the windows,
due to e.g. the sliding in of the thumbnails or some other reason, then we
need to consider the original position of the dragged window, rather than
the currend drag position. Otherwise we will unnecessarily rearrange the
other windows for instance on snap-back if you moved the dragged window
past some other window.

https://bugzilla.gnome.org/show_bug.cgi?id=643786
2011-03-09 10:36:09 +01:00
Alexander Larsson
a80e88e33e dnd: Add a drag-cancelled signal
This lets us start the workspace zoom out animation right when the
snapback starts, rather than waiting for the snapback to finish.

https://bugzilla.gnome.org/show_bug.cgi?id=643786
2011-03-09 10:36:09 +01:00
Alexander Larsson
0207f1f29b Restructure the way we handle positioning zooming in Workspace
We currently show the workspace in the overview in a rectangle
with the same aspect ratio as the screen. Originally this was
probably done since it showed the desktop, but we don't do this
anymore, and the positioning of the windows in the overview is
strictly a grid, so its not in any way related to monitor geometry.
Additionally, in the multihead case the screen aspect ratio is
very different from the overview monitor geometry, so a lot of
space is lost.

So, instead we just fill the entire inner rectangle of the overview
with the workspace. However, the way the zoom into and out of the
workspace right now is by scaling the workspace so that it covers
the entire monitor. This cannot really work anymore when the workspace
is a different aspect ratio. Furthermore the coordinates of the
window clone actors are of two very different types in the "original
window" case and the "window in a slot case". One is screen relative,
the other is workspace relative. This makes it very hard to compute
the cost of window motion distance in computeWindowMotion.

In order to handle this we change the way workspace actor positioning
and scaling work. All workspace window clone actors are stored in
true screen coordingates, both the original window positions and the
in-a-slot ones. Global scaling of the workspace is never done, we
just reposition everything in both the initial zoom and when the
controls appear from the side.

There is one issue in the initial and final animations, which is that
the clip region we normally have for the workspacesView will limit the
animation of the clones to/from the original positions, so we disable
the clip region during these animations.

https://bugzilla.gnome.org/show_bug.cgi?id=643786
2011-03-09 10:36:02 +01:00
Florian Müllner
cf85477864 workspace: Move close button to the left in RTL locales
Mutter reverses the button layout in RTL locales, so we should do
the same for the window previews' close buttons.

https://bugzilla.gnome.org/show_bug.cgi?id=643834
2011-03-04 22:42:57 +01:00
Adel Gadllah
75dbe4fdb9 workspaces: Remove the unused '_removeSelf' method
https://bugzilla.gnome.org/show_bug.cgi?id=640363
2011-02-21 21:31:07 +01:00
Adel Gadllah
3fd908d92c workspaces: Remove obsolete comment
https://bugzilla.gnome.org/show_bug.cgi?id=640361
2011-02-21 19:23:34 +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
Adel Gadllah
c2ae95f912 AppWellMenu: Remove window filtering
Don't filter and highlight windows when opening the menu
as this turned out to be distracting and confusing.

https://bugzilla.gnome.org/show_bug.cgi?id=642189
2011-02-14 23:07:27 +01:00
Owen W. Taylor
e5130877e7 Avoid relayout when not changing the workspace reserved slot
Make calling workspace.setReservedSlot(null) do nothing if the slot was
already null; this improves efficiency and more importantly chills out some
weird reentrancy at the end of drag and drop that removes a window from
a workspace.
2011-02-11 12:34:15 -05:00
Maxim Ermilov
aba6a85c56 workspace: don't show WindowOverlay during zoomFromOverview
https://bugzilla.gnome.org/show_bug.cgi?id=641533
2011-02-11 00:43:22 +03: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
3c593fc056 Don't check for Workspaces.WindowClone for window drops
When checking the type of a DND source, instead of checking
'instanceof Workspaces.WindowClone' accept any actor with realWindow
and metaWindow properties. This will be useful to support a separate
type of actor dragged from workspace thumbnails.

https://bugzilla.gnome.org/show_bug.cgi?id=640996
2011-02-08 19:43:20 -05:00
Maxim Ermilov
2792ad1cf4 chrome: try find fullscreen windows only on current workspace
https://bugzilla.gnome.org/show_bug.cgi?id=641677
2011-02-08 23:43:35 +03:00
Florian Müllner
00df20c618 window-clone: Fix signal connections when the window is closed
Commit 91d8a32f25 let WindowClone forward the size-changed signal
of the "real" window, disconnecting the signal handler when the
clone is destroyed. In case the clone was destroyed due to the
MetaWindowActor being closed, this results in a warning
(gsignal.c:2392: instance `0x2a3fac0' has no handler with id `2955').

Handle the case where the original window is destroyed before its
clone.
2011-02-03 19:38:57 +01:00
Maxim Ermilov
91d8a32f25 workspace: make WindowClone forward the 'size-changed' event
https://bugzilla.gnome.org/show_bug.cgi?id=640781
2011-02-01 23:41:16 +03:00
Florian Müllner
e2e90a550e Overview: Adjust to window size changes
Windows may change their size while the overview is open, e.g. when
switching panels in the control center. Make sure that the preview's
position and overlay are updated in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=640560
2011-01-25 21:53:33 +01:00
Florian Müllner
d64d491f63 workspaces-view: Use overview swipe-scrolling
Remove the swipe-scrolling implementation in WorkspacesView and
use the new overview facility.

https://bugzilla.gnome.org/show_bug.cgi?id=635034
2011-01-24 02:59:39 +01:00
Adel Gadllah
7279cc1db8 Overview: Remove invisible animations
Given that the grid view is gone there is no point in animating the
window previews on all workspaces anymore so just do it for the current
one avoid taking a slow down caused by animating windows on other workspaces.

https://bugzilla.gnome.org/show_bug.cgi?id=637353
2010-12-16 20:24:08 +01:00
Adel Gadllah
e41b0bc16d Remove unused workspace._visible property 2010-12-16 20:23:45 +01:00
Milan Bouchet-Valat
43d479c786 Don't pass an (out) argument to meta_window_get_outer_rect()
Mutter now has the needed (out) annotation, so we have to use the
return value instead of passing a reference to a rectangle.
2010-12-01 22:43:02 +01:00
Florian Müllner
5fef9188c9 workspaces: Change handling of window-drag signals
Delegate the emission of the window-drag-begin/window-drag-end
signals to overview functions, as done already for other items.
This will enable objects to react to those signals without having
access to the workspace objects / the workspaces view.

https://bugzilla.gnome.org/show_bug.cgi?id=634948
2010-11-29 16:35:54 +01:00
Florian Müllner
0942f50781 workspaces-view: Remove MosaicView
The new layout does no longer support view switching, so merge
GenericWorkspacesView and SingleView, and remove MosaicView.
Also rename or remove workspace properties and functions which
are now unused.
The grid will have a comeback with the new DND behavior.

https://bugzilla.gnome.org/show_bug.cgi?id=634948
2010-11-29 16:35:53 +01:00
Florian Müllner
f24e567dc4 overview: Do not zoom the desktop background
While scaling the desktop background with the window previews represents
workspaces quite intuitively, the approach is not without problems.
As window previews in the overview behave quite differently to "real"
windows, the representation of workspaces as miniature versions of
"real" workspaces is flawed. The scaling also makes the transitions
to and from the overview much more visually expensive, without adding
much benefit.
Leaving the background in place provides more visual stability to the
transitions and emphasizes the distinctive behavior of elements in the
overview.

https://bugzilla.gnome.org/show_bug.cgi?id=634948
2010-11-29 02:25:15 +01:00
Florian Müllner
01e7d6f30e workspace: Simplify the close button's timeout handler
Clutter actor gained a :has_pointer property after the original
code was written, so use this instead of picking.
2010-11-24 19:04:15 +01:00
Owen W. Taylor
e5a802bf99 Use the new "background actor" functionality in Mutter
The code to draw the root background has now been moved into Mutter,
with added smarts to not draw obscured portions. Remove the old
version of the code and clone the Mutter background actor to draw
the background in the overview.

https://bugzilla.gnome.org/show_bug.cgi?id=634836
2010-11-18 14:03:37 -05:00
Owen W. Taylor
2fa6f7ba7e Adapt to removal of Mutter namespace
MutterWindow and MutterPlugin have been renamed to MetaWindowActor
and MetaPlugin, mutter_plugin_list_windows() to
meta_plugin_list_window_actors(). Adapt to those changes.

https://bugzilla.gnome.org/show_bug.cgi?id=632500
2010-10-23 14:02:45 -04: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
Adel Gadllah
61c906807b Don't use mutter_window_get_window_type / MetaCompWindowType
They have been removed so we have to use meta_window_get_window_type()
and MetaWindowType instead.

https://bugzilla.gnome.org/show_bug.cgi?id=630363
2010-09-30 18:36:28 +02:00
Maxim Ermilov
38c3422331 [DND] change cursor when dragging
Return a DND.DragMotionResult constant from delegate _handleDragMotion
methods as well as the existing return value from the drag monitor method dragMotion.
https://bugzilla.gnome.org/show_bug.cgi?id=607821
2010-09-10 06:00:28 +04:00
Florian Müllner
4632db177a Clean up unused includes
Some late spring cleaning ...
2010-07-19 01:46:01 +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
Dan Winship
748739ed9c [appDisplay] port from ShellMenu to PopupMenu
This fixes the style, and also makes it keyboard navigable

https://bugzilla.gnome.org/show_bug.cgi?id=619541
2010-06-10 15:04:48 -04:00
Florian Müllner
528930d0a9 [Lightbox] Use a fade effect to smooth the transition
Add show()/hide() methods to Lightbox, which (optionally) fade the
lightbox. Change all lightboxes to fade in smoothly.

https://bugzilla.gnome.org/show_bug.cgi?id=602466
2010-06-09 17:07:10 +02:00