1
0
Fork 0
Commit graph

261 commits

Author SHA1 Message Date
Jasper St. Pierre
6f873be7fa Revert "Make work_area calculation funcs public and introspectible"
This reverts commit d8058138ab.
2013-02-06 00:03:10 -05:00
Jasper St. Pierre
d8058138ab Make work_area calculation funcs public and introspectible
https://bugzilla.gnome.org/show_bug.cgi?id=692679
2013-02-05 23:54:13 -05:00
Adel Gadllah
9a57626556 meta-window-actor: Change unredirection hints to match spec changes
Change the bypass / dont_bypass compositor code to match the latest
spec.

https://bugzilla.gnome.org/show_bug.cgi?id=693064
2013-02-03 14:29:45 +01:00
Florian Müllner
4d9d66da65 window: Add set_icon_geometry() method
Using a public method for setting the (cached) icon geometry rather
than accessing the struct members directly allows setting the icon
geometry from extensions.

https://bugzilla.gnome.org/show_bug.cgi?id=692997
2013-02-01 15:08:48 +01:00
Florian Müllner
30bdadb519 window: Cache _NET_WM_ICON_GEOMETRY
Rather than doing a server round trip each time when retrieving the
icon geometry, use the existing property mechanism to cache it.

https://bugzilla.gnome.org/show_bug.cgi?id=692997
2013-02-01 15:08:38 +01:00
Florian Müllner
c388ccf477 window: Fix get_icon_geometry() annotation
gjs has had support for (out) parameters for quite some time now ...

https://bugzilla.gnome.org/show_bug.cgi?id=692997
2013-02-01 15:08:36 +01:00
Jasper St. Pierre
df15843407 Use meta_window_located_on_workspace() in more places
https://bugzilla.gnome.org/show_bug.cgi?id=691744
2013-01-18 15:45:05 -05:00
Jasper St. Pierre
d8eb47e2b7 window: Make meta_window_located_on_workspace() public
We have some code in gnome-shell that does the equivalent of:

    window.get_workspace() == workspace || window.is_on_all_workspaces();

which is a bit unwieldy. We already have a method in mutter,
so use that and document it.

https://bugzilla.gnome.org/show_bug.cgi?id=691744
2013-01-18 15:45:05 -05:00
Jasper St. Pierre
3a3be74e37 Remove some server calls for core devices
These were missed in the first porting.

https://bugzilla.gnome.org/show_bug.cgi?id=691363
2013-01-08 15:54:50 -05:00
Giovanni Campagna
6431abbc85 Check that the application is responding when activating a window
Currently, we ping windows only when attempting to delete them, but
if the application is not responding, we want to show the dialog
as soon as possible. Given that we cannot be passively notified that
the window stopped responding with the current X11 protocol, a good
workaround is to ping the window when activating it.
If the window stops responding while active, it is expected the user
will try to switch window or open the overview, and when coming back
he'll get the failure dialog.

https://bugzilla.gnome.org/show_bug.cgi?id=684340
2012-12-25 18:39:10 +01:00
Adel Gadllah
2a2ac52726 automaximize: Make it optional
Make automaximize optional by adding a gsetting "auto-maximize"
(defaults to true).

https://bugzilla.gnome.org/show_bug.cgi?id=680990
2012-12-25 13:37:22 +01:00
Giovanni Campagna
6111d3ee4a window: recompute modal dialog attached status when the window type changes
We want to maintain the invariant that an attached modal dialog is always
of type MODAL_DIALOG, so recompute is_attached_dialog() when the window
type changes.

https://bugzilla.gnome.org/show_bug.cgi?id=690454
2012-12-18 23:18:58 +01:00
Adel Gadllah
3876a1a192 Support bypass compositor hints
Add support for _NET_WM_BYPASS_COMPOSITOR and _NET_WM_DONT_BYPASS_COMPOSITOR
as proposed here: https://mail.gnome.org/archives/wm-spec-list/2012-February/msg00010.html

https://bugzilla.gnome.org/show_bug.cgi?id=683020
2012-12-18 19:02:34 +01:00
Jasper St. Pierre
774ceec243 Select for XI2 events everywhere else
In random places that are not grabs, we selected for events on
things like the root window, stage window, COW and more. Switch
these over to using the proper XI2 APIs.

https://bugzilla.gnome.org/show_bug.cgi?id=688779
2012-12-13 17:14:06 -05:00
Jasper St. Pierre
c1b8e0ac8f display: Use XInput2 to grab the pointer
As calling XIGrabDevice multiple times will change it, just
drop the XChangeActivePointerGrab path and just go down the
XIGrabPointer path always.

https://bugzilla.gnome.org/show_bug.cgi?id=688779
2012-12-13 17:14:06 -05:00
Jasper St. Pierre
c90765370d window: Pass the grab timestamp when updating the resize grab
Since XChangeActivePointerGrab doesn't have a direct equivalent
in XI2, we need to make sure we don't re-grab with a newer
tiemstamp.
2012-12-13 17:06:00 -05:00
Jasper St. Pierre
1d827049d6 Port mutter to use XInput2 events instead of Core Events
Mechanically transform the event processing of mutter to care
about XI2 events instead of Core Events. Core Events will be left
in the dust soon, and removed entirely.

https://bugzilla.gnome.org/show_bug.cgi?id=688779
2012-12-13 14:56:25 -05:00
Jasper St. Pierre
881d256ce0 window: Move grab op sync handling code out
This removes some duplicate event type checks, and will make
the code cleaner in the future when we want to make the grab_op_event
handler take an XIDeviceEvent directly.

Based on a patch by Owen Taylor <otaylor@fishsoup.net>

https://bugzilla.gnome.org/show_bug.cgi?id=688779
2012-12-13 14:56:24 -05:00
Jasper St. Pierre
9d904f9a85 Increase typical icon size to 96
Since we want nice alt-tab applications for gnome-shell, we should up the
limit to 96. In the future, we probably want to get rid of the icon-cache,
and allow looking up a correctly sized icon directly from the window.

To prevent app breakage, set the legacy WM_HINTS pixmap size directly to
32x32.

https://bugzilla.gnome.org/show_bug.cgi?id=689651
2012-12-09 20:44:13 -05:00
Florian Müllner
2cc0d31b17 window: Avoid spurious focus-window changes when showing desktop
When using the show-desktop shortcut with no desktop window, unshowing
will focus the second-most-recently-used window. If we find a desktop
window, it will be focused explicitly and everything works as expected;
however without a desktop window, we end up hiding the focus window,
which will use focus_default_window() with the not_this_one parameter
to move focus away. We used to get away with this, as the not_this_one
parameter was ignored until commit e257580b94, now with bug 675982
fixed, we need to explicitly handle the show-desktop case.

https://bugzilla.gnome.org/show_bug.cgi?id=686928
2012-10-26 15:52:32 +02:00
Jasper St. Pierre
7a2c019514 window: Don't move the desktop window after monitor hotplug
If someone plugs in a new monitor, while all their regular windows
should move in absolute X coordinates to ensure they stay on the
same monitor, the desktop window should stay put.

https://bugzilla.gnome.org/show_bug.cgi?id=681159
2012-10-07 13:23:04 -03:00
Florian Müllner
10d53fc7d2 window: Do not restore tiling on unmaximize
When we consider tiling a special case of maximization, it makes
more sense to always unmaximize to the normal state rather than
restoring a previous tile state.

https://bugzilla.gnome.org/show_bug.cgi?id=677565
2012-07-16 22:18:47 +02:00
Florian Müllner
eb1292ea99 window: Handle changes of the attach-modal-dialogs preference
Currently we decide whether a modal dialog should be attached or not
when mapping it, i.e. we don't pick up preference changes that happen
while the dialog is up. It's not really a big deal given that modal
dialogs are usually transitory, but it's easy enough to add a bit of
extra polish ...

https://bugzilla.gnome.org/show_bug.cgi?id=679904
2012-07-16 22:15:13 +02:00
Florian Müllner
0fe0534c85 constraints: Center modal dialogs on their parent
... rather than attaching them to the parent's title bar.

https://bugzilla.gnome.org/show_bug.cgi?id=674499
2012-07-14 03:30:56 +02:00
Florian Müllner
0a50488bef window: Also use hide-titlebar-when-maximized when tiled
Side-by-side tiling is conceptually very close to maximization
("half-maximized"), so it makes sense to also hide the titlebar
in this state if requested by the application.

https://bugzilla.gnome.org/show_bug.cgi?id=679290
2012-07-03 12:21:54 +02:00
Giovanni Campagna
f65b7c59d3 Make it possible to reimplement move-to-workspace keybindings from plugins
Export the necessary functions so that a plugin that wishes to do
so can reimplement those keybindings without loss of functionality.

https://bugzilla.gnome.org/show_bug.cgi?id=674104
2012-06-25 23:11:24 +02:00
Jasper St. Pierre
50bc4ad0e1 Fix bad declarations
meta_screen_get_current_monitor now returns an integer, not a pointer.
2012-06-11 10:13:43 -04:00
Tim L
4595209346 screen: Add new public meta_screen_get_current_monitor API
Similar to meta_screen_get_primary_monitor, this returns a monitor index.
The monitor that the pointer is on. The previous private implementation
has been renamed to meta_screen_get_current_monitor_info.

https://bugzilla.gnome.org/show_bug.cgi?id=642591
2012-06-08 23:06:46 -04:00
Florian Müllner
49400657ca stack: Ignore keep-on-top property on maximized windows
It is impossible to switch to other windows when keep-on-top is set
for maximized windows; given that keep-on-top is only ever useful
to keep a window visible while focusing a different window, the
current behavior is pointless. So ignore keep-on-top while a window
is maximized.

https://bugzilla.gnome.org/show_bug.cgi?id=673581
2012-05-30 15:01:57 +02:00
Jasper St. Pierre
a78fec7951 window: Remove setting of an unused variable
Well, technically it's used, but only in one block, so let's
just make it scoped to that block.

https://bugzilla.gnome.org/show_bug.cgi?id=674876
2012-05-01 18:21:17 -04:00
Owen W. Taylor
c669a3892e meta_window_move_frame(): fix crash when frame is NULL
When meta_frame_calc_borders() was made to take a NULL frame argument,
a crash was accidentally introduced into meta_window_move_frame().

This partially reverts 8c1b2d5.

https://bugzilla.gnome.org/show_bug.cgi?id=675254
2012-05-01 13:44:35 -04:00
Javier Jardón
c64188c67f core/window.c: Remove unused unmap_frame() function 2012-04-26 11:54:31 +01:00
Javier Jardón
4c2371f2e7 Revert "core/window.c: Remove unused function"
This reverts commit ff6c31dcc0.
2012-04-26 11:54:12 +01:00
Javier Jardón
ff6c31dcc0 core/window.c: Remove unused function 2012-04-26 11:29:24 +01:00
Jasper St. Pierre
2d6555ca4d prefs: Remove live-hidden-windows preference
The preference existed, even though it was hard-coded to true. Just
remove it for good.

https://bugzilla.gnome.org/show_bug.cgi?id=671104
2012-04-24 16:40:47 -04:00
Jasper St. Pierre
044d58951e Switch to gtk-doc syntax
https://bugzilla.gnome.org/show_bug.cgi?id=673752
2012-04-24 15:20:39 -04:00
Owen W. Taylor
93d06d4368 Don't try to auto-maximize not-maximizable windows
Starting the auto-maximize process on a window like a
META_WINDOW_DESKTOP window that is not maximizable gets placement into
a confused state and eventually results in the window being positioned
at the wrong position (the position that an auto-maximized window would
be restored to.)

https://bugzilla.gnome.org/show_bug.cgi?id=673566
2012-04-05 14:53:11 -04:00
Rui Matos
f16f47bd38 Revert "window: Stop a gcc warning"
This reverts commit 335d211204 trying
not to trigger the uninitialized variable warning in gcc.
2012-03-19 00:32:34 +01:00
Jasper St. Pierre
335d211204 window: Stop a gcc warning
"warning: 'match_tile_mode' may be used uninitialized in this function", it
complains. It thinks it's not unused because of other values of
window->tile_mode, but other complex logic ensures that it can't be
META_TILE_MAXIMIZED, so this is a safe commit.
2012-03-17 16:59:09 -04:00
Jasper St. Pierre
7f64d6b92e window: Disallow maximization for windows that can't be maximized
Windows that have minimum widths larger than the screen can't be maximized,
even though we put them in a maximized state and allow users to do so:
the window just won't change size and position. Fix this by simply not giving
the option to maximize, like what happens for non-resizable windows.

https://bugzilla.gnome.org/show_bug.cgi?id=643606
2012-03-17 06:40:55 -04:00
Jasper St. Pierre
8c1b2d5eda Simplify the frame testing logic in callers to grab borders
A lot of code did something similar to:

  MetaFrameBorders borders;

  if (window->frame)
    meta_frame_calc_borders (window->frame, &borders);
  else
    meta_frame_borders_clear (&borders);

Sometimes, the else part was omitted and we were unknowingly using
uninitalized values for OR windows. Clean this up by just testing
for a NULL frame in meta_frame_calc_borders and clearing for the
caller if so.

https://bugzilla.gnome.org/show_bug.cgi?id=643606
2012-03-17 06:40:54 -04:00
Jasper St. Pierre
578b1c06c7 window: Fix meta_window_get_workspaces when a window isn't on a workspace
Since we're going to be evaluating the work area at startup now, we need
to make sure that we don't iterate over workspaces before they're assigned.
The easiest way to do this is to make sure that meta_window_get_workspaces
doesn't crash.

https://bugzilla.gnome.org/show_bug.cgi?id=643606
2012-03-16 21:01:48 -04:00
Rui Matos
2926323a9a window: Introduce meta_window_get_tile_match()
Returns the matching tiled window. This is the topmost tiled window in a
complementary tile mode that is:

 - on the same monitor;
 - on the same workspace;
 - spanning the remaining monitor width;
 - there is no 3rd window stacked between both tiled windows that's
   partially visible in the common edge.

https://bugzilla.gnome.org/show_bug.cgi?id=643075
2012-03-16 19:12:05 +01:00
Adel Gadllah
f2f500836e Automaximize large windows on map
Windows that start up in a size that is almost as big as the workarea create
extra work for the user (resizing or maximizing) so save the user's time by
detecting such windows and automaximize them.

https://bugzilla.gnome.org/show_bug.cgi?id=671677
2012-03-15 22:03:00 +01:00
Adel Gadllah
c39998efee Don't unmaximize to nearly maximized size
Basically we don't really want to create windows that are almost maximized in
size but not actually maximized. This creates work for the user and makes it
very difficult to use and resize manually.

So set the newly unmaximized window size to the previously used size or 80% of the
size of the current workarea (attempting to retain natural aspect ratio if
possible), whichever is smaller.

https://bugzilla.gnome.org/show_bug.cgi?id=671677
2012-03-15 22:02:54 +01:00
Rui Matos
860c2a6282 window: Remove prefs listener in _unmanage instead of _finalize
After _unmanage the object is semantically dead even if technically it's not,
so remove the prefs listener here to prevent it being called for a dead
object.

In particular this fixes a crash when starting up gnome-shell with at least
one gimp utility window opened which causes mutter to create a MetaWindow for
it only to immediately get an UnmapNotify afterwards which causes mutter to
unmanage the MetaWindow. Afterwards prefs_changed_callback is called for this
dead MetaWindow and tries to dereference the window->monitor pointer which is
already NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=671087
2012-03-01 10:22:21 +01:00
Jasper St. Pierre
01c363bb6a Use a META_ prefix for enum types, not MUTTER_ 2012-02-23 16:39:28 -05:00
Jasper St. Pierre
c47039db82 window: Fix meta_window_move_frame in the context of the new invisible borders
https://bugzilla.gnome.org/show_bug.cgi?id=659643
2012-02-16 16:46:10 -05:00
Ryan Lortie
1772a2a59c adjust to new Gtk properties for app menu
https://bugzilla.gnome.org/show_bug.cgi?id=668118
2012-01-18 17:26:12 -05:00
Florian Müllner
9729a99ec5 window: Support GTK+'s hide-titlebar-when-maximized hint
For maximized windows, titlebars cannot be used to reposition or
scale the window, so if an application does not use it to convey
useful information (other than the application name), the screen
space occupied by titlebars could be put to better use.
To account for this use case, a setting for requesting that windows'
titlebars should be hidden during maximization has been added to
GTK+, add support for this in the window manager.

https://bugzilla.gnome.org/show_bug.cgi?id=665617
2011-12-15 16:37:20 +01:00