1
0
Fork 0
Commit graph

3070 commits

Author SHA1 Message Date
Owen W. Taylor
70c0d39fa7 Add support for an extended style of _NET_WM_SYNC_REQUEST_COUNTER
If an application provides two values in _NET_WM_SYNC_REQUEST_COUNTER,
use that as a signal that the applications wants an extended behavior
where it can update the counter as well as the window manager. If the
application updates the counter to an odd value, updates of the
window are frozen until the counter is updated again to an even value.

https://bugzilla.gnome.org/show_bug.cgi?id=685463
2013-02-13 09:48:26 -05:00
Owen W. Taylor
7d43bde019 Support properties with lists of XSyncCounter
Add META_PROP_VALUE_SYNC_COUNTER_LIST for a property that contains
multiple XSyncCounter values.

https://bugzilla.gnome.org/show_bug.cgi?id=685463
2013-02-13 09:48:26 -05:00
Owen W. Taylor
7743c70d47 Move sync alarms to be per-window and permanent
Instead of creating a new alarm each time we resize a window
interactively, create an alarm the first time we resize a window
and keep it around permanently until we unmanage the window.
Doing it this way will be useful when we allow the application to
spontaneously generate sync request updates to indicate
frames it is drawing.

https://bugzilla.gnome.org/show_bug.cgi?id=685463
2013-02-13 09:48:25 -05:00
Owen W. Taylor
c9343e3ee3 Implement freezing of updates during resize
Replace the unused meta_compositor_set_updates() with
a reversed-meaning meta_compositor_set_updates_frozen(), and use
it to implement freezing application window updates during
interactive resizing. This avoids drawing new areas of the window
with blank content before the application has a chance to repaint.

https://bugzilla.gnome.org/show_bug.cgi?id=685463
2013-02-13 09:40:07 -05:00
Owen W. Taylor
3abaf506a6 MetaWindowActor: Use guint for bitfields
A 1-bit boolean (int) bitfield has the values 0 and -1. Use
guint instead for bitfield values.

https://bugzilla.gnome.org/show_bug.cgi?id=685463
2013-02-13 09:39:09 -05:00
Adel Gadllah
2942b22ccf screen: Don't try to move / resize OR windows on montior change
meta_screen_resize calls meta_window_update_for_monitors_changed for all
windows including OR windows when the monitors change (or screen size).

This calls meta_window_move_between_rects for the window which attempts to
move the OR window by calling meta_window_move_resize.

meta_window_move_resize refuses to do anything on OR windows (just returns
for OR windows).

This causes a storm of assert messages when the screen
resolution changes while an OR window is visible.
(like the one gnome-control-center displays with the monitor name).

Fix that by not calling meta_window_update_for_monitors_changed for OR windows
and let the applications handle them by themselves.

https://bugzilla.gnome.org/show_bug.cgi?id=693540
2013-02-10 20:43:03 +01:00
Cosimo Cecchi
94e6e55ef7 resize-popup: use a tooltip style for the resize popup window
- set GTK_STYLE_CLASS_TOOLTIP on the window, and use the same code of
  GtkTooltip to paint it
- set GDK_WINDOW_TYPE_HINT_TOOLTIP and make the window non-resizable, so
  it doesn't get an incorrect shadow from the WM

https://bugzilla.gnome.org/show_bug.cgi?id=692741
2013-02-10 14:25:27 -05:00
Cosimo Cecchi
34fc234fd7 resize-popup: set a bigger margin
Since we're going to use the tooltip's rounded corners we need a little
bit more of margin (which wasn't a bad idea even with the frame).
Also, don't use GtkMisc for this anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=692741
2013-02-10 14:25:27 -05:00
Cosimo Cecchi
c3ffd28bb6 resize-popup: don't use a GtkFrame
We want this to look like a normal tooltip - start with removing the
GtkFrame around its shape.

https://bugzilla.gnome.org/show_bug.cgi?id=692741
2013-02-10 14:25:27 -05:00
Adel Gadllah
1c680be11a meta-window-actor: Make sure that the shape_region is always set
Start off with an empty region to make sure that the shape_region is
always set even for unredirected and frozen windows.

https://bugzilla.gnome.org/show_bug.cgi?id=693482
2013-02-09 20:56:03 +01:00
Adel Gadllah
a362c08f4e Fix build error introduced by d482590c84 2013-02-09 17:02:36 +01:00
Rui Matos
380154af0a screen: Fix a potentially endless loop
We always need to move the list pointer forward.

https://bugzilla.gnome.org/show_bug.cgi?id=693475
2013-02-09 16:07:59 +01:00
Adel Gadllah
d482590c84 Fix button check in meta_window_client_message
Fixes a regression introduced in 3a3be74e37

https://bugzilla.gnome.org/show_bug.cgi?id=692718
2013-02-09 13:17:42 +01:00
Tim Lunn
b3c572b8e3 barrier: fix fallback for unsupported servers
add missing ifdef HAVE_XI23.

https://bugzilla.gnome.org/show_bug.cgi?id=677215
2013-02-09 11:27:22 +11:00
Jasper St. Pierre
c64eb94724 display: Remove an unused code path for enabling the compositor 2013-02-08 14:36:20 -05:00
Jasper St. Pierre
d8f569eaf5 display: Rename window_ids to xids
As the hash table no longer stores only window IDs, we should rename it so
that we make sure to check if something is actually a window before using it
as a window.

https://bugzilla.gnome.org/show_bug.cgi?id=677215
2013-02-08 14:23:38 -05:00
Jasper St. Pierre
57c31a56f4 barrier: Add support for new barrier features in XInput 2.3
XInput 2.3 adds support for "barrier events", which let us know when
a pointer barrier has been hit, and when the pointer has stopped
hitting the barrier, and lets us "release" the barrier, temporarily
letting the pointer pass through the barrier. These features can be
combined to allow for certain pointer gestures, such as "pushing"
against the bottom of the screen, or stopping the pointer on monitor
edges while dragging slowly for increased edge precision.

This commit should allow graceful fallback if servers with
XInput 2.3 aren't supported.

https://bugzilla.gnome.org/show_bug.cgi?id=677215
2013-02-08 14:23:38 -05:00
Jasper St. Pierre
8b21df92f0 barrier: Add a new Meta wrapper for pointer barriers
Currently, we have a few function wrappers in the shell for pointer
barriers. If we want to implement interactive features on barriers,
we need some sort of signal to be notified of the interactivity.
In that case, we need to make a more sophisticated object-based wrapper
for a pointer barrier. Add one, and stick it in mutter.

https://bugzilla.gnome.org/show_bug.cgi?id=677215
2013-02-08 14:23:38 -05:00
Florian Müllner
e914595062 theme-viewer: Stop using deprecated GTK+ functions
https://bugzilla.gnome.org/show_bug.cgi?id=693439
2013-02-08 19:08:55 +01:00
Adel Gadllah
a2a3188331 Fix compiler warnings 2013-02-08 00:22:54 +01:00
Jasper St. Pierre
453020c315 Make sure to include the old XI2 mask when selecting for events
Some windows may already have event masks on them that we've selected
for, especially if we're using GTK+ windows. In particular, this fixes
window menus in the XI2 port.

https://bugzilla.gnome.org/show_bug.cgi?id=690581
2013-02-07 18:13:40 -05:00
Jasper St. Pierre
d794db876a core: Add a helper function to grab the old event mask of a window
https://bugzilla.gnome.org/show_bug.cgi?id=690581
2013-02-07 17:53:53 -05:00
Adel Gadllah
b33b4a8e2c ui: Don't use gdk_device_manager_get_client_pointer
gdk_device_manager_get_client_pointer which in calls
XIGetClientPointer seems to be very slow in a XI2 world.

So use
	gdk_x11_device_manager_lookup (gmanager, META_VIRTUAL_CORE_POINTER_ID)
instead.

https://bugzilla.gnome.org/show_bug.cgi?id=693354
2013-02-07 21:54:27 +01:00
Adel Gadllah
5298d1c8d0 meta-window-actor: Don't do check_needs_reshape when not mapped
This can cause us ending up with a wrong mask because we don't yet
have a pixmap to use in build_and_scan_frame_mask().

https://bugzilla.gnome.org/show_bug.cgi?id=679901
2013-02-06 18:11:36 +01:00
Rico Tzschichholz
493f619adc meta-window-actor: Fix uninitialized variable
Fallout of 90f2a3ae4c
2013-02-06 08:19:20 +01:00
Jasper St. Pierre
a613a55658 Support _NET_WM_OPAQUE_REGION
This new hint allows compositors to know what portions of a window
will be obscured, as a region above them is opaque. For an RGB window,
possible to glean this information from the bounding shape region of
a client window, but not for an ARGB32 window. This new hint allows
clients that use ARGB32 windows to say which part of the window is
opaque, allowing this sort of optimization.

https://bugzilla.gnome.org/show_bug.cgi?id=679901
2013-02-06 00:08:04 -05:00
Jasper St. Pierre
3fe5a676c2 window-actor: Remove the bounding region
With the shape region always set, it turns out the bounding region
is only used in one place, that's easily replaced with a variable
we already have available to us.

https://bugzilla.gnome.org/show_bug.cgi?id=679901
2013-02-06 00:05:23 -05:00
Jasper St. Pierre
19420f147f window-actor: Remove conditional checks for the shape region
With recent changes in the way the window mask texture is constructed,
the shape_region is always set, which means that we can remove
conditionals checking if the shape region is set.

https://bugzilla.gnome.org/show_bug.cgi?id=679901
2013-02-06 00:05:23 -05:00
Jasper St. Pierre
32b7743735 screen: Add an introspectible wrapper for find_monitor_for_rect
Instead of returning a MonitorInfo, it returns a monitor index.

https://bugzilla.gnome.org/show_bug.cgi?id=692679
2013-02-06 00:04:15 -05:00
Jasper St. Pierre
093e101252 Make work_area calculation funcs public and introspectible
https://bugzilla.gnome.org/show_bug.cgi?id=692679
2013-02-06 00:03:47 -05:00
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
f37dd25e92 Revert "screen: Add an introspectible wrapper for find_monitor_for_rect"
This reverts commit 3900aa10f8.
2013-02-06 00:02:04 -05:00
Jasper St. Pierre
d48df249c9 Revert "window-actor: Ensure we always have a valid shape_region"
This reverts commit 07273a075d.
2013-02-06 00:02:03 -05:00
Jasper St. Pierre
e48c3dac87 Revert "window-actor: Remove conditional checks for the shape region"
This reverts commit 84930f1d78.
2013-02-06 00:02:02 -05:00
Jasper St. Pierre
3516902fae Revert "window-actor: Remove the bounding region"
This reverts commit 66185a468c.
2013-02-06 00:02:00 -05:00
Jasper St. Pierre
66185a468c window-actor: Remove the bounding region
With the shape region always set, it turns out the bounding region
is only used in one place, that's easily replaced with a variable
we already have available to us.

https://bugzilla.gnome.org/show_bug.cgi?id=679901
2013-02-05 23:59:20 -05:00
Jasper St. Pierre
84930f1d78 window-actor: Remove conditional checks for the shape region
With recent changes in the way the window mask texture is constructed,
the shape_region is always set, which means that we can remove
conditionals checking if the shape region is set.

https://bugzilla.gnome.org/show_bug.cgi?id=679901
2013-02-05 23:54:13 -05:00
Jasper St. Pierre
07273a075d window-actor: Ensure we always have a valid shape_region
Force a reshape at startup to ensure that shape_region is always
constructed and valid, even if the window is unredirected or frozen.

https://bugzilla.gnome.org/show_bug.cgi?id=679901
2013-02-05 23:54:13 -05:00
Jasper St. Pierre
3900aa10f8 screen: Add an introspectible wrapper for find_monitor_for_rect
Instead of returning a MonitorInfo, it returns a monitor index.

https://bugzilla.gnome.org/show_bug.cgi?id=692679
2013-02-05 23:54:13 -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
90f2a3ae4c mutter-window-actor: Improve unredirect heuristic
Currently we only unredirect monitor sized override redirect windows.
This was supposed to catch fullscreen opengl games and improve
their performance.

Newer games like fullscreen webgl games and SDL2 using games (like L4D) as well as wine based games do not use override redirect windows so we need a better
heuristic to catch them.

GLX windows always damage the whole window when calling glxSwapBuffers and
never damage sub regions. So we can use that to detect them.

The new heuristic unredirects windows fullscreen windows that have damaged the
whole window more then 100 times in a row.

https://bugzilla.gnome.org/show_bug.cgi?id=683786
2013-02-05 21:13:27 +01: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
Adel Gadllah
2ecc50af53 meta-window-actor: Correctly create a new pixmap when redirecting a window again
We should call meta_window_actor_detach not
meta_window_actor_queue_create_pixmap to create a new pixmap when we redirect a
previously unredirected window again.

https://bugzilla.gnome.org/show_bug.cgi?id=693042
2013-02-02 11:02:49 +01:00
Jasper St. Pierre
71055556ee display: Require XFixes 5.0
We want to put barrier wrappers in mutter, which requre XFixes 5.0.
XFixes 5.0 was released in March, 2011, which should be old enough
to mandate support for.

https://bugzilla.gnome.org/show_bug.cgi?id=677215
2013-02-01 13:13:51 -05: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
Colin Walters
cefadb55b1 display: Request XI2.3
This matches commit:

http://git.gnome.org/browse/clutter/commit/?h=clutter-1.14&id=3e1450ba17fce90a8034cc525c67a87ff3cdd53d

Since XIQueryVersion, the bad API that it is, chooses the first client
version that it gets, we need to ensure that we pass XIQueryVersion the
new XI2.3 version, knowing fully well that Clutter won't be confused
by the new features.

https://bugzilla.gnome.org/show_bug.cgi?id=692877
2013-01-31 04:22:10 -05: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
e28a36affd window-actor: Merge two simple methods
With some recent changes to how mask textures are constructed from
shapes, a helper method we made was only called in one place, allowing
us to drop a reference/destroy, and remove a double clear.

https://bugzilla.gnome.org/show_bug.cgi?id=679901
2013-01-18 00:28:54 -05:00
Jasper St. Pierre
53534b4ded window-actor: Remove custom region destruction methods with g_clear_pointer
https://bugzilla.gnome.org/show_bug.cgi?id=679901
2013-01-18 00:28:54 -05:00
Jasper St. Pierre
079dd60e3d window-actor: Clean up finalization code with simple uses of g_clear_pointer
While not a massive change by itself, adding new code to use g_clear_pointer
without porting existing usage looks strange.

https://bugzilla.gnome.org/show_bug.cgi?id=679901
2013-01-18 00:28:54 -05:00
Jasper St. Pierre
5d12f00b3b window-actor: Speed up mask creation
Due to a conditional error, meta_region_builder_add_rectangle was called
on every single blank pixel, rather than at the end of spans. With the new
rename, it's fairly clear to see the error. Fix the check to ensure that
we no longer make extraneous calls to meta_region_builder_add_rectangle.

https://bugzilla.gnome.org/show_bug.cgi?id=691874
2013-01-17 16:33:54 -05:00
Jasper St. Pierre
95f3bb3b81 window-actor: Rename variable in scanning function
"w" usually stands for "width", but here it stands for the end X bound,
so we'll rename it to the more traditional "x2".

https://bugzilla.gnome.org/show_bug.cgi?id=691874
2013-01-17 16:33:53 -05:00
William Jon McCann
27e0e44d8b Don't allow multiline window titles
https://bugzilla.gnome.org/show_bug.cgi?id=683056
2013-01-16 14:25:11 -05:00
Jasper St. Pierre
47be4fdf07 theme: Add the .background style class back to frames
GtkWindow added the BACKGROUND style class to all windows, which the
CSS file selects on to set a background color for all windows. Without
this, the background color becomes undefined, and thus window frames
look like they have "glitchy" graphics.

https://bugzilla.gnome.org/show_bug.cgi?id=690317
2013-01-11 12:40:07 -05:00
Jasper St. Pierre
9b34545bd5 theme: Fix a memory leak
Commit 5c33b0d tried to copy/paste the code that constructed
classes, but for some reason didn't copy the theme name.

https://bugzilla.gnome.org/show_bug.cgi?id=690317
2013-01-11 12:40:07 -05:00
Rui Matos
e5317cc7a0 theme: Remove a bunch of unused *_to_string methods
These were there just for consistency's sake.
2013-01-11 17:40:23 +01:00
Florian Müllner
b8887a6c3a keybindings: Rebrand "minimize" as "hide"
The minimize action does not make much sense without a window list,
which is why its default keybinding was removed in bug 643609;
getting the focused window out of the way quickly can still be useful
though, so change the description to "Hide window" instead, which does
not imply a window list. We will then assign a default shortcut again.

https://bugzilla.gnome.org/show_bug.cgi?id=682887
2013-01-11 16:22:29 +01:00
Florian Müllner
a6c51addac prefs: Annotate meta_prefs_get_button_layout()
https://bugzilla.gnome.org/show_bug.cgi?id=689263
2013-01-10 00:10:50 +01:00
Florian Müllner
54a3847a5e common: Annotate MetaButtonLayout
https://bugzilla.gnome.org/show_bug.cgi?id=689263
2013-01-10 00:10:50 +01:00
Florian Müllner
5a8473e226 prefs: Do not leave junk values in unused button_layout fields
MetaButtonLayout is extremely unfriendly for introspection: its fields
are arrays of a fixed length, but the actual length is determined by
a custom stop value (e.g. not NULL / 0).
Without API changes this will never work nicely in introspection, but
we can at least make it work; start by filling up unused fields with
the stop value rather than leaving it at random values.

https://bugzilla.gnome.org/show_bug.cgi?id=689263
2013-01-10 00:10:50 +01:00
Jasper St. Pierre
5c33b0d768 theme-viewer: use the same GtkStyleContext as mutter usually renders
https://bugzilla.gnome.org/show_bug.cgi?id=690317
2013-01-09 14:06:24 -05:00
Jasper St. Pierre
22a3126a2b theme: Make meta_frame_draw_theme take a GtkStyleContext instead of a widget
The style context of the widget is rarely what we want. We won't
fix this to be a MetaFrames style context yet; this just changes
the internal API.

https://bugzilla.gnome.org/show_bug.cgi?id=690317
2013-01-09 14:06:24 -05:00
Jasper St. Pierre
9596c24f83 plugin-manager: Remove a bogus check
We dereference the plugin_mgr in the initializer above,
so it's wrong.

https://bugzilla.gnome.org/show_bug.cgi?id=690609
2013-01-09 14:06:24 -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
Jasper St. Pierre
f57d64337b display: Use XI2 constants for mode/detail focus event values
This makes no function difference, except conceptual clarity.

https://bugzilla.gnome.org/show_bug.cgi?id=691363
2013-01-08 15:54:50 -05:00
Jasper St. Pierre
e69fcc860c display: Remove some more core events
I apparently forgot to remove these.

https://bugzilla.gnome.org/show_bug.cgi?id=691363
2013-01-08 15:54:50 -05:00
Jasper St. Pierre
afbca61524 main: Remove call to clutter_x11_enable_xinput
The call is deprecated and is called by default upstream.

https://bugzilla.gnome.org/show_bug.cgi?id=691363
2013-01-08 15:54:50 -05:00
Jasper St. Pierre
66d37e06ba compositor: Remove unused code fetching _XSETROOT_ID
We don't use this atom anywhere, so don't bother fetching it.

https://bugzilla.gnome.org/show_bug.cgi?id=691363
2013-01-08 15:54:50 -05:00
Debarshi Ray
b9f775fe02 ui: Suppress warnings from -Werror=maybe-uninitialized 2013-01-03 17:30:44 +01:00
Jasper St. Pierre
90cf43da9f display: Expose the xinput opcode
This is needed by the shell to filter out certain events

https://bugzilla.gnome.org/show_bug.cgi?id=690590
2013-01-02 13:41:56 -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
Giovanni Campagna
57ff0f7071 MetaWindow: add a public method for checking if the application is responding
Add meta_window_check_alive(), which is a simple wrapper over
meta_display_ping_window(), and takes care of showing the "Application
is not responding dialog" if needed.

https://bugzilla.gnome.org/show_bug.cgi?id=684340
2012-12-25 18:39:09 +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
Jasper St. Pierre
4e21d5d610 ui: Don't use deprecated GtkStyleContext API
Update for deprecations.

https://bugzilla.gnome.org/show_bug.cgi?id=690593
2012-12-23 03:17:26 -05:00
Ray Strode
748064678f prefs: drop errnoneous semi-colon
This fixes a compiler warning and spurious
enqueuing of WORKSPACE_NAMES change.

https://bugzilla.gnome.org/show_bug.cgi?id=690573
2012-12-20 14:27:26 -05: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
Rui Matos
7d7b859b40 Fix 'comparison between signed and unsigned integer' compiler errors 2012-12-17 12:30:01 +00:00
Florian Müllner
d78de379cc keybindings: Give dynamic keybindings a keybindings action
https://bugzilla.gnome.org/show_bug.cgi?id=682315
2012-12-17 12:00:55 +00:00
Jasper St. Pierre
2fcbc467e8 keybindings: Fix whitespace and alignment
https://bugzilla.gnome.org/show_bug.cgi?id=688779
2012-12-13 18:15:23 -05:00
Jasper St. Pierre
6139bc77ec Remove support for Core Events
https://bugzilla.gnome.org/show_bug.cgi?id=688779
2012-12-13 18:15:23 -05:00
Jasper St. Pierre
c1ac9d1dff ui: Use XI2 to fake GDK events
This removes our final dependency on Core Events, meaning
we can remove support code for them soon.

This commit is a bit ugly as it requires ui having a dependency on
core, but this is already a hack, so this is thus a hack inside a
hack, and two hacks make a right or however that goes.

https://bugzilla.gnome.org/show_bug.cgi?id=688779
2012-12-13 18:15:23 -05:00
Jasper St. Pierre
945c530354 display: Add spew for XI2
https://bugzilla.gnome.org/show_bug.cgi?id=688779
2012-12-13 18:15:22 -05: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
7c20621112 keybindings: Grab keys with XI2
https://bugzilla.gnome.org/show_bug.cgi?id=688779
2012-12-13 17:14:06 -05:00
Jasper St. Pierre
afcdfd158f keybindings: Grab keyboard with XI2
https://bugzilla.gnome.org/show_bug.cgi?id=688779
2012-12-13 17:14:06 -05:00
Jasper St. Pierre
8fb9e0072c display: Grab buttons with XI2
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
8931b8026e compositor: Identify XI2 events as grabbed events
https://bugzilla.gnome.org/show_bug.cgi?id=688779
2012-12-13 16:36:43 -05:00
Jasper St. Pierre
55251aa986 compositor: Use XInput2 to grab the pointer/keyboard
https://bugzilla.gnome.org/show_bug.cgi?id=688779
2012-12-13 16:36:42 -05:00
Carlos Garnacho
946a42f13e core: enable XInput2 by default
Enable XI2 support in both Clutter and GDK.

https://bugzilla.gnome.org/show_bug.cgi?id=688779
2012-12-13 14:57:31 -05:00
Jasper St. Pierre
0fd4059927 display: Only care about input events for the VCP/VCK
It's unlikely that we'll ever want to support multiple pointer
devices. Multiple keyboard devices may become useful in the future,
but for now, only care about the core keyboard.

https://bugzilla.gnome.org/show_bug.cgi?id=688779
2012-12-13 14:57:31 -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
6b31bd402a display: Don't pass an event to a handler that will no-op
meta_window_handle_mouse_grab_op_event won't do anything on a
EnterNotify/LeaveNotify, so why are we passing something to it?

https://bugzilla.gnome.org/show_bug.cgi?id=688779
2012-12-13 14:56:24 -05:00
Carlos Garnacho
129c729c50 display: separate input/non-input events handling in the event callback
In order to make the XI2 handling easier on us in the future, we now
split input events from non-input events. This will allow one code path
to use XIEvent, and the other to use XEvent in the future. This commit
has involved plenty of indenting changes, so it's better seen with
git diff -b or &ignorews=1

https://bugzilla.gnome.org/show_bug.cgi?id=688779
2012-12-13 14:12:56 -05:00
Jasper St. Pierre
8bf8f3ea55 common: Add the XInput2 headers to common.h, which everything uses
https://bugzilla.gnome.org/show_bug.cgi?id=688779
2012-12-13 14:12:56 -05:00
Jasper St. Pierre
f0c1e39fb7 display: Initialize XInput2
Make sure it's the correct version.

https://bugzilla.gnome.org/show_bug.cgi?id=688779
2012-12-13 14:12:56 -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
Jasper St. Pierre
8830814d70 screen: Add a convenience method to focus the default window
This will be used for gnome-shell so that it can focus a window after
a keyboard grab or other things.

https://bugzilla.gnome.org/show_bug.cgi?id=689652
2012-12-07 13:01:49 -05:00
Florian Müllner
2282326f30 Add 'switch-applications' keybinding
Add an additional "switcher" keybinding for switching between
applications rather than windows (like the existing 'switch-windows'
and 'switch-group' bindings).
The purpose of the new keybinding is to be taken over by gnome-shell's
application-based alt-tab popup, so rather than actually implementing
an application switcher in mutter, let it duplicate the normal window
switcher when run standalone.

https://bugzilla.gnome.org/show_bug.cgi?id=688913
2012-12-05 18:45:22 +01:00
Florian Müllner
8703daccbe display: Make workspace parameter to get_tab_list() optional
Currently meta_display_get_tab_list() will only return windows on
a single workspace. Make the workspace parameter optional to allow
requesting windows from all workspaces.

https://bugzilla.gnome.org/show_bug.cgi?id=688913
2012-12-05 18:45:22 +01:00
Florian Müllner
3797ecaa65 display: Clean up meta_display_get_tab_list()
https://bugzilla.gnome.org/show_bug.cgi?id=688913
2012-12-05 18:45:22 +01:00
Jasper St. Pierre
c6fcc79e6a display: Kill a warning at shutdown
A small semicolon was causing us to always remove the focus
timeout ID.
2012-12-04 16:46:40 -05:00
Alban Crequy
e5b46747d6 Initialize window->user_rect in the initial placement
The window positioning is delayed in idle_move_resize() in case the application
resizes/maximizes its window quickly after its creation. The delayed
positioning uses window->user_rect because of bug 426519 comment 3 (see
meta_window_move_resize_now()).

user_rect was not set in the initial positioning, causing the delayed
positioning unable to know which monitor we use for this window. As a
consequence, the window could jump spontaneously from one monitor to another.

With this patch, the window does not jump anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=556696
2012-11-30 13:29:26 +00:00
Florian Müllner
38484bf967 Remove another call to g_type_init() 2012-11-19 21:03:14 +01:00
Giovanni Campagna
e73946f0bf MetaBackgroundActor: add a setter for GLSL uniforms
It doesn't make sense to GLSL shaders without uniforms.

https://bugzilla.gnome.org/show_bug.cgi?id=682536
2012-11-17 02:14:38 +01:00
Florian Müllner
6004197064 keybindings: Add is_builtin() method
https://bugzilla.gnome.org/show_bug.cgi?id=688202
2012-11-17 01:47:06 +01:00
Florian Müllner
aa43e715c0 keybindings: Add MetaKeyBinding for overlay-key
As the overlay key works differently from normal keybindings, it
requires special treatment. However, by adding a rudimentary
MetaKeyBinding for it, we will be able to confine the special
handling to mutter and treat it like any other keybinding in
the shell.

https://bugzilla.gnome.org/show_bug.cgi?id=688202
2012-11-17 01:47:06 +01:00
Florian Müllner
424fc5245a Add compositor hook to process keybindings selectively
Currently keybindings are blocked while the compositor holds a grab; if
we want a keybinding to be available anyway, we use captured ClutterEvents
to determine the KeyBindingAction the event would have triggered and
run our own handlers (ugh).
Instead, provide a hook to allow the compositor to filter out keybindings
before processing them normally, regardless of whether the compositor
holds a grab or not.

https://bugzilla.gnome.org/show_bug.cgi?id=688202
2012-11-17 01:47:05 +01:00
Rico Tzschichholz
90952ac5c8 Fix naming of "user_data" arguments for better introspection 2012-11-16 21:23:47 +01:00
Florian Müllner
bdf47aeac4 keybindings: Import keybinding files from Metacity
Fallback mode is going away, so we should stop depending on Metacity
for keybinding files for common bindings.

https://bugzilla.gnome.org/show_bug.cgi?id=687672
2012-11-12 19:27:35 +01:00
Florian Müllner
daac778f16 ui: Remove obsolete GTK+ version check 2012-11-12 19:27:35 +01:00
Florian Müllner
93a16f6d43 frames: Bump priority of style providers
Since GTK+ commit b1ad5c8abc2c, GtkSetting's CSS provider uses a
priority of GTK_STYLE_PROVIDER_PRIORITY_SETTINGS, which means it
will overwrite the ones we create ourselves.
Bump the priority to fix dark window decorations.

https://bugzilla.gnome.org/show_bug.cgi?id=688182
2012-11-12 19:27:34 +01:00
Rui Matos
c37c741592 meta-background-actor: Fix compilation error 2012-11-05 19:44:03 +01:00
Rui Matos
4cf461fffa display: Only process keyboard mapping events for the core X keyboard
The X server sends a XkbNewKeyboardNotify event for each keyboard
device when a new keyboard description is loaded. These days a typical
computer has several keyboard devices, e.g. xinput on this laptop
lists 8. Since the work we do on these events is relatively expensive
and we are only really interested in changes to the virtual core
keyboard we can skip other devices' events to cut on needless work.

https://bugzilla.gnome.org/show_bug.cgi?id=674859
2012-11-05 19:40:14 +01:00
Giovanni Campagna
859ea1457d Add the ability to add shader hooks to MetaBackgroundActor
Using ClutterEffect is not pratical on MetaBackgroundActor, as the FBO
redirection has a noticeable performance impact. Instead, allow adding
GLSL code directly to the pipeline used to draw the background texture.
At the same time, port MetaBackgroundActor to modern Cogl API.

https://bugzilla.gnome.org/show_bug.cgi?id=669798
2012-11-05 19:12:37 +01:00
Jasper St. Pierre
188d532438 display: Ignore DamageNotify in spew 2012-11-03 19:37:51 -04:00
Owen W. Taylor
f258556cec MetaPluginManager: don't send events to Clutter twice
When support for multiple plugins was removed, the logic that was
supposed to send events to Clutter directly *only if there is no filter
function from a plugin* was broken, so events were being sent to
Clutter twice if Clutter didn't consume them the first time.

https://bugzilla.gnome.org/show_bug.cgi?id=686406
2012-11-03 19:36:41 -04:00
Jasper St. Pierre
62dbaa89ca mutter: Don't call g_type_init
It has been deprecated upstream.
2012-11-02 11:45:11 -04: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
Florian Müllner
2717a02a8d screen: Ignore num-workspaces when using dynamic workspaces
On startup, workspaces are initialized according to the num-workspaces
preference. However when using dynamic workspaces, the actual number
of workspaces in use might be greater than the preference (when
replacing the window manager), forcing windows on those workspaces
to the first workspace.
To fix, ignore the preference completely when using dynamic workspaces
and try to restore the previous number of workspaces (as read from
_NET_NUMBER_OF_DESKTOPS).

https://bugzilla.gnome.org/show_bug.cgi?id=685439
2012-10-17 22:43:26 +02:00
Florian Müllner
07d8b9ce19 Revert "delete: Unbreak string freeze"
This reverts commit 09713c5fd4.

https://bugzilla.gnome.org/show_bug.cgi?id=684306
2012-10-16 14:47:37 +02:00
Jürg Billeter
1a521e10c3 display: Only manage the default X screen
https://bugzilla.gnome.org/show_bug.cgi?id=648156
2012-10-15 19:18:45 +02:00
Benjamin Berg
472662d099 Resize the guard window when the X screen is resized.
Fixes bug #670396. Without this fix the guard window may not
extend over the whole area of the screen after a XRandR
reconfiguration. The effect being that mouse events are
delivered to invisible windows.
2012-10-14 12:16:06 +02:00
Florian Müllner
59bc5b7975 display: (Optionally) delay focus changes in focus-follows-mouse mode
Moving focus immediately on crossing events as we currently do
in focus-follows-mouse mode may trigger a lot of unwanted focus
changes when moving over unrelated windows on the way to a target.
Those accidental focus changes prevent features like GNOME Shell's
application menu from working properly and are visually expensive
since we now use a very distinct style for unfocused windows.
Instead, delay the actual focus change until the pointer has stopped
moving.

https://bugzilla.gnome.org/show_bug.cgi?id=678169
2012-10-11 07:49:21 +02:00
Evan Broder
99cbe762d7 Expose MetaPlugin to introspection
Add a type annotation on the xevent_filter vfunc. This is sufficient
to remove the skip annotation on MetaPlugin and MetaPluginClass
without triggering scan errors.

https://bugzilla.gnome.org/show_bug.cgi?id=671098
2012-10-08 17:05:11 -04: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
Owen W. Taylor
c02e1b6f56 Remove unused public window-property functions
Simplify the set of window-property functions to remove the
unused functions:

 meta_window_reload_properties_from_xwindow()
 meta_window_reload_properties()

And to make:

 meta_window_reload_property()

static. The code is considerably simplified by removing the
plural variants.

https://bugzilla.gnome.org/show_bug.cgi?id=587255
2012-10-03 23:35:35 -04:00
Jasper St. Pierre
7938458eb8 window-actor: Don't create a mask texture unnecessarily
Mask texture resources may be expensive. Don't create one
if we don't need to, like on an unshaped window without
a frame.

https://bugzilla.gnome.org/show_bug.cgi?id=681676
2012-09-26 13:53:14 -03:00
Florian Müllner
5eb72743dd util: Guard against older zenity versions
Plenty of ugly here, but it works; revert when the zenity version
we depend on stops being bleeding-edge (or we can assume a zenity
version that does not error out on unknown options).

https://bugzilla.gnome.org/show_bug.cgi?id=684306
2012-09-19 15:09:43 +02:00
Florian Müllner
ae1be578ba util: Use a sad face in the force-quit dialog
https://bugzilla.gnome.org/show_bug.cgi?id=684306
2012-09-19 15:09:42 +02:00
Florian Müllner
7e1e9320bc utils: Request a modal dialog when transient_for is set
https://bugzilla.gnome.org/show_bug.cgi?id=684306
2012-09-19 15:09:42 +02:00
Florian Müllner
09713c5fd4 delete: Unbreak string freeze
Quotes should definitively part of the translation, but we are in
string freeze now - revert this when we get a string freeze approval
or after the freeze ends.

https://bugzilla.gnome.org/show_bug.cgi?id=684306
2012-09-19 11:21:39 +02:00
William Jon McCann
909cd82bea Minor improvements to the not responding dialog
https://bugzilla.gnome.org/show_bug.cgi?id=684306
2012-09-19 11:15:06 +02:00
Florian Müllner
0593df8fe0 display: Add API to set wm_name / wm_keybindings
As plugins can now define their own keyboard shortcuts via
meta_display_add_keybinding(), it makes sense for them to
expose those shortcuts to System Settings, so add some API
to set the properties gnome-control-center uses to pick up
wm keybinding settings.

https://bugzilla.gnome.org/show_bug.cgi?id=671010
2012-09-18 12:53:28 +02:00
Tomeu Vizoso
079822c3f4 screen: Allow NULL out arguments in meta_screen_get_size 2012-09-05 16:40:01 +02:00
Jasper St. Pierre
bfacd9d420 keybindings: Correct annotations for meta_keybindings_set_custom_handler
We need @handler to be marked as (allow-none). At the same time,
give the function a more useful docstring.
2012-09-04 17:07:58 -03:00
Florian Müllner
0371194191 window-group: Add missing cast 2012-09-04 09:10:35 +02:00
Florian Müllner
3b0c7c568d window-group: Remove unused variables 2012-09-04 08:56:48 +02:00
Florian Müllner
6a32fa9452 keybindings: Fix unsetting of overlay-key
Commit 802c1ac427 fixed updating the overlay key on settings
changes, but missed the case where the setting was set to an
empty value to disable the overlay key altogether.

https://bugzilla.gnome.org/show_bug.cgi?id=682993
2012-08-29 23:20:49 +02:00
Florian Müllner
b422b6f06e keybindings: Silence a compiler warning
https://bugzilla.gnome.org/show_bug.cgi?id=682993
2012-08-29 23:20:49 +02:00
Jasper St. Pierre
bc96a14185 window-group: Subtract the unredirected window in stage space
meta_window_group_paint tries to carefully figure out which parts of the
scene it can avoid painting. One area it avoids painting is the region of
the screen occupied by an unredirected window (if there's one present).
When subtracting from the visible region, it gets the coordinate spaces
confused, and ends up subtracting the area at the wrong offset. Fix this
by translating the rectangle subtracted from the visible region.

https://bugzilla.gnome.org/show_bug.cgi?id=677116
2012-08-29 15:38:53 -03:00
Jasper St. Pierre
fbcddbcf3e window-group: Skip the unredirected window
We shouldn't need to process it here.

https://bugzilla.gnome.org/show_bug.cgi?id=677116
2012-08-29 15:23:06 -03:00
Jasper St. Pierre
dfe8979a90 window-group: Don't create a region when we have an unredirected window
We don't do anything with it other than modify an existing region.

https://bugzilla.gnome.org/show_bug.cgi?id=677116
2012-08-29 15:06:09 -03:00
Alexander Larsson
c3a6de749b Don't include markup in app not responding dialog
We escaped the <tt> markup, making it visible in the ui.
2012-08-28 16:42:30 +02:00
Jasper St. Pierre
d8bc7f7aa1 window-actor: Fix a memory leak
We need to free the frame_paint_region here.

https://bugzilla.gnome.org/show_bug.cgi?id=682648
2012-08-25 05:51:01 -03:00
Florian Müllner
6c3985220e keybindings: Add MetaKeybindingAction for overview-key
Currently gnome-shell hardcodes <super> as overlay key when it has
a keyboard grab. In order to fix this, add a corresponding keybinding
action.

https://bugzilla.gnome.org/show_bug.cgi?id=665547
2012-08-16 09:40:47 +02:00
Florian Müllner
802c1ac427 prefs: Update overlay-key on settings changes
When changing the overlay-key setting, the change only takes effect
on restart - there are actually two bugs involved:
  (1) the test whether the key has changed is located in the
      else part of a test for string settings (and overlay-key happens
      to be a string settings ...)
  (2) with (1) fixed, a change signal is emitted, which triggers a
      reload of all keybindings - unfortunately, the actual value
      of overlay-key is only read on startup, so the key is reloaded
      using the old value
Fix both issues by replacing the custom handling of the overlay-key
with the regular handling of string preferences.

https://bugzilla.gnome.org/show_bug.cgi?id=681906
2012-08-16 09:40:47 +02:00
Owen W. Taylor
7a2a6e2675 MetaWindowGroup: Fix bad merge
I accidentally committed merge indicators: fix compilation.
2012-08-15 22:46:23 -04:00
Owen W. Taylor
c27b4b7cfc MetaWindowGroup: Handle painting inside a ClutterClone
Look at the current COGL model-view matrix and use that to find
out any offset we are painting at as a result of being inside
a ClutterClone.

https://bugzilla.gnome.org/show_bug.cgi?id=681953
2012-08-15 20:43:19 -04:00
Owen W. Taylor
0ab572d511 MetaWindowGroup: fix logic for handling translations
Instead of getting the x/y of the MetaBackgroundActor with respect to the
parent, use the same logic that we do for windows, fixing the case
where there is a more complex transformation involved.

https://bugzilla.gnome.org/show_bug.cgi?id=681221
2012-08-15 20:43:07 -04:00
Florian Müllner
4e2c2cb1ab shadows: Adjust values for attached modal dialogs
The designers consider the current shadow too dramatic for the new
centered position; adjust the shadow to use the same values as
popup menus.
2012-08-10 16:36:26 +02:00
Tom Beckmann
cd0870730f window-group: Translate background's visible region as necessary
Currently when the window group is moved, the visible region set
on the background actor no longer matches the actually visible
region, resulting in flickering around window actors.
Fix by translating the visible region with the window group.

https://bugzilla.gnome.org/show_bug.cgi?id=681221
2012-08-07 01:28:09 +02: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
Jasper St. Pierre
e257580b94 workspace: Respect the not_this_one parameter passed in
In the case of focus-follows-mouse, we need to ensure that we
do not select a certain window after closing another one.

https://bugzilla.gnome.org/show_bug.cgi?id=675982
2012-07-16 15:21:54 -04:00
Matthias Clasen
760a36aeee Reduce amount of markup in translated messages
Markup in messages is fragile and tends to break in translations.
This patch reduces the amount of markup as far as possible.

https://bugzilla.gnome.org/show_bug.cgi?id=679660
2012-07-14 20:48:29 -04:00
Debarshi Ray
5d57a2594d constraints: Remove unused variable 2012-07-14 15:03:54 +02:00
Florian Müllner
1a5132d391 shadow-factory: Don't use a top-fade on attached modals
https://bugzilla.gnome.org/show_bug.cgi?id=674499
2012-07-14 03:30:56 +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
Jasper St. Pierre
e6ed29f0e2 keybindings: Use G_DEFINE_BOXED_TYPE
https://bugzilla.gnome.org/show_bug.cgi?id=673824
2012-07-13 00:00:42 -04:00
Pavel Vasin
255347f876 constraints: fix mem leak in meta_window_constrain()
MetaFrameBorders leaked when orig_borders != NULL and
window->fullscreen == TRUE

https://bugzilla.gnome.org/show_bug.cgi?id=679153
2012-07-08 11:56:31 -04:00
Jasper Lievisse Adriaanse
e4ae7d7b1b *BSD build fix: Include sys/wait.h as described in POSIX specs 2012-07-08 17:47:24 +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
Rico Tzschichholz
78c966321a prefs: add get_/set_ignore_request_hide_titlebar ()
Enables the possibility to ignore GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED
to prevent hiding the titlebar of applications even if they
requested so.

https://bugzilla.gnome.org/show_bug.cgi?id=678947
2012-07-01 19:25:08 +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
Giovanni Campagna
e31f55e146 Make meta_workspace_get_neighbor() public
There is no need for this function to be private, and it can
greatly simplify gnome-shell code handling workspace switch.

https://bugzilla.gnome.org/show_bug.cgi?id=674104
2012-06-25 23:07:19 +02:00
Jasper St. Pierre
a2f2e07e9b meta-window-actor: Fix a potential crash in the window shaping code
There was a potential case where we were trying to use uninitialized memory,
in the case where the X server threw an error during XShapeGetRectangles.
In this case, we need to use the implicit shape for the window, which means
we need to rearrange code flow to make it work.

https://bugzilla.gnome.org/show_bug.cgi?id=677977
2012-06-25 14:07:35 -04:00
Jasper St. Pierre
f5e48223c9 meta-plugin-manager: Guard against a NULL start vfunc
The default plugin has no such vfunc.

https://bugzilla.gnome.org/show_bug.cgi?id=678238
2012-06-25 13:52:47 -04:00
Jasper St. Pierre
1478510392 mutter: Use the default plugin by default
https://bugzilla.gnome.org/show_bug.cgi?id=678238
2012-06-25 13:52:47 -04:00
Jasper St. Pierre
18b38320a6 window: Make some window methods public
There's no reason they aren't, right now. Extensions should be able
to use these.

https://bugzilla.gnome.org/show_bug.cgi?id=678126
2012-06-25 13:52:47 -04:00
Rico Tzschichholz
accc183474 prefs: remove some obsolete header definitions 2012-06-18 11:54:22 +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
Marc-Antoine Perennou
277e8bdad9 core: Fix meta_screen_get_current_monitor
fixes 4595209346

We're supposed to return an index from here now, no longer a pointer
to the current monitor.

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2012-06-11 10:53:21 +02:00
Jasper St. Pierre
dc50ccf9b7 frames: Add a multiplier to increase the size of resize corners
Now the resize corners will extend into the actual border edges.

https://bugzilla.gnome.org/show_bug.cgi?id=677669
2012-06-08 23:09:32 -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
Jasper St. Pierre
50cf3dd1a5 main: Support -r as the equivalent of --replace
https://bugzilla.gnome.org/show_bug.cgi?id=676857
2012-06-08 17:33:37 -04:00
Jasper St. Pierre
66eac7824a meta-window-actor: Don't unredirect shaped windows
If a window has its BoundingRegion shaped, we shouldn't unredirect it,
as it expects the rest of the windows from being shown under it. This
prevents applications like the Skype screen recorder or gtkRecordMyDesktop
which want to show a "border" around the recorded area from being
unredirected, giving the appearance of making the desktop freeze.

https://bugzilla.gnome.org/show_bug.cgi?id=677657
2012-06-08 16:48:43 -04:00
Jasper St. Pierre
4041f96ed3 meta-window-actor: Refactor should_unredirect a bit more
"Flat is better than nested"

https://bugzilla.gnome.org/show_bug.cgi?id=677657
2012-06-08 16:48:42 -04:00
Jasper St. Pierre
f9454e29db meta-plugin-manager: Only allow one plugin to be loaded
The "multiple plugins loaded at once" strategy was always a big fiction:
while it may be viable if you're super careful, it's fragile and requires
a bit of infrastructure that we would be better off without.

Note that for simplicity, we're keeping the MetaPluginManager, but it only
manages one plugin. A possible future cleanup would be to remove it entirely.

https://bugzilla.gnome.org/show_bug.cgi?id=676855
2012-06-05 13:28:23 -04:00
Jasper St. Pierre
574c0c3287 meta-plugin: Remove "disabled" feature
It's just code cruft that nobody's using

https://bugzilla.gnome.org/show_bug.cgi?id=676855
2012-06-05 13:28:23 -04:00
Jasper St. Pierre
9fa5aa9889 meta-plugin: Kill off "features"
We already check that the plugin has the appropriate vfunc in the klass
structure, so we shouldn't need to check for the same data again with
a "features" long.

https://bugzilla.gnome.org/show_bug.cgi?id=676855
2012-06-05 13:28:23 -04:00
Jasper St. Pierre
80a70a4ad1 mutter: Only allow one plugin to be loaded
https://bugzilla.gnome.org/show_bug.cgi?id=676855
2012-06-05 13:28:23 -04:00
Jasper St. Pierre
7c1b734053 meta-plugin: Remove some cruft
https://bugzilla.gnome.org/show_bug.cgi?id=676855
2012-06-05 13:28:23 -04:00
Jasper St. Pierre
33e1017403 main: Don't call g_type_init from meta_init
For the plugin system, GType has to have been initialized by now.

https://bugzilla.gnome.org/show_bug.cgi?id=676855
2012-06-05 13:28:23 -04:00
Jasper St. Pierre
f143fe3710 util: Don't generate a backtrace on every G_LOG
We may not show the backtrace, but it's prohibitly expensive to generate,
so don't. If someone wants a backtrace they can use the appropriate G_DEBUG
environment variable plus GDB.

https://bugzilla.gnome.org/show_bug.cgi?id=676855
2012-06-05 13:28:22 -04:00
Rico Tzschichholz
042ddc5637 workspace: add annotation for meta_workspace_get_work_area_all_monitors 2012-05-31 19:17:49 +02: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
30bc8bc6ce window-actor: Add a debugging tool to write a region to a PNG
Just a helper function that I keep rewriting all over the place.

https://bugzilla.gnome.org/show_bug.cgi?id=676052
2012-05-25 17:31:06 -04:00
Jasper St. Pierre
ac18f41ed1 window-actor: Use MetaRegionBuilder when scanning the visible region
This gives a pretty solid performance improvement when resizing windows.
2012-05-25 17:31:06 -04:00
Jasper St. Pierre
60c05a0dac window-actor: Add back antialiased window corners
This simply adds fancy arcs to the mask texture. It's still not painted
with GTK+ yet.

https://bugzilla.gnome.org/show_bug.cgi?id=676052
2012-05-25 17:31:05 -04:00
Jasper St. Pierre
c47de98c88 window-actor: Paint the shape region with cairo
https://bugzilla.gnome.org/show_bug.cgi?id=676052
2012-05-21 16:12:30 -04:00
Jasper St. Pierre
f1aada0fae window-actor: Punt mask generation to MetaWindowActor
This effectively makes MetaShapedTexture not a MetaShapedTexture, but a simple
and dumb MetaMaskedTexture, with an optimization for clipped regions.

We're doing this as the mask may need to be more complicated than made of
a cairo path -- we eventually want GTK+ to draw the entire frame background,
which we'll then scan.

https://bugzilla.gnome.org/show_bug.cgi?id=676052
2012-05-21 16:12:30 -04:00
Jasper St. Pierre
4de492eb20 shaped-texture: Remove the cairo overlay (and rounded corners)
As we want GTK+ to paint the mask on an A8, we can't simply use a cairo
path. A later commit will make this into a simple masked texture, and
meta-window-actor will be in control of the mask.

https://bugzilla.gnome.org/show_bug.cgi?id=676052
2012-05-21 16:12:30 -04:00
Jasper St. Pierre
9ca00d5cce window-actor: Remove an unnecessary frame check
meta_frame_calc_borders will zero out the borders if we don't have a frame.

https://bugzilla.gnome.org/show_bug.cgi?id=676052
2012-05-21 16:12:30 -04:00
Jasper St. Pierre
b98e4e37ad theme: Make meta_frame_style_draw_with_style static
https://bugzilla.gnome.org/show_bug.cgi?id=676052
2012-05-21 16:12:30 -04:00
Jasper St. Pierre
8b64a951c9 theme: Make meta_frame_layout_calc_geometry static
https://bugzilla.gnome.org/show_bug.cgi?id=676052
2012-05-21 16:12:30 -04:00
Jasper St. Pierre
c2a0719e44 preview-widget: Remove meta_preview_get_clip_region
The concept of a clip region doesn't make sense now that we have anti-aliased
corners and a full alpha channel. Once the theme transition is complete,
creating a preview image with an alpha channel will be possible by passing
an ARGB surface to gtk_widget_draw(preview_widget, ...);

https://bugzilla.gnome.org/show_bug.cgi?id=676052
2012-05-21 16:12:30 -04:00
Jasper St. Pierre
8cb7a450ae screen: Remove more unused private API
These queued redraws, which is a problem when we want to know exactly
what changed when we redraw, so we do minimal effort. We're eventually
going to replace the queue_redraw API with something a lot better, so
let's just get these out of the way now.

https://bugzilla.gnome.org/show_bug.cgi?id=676052
2012-05-21 16:11:16 -04:00
Jasper St. Pierre
6fb857cb23 frames: Remove frame border pixel caching and related optimizations
Since we now cache windows in the X server, we don't really need to cache
them here. Since we are redirecting windows in most cases, we're not gaining
anything except added memory usage. Additionally, remove the clip to screen
optimization - if a window is partially off-screen, we still need to draw
the entire thing as redirection means we won't get an expose event for it.

Additionally, when introducing invisible borders, something accidentally
slipped through: we were getting expose events on the invisible borders,
and they weren't in the cached pixels rect, so we were painting the theme
for them, even if we didn't actually paint anything with cairo. Make sure
to clip out the invisible borders instead of just the client rect so that
we don't draw if our expose event is on the invisible borders.

https://bugzilla.gnome.org/show_bug.cgi?id=675111
2012-05-21 12:51:32 -04:00
Jasper St. Pierre
fc87a635b2 frames: Remove expose_delayed
This was introduced for the effects API and wireframe mode, and was
forgotten when that went the way of the dinosaur.

https://bugzilla.gnome.org/show_bug.cgi?id=671104
2012-05-14 15:44:49 -03:00
Jasper St. Pierre
81930ca76e theme-parser: Look for themes in XDG_USER_DATA_DIR, not in ~/.themes
https://bugzilla.gnome.org/show_bug.cgi?id=675316
2012-05-14 14:25:55 -03:00
Jasper St. Pierre
da65738901 theme-parser: Don't load themes from our source tree
There aren't any mutter themes in the source tree. You're better off
using jhbuild with gnome-themes-standard.

https://bugzilla.gnome.org/show_bug.cgi?id=675316
2012-05-14 14:25:55 -03:00
Evan Broder
4148a5cc6a Fix introspection gir metadata
The EXPORT_PACKAGES variable to the GIR makefile should be the
packages needed to use this gir. It's also unnecessary to set PACKAGES
(which is just used for CFLAGS at scan-time) since CFLAGS is already
pulls in all necessary CFLAGS.

https://bugzilla.gnome.org/show_bug.cgi?id=671092
2012-05-02 14:13:48 -04:00
Pavel Vasin
8a6a568aca meta_stack_tracker_free(): fix memory leak
https://bugzilla.gnome.org/show_bug.cgi?id=672640
2012-05-02 14:03:56 -04:00
Pavel Vasin
12cc0cee29 display: correctly init and free hostname
==31043== 7 bytes in 1 blocks are definitely lost in loss record 213 of 6,861
==31043==    at 0x402B018: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==31043==    by 0x417789A: ??? (in /usr/lib/libglib-2.0.so.0.3122.0)
==31043==    by 0x4177C42: g_malloc (in /usr/lib/libglib-2.0.so.0.3122.0)
==31043==    by 0x418DC3A: g_strdup (in /usr/lib/libglib-2.0.so.0.3122.0)
==31043==    by 0x408C470: meta_display_open (display.c:475)
==31043==    by 0x40A4D42: meta_run (main.c:552)
==31043==    by 0x8048A74: main (mutter.c:96)

https://bugzilla.gnome.org/show_bug.cgi?id=672640
2012-05-02 14:03:34 -04:00
Jasper St. Pierre
878b1012b4 window-actor: Another simple clang warning fix
If we explicitly check for a NULL pointer, clang will assume
that the pointer may be NULL at some point. We clearly rely
on the pointer being non-NULL earlier, so fix this guy up.

https://bugzilla.gnome.org/show_bug.cgi?id=674876
2012-05-01 18:25:33 -04: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
Jasper St. Pierre
a24c512caa boxes: Remove an unnecessary assignment
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
Owen W. Taylor
ba4f008d40 meta_window_actor_has_shadow: remove verbosity
meta_window_actor_has_shadow() is called for every paint for every
window, verbosely logging in it makes the output of MUTTER_VERBOSE
pretty much useless.
2012-05-01 11:37:23 -04:00
Jasper St. Pierre
b0a099935b frames: Remove forgotten references to tooltips
Tooltips were removed a little while back, but two historical artifacts
were untouched. We're not in the museum business, now are we...
2012-04-30 16:36:18 -04:00
Jasper St. Pierre
ebf8c460e1 default plugin: Remove start method that does nothing
All animations use the constants directly, so this is just declaring
a bunch of local variables and then doing nothing with it.

Another clang warning.

https://bugzilla.gnome.org/show_bug.cgi?id=674876
2012-04-26 15:07:46 -04:00
Jasper St. Pierre
25d3432eee window-group: Remove an unnecessary assignment
Clang warns about this.

https://bugzilla.gnome.org/show_bug.cgi?id=674876
2012-04-26 15:07:46 -04:00
Jasper St. Pierre
cd7a74fbcd texture-tower: Remove potential leak
The expression in here does not match the one where we malloc the
data.

https://bugzilla.gnome.org/show_bug.cgi?id=674876
2012-04-26 10:02:41 -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
1b649c18ed Remove live-hidden-windows from mutter-schemas.convert
The preference no longer exists.
2012-04-26 02:37:34 -04:00
Owen W. Taylor
93037e4c6b Make support for "XFree86" Xinerama mandatory
Require the headers for "XFree86" Xinerama to be present at compile
time. The older "Solaris" Xinerama is only needed for versions of
Solaris where Mutter is unlikely to work. Solaris 10 and 11 include
the XFree86 Xinerama libraries, and apparently that's the only version
that will actually work for Solaris 11, which uses Xorg.

https://bugzilla.gnome.org/show_bug.cgi?id=674727
2012-04-25 14:37:32 -04:00
Neil Roberts
ed358c8f4b meta-texture-rectangle: Use Cogl's API to create a rectangle texture
Cogl now has public experimental API to create a rectangle texture
which we can use instead of creating a foreign texture with GL. This
avoids Mutter depending on Cogl including a GL header from its public
headers which it might not do in future.

https://bugzilla.gnome.org/show_bug.cgi?id=672711
2012-04-25 14:54:09 +01:00
Robert Bragg
a22859a64a shaped-texture: never slice shape mask texture
Since Cogl doesn't support multi-texturing with sliced textures and the
shape texture is combined with the texture-from-pixmap texture we need
to make sure we never construct a sliced mask texture. This patch simply
passes the COGL_TEXTURE_NO_SLICE flag to cogl_texture_from_data when
creating the shape mask texture.

https://bugzilla.gnome.org/show_bug.cgi?id=674731
2012-04-25 11:57:33 +01:00
Jasper St. Pierre
c44438b19f Revert "Remove a bunch of dead code"
This reverts commit 0d794f28f0.

I thought this was marked ACN. It wasn't.
2012-04-24 18:02:33 -04:00
Jasper St. Pierre
b58366d3ad theme: Remove unused "widget" parameter to frame style drawing
It seems that the only usage of the "widget" parameter throughout
the entire call chain was to pass between two function calls as
mutual recursion.

https://bugzilla.gnome.org/show_bug.cgi?id=671104
2012-04-24 16:54:49 -04:00
Jasper St. Pierre
6900128b2f theme: Remove unused entry points
meta_draw_op_draw, meta_draw_op_list_draw, and meta_frame_style_draw were
all unused

https://bugzilla.gnome.org/show_bug.cgi?id=671104
2012-04-24 16:54:49 -04:00
Jasper St. Pierre
c0b4d68390 meta-window-actor: Remove some unused constants
https://bugzilla.gnome.org/show_bug.cgi?id=671104
2012-04-24 16:54:49 -04:00
Jasper St. Pierre
0d794f28f0 Remove a bunch of dead code
Code isn't version control. We don't need bug links and commented out
code to remind us of how things were done originally.

https://bugzilla.gnome.org/show_bug.cgi?id=671104
2012-04-24 16:54:49 -04:00
Jasper St. Pierre
e389eff79d Remove meta_compositor_update_workspace_geometry
This callback is just dead code

https://bugzilla.gnome.org/show_bug.cgi?id=671104
2012-04-24 16:54:49 -04:00
Jasper St. Pierre
41adbdda12 prefs: Remove a dead declaration
https://bugzilla.gnome.org/show_bug.cgi?id=671104
2012-04-24 16:41:04 -04: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
Florian Müllner
9c97e8999e keybindings: Remove 'toggle-recording' binding
The keybinding is only useful when using GNOME Shell, so now that we
can define keybindings outside of mutter, move it there.

https://bugzilla.gnome.org/show_bug.cgi?id=674376
2012-04-24 17:36:46 +02:00
Florian Müllner
8809673a74 display: Cancel overlay key presses on mouse button events
Currently pressing the overlay key only triggers the overview if
no other key is pressed between KeyPress and KeyRelease. Extend
this logic to pointer events, so that KeyPress + ButtonPress actions
are treated explicitly different from "pure" overlay key presses.
In particular, this change allows to re-use the overlay key as mouse
button modifier.

https://bugzilla.gnome.org/show_bug.cgi?id=662476
2012-04-17 23:53:36 +02:00
Jasper St. Pierre
68321d9bf4 keybindings: Use a GSettings object rather than a schema, to support extensions
If we want to support keybindings from extensions installed in the user's
directory, we can't take a schema, as the GSettings object needs to have
a special GSettingsSchemaSource.

https://bugzilla.gnome.org/show_bug.cgi?id=673014
2012-04-16 20:31:45 -04:00
Giovanni Campagna
3aad30143c default plugin: use the right type for varargs
Coordinates in Clutter are double, so twice the size of an int, and
if not correctly casted memory corruption occurs.

https://bugzilla.gnome.org/show_bug.cgi?id=673809
2012-04-10 03:45:25 +02: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
Owen W. Taylor
c8b4939c7e Fix uninstalling default.so
We need a clean uninstall for 'make distcheck' to pass; libtool
hijinks leave a left-over plugins/default.so - remove it manually.
2012-03-26 14:23:19 -04:00
Jasper St. Pierre
23046f6e28 stack: Fix crash when opening a full-screen window
When mutter recognizes a full-screen window, it tries to raise it to the top
of the stack. Unfortunately, a recent rewrite of the stack code didn't do
well with raising a window to the top of the stack if the stack wasn't in
a consistent state -- it would crash. Ensure that the stack is in a consistent
state at the top of meta_stack_raise/meta_stack_lower.

https://bugzilla.redhat.com/show_bug.cgi?id=806437

https://bugzilla.gnome.org/show_bug.cgi?id=672797
2012-03-26 08:15:21 -03:00
Pavel Vasin
423bda908e meta_display_get_tab_list(): Fix leaked GSList
https://bugzilla.gnome.org/show_bug.cgi?id=672640
2012-03-24 19:30:00 +01:00
Pavel Vasin
98d427ddba meta_stack_update_window_tile_matches(): Fix leaked GList
https://bugzilla.gnome.org/show_bug.cgi?id=672640
2012-03-24 19:19:17 +01:00
Jasper St. Pierre
a3bf9b01aa workspace: Don't try to use per-workspace MRU lists as a hint for focusing
Commit 2fc880db switched from focusing the topmost window as the default
window to focusing the MRU window. This was done in alignment with the
introduction of per-workspace MRU lists to avoid problems where the window
stack was inadvertently changed when focusing windows during window switches.

Now that focusing windows don't have as big an impact on the stacking order,
we can revert back to focusing the top window, which is less confusing to the
user.

For now, leave per-workspace MRU lists, as they're a pretty good approximation
of a global MRU list, and it works well enough.

https://bugzilla.gnome.org/show_bug.cgi?id=620744
2012-03-20 17:08:34 -04:00
Jasper St. Pierre
402b477458 stack: Make meta_window_raise() and meta_window_lower() smarter
https://bugzilla.gnome.org/show_bug.cgi?id=620744
2012-03-20 17:08:34 -04:00
Lionel Landwerlin
78dc480e86 screen: don't use unreffed pointer 2012-03-19 14:58:32 +00:00
Jasper St. Pierre
5770b5b3c3 util: Quit early once we've found and removed a later
This prevents an invalid read and also improves performance slightly.

https://bugzilla.gnome.org/show_bug.cgi?id=672374
2012-03-19 02:00:03 -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
Stefano Facchini
8fb361cb26 Add META_TAB_LIST_NORMAL_ALL to MetaTabList enum
This is a new value, not associated with any keybindings, useful
when the WM needs to order the applications by last-interaction,
taking into account all windows.

https://bugzilla.gnome.org/show_bug.cgi?id=667552
2012-03-18 14:52:12 +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
a8ead4d447 MetaWindowActor: don't draw shadows for tiled windows with a match
The shadow between 2 tiled windows ruins the visual tiles effect.

https://bugzilla.gnome.org/show_bug.cgi?id=643075
2012-03-16 19:12:10 +01: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
Florian Müllner
8ca86fa8bf ui: Kill tooltips
After the changes in style handling in GTK+, mutter's tooltips no
longer match the tooltip style used in applications. Given that
all buttons in the default layout are well-known, killing tooltips
altogether rather than fixing the styling issues looks like a valid
approach.

https://bugzilla.gnome.org/show_bug.cgi?id=645101
2012-03-15 22:27:43 +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
Florian Müllner
5361e0259f display: Add accessor function for ignored_modifier_mask
Some modifiers like NumLock and ScrollLock don't make sense in
keybindings, which is why we ignore them when matching keybindings
to events. We should do the same in Javascript, so add an accessor
function.

https://bugzilla.gnome.org/show_bug.cgi?id=665215
2012-03-13 20:33:27 +01:00
Damien Radtke
04bf73ff6d default plugin: animate minimization to icon geometry
Instead of minimizing windows in place, minimize them to the icon
geometry for the window (if set), or to the upper-left corner if
it's not set.

https://bugzilla.gnome.org/show_bug.cgi?id=667437
2012-03-13 13:53:05 -04:00
Owen W. Taylor
047b9de1c6 Fix move-to-corner keybindings
The move-to-corner keybindings weren't treated as user actions, which
resulted in them not affecting the saved position - they weren't
always being treated as sticky. Marking them as a user action revealed
bugs in the positioning logic that were hidden by the constraint
code applied to automated moves. Fix those as well. Bug tracked
down by Mariusz Libera.

https://bugzilla.gnome.org/show_bug.cgi?id=661256
2012-03-13 12:19:07 -04:00
Jasper St. Pierre
0b7f2f8cd3 theme-viewer: Fix invisible borders
https://bugzilla.gnome.org/show_bug.cgi?id=662895
2012-03-13 00:48:29 -04:00
Jasper St. Pierre
efc90173b1 display: Add signals for plugins to know when a grab op begins/ends
https://bugzilla.gnome.org/show_bug.cgi?id=670658
2012-03-12 22:53:11 -04:00
Rui Matos
1d98f1fee8 prefs: Handle the new META_PREF_DYNAMIC_WORKSPACES enum value
Avoids a -Werror compiler error.
2012-03-12 01:10:27 +01:00
Florian Müllner
607dbf0f43 prefs: Add dynamic-workspaces setting
We currently sync the number of workspaces with the corresponding
preference. This is not really useful with GNOME Shell's dynamic
handling of workspaces, not least as the setting is effectively
ignored. Worse, it will trigger writes to dconf on login, slowing
down startup, so add a setting to indicate that workspaces are managed
dynamically and really ignore the num-workspaces setting when set.

https://bugzilla.gnome.org/show_bug.cgi?id=671568
2012-03-11 22:55:38 +01:00
Florian Müllner
7253a75b18 frames: Explicitly initialize style contexts
We were relying on GTK+ emitting GtkWidget::style-updated during
widget initialization to create the GtkStyleContexts used for
window decorations. A recent GTK+ update broke this assumption,
so do the necessary initialization ourselves.

https://bugzilla.gnome.org/show_bug.cgi?id=671796
2012-03-10 22:11:22 +01:00
Rui Matos
3f3e3ce37e plugins/default: Fix compiler error 2012-03-09 14:05:28 +01:00
Jasper St. Pierre
5e3d93da87 plugin: Remove unneeded wrapper APIs
Mutter originally started out with the idea that only a subset of the total
API was exposed to plugins, so some APIs are duplicated on MutterPlugin.
We've long since abandoned that idea; remove these wrappers.

https://bugzilla.gnome.org/show_bug.cgi?id=671103
2012-03-08 16:52:44 -05: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
Robert Bragg
d249cfd040 Pass CoglContext to cogl_texture_pixmap_x11_new()
The experimental Cogl api cogl_texture_pixmap_new() was recently changed
so it now expects an explicit CoglContext argument and it can also
return exceptions now via a GError. This patch updates mutters use of
the api accordingly.
2012-02-21 18:23:22 +00:00
Adel Gadllah
3cb912aee2 MetaShapedTexture: Implement get_paint_volume
Add a get_paint_volume implementation to MetaShapedTexture.
2012-02-21 18:09:25 +01: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
Jasper St. Pierre
0dab6df25a configure: Require Clutter 1.9.10
We depend on API introduced in Clutter 1.9.10. Additionally, remove
a compatibility fallback that isn't needed anymore.
2012-02-16 16:44:03 -05:00
Jasper St. Pierre
c844bab232 meta-background-actor: Chain up in dispose
This was preventing Clutter from running its dispose, preventing
it from being destroyed correctly. While a major bug and possibly
big memory leak, the most obvious effect was the message that Clutter
spat out:

  Clutter-CRITICAL **: clutter_actor_iter_next: assertion `ri->age == ri->root->priv->age' failed

Since we never disposed the actor correctly, it was never removed
from its parent, and the age wasn't updated correctly.
2012-02-16 16:29:33 -05:00
Jasper St. Pierre
7319b10d72 MetaShapedTexture: Remove visible_pixels_region
When we were shaping the window with a cairo region, there was an easy
optimization to restrict painting only to the pixels we were going to
actually draw. With rounded corners, the amount of work we have to do
figure out what pixels isn't worth the small savings of not drawing the
completely transparent parts of the corners, so remove this optimization,
and the supporting meta_shaped_texture_get_visible_pixels_region()

https://bugzilla.gnome.org/show_bug.cgi?id=657639
2012-02-03 19:58:21 -05:00
Jasper St. Pierre
1265efcf78 MetaShapedTexture: Add a new method to flatten the shaped texture into pixels
This will be used by the Shell to implement a screenshot_window method.

https://bugzilla.gnome.org/show_bug.cgi?id=660941
2012-02-03 19:57:38 -05:00
Jasper St. Pierre
3e0ef03fd9 MetaShapedTexture: Make public and directly derive from ClutterActor
ClutterTexture has many features that we simply don't use and don't make
sense for a subclass with custom drawing. Deriving directly from ClutterActor
simplifies our code by avoiding workarounds and makes things more robust.

Additionally, make it public. GNOME Shell was already assuming that any
MetaShapedTexture was also a ClutterTexture, and we need to replace these
bits with new API for GNOME Shell to use.

https://bugzilla.gnome.org/show_bug.cgi?id=660941
2012-02-03 15:35:41 -05:00
Rui Matos
fd404bafc8 screen: Remove harmless leftover argument
It compiled because it was picking index(3) from strings.h.
2012-01-26 15:27:50 +00:00
Owen W. Taylor
c0a440b852 Fix crash when meta_display_close() is called with attached modal dialogs
When meta_display_unmanage_window_for_screen() is called, it gets a list
of windows and iterates over them and unmanages them, but unmanaging a
window with attached modal dialogs also unmanages those attached modal
dialogs (in the normal case, temporarily), so we need to guard against
such cases by ref'ing the windows in the list and checking if they have
already been unmanaged.

https://bugzilla.gnome.org/show_bug.cgi?id=668299
https://bugzilla.redhat.com/show_bug.cgi?id=760918
2012-01-19 16:12:56 -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
44f362ad87 tile-preview: Remove non-composited case
The main reason for handling the non-composited case was to keep
code differences with metacity small, but the tiling patch[0] never
got merged. In mutter itself, the compositor is not optional, so
there's no good reason for keeping those untested code chunks around.

[0] https://bugzilla.gnome.org/show_bug.cgi?id=607694

https://bugzilla.gnome.org/show_bug.cgi?id=666039
2012-01-17 12:53:33 +01:00
Owen W. Taylor
e8209e7b22 Handle rename of GTK+'s window-unfocused state to backdrop
GTK_STATE_FLAG_WINDOW_UNFOCUSED was renamed to
GTK_STATE_FLAG_BACKDROP.
2012-01-09 19:03:27 -05:00
Jasper St. Pierre
2eb3ff4bfb prefs: Fix memory leak 2011-12-19 09:45:41 -05:00
Jasper St. Pierre
ac7ec585c8 compositor: Use raw Xlib to resize the compositor window
If we get two configure events on the root window in close
sequence, then we could get the sequence:

 ConfigureNotify on the root window w1xh1
   Processed by Mutter
 clutter_actor_set_size(stage, w1, h1)
 <relayout happens, stage window resized by clutter>

 ConfigureNotify on the root window, w2xh2
   Processed by Mutter
 clutter_actor_set_size(stage, w2, h2)
 ConfigureNotify on the stage window, w1, h1)
   Processed by Clutter
 clutter_actor_set_size(stage, w1, h1)
 <relayout happens, stage window resized by clutter>

Leaving the stage at the wrong size. To avoid fighting with Clutter,
switch to resizing the stage with XResizeWindow(), similar to how a
toplevel window is handled by a window manager.
2011-12-15 16:06:07 -05:00
Jasper St. Pierre
264c555af0 Do not use the default stage
https://bugzilla.gnome.org/show_bug.cgi?id=664028
2011-12-15 16:06:07 -05:00
Adel Gadllah
bbbb0e6002 meta-window-actor: Add error traps in meta_window_actor_set_redirected
meta_window_actor_set_redirected makes X calls on the client window
so it need to set error traps.
2011-12-15 19:53:41 +01:00
Lionel Landwerlin
41ae760454 Fix compilation with --disable-introspection
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@linux.intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=661871
2011-12-15 10:54:50 -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
Lionel Landwerlin
d64c5bfc11 screen: signal workspace creation from client applications
Using an external application using libwnck an external application
can create a new workspace by moving a window into it. In this case we
are currently missing a "workspace-added" signal emission.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@linux.intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=666015
2011-12-15 10:24:20 -05:00
Ryan Lortie
e4ed433e18 Add _DBUS_UNIQUE_NAME and _OBJECT_PATH properties
https://bugzilla.gnome.org/show_bug.cgi?id=664851
2011-12-15 10:21:22 -05:00
Colin Walters
8ab5cc8f19 Load _DBUS_APPLICATION_ID property, expose it via API
This is used to associate GtkApplication -> X window, and will
be consumed by gnome-shell.

https://bugzilla.gnome.org/show_bug.cgi?id=664851
2011-12-15 10:12:31 -05:00
Jasper St. Pierre
3a4512cd91 Use generic marshaller
https://bugzilla.gnome.org/show_bug.cgi?id=662153
2011-12-13 19:53:57 -05:00
Marc-Antoine Perennou
eb0185c1b1 followup to last commit: close comment
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2011-12-13 15:48:29 +01:00
Florian Müllner
34f6ffd1ad keybindings: Add toggle-tile-left/right bindings
Having keybindings for side-by-side tiling has been requested for
a long time, so add this support now.

https://bugzilla.gnome.org/show_bug.cgi?id=648700
2011-12-13 14:36:40 +01:00
Florian Müllner
baeb9fbc4b window: Make meta_window_can_tile_side_by_side() public
In order to support keybindings for window tiling, we need to
determine whether a window is tilable or not, so make this public.

https://bugzilla.gnome.org/show_bug.cgi?id=648700
2011-12-12 11:55:51 +01:00
Florian Müllner
c3d76aead6 window: Relax restrictions for can_tile_maximized ()
The current code requires windows to be resizable to be considered
for tiling, which excludes all maximized/tiled windows. While this
restriction concurs with the desired behavior for edge-tiling, it
feels overly restrictive for keybindings.
As the edge-tiling code in update_move() already ensures the above
restriction, it seems save to remove it from the can_tile_maximized()
function, assuming that windows that are not meant to be tiled or
maximized won't provide a maximize function.

https://bugzilla.gnome.org/show_bug.cgi?id=648700
2011-12-12 11:55:51 +01:00
Florian Müllner
bed9cb1648 window: Keep track of the last full-maximization state
In order to be able to toggle between tiled and normal/maximized
states, we need to keep track of the last full maximization state.

https://bugzilla.gnome.org/show_bug.cgi?id=648700
2011-12-12 11:55:50 +01:00
Florian Müllner
4ca552785f window: Queue a frame redraw after tiling
Usually tiling involves a size change and the frame is redrawn
automatically, however this is not the case when switching directly
between left- and right-tiled.
Ensure that a redraw happens in that case as well.

https://bugzilla.gnome.org/show_bug.cgi?id=648700
2011-12-12 11:55:50 +01:00
Florian Müllner
497f9be61e window: Listen for pref changes
The workspaces-only-on-primary preference changes how windows are
displayed, so listen for pref changes and update the visibility
accordingly.

https://bugzilla.gnome.org/show_bug.cgi?id=664853
2011-11-26 11:34:03 +01:00
Florian Müllner
0e50287aea keybindings: Allow to add/remove keybindings at runtime
Add meta_display_add_keybinding()/meta_display_remove_keybinding(),
which allow to add/remove keybindings dynamically at runtime.

https://bugzilla.gnome.org/show_bug.cgi?id=663428
2011-11-22 00:42:30 +01:00
Florian Müllner
d42a2a3c27 keybindings: Store keybindings dynamically
Rather than defining keybindings in static arrays generated at compile
time, store them in a hash table initialized in meta_display_init_keys()
and filled in init_builtin_keybindings().

This is a prerequisite for allowing to add/remove keybindings at runtime.

https://bugzilla.gnome.org/show_bug.cgi?id=663428
2011-11-22 00:42:30 +01:00
Rico Tzschichholz
b1a69d1e89 prefs: Fix typo 2011-11-14 20:13:56 +01:00
Florian Müllner
c5468ee391 prefs: Adapt to re-addition of a separate visual-bell option
Commit d0910da036 merged the visual-bell/visual-bell-type options,
but the change turned out too disruptive for gnome-control-center /
gnome-shell, so gsettings-desktop-schemas commit a5819b2a4e9 re-added
the separate option.
2011-11-14 15:43:48 +01:00
Rico Tzschichholz
1a51d307c8 Fix installation of mutter-schemas.convert 2011-11-11 21:39:54 +01:00
Florian Müllner
d0910da036 Port preferences to GSettings
Move preferences to GSettings, using mainly shared schemas from
gsettings-desktop-schemas.

Unlike GConf, GSettings support is not optional, as Gio is already
a hard dependency of GTK+.

https://bugzilla.gnome.org/show_bug.cgi?id=635378
2011-11-11 20:26:38 +01:00
Rico Tzschichholz
a2726f41c9 ui: Replace deprecated gtk_widget_size_request 2011-11-11 09:33:42 +01:00
Jasper St. Pierre
162213be0d Fix cogl crash from updating non-existent texture
The code here was always incorrect - we were processing damage events for
windows without having a texture. Before, this didn't matter, as
cogl_texture_get_width silently returned 0 for invalid handles. Cogl commit
4c3dadd35e changed this.

The fix here involves two strategies. First, we try to guard MetaTextureTower
from invalid textures. Second, we try not to go down the path that eventually
calls meta_shaped_texture_update_area by not handling damage events if we
don't have a texture for the window.

https://bugzilla.gnome.org/show_bug.cgi?id=660941
2011-11-10 16:40:12 -05:00
Jasper St. Pierre
1596d1af10 meta-window-group: Fix types typo
gboolean is a typedef for int, so it doesn't matter too much

https://bugzilla.gnome.org/show_bug.cgi?id=660941
2011-11-10 15:52:25 -05:00
Rui Matos
441287dc64 theme: handle GTK_STATE_FLAG_WINDOW_UNFOCUSED
This bumps the required GTK+ version to >= 3.3.3 .
2011-11-08 20:59:41 +00:00
Rui Matos
6e47f0e846 window: add _NET_WM_STATE_FOCUSED hint to _NET_WM_STATE
This hint reflects whether a window appears focused.

https://bugzilla.gnome.org/show_bug.cgi?id=661427
2011-11-08 19:19:32 +00:00
Tim Cuthbertson
4fb2fab7f7 window.c: add meta_window_move_resize_frame
meta_window_move_resize_frame operates much like
meta_window_move_resize, but ensures the window
and its frame (if present) will fit within the
specified dimensions.

https://bugzilla.gnome.org/show_bug.cgi?id=651899
2011-11-05 18:52:43 -04:00
Jasper St. Pierre
3beb33bb44 mutter-mag: Quit when the user hits escape
https://bugzilla.gnome.org/show_bug.cgi?id=662895
2011-10-28 21:21:57 -04:00
Jasper St. Pierre
1b04a40dce mutter-mag: Remove deprecated stuff
https://bugzilla.gnome.org/show_bug.cgi?id=662895
2011-10-28 21:21:56 -04:00
Jasper St. Pierre
8087872130 theme-viewer: Fix layout
https://bugzilla.gnome.org/show_bug.cgi?id=662895
2011-10-28 15:09:21 -04:00
Jasper St. Pierre
3ad25a62cd ui: Remove deprecated stuff
https://bugzilla.gnome.org/show_bug.cgi?id=662895
2011-10-28 15:09:21 -04:00
Jasper St. Pierre
7ecd673d23 mutter-window-demo: Remove deprecated stuff
https://bugzilla.gnome.org/show_bug.cgi?id=662895
2011-10-28 15:09:21 -04:00
Jasper St. Pierre
ec1979f9f5 theme-viewer: Update to fix GTK+ deprecations
Replace the GtkTable with a GtkGrid, replace GtkH/VBox with GtkBox
and junk a GtkHandleBox.

https://bugzilla.gnome.org/show_bug.cgi?id=662574
2011-10-25 09:42:16 -04:00
Jasper St. Pierre
4b411ea241 tabpopup: Update to fix GTK+ deprecations
Replace the GtkTable with a GtkGrid, replace GtkH/VBox with GtkBox

https://bugzilla.gnome.org/show_bug.cgi?id=662574
2011-10-25 09:42:11 -04:00
Jasper St. Pierre
70db187c36 frames: Don't use deprecated API to grab pointer position
https://bugzilla.gnome.org/show_bug.cgi?id=662574
2011-10-25 09:42:04 -04:00
Jasper St. Pierre
821d4458ea Minor annotation fixes. 2011-10-24 17:06:17 -04:00
Jasper St. Pierre
7f9472a58f util: Fix memory leak in meta_later_remove
We never destroy the later list that's added by meta_later_add.

==4289== 16 bytes in 1 blocks are definitely lost in loss record 1,632 of 7,258
==4289==    at 0x4C2640D: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4289==    by 0x5178D9F: standard_malloc (gmem.c:88)
==4289==    by 0x5178E37: g_malloc (gmem.c:164)
==4289==    by 0x51924B5: g_slice_alloc (gslice.c:842)
==4289==    by 0x5194521: g_slist_insert_sorted_real (gslist.c:900)
==4289==    by 0x519465A: g_slist_insert_sorted (gslist.c:957)
==4289==    by 0x4EA609A: meta_later_add (util.c:876)
==4289==    by 0x4E9C330: meta_screen_queue_workarea_recalc (screen.c:2640)
==4289==    by 0x4E9A360: update_num_workspaces (screen.c:1646)
==4289==    by 0x4E99026: meta_screen_new (screen.c:924)
==4289==    by 0x4E7AB51: meta_display_open (display.c:803)
==4289==    by 0x4E9168E: meta_run (main.c:552)

https://bugzilla.gnome.org/show_bug.cgi?id=642652
2011-10-21 15:44:50 -04:00
Jasper St. Pierre
3599917123 meta-window-group: Use clutter_actor_has_effects if available
This avoids a potentially costly allocation on every pixmap update.

https://bugzilla.gnome.org/show_bug.cgi?id=662225
2011-10-21 09:20:46 -04:00
Jasper St. Pierre
d624e85bc1 frames: Disable the titlebar "inner resize"
Since invisible draggable borders have been around, there isn't really a big
need for this feature

https://bugzilla.gnome.org/show_bug.cgi?id=660129
2011-10-21 09:16:39 -04:00
Rui Matos
6aa4bfd060 tiling: do not tile if moving in snap mode
If we are moving in snap mode (shift pressed) we don't want to tile. We must
also cancel any pending tiling if snap mode is activated during the move drag.

https://bugzilla.gnome.org/show_bug.cgi?id=662270
2011-10-20 16:18:38 +01:00
Jasper St. Pierre
bb035fe6e0 window: Correct coordinates for the configure event
We should still correct the coordinates for withdrawn windows.
2011-10-17 21:53:58 -04:00
Jasper St. Pierre
6d0c1f08d2 frame: Make sure to offset by invisible borders when unmanaging windows
When we reparent a window to the root when we're exiting, we need to offset
the position by the invisible borders, otherwise windows will creep up and
to the left.

https://bugzilla.gnome.org/show_bug.cgi?id=660848
2011-10-17 21:53:58 -04:00
Jasper St. Pierre
f700a7be07 Make meta_display_unmanage_screen public
https://bugzilla.gnome.org/show_bug.cgi?id=660848
2011-10-17 21:53:58 -04:00
Rui Matos
138eb1e3b4 tiling: keep track of the monitor where a window was tiled
meta_window_get_current_tile_area() computes the area where the tiled window
should be based on the current pointer position but that's only meaningful
when the user is actually dragging the window.

When running the tiling constrain the pointer might be on other monitor and at
that point the window jumps to this other monitor.

https://bugzilla.gnome.org/show_bug.cgi?id=642580
2011-10-18 02:40:36 +01:00
Rui Matos
c39129b6e8 tiling: for tiled maximization use the tile area as target size/position
When using more than one monitor, tiled maximization can be triggered with the
pointer in one monitor while most of the window area remains in another. This
means that the maximization constraint would maximize the window into the wrong
monitor as it uses the work area size/position as target.

Fix this by using the current tile area as target size/position.

https://bugzilla.gnome.org/show_bug.cgi?id=657519
2011-10-18 02:33:41 +01:00
Rui Matos
bf175e72ad MetaWindowActor: don't unredirect ARGB32 windows
In particular this would a cause a "flash" when showing the tile preview for
maximization on a non-primary monitor.

https://bugzilla.gnome.org/show_bug.cgi?id=662053
2011-10-18 02:33:34 +01:00
Owen W. Taylor
ba31ba4615 Update window->has_resize_func at the right time when unfullscreening
Since the frame window size that meta_window_move_resize() uses depends
on whether the window has horizontal/vertical resize functionality, we
need to update this flag before we resize the window.

https://bugzilla.gnome.org/show_bug.cgi?id=659854
2011-10-17 15:08:00 -04:00
Owen W. Taylor
f94f008ed6 window.c: use a consistent mapping from frame_type => decorated
If a window had a type hint intended for override-redirect windows
like NOTIFICATION, we ended up with a window that was decorated but
with a frame type of FRAME_TYPE_LAST, causing assertion failures.
Fix this by making recalc_window_features() just call
meta_window_get_frame_type().

https://bugzilla.gnome.org/show_bug.cgi?id=599988
2011-10-17 11:58:10 -04:00
Matthias Clasen
9d4f3c5842 Allow keyboard ops to work without a pointer grab
https://bugzilla.gnome.org/show_bug.cgi?id=660457
2011-10-15 22:50:45 +02:00
Sandro Mani
28deea44d4 theme: Remove outdated assertion
The theme state used to use GtkStateType, but was ported over to GtkStateFlags,
leaving behind a broken assertion that fails when using certain Metacity
themes, for example Nodoka.

https://bugzilla.gnome.org/show_bug.cgi?id=661286
2011-10-08 17:27:12 -04:00
Jasper St. Pierre
f82966adb5 Various annotation fixes
https://bugzilla.gnome.org/show_bug.cgi?id=660854
2011-10-04 16:44:39 -04:00
Rui Matos
9f54f1d75d frame: destroy window->frame_bounds when destroying the frame
Since window->frame_bounds is used as a cache we need to invalidate it when
destroying the frame.

https://bugzilla.gnome.org/show_bug.cgi?id=660773
2011-10-04 12:47:42 +01:00
Jasper St. Pierre
be9f7d7729 theme: Don't add invisible borders for windows that can't be resized
Invisible borders are all about resizing -- in the case that a window
cannot be resized, it makes no sense to add them.

https://bugzilla.gnome.org/show_bug.cgi?id=659854
2011-09-29 16:19:38 -04:00
Adel Gadllah
1b4dce6f84 meta-window-group: Plug memory leak
We have to free the list returned by clutter_actor_get_effects() .

https://bugzilla.gnome.org/show_bug.cgi?id=660464
2011-09-29 15:36:10 +02:00
Jasper St. Pierre
c4692b8d51 window: Fix _NET_FRAME_EXTENTS to work properly
_NET_FRAME_EXTENTS should contain the difference between where a window asked
to be placed, and where it is. Ideally, this should be the same as the visible
extents.

https://bugzilla.gnome.org/show_bug.cgi?id=659848
2011-09-24 13:21:25 -04:00
Jasper St. Pierre
764569eb7a window: Fix window placement to exclude invisible borders
A window can specify geometry that it is placed at. We need to exclude invisible
borders when calculating where to place the window, otherwise the window will have
a strange offset.

https://bugzilla.gnome.org/show_bug.cgi?id=659848
2011-09-24 13:21:25 -04:00
Jasper St. Pierre
00e49b330c frames: Take out accidental south resize disable of attached dialogs
https://bugzilla.gnome.org/show_bug.cgi?id=657795
2011-09-20 15:30:29 -04:00
Adel Gadllah
7c6bc73031 MetaWindowActor: Skip paint optimization for actors with an effect
The optimizations might not work for an actor with an effect, and
our clipped drawing interferes badly with the operation of
CoglOffscreenEffect.

https://bugzilla.gnome.org/show_bug.cgi?id=659523
2011-09-20 20:52:03 +02:00
Rui Matos
c1368155fc MetaWindowActor: unset the shaped texture overlay path for frameless windows
When a window loses its frame we must unset any overlay path previously set on
the shaped texture.

Not doing so would cause rendering glitches near the window corners in
e.g. chrome/chromium by changing the Appearance preference "Use system title
bar and borders" → "Hide system title bar and use compact borders".

https://bugzilla.gnome.org/show_bug.cgi?id=659477
2011-09-19 18:52:43 +01:00
Florian Müllner
6087a71951 theme: Don't add any bottom border to shaded windows
Shaded windows are assumed to be reduced to the titlebar: the
current code enforces a visible bottom border of 0 and only takes
the size of the title bar (+ invisible top border) into account
when resizing the frame. However, we still add an invisible border
at the bottom, which is than subtracted from the title bar, resulting
in shaded windows being cut off.
Fix by forcing both visible and invisible bottom borders to 0.

https://bugzilla.gnome.org/show_bug.cgi?id=659266
2011-09-17 03:50:37 +02:00
Jasper St. Pierre
5f1c3de29a frames: Fall back to title bar if nothing else matched
The condition got removed in eeb2efe010 but that
had a side effect of adding a couple of rows of dead pixels so add it back.

https://bugzilla.gnome.org/show_bug.cgi?id=658069
2011-09-16 18:16:37 -04:00
Adel Gadllah
abde64cb0c Don't unredirect non fully opaque windows
When a window is set to be translucent with _NET_WM_WINDOW_OPACITY it shouldn't
be unredirected as this will cause the hint to have no effect.
2011-09-16 21:39:03 +02:00
Adel Gadllah
6923973c8a compositor: Fix cow shaping on multi monitor setups
XFixesCreateRegionFromWindow does not take the window's position into account,
which results into setting a wrong shape for windows not located on the
leftmost monitor.

Fix that by creating the region from the window's MetaRectangle.

https://bugzilla.gnome.org/show_bug.cgi?id=657869
2011-09-16 19:02:11 +02:00
Jasper St. Pierre
4a5c7ee4cc theme: Attached modal dialogs should have no top invisible border
If we do this, then there will be invisible borders around the top of attached
modal dialogs, which is unnecessary -- they can't be resized from the top
border and just interfere with the parent dialog.

This requires changing a bit of API to help identify the type of dialog.

https://bugzilla.gnome.org/show_bug.cgi?id=657795
2011-09-14 20:03:41 -04:00
Jasper St. Pierre
f3bb16f301 theme: Remove meta_theme_draw_frame_by_name
It was unused, and isn't really useful.

https://bugzilla.gnome.org/show_bug.cgi?id=657795
2011-09-14 20:03:41 -04:00
Jasper St. Pierre
d6b528a955 Disable top resizing for attached modal dialogs, for real this time
https://bugzilla.gnome.org/show_bug.cgi?id=657795
2011-09-14 20:03:40 -04:00
Rui Matos
7ba6503e9b display: trivial code clean up
Remove redundant if statement.
2011-09-14 23:30:29 +01:00
Owen W. Taylor
2dc5693c60 Don't lose application redraws
Our usage of DamageReportBoundingBox was causing us to miss some
updates when an area of the screen was drawn twice in rapid
succession. Add an explicit XSync() call to force the server
to flush rendering to the kernel before we draw.

https://bugzilla.gnome.org/show_bug.cgi?id=657071
2011-09-14 14:36:52 -04:00
Alexander Larsson
19b6888ea5 When monitors change, keep windows on same output.
If XRANDR is availible, we track the first (or primary) output per
crtc (== xinerama monitor) so when the monitors change we can try
to find the same output and move windows there. If we can't find the
original monitor in the new set (or XRANDR is not supported) we move
the window to the primary monitor.

https://bugzilla.gnome.org/show_bug.cgi?id=645408
2011-09-14 15:38:55 +02:00
Jasper St. Pierre
9520eaa970 MetaShapedTexture: Fix a crash caused by a silly typo 2011-09-13 20:15:22 -04:00
Jasper St. Pierre
088e0c1ee7 MetaWindowActor: Make sure to always pop an error trap
https://bugzilla.gnome.org/show_bug.cgi?id=658228
2011-09-13 13:42:06 -04:00
Jasper St. Pierre
de704386a1 Revert "MetaWindowActor: Delete useless error trap"
This reverts commit 766799ec6d.
2011-09-13 13:41:43 -04:00
Jasper St. Pierre
766799ec6d MetaWindowActor: Delete useless error trap
https://bugzilla.gnome.org/show_bug.cgi?id=658228
2011-09-13 13:40:26 -04:00
Adel Gadllah
7c50db5bf5 meta-window-actor: Skip unnecessary steps in pre_paint
We don't have to call check_needs_pixmap, check_needs_reshape
and check_needs_shadow on unredirected windows, so skip that.

https://bugzilla.gnome.org/show_bug.cgi?id=658228
2011-09-13 13:40:11 -04:00
Rui Matos
7223c4e184 window: remove warning about _NET_WM_MOVERESIZE's lack of timestamps
The comments in the code about the protocol's inadequacies are enough, there's
no need to spam our standard outputs.
2011-09-12 18:46:47 +01:00
Owen W. Taylor
e1362562b4 MetaDisplay: Renamed 'ignored_serials' for clarity
The ignored_serials member of Display refers explicitly to crossing
serials - rename the member and associated functions and constants
for clarity.

https://bugzilla.gnome.org/show_bug.cgi?id=597190
2011-09-12 09:56:59 -04:00
Owen W. Taylor
1ab6abc044 focus-follows-mouse: ignore events generated when reshaping the stage
* Export meta_display_add_ignored_crossing_serial()
* Add the serial for reshaping the stage
* Increase the size of the "ignored_serials" array a bit to
  try to avoid the possibility of losing serials from multiple
  reshapes happening close together.

https://bugzilla.gnome.org/show_bug.cgi?id=597190
2011-09-12 09:56:59 -04:00
Matthias Clasen
818320e748 Don't show a title on alerts
This goes better with the general style of similar alerts throughout
GNOME 3, and as has been pointed out in bug 591735, 'Mutter' is
a somewhat unfortunate title in several lanuages, such as English
and German.
2011-09-06 12:51:53 -04:00
Owen W. Taylor
7af6aa9739 Additional annotation fixes
* At least one line (possibly blank) is required after a function name for a doc header
  to be parsed correctly.

* SnStartupSequence isn't a type known to introspection
2011-08-30 15:12:09 -04:00
Jasper St. Pierre
faae2daae8 Add (element-type) annotations to make gobject-introspection happy 2011-08-30 12:54:49 -04:00
Jasper St. Pierre
0b4cc14aa6 frames: Fix the visible region when we have a rounded bottom-right corner
https://bugzilla.gnome.org/show_bug.cgi?id=657661
2011-08-30 10:55:06 -04:00
Jasper St. Pierre
622583a0d5 MetaWindowActor: Corner paths needs to be made in clockwise order
https://bugzilla.gnome.org/show_bug.cgi?id=657661
2011-08-30 10:55:06 -04:00
Adel Gadllah
2f33d85a41 compositor: Fix crash in pre_paint_windows when no windows are open
https://bugzilla.gnome.org/show_bug.cgi?id=657692
2011-08-30 15:20:34 +02:00
Adel Gadllah
ada8882b61 Fix typo 2011-08-29 23:18:51 +02:00
Adel Gadllah
d3831729a0 Unredirect fullscreen windows
Some apps that do a lot of rendering on the screen like games, mostly run in
fullscreen where there is no need for them to be redirected doing so does add
an overhead; while performance is critical for those apps.

This can be disabled / enabled at runtime using
meta_enable_unredirect_for_screen / meta_disable_unredirect_for_screen

https://bugzilla.gnome.org/show_bug.cgi?id=597014
2011-08-29 23:05:30 +02:00
Jasper St. Pierre
05fee9beea Account for invisible borders when constraining modal dialogs
https://bugzilla.gnome.org/show_bug.cgi?id=656619
2011-08-29 13:00:26 -04:00
Jasper St. Pierre
e4da6495d3 Disable top resizing for attached modal dialogs
https://bugzilla.gnome.org/show_bug.cgi?id=656619
2011-08-29 13:00:26 -04:00
Jasper St. Pierre
8c74ad1992 MetaWindowActor: Don't use uninitialized frame borders
https://bugzilla.gnome.org/show_bug.cgi?id=656335
2011-08-29 12:58:05 -04:00
Rui Matos
88064fd534 MetaBackgroundActor: fix a typo
https://bugzilla.gnome.org/show_bug.cgi?id=657583
2011-08-29 16:54:29 +01:00
Rui Matos
b28c6533f8 MetaBackgroundActor: make it a public class
https://bugzilla.gnome.org/show_bug.cgi?id=656433
2011-08-29 16:54:09 +01:00
Rui Matos
53e70b3e99 MetaBackgroundActor: add a dim-factor property
This property darkens the background.

https://bugzilla.gnome.org/show_bug.cgi?id=656433
2011-08-29 15:40:20 +01:00
Owen W. Taylor
c630046858 MetaBackgroundActor: allow creating multiple instances
Instead of requiring a singleton MetaBackgroundActor for the screen,
allow creating multiple copies that internally share a single
CoglTexture behind the scenes. This will be useful for allowing
multiple views of the screen background with different rendering
options.

https://bugzilla.gnome.org/show_bug.cgi?id=656433
2011-08-29 07:51:12 -04:00
Dan Winship
368a90c82a test-attached: new program for testing attached dialogs
https://bugzilla.gnome.org/show_bug.cgi?id=646761
2011-08-27 13:12:25 -04:00
Dan Winship
2be1574e55 window: only attach dialogs to NORMAL, DIALOG, and MODAL_DIALOG windows
Attaching dialogs to unusual windows (like the desktop) looks bad, so
don't do it.

https://bugzilla.gnome.org/show_bug.cgi?id=646761
2011-08-27 13:12:25 -04:00
Dan Winship
7f8c59614e window: make determination of attached dialog windows more consistent
Different bits of code were using slightly different checks to test
whether a window was an attached dialog. Add a new
meta_window_is_attached_dialog(), and use that everywhere.

Also, freeze the is-attached status when the window is first shown,
rather than recomputing it each time the caller asks, since this could
cause problems if a window changes its type after it has already been
attached, etc. However, if an attached window's parent is destroyed,
or an attached window changes its transient-for, then fix things up by
destroying the old MetaWindow and creating a new one (causing
compositor unmap and map events to be fired off, allowing the display
of the window to be fixed up).

Remove some code in display.c that tried to fix existing windows if
the gconf setting changed, but which didn't actually do anything (at
least under gnome-shell). However, if 654643 was fixed then the new
behavior with this patch would be that changing the gconf setting
would affect new dialogs, but not existing ones.

https://bugzilla.gnome.org/show_bug.cgi?id=646761
2011-08-27 13:12:25 -04:00
Jasper St. Pierre
978e601217 MetaWindowActor: Don't use truncated values when drawing the cairo overlay path
This was causing visual artifacts on large border radius values.
2011-08-26 21:50:20 -04:00
Jasper St. Pierre
dcfa6986c6 Antialiased corners
Use a specially constructed cairo overlay to give us fully anti-aliased
corners on the mask texture.

https://bugzilla.gnome.org/show_bug.cgi?id=628195
2011-08-26 12:24:23 -04:00
Jasper St. Pierre
49a3fd53b0 MetaShapedTexture: Allow for a "cairo overlay"
A cairo overlay gives us a path to overlay the mask texture data, allowing for
complex, anti-aliasing effects on the frame shape.

https://bugzilla.gnome.org/show_bug.cgi?id=628195
2011-08-26 12:24:22 -04:00
Jasper St. Pierre
d33d113746 frame: Add "get_corner_radiuses" chain
https://bugzilla.gnome.org/show_bug.cgi?id=628195
2011-08-24 09:38:23 -04:00
Jasper St. Pierre
f83568fc4e MetaShapedTexture: Use a proper stride, calculated by cairo
This will help us when painting directly on to the mask texture with
cairo, which is needed for rounded corner AA.

https://bugzilla.gnome.org/show_bug.cgi?id=628195
2011-08-24 09:38:23 -04:00
Jasper St. Pierre
46415bb248 MetaWindowActor: Fix incorrect short-circuit
The code here was wrong in every way: it only updated the shape if all the
borders changed. It never saved new last_borders even if it *had* changed,
and the bounding rectangle's x and y positions were still important otherwise.

This had user-visible impact when doing simple things like changing the
border_width. It would short-circuit here and due to the above incorrectness,
weirdness could happen where windows would be cut off and so on.

https://bugzilla.gnome.org/show_bug.cgi?id=656334
2011-08-24 09:38:23 -04:00
Florian Müllner
a485685867 theme: Allow disabling fallback colors in gtk:custom()
gtk:custom() requires a fallback color in case the GTK+ theme in use
does not define the desired color. As in general the fallback color
will approximate the intended color, there is the risk of typos going
unnoticed. To make catching these kind of errors easier, allow to ignore
the fallback color specified (and fall back to a nice shade of pink
instead) by setting an environment variable.

https://bugzilla.gnome.org/show_bug.cgi?id=656112
2011-08-10 18:05:11 +02:00
Jasper St. Pierre
2f254e5aa3 MetaWindowActor: Compensate for invisible borders
https://bugzilla.gnome.org/show_bug.cgi?id=644930
2011-08-09 17:14:51 -04:00
Jasper St. Pierre
e0e78993f6 MetaWindowActor: Remove priv->attrs
It was deprecated and most of the information was in the MetaWindow anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=644930
2011-08-09 17:14:51 -04:00
Jasper St. Pierre
eeb2efe010 ui: Replace inline borders in MetaFrameGeometry with MetaFrameBorder
... and start compensating for invisible borders in all of the math.

https://bugzilla.gnome.org/show_bug.cgi?id=644930
2011-08-09 17:14:51 -04:00
Jasper St. Pierre
be4ef9b43d MetaWindow: Compensate for invisible border changes
https://bugzilla.gnome.org/show_bug.cgi?id=644930
2011-08-09 17:14:51 -04:00
Jasper St. Pierre
a133d8b42e MetaWindow: Repurpose get_outer_rect and add get_input_rect
get_outer_rect now returns the visible region, and a new get_input_rect
method returns the boundaries of the full frame, including the possible
invisible regions. When undecorated, both do the samething.

https://bugzilla.gnome.org/show_bug.cgi?id=644930
2011-08-09 17:14:51 -04:00
Jasper St. Pierre
a1a2527c75 MetaFrameBorders: Add invisible borders
This just adds the invisible border field and populates it with data
but doesn't use it in any way.

https://bugzilla.gnome.org/show_bug.cgi?id=644930
2011-08-09 17:14:51 -04:00
Jasper St. Pierre
6f5882302f prefs: Add draggable_border_width preference
https://bugzilla.gnome.org/show_bug.cgi?id=644930
2011-08-09 17:14:51 -04:00
Jasper St. Pierre
ce9c7a210d MetaFrameBorders: Add meta_frame_borders_clear
Just a quick little commit to help clean things up for when we add invisible
borders. Additionally, do a little housekeeping in preview-widget as well.

https://bugzilla.gnome.org/show_bug.cgi?id=644930
2011-08-09 17:14:51 -04:00
Jasper St. Pierre
e0fb83c691 Replace public MetaFrameGeometry with MetaFrameBorders
There were actually *two* MetaFrameGeometry structs: one in theme-private.h,
one in frame.h. The latter public struct was populated by a mix of (void*)
casting and int pointers, usually pulling directly from the data in the private
struct.

Remove the public struct, replace it with MetaFrameBorders and scrap all
the pointer hacks to populate it, instead relying on both structs being used
in common code.

This commit should be relatively straightforward, and it should not do any
tricky logic at all, just a sophisticated find and replace.

https://bugzilla.gnome.org/show_bug.cgi?id=644930
2011-08-09 17:14:50 -04:00
Jasper St. Pierre
7e0a56fb80 Track the shape of the client window directly
Since we're not setting the frame's output shape any more, it doesn't
make sense to calculate the output shape based on the frame window.
Instead, track the client window directly and calculate the output shape
based on that.

https://bugzilla.gnome.org/show_bug.cgi?id=644930
2011-08-09 17:14:50 -04:00
Jasper St. Pierre
65e1b416ef Port MetaShapedTexture/MetaWindowActor to use cairo regions instead of XRects
https://bugzilla.gnome.org/show_bug.cgi?id=644930
2011-08-09 17:14:50 -04:00
Jasper St. Pierre
183bcd6fc7 Stop shaping the frame window
In preparation for switching to handling the output shape purely by what we
paint, stop applying a shape to the frame of the window. Even when we restore
handling the output shape, this will change the behavior with respect to input;
transparent areas between the frame and the contents will stop clicks rather
than passing them through, but that is arguably at least as expected
considering how that we decorate shaped windows with a frame all around.

https://bugzilla.gnome.org/show_bug.cgi?id=644930
2011-08-09 17:14:50 -04:00
Tim Cuthbertson
f76372dd7d MetaWindow: Add :resizable and :above properties
Allow libmutter users to treat windows different based on these
attributes and to watch for changes.

https://bugzilla.gnome.org/show_bug.cgi?id=653858
2011-08-09 04:58:18 -04:00
Rui Matos
d3edcbc11e window: remove redundant condition
This condition is already checked for at this point.
2011-07-27 01:42:25 +01:00
Rui Matos
779ef582f1 prefs: Initialize button_layout struct even on pref string corner cases
We were leaving some members of the button_layout struct uninitialized if the
pref string didn't have at least one colon or if it was an empty string ("").

https://bugzilla.gnome.org/show_bug.cgi?id=654539
2011-07-24 01:41:25 +01:00
Emmanuele Bassi
f396a7aeb4 Do not use ClutterGLXTexturePixmap
MetaShapedTexture can be a ClutterX11TexturePixmap sub-class, given that
ClutterGLXTexturePixmap is just a shim compatibility layer since Clutter
1.4, and it's been deprecated.

https://bugzilla.gnome.org/show_bug.cgi?id=655064
2011-07-22 10:49:04 +01:00
Emmanuele Bassi
ffa2310a34 Use Cogl API to check for TfP extension support
Do not use the ClutterGLXTexturePixmap method, since it's been
deprecated and it's just a convenience function around the Cogl
API anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=655064
2011-07-22 10:49:04 +01:00
Neil Roberts
fccd626604 Use a utility function to create GL_ARB_texture_rectangles
meta-texture-rectangle and meta-shaped-texture both create textures
with GL_TEXTURE_RECTANGLE_ARB as the target using direct GL
calls. This patch moves that code into a shared utility function in a
separate file instead. The function resolves the required GL symbols
dynamically instead of linking to them directly so that if Clutter
eventually stops linking to -lGL mutter will continue to build. The
function also splits the texture creation into a separate texture
creation and data upload stage so that it can use
cogl_texture_set_region to upload the data. That way it can avoid
clobbering the glPixelStore state and it can let Cogl do any necessary
format conversion. The code preserves the old value of the rectangle
texture binding instead of clobbering it because Cogl expects to be
able to cache this value to avoid redundant glBindTexture
calls. Finally, the function uses cogl_object_set_data to
automatically destroy the GL texture when the Cogl texture is
destroyed. This avoids having to have special code to destroy the cogl
texture.

https://bugzilla.gnome.org/show_bug.cgi?id=654569
2011-07-19 11:06:23 +01:00
Jasper St. Pierre
5237b2aa65 Fix dump_region 2011-07-18 16:49:10 -04:00
Adel Gadllah
3f694c7335 MetaTextureTower: Remove workaround for old clutter bug
texture_tower_revalidate_fbo() called cogl_flush() to work around
clutter bug #2110, which has been long fixed.

As we depend on clutter 1.7.x anyway we can just remove that workaround.

https://bugzilla.gnome.org/show_bug.cgi?id=654729
2011-07-16 14:24:31 +02:00
Adel Gadllah
3da2f876bd Use paint volumes unconditionally
As we depend on clutter 1.7.x we no longer need to the 1.5.2
version check for paint volumes so just remove it.

https://bugzilla.gnome.org/show_bug.cgi?id=654730
2011-07-16 14:20:51 +02:00
Neil Roberts
4167ef870c meta-window-group: Use clutter_stage_get_redraw_clip_bounds
Clutter now has some API to get the bounds of the current redraw clip
so Mutter no longer needs to make direct GL calls to get the scissor
rect. This should make it more robust against Cogl or Clutter changing
how it does the clipping.

https://bugzilla.gnome.org/show_bug.cgi?id=654551
2011-07-13 16:39:50 +01:00
Dan Winship
cd7a968093 util: fix a reentrancy problem with meta_later
Calling meta_later_add() or meta_later_remove() from within a
META_LATER_BEFORE_REDRAW callback ended up being a no-op, because of
how run_repaint_laters() was fiddling with the laters list. (This
resulted in a crash in window.c:idle_calc_repaint(), which assumed it
would only be called when a certain queue was non-empty, but was
getting called anyway because of a failed meta_later_remove() call.)

Fix this by having run_repaint_laters() work on a copy of the laters
list instead, and add refcounting to MetaLater so that removing a
later that run_repaint_laters() hasn't gotten to yet won't cause
problems.

https://bugzilla.gnome.org/show_bug.cgi?id=642957
2011-07-13 10:40:41 -04:00
Owen W. Taylor
12f71c9795 Improve handling of <Super>key combinations
When we get a press of the overlay key, and then another key is pressed,
first try to handle the combination as a global keybinding. If that fails,
call XAllowEvents(..., ReplayKeyboard, ...) to let it be handled by
our per-window keybindings or by the application.

This requires restructuring things to call XAllowEvents a bit later
so we can pass the right mode.

https://bugzilla.gnome.org/show_bug.cgi?id=624869
2011-07-13 09:44:33 -04:00
Dan Winship
d2b63eaf1f fix a crash-on-exit
meta_frames_destroy() was not safe to be called multiple times, which
was causing a crash on exit due to something else changing somewhere
that makes it get called multiple times.

https://bugzilla.gnome.org/show_bug.cgi?id=654489
2011-07-12 13:53:19 -04:00
Jakub Steiner
47b432bf89 Improve shadow defaults.
- menus have a very subtle shadow, define the outline better. Required for gtk theming.
- focused windows are better identified now as unfocused windows have a subtle shadow.

https://bugzilla.gnome.org/show_bug.cgi?id=649374
2011-07-11 16:00:03 +02:00
Owen W. Taylor
be8df20675 Fix typo when computing shadow bounds
A x/y typo that was causing shadow bounds to be incorrectly
computed and trails to be left in some circumstances. Behavior
noted by Jakub Steiner.

https://bugzilla.gnome.org/show_bug.cgi?id=649374
2011-07-08 22:38:12 -04:00
Florian Müllner
4a10c95e76 core: Replace lower_beneath_focus_window()
The code assumed that the focus window was always the one at the
top of the window stack, which is not true if an unfocused window
has the above hint set.

Rather than fixing this assumption, rename the function to
lower_beneath_grab_window() and use the display's grab window - the
function is only used for displaying the tile previews, which means
that we want the grab window anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=650661
2011-07-09 01:08:58 +02:00
Florian Müllner
54b2fab849 theme: Allow using custom colors from the GTK+ theme
Add an additional color type to pick up colors defined with
@define-color in the GTK+ theme's CSS:

  gtk:custom(name,fallback)

(where "name" refers to the name defined in GTK+'s CSS, and fallback
refers to an alternative color spec which is used when the color
referenced by "name" is not found)

The main intent of the change is to allow designers to improve
Adwaita's dark theme variant without having to compromise on colors
which work in the light variant as well.

https://bugzilla.gnome.org/show_bug.cgi?id=648709
2011-07-08 22:40:43 +02:00
Thierry Reding
8033184134 Fix out-of-tree build.
This patch fixes an issue encountered when building mutter
out-of-tree:

  * When generating mutter-enum-types.[ch], the glib-mkenums command is
    executed from $(srcdir), so it is wrong to prepend $(srcdir) to the
    template file.

https://bugzilla.gnome.org/show_bug.cgi?id=624910
2011-07-08 16:33:12 -04:00
Florian Müllner
d95da2dfbe theme: Port from GtkStateType to GtkStateFlags
We now use GtkStyleContext exclusively, so it's a bit weird to store
widget state as GtkStateType and translate it always to GtkStateFlags.
Just use GtkStateFlags instead of GtkStateType.

https://bugzilla.gnome.org/show_bug.cgi?id=650586
2011-07-08 21:40:55 +02:00
Florian Müllner
03457029f7 draw-workspace: Update to current GTK style API
Move from GtkStyle to GtkStyleContext.

https://bugzilla.gnome.org/show_bug.cgi?id=650586
2011-07-08 21:40:55 +02:00
Florian Müllner
f8d900c3ea theme: Add helper functions for light/dark colors
GtkStyleContext no longer has dark/light colors GtkStyle used to
have. We already have compatibility code for them in theme.c, so
add two helper functions to make it available outside theme.c.

https://bugzilla.gnome.org/show_bug.cgi?id=650586
2011-07-08 21:40:55 +02:00
Florian Müllner
e16beba111 mutter-window-demo: Port from GdkColor to GdkRGBA
GdkColor is about to be deprecated, so move to GdkRGBA instead.

https://bugzilla.gnome.org/show_bug.cgi?id=650586
2011-07-08 21:40:54 +02:00
Florian Müllner
60ee25d8d5 theme-viewer: Port from GdkColor to GdkRGBA
GdkColor is about to be deprecated, so move to GdkRGBA instead.

https://bugzilla.gnome.org/show_bug.cgi?id=650586
2011-07-08 21:40:54 +02:00
Florian Müllner
ce1369609f theme: Port from GdkColor to GdkRGBA
GdkColor is about to be deprecated, so move to GdkRGBA instead.

https://bugzilla.gnome.org/show_bug.cgi?id=650586
2011-07-08 01:29:54 +02:00
Florian Müllner
8199699e7c gradient: Port from GdkColor to GdkRGBA
GdkColor is about to be deprecated, so move to GdkRGBA instead.
It might be worth considering using cairo patterns for the gradients
rather than using custom code to render gradients to a pixbuf which
is then drawn with cairo, but for now this is just a straight port
of the existing code.

https://bugzilla.gnome.org/show_bug.cgi?id=650586
2011-07-08 01:29:54 +02:00
Dan Winship
48cabd1364 window: fix appears-focused propagation with attached grandchildren
When detaching/attaching a dialog, we were only updating
appears-focused on the parent if the child itself was focused, but in
fact, we need to do it if the child has an attached child which is
focused too.

To simplify the case of detaching a focused subtree from its parent,
we change meta_window_propagate_focus_appearance() to use
@window->display->focus_window as the window to add/remove as the
attached_focus_window, and @window only as the starting point to
propagate from. That way we can propagate focus-removal up to
@window's (soon-to-be-ex-)ancestors without having to remove it from
its descendants as well.

https://bugzilla.gnome.org/show_bug.cgi?id=647712
2011-07-07 16:51:36 -04:00
Dan Winship
6dc79ce60a reload_transient_for: avoid xtransient_for loops
Don't set a window's xtransient_for if it would create a loop. Since
this is the only place we ever set xtransient_for, we can therefore
assume everywhere else that it does not loop.

https://bugzilla.gnome.org/show_bug.cgi?id=647712
2011-07-07 16:51:36 -04:00
Owen W. Taylor
b5f277bd7b Freeze api_version to 3.0
Back the API version down to 3.0; since we don't make any stability
guarantees, there's no reason to have a merry-go-round of different
directories and filenames that people have to keep up with.
2011-07-01 19:19:11 -04:00
Jasper St. Pierre
2b93c19328 Clip the shaped region to the bounding region
According to the XShape specification, the shaped region should always be
a subset of the bounding region. Certain programs such as wine depended
on this behavior.

https://bugzilla.gnome.org/show_bug.cgi?id=627880
2011-06-30 16:35:13 -04:00
Owen W. Taylor
66a830fd46 Fixes for compositor replacement
* When unmanaging a screen, stop redirecting subwindows explicitly,
  so that we do that before destroying the window manager selection
  window.
* Improve comment in the retry code
* When exiting because the previous compositor couldn't be replaced,
  don't g_error() and drop a core file.

https://bugzilla.gnome.org/show_bug.cgi?id=653121
2011-06-30 16:26:10 -04:00
Jasper St. Pierre
d752096cdf Fix XShape
Commit c3a04bf unintentionally broke XShape handling. By studying the code
extremely carefully, I found this inconsistency with the code that was
there before.

https://bugzilla.gnome.org/show_bug.cgi?id=635268
2011-06-29 16:07:34 -04:00
Owen W. Taylor
fe12294b92 Create the 1x1 texture for the root background unsliced
When there was no root background pixmap, we were using a 1x1 repeating
texture as a simple way of drawing a solid color without adding a
second code path. However, when that 1x1 texture was combined into
a larger "atlas texture", hardware repeat couldn't be used, so a
small inefficiency from this approach became an enormous inefficiency
as clutter drew every pixel of the background as a separate rectangle.

https://bugzilla.gnome.org/show_bug.cgi?id=652507
2011-06-29 12:27:02 -04:00
Colin Walters
c18940a5a2 compositor: Loop and retry to get compositor selection when replacing
There are unavoidable race conditions here when another process is
replacing us.  As a band aid, loop for 5 seconds.

https://bugzilla.gnome.org/show_bug.cgi?id=653121
2011-06-21 15:22:31 -04:00
Florian Müllner
b533ad2669 core: Remove META_CORE_IS_TITLEBAR_ONSCREEN
The functionality is no longer needed outside of core/, so remove
the getter.

https://bugzilla.gnome.org/show_bug.cgi?id=652369
2011-06-15 21:34:04 +02:00
Florian Müllner
526bc34bba frames: Always start grab operation on left click
When left-clicking the frame border with the titlebar being
off-screen, rather than starting the expected grab operation the
window menu was popped up.
This behavior is pretty confusing, especially since the menu button
was removed from the default layout, making right-clicking the only
way to get to the window menu.

https://bugzilla.gnome.org/show_bug.cgi?id=652369
2011-06-15 21:34:04 +02:00
Dan Winship
c70087db0c meta_quit: ignore repeated calls after it's already quitting
meta_run() calls meta_finalize() after the main loop exits, which ends
up calling meta_display_close(), which calls
meta_quit(META_EXIT_SUCCESS), meaning that any exit status passed to
the original meta_quit() call is lost.

Fix this by ignoring meta_quit() calls after the main loop is no
longer running.

https://bugzilla.gnome.org/show_bug.cgi?id=652010
2011-06-06 16:22:39 -04:00
Florian Müllner
4257b8deff window: Expose minimized state as property
Track the minimized state in a property, so that we can receive
change notifications.

https://bugzilla.gnome.org/show_bug.cgi?id=651568
2011-05-31 21:20:42 +02:00
Adam Jackson
05662b678e Fix crash in meta_display_get_above_tab_keycode
https://bugzilla.gnome.org/show_bug.cgi?id=647777
2011-05-25 14:20:06 -04:00
Jasper St. Pierre
64f37a3769 window: Add wm-class property and notify it when changed.
https://bugzilla.gnome.org/show_bug.cgi?id=649315
2011-05-25 12:10:03 -04:00
Florian Müllner
7577437167 ui-frames: Delay attaching the style to new frames
Like the setting of new frames' background is delayed until the
frame is associated with its window, delay attaching the initial
style, so that the correct style variant is picked.

https://bugzilla.gnome.org/show_bug.cgi?id=645355
2011-05-18 23:07:23 +02:00
Florian Müllner
be6775767c core: Update frame style when _GTK_THEME_VARIANT changes
When the _GTK_THEME_VARIANT property changes, rather than just
updating the window's theme_variant property, update its frame
style as well, so that the window decoration reflects the requested
variant. As the initial properties of a window may be read before
its frame is created, there will be cases where the change is not
picked up initially.

https://bugzilla.gnome.org/show_bug.cgi?id=645355
2011-05-18 23:07:23 +02:00
Florian Müllner
0d9a9b8d3b theme: Do not create temporary GtkStyle objects
In order to pick up colors from a GtkStyleContext, a temporary
GtkStyle object was created from the context and destroyed after
copying the requested GdkColor. This is slightly inefficient, so
get the appropriate GdkRGBA from the context and translate it to
a GdkColor, based on the compatibility code in gtkstyle.c.

https://bugzilla.gnome.org/show_bug.cgi?id=645355
2011-05-18 23:07:23 +02:00
Florian Müllner
4affd22817 ui-frame: Add support for style variants
Rather than sharing a single style context between all frames, use
a default style and one style per encountered variant (as determined
by the _GTK_THEME_VARIANT property), so that colors from the GTK+ style
are picked from the correct theme variant.

https://bugzilla.gnome.org/show_bug.cgi?id=645355
2011-05-18 23:07:23 +02:00
Florian Müllner
eb17cd9ba9 ui: Add meta_ui_update_frame_style()
This method allows forcing a style update of a particular frame
from the core, so that it can pick up style variants.

https://bugzilla.gnome.org/show_bug.cgi?id=645355
2011-05-18 23:07:23 +02:00
Florian Müllner
0cdac78bd5 core: Allow retrieving the theme variant via core_get()
To associate frames with the correct style variant, the UI will
need access to the window's theme variant property.

https://bugzilla.gnome.org/show_bug.cgi?id=645355
2011-05-18 23:07:23 +02:00
Florian Müllner
4f3b03e13b window: Parse _GTK_THEME_VARIANT property
Since version 3.0, GTK+ has support for style variants. At the moment,
themes may provide a dark variant, which can be requested by
applications via GtkSettings. The requested variant is exported to
X11 via the _GTK_THEME_VARIANT property - support this property, in
order to pick up the correct style variant in the future.

https://bugzilla.gnome.org/show_bug.cgi?id=645355
2011-05-18 23:07:23 +02:00
Florian Müllner
da4486b833 theme: Get GTK+ colors from style context
Rather than using a single widget's style for GTK+ colors in themes,
use the style context parameter of the drawing functions for those
colors. Right now, a single style context is shared between frames,
but this will change to support different style variants.

https://bugzilla.gnome.org/show_bug.cgi?id=645355
2011-05-18 23:07:22 +02:00
Florian Müllner
37aeb5baf1 frame: Delay updating the background until the frame is ready
To determine the correct background style, the UI needs to access
some frame properties via meta_core_get(); this call will bail out
early if window->frame is unset, so delay the call until the
association is made.

https://bugzilla.gnome.org/show_bug.cgi?id=645355
2011-05-18 23:07:22 +02:00
Florian Müllner
a2cb38b382 tile-preview: Use gdk_cairo_set_source_rgba()
gdk_cairo_set_source_rgba() is a convenience function which was
added to GTK+-3.0 after the port to GtkStyleContext, so we ended
up using cairo_set_source_rgba() instead. Save a couple of lines ...
2011-05-18 23:07:22 +02:00