Commit Graph

30 Commits

Author SHA1 Message Date
Cosimo Cecchi
3b6fae582b sessionMode: add a property to disable window manager menus
We will use this to disable menus in the initial-setup session.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/569
2019-06-06 01:25:04 +00:00
Marco Trevisan (Treviño)
2b3ab3ecec windowMenu: Do actions requiring grab once ungrabbed
Resizing or moving a window needs starting a keyboard grab. However, if the
action is triggered by a menu entry activation it might not work as we already
have already an active grab on input devices to manage the menu itself.

So, possibly wait maximum 100ms for the current grab operation to be completed
before trying go start a new one.

Needs https://gitlab.gnome.org/GNOME/mutter/merge_requests/596
Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1326

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/557
2019-05-29 12:04:26 -05:00
Marco Trevisan (Treviño)
7bb84dae80 popupMenu: Make MenuManager to take an actor as parameter
Since we assume now that most of the classes are actors per se we can just pass
the actor itself as parameter

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/487
2019-04-17 21:32:18 +00:00
Florian Müllner
fd50b9a45e cleanup: Use destructuring for imports from GI
This is *much* nicer than repetitive "imports.gi" lines ...

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/399
2019-02-09 07:39:20 +01:00
Florian Müllner
62a3b9e6a3 windowMenu: Remove fallback app menu support
With the app menu being phased out entirely, there's no good reason to
keep support for the fallback app menu in decorations either - the number
of applications that set an app menu and haven't embraced client-side
decorations is extremely small, and they should already have alternative
fallbacks for non-GNOME environment in place.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/624
2019-02-06 18:29:15 +01:00
Carlos Garnacho
c59c5eb893 st: Add StDirectionType enum
In order to replace GTK+'s GtkDirectionType. It's bit-compatible with it,
too. All callers have been updated to use it.

This is a purely accessory change in terms of X11 Display usage cleanup,
but helps see better what is left.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/317
2019-01-30 22:50:01 +01:00
Florian Müllner
bacfdbbb03 cleanup: Port non-GObject classes to JS6 classes
ES6 finally adds standard class syntax to the language, so we can
replace our custom Lang.Class framework with the new syntax. Any
classes that inherit from GObject will need special treatment,
so limit the port to regular javascript classes for now.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/361
2019-01-25 14:02:44 +00:00
Jürg Billeter
2d791a51c0 windowMenu: Port from Meta.ScreenDirection to Meta.DisplayDirection
Meta.ScreenDirection no longer exists. This fixes window menus on
multi-monitor systems.

	JS ERROR: TypeError: Meta.ScreenDirection is undefined
	_buildMenu@resource:///org/gnome/shell/ui/windowMenu.js:135:17
2018-09-11 12:59:07 +02:00
Jonas Ådahl
47ea10b7c9 Remove usage of MetaScreen
Remove any usage of MetaScreen, as it has been removed from libmutter
in the API version 3. The corresponding functionality has been moved
into three different places: MetaDisplay, MetaX11Display (for X11
specific functionality) and MetaWorkspaceManager.

https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:56:19 +02:00
Sam Spilsbury
c9bf72c5c4 windowMenu: Check if monitorIndex is valid before using it
Calling meta_window_get_monitor on an unmanaged window may return
-1, so we need to check the return value.

https://bugzilla.gnome.org/show_bug.cgi?id=788882
2018-06-28 16:29:07 +02:00
Florian Müllner
213e38c2ef cleanup: Use arrow notation for anonymous functions
Arrow notation is great, use it consistently through-out the code base
to bind `this` to anonymous functions, replacing the more overbose
Lang.bind(this, function() {}).

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/23
2018-02-21 13:55:00 +00:00
Florian Müllner
76f09b1e49 cleanup: Use method syntax
Modern javascript has a short-hand for function properties, embrace
it for better readability and to prepare for an eventual port to
ES6 classes.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/23
2018-02-21 13:54:58 +00: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
09af4433b0 windowMenu: Remove left-over variable 2017-03-14 17:47:04 +01:00
Rui Matos
9c74e22313 windowMenu: Ensure the source actor isn't sized 0x0
If the source actor is sized 0x0, the grabHelper will close the menu
on button release if the menu ends up flipped because in that case the
release event happens when the pointer is neither over the source
actor (since it's 0x0) or over the menu actor. A zero sized source
actor works for the non-flipped menu case because the menu's actor
itself ends up underneath the pointer.

https://bugzilla.gnome.org/show_bug.cgi?id=756605
2015-10-20 15:00:33 +02:00
Florian Müllner
fc45cf03bf windowMenu: Use CHECK ornament rather than DOT
The dot suggests a radio action, while the items are actually toggles;
in the app menu we use checkmarks in that case, so do the same here.
2015-07-30 18:11:43 +02:00
Ron Yorston
cca528a630 windowMenu: Reinstate left/right window movement
The menu items to move a window to the left/right workspaces were
removed when the window menu was implemented in GNOME Shell.  This
is OK for the default vertical layout but not for alternatives.

https://bugzilla.gnome.org/show_bug.cgi?id=751344
2015-06-22 17:57:01 -07:00
Florian Müllner
60d1f7797c windowMenu: Close when corresponding window goes away
The menu is clearly associated with a particular window, so keeping
it around when the window is gone doesn't make sense - in case of
the window menu, it is actually harmful as every action will act on
the invalidated window and result in a crash. So just dismiss the
menu when the menu is unmanaged.

https://bugzilla.gnome.org/show_bug.cgi?id=749529
2015-05-21 18:20:39 +02:00
acgtyrant
43fc598bd5 windowMenu: Add option to move different monitor
The window menu has all those workspace related options, but with multiple
monitors, it is much more interesting to quickly move a window 'over' to the
other monitor.

https://bugzilla.gnome.org/show_bug.cgi?id=633994
2015-04-14 23:19:05 +02:00
Florian Müllner
1e82d6edc2 windowMenu: Only disable "Always on Top" for fully maximized
Since (mutter) commit 49400657caae27 we disable the "Always on Top"
action for maximized windows, however when commit e7af257814
moved the window menu into the shell, this behavior was accidentally
extended to partially maximized (including tiled) windows.
As it can be desirable in this case to keep the window visible while
interacting with a different one, restore the previous behavior.

https://bugzilla.gnome.org/show_bug.cgi?id=737382
2014-09-25 23:10:03 +02:00
Florian Müllner
e51eb723fc windowMenu: Do a better job with faking the source actor
The 0x0 dummyCursor works well when the menu pops up directly underneath
the pointer (e.g. when triggered by right-clicking the titlebar) or by
keyboard, but not when triggered by the menu button - the menu does not
point to the center of the button's bottom edge, and unless the user
keeps holding the mouse button while moving into the menu, the menu will
be dismissed immediately on button release.
Address these issues by using the button geometry to overlay the window
button with an appropriately sized actor that acts as a proper sourceActor,
to make the window menu behavior consistent with other shell menus.

https://bugzilla.gnome.org/show_bug.cgi?id=731058
2014-06-02 23:48:53 +02:00
Florian Müllner
5b61f2d642 windowMenu: Implement new show_menu_for_rect() hook
Having the full geometry of the menu's source button (if any) will
allow us to address several misbehaviors of window menus, so use
that instead of show_menu().

https://bugzilla.gnome.org/show_bug.cgi?id=731058
2014-06-02 23:48:53 +02:00
Florian Müllner
9f366118f0 windowMenu: Only add workspace actions when enabled by session mode
When workspaces are disabled by the session mode, all workspace
related actions don't make sense. Worse, the "Move to Workspace ..."
actions allow sending windows into a nirvana with no means to
get them back.

https://bugzilla.gnome.org/show_bug.cgi?id=730653
2014-05-27 19:49:06 +02:00
Florian Müllner
e747fcb16f windowMenu: Ping window when activating any menu action
We do this for actions in the regular app menu, it makes sense to
do the same for window menu and fallback app menu.
2014-05-27 19:49:05 +02:00
Florian Müllner
a72a24ebff theme: Bring fallback app-menu style closer to GTK+
The fallback app-menu in GTK+'s client side decorations obviously
uses the GTK+ theme rather than the shell one; update the style
of our own fallback app-menu to resemble that style.

https://bugzilla.gnome.org/show_bug.cgi?id=730752
2014-05-27 19:49:05 +02:00
Florian Müllner
8811ba2ec0 Support (fallback) app menu in SSD
We now allow "appmenu" in the button layout to make synchronizing it
with GTK+'s client-side decorations easier, but as some people tweak
their settings to get in-window app menus even when using the shell,
actually pop up the app menu when the button is activated.

https://bugzilla.gnome.org/show_bug.cgi?id=730752
2014-05-27 19:49:05 +02:00
Jasper St. Pierre
752aca811c windowManager: Support coords 2014-05-22 10:51:49 -04:00
Florian Müllner
4c7b992c36 windowMenu: Fix typo
Closing windows is done with delete(), not close() ...
2014-05-21 19:57:17 +02:00
Piotr Drąg
659730ab09 Mark string as translatable 2014-05-18 01:08:49 +02:00
Jasper St. Pierre
e7af257814 Implement window menus in gnome-shell
https://bugzilla.gnome.org/show_bug.cgi?id=726352
2014-05-17 15:17:29 -04:00