Commit Graph

3042 Commits

Author SHA1 Message Date
Jasper St. Pierre
6b81a05341 default: Don't wait to show the stage
We can show it immediately now...
2014-02-17 13:48:15 -05:00
Giovanni Campagna
5298a834ef Fix regression in mutter translations
Switching meta/util.h to gi18n.h was wrong, mutter is a library
and needs gi18n-lib.h, but that cannot be included from a public
header (since it depends on config.h or command line options),
so split util.h into a public and a private part.

https://bugzilla.gnome.org/show_bug.cgi?id=707897

Conflicts:
	src/compositor/compositor.c
	src/meta/util.h
2014-02-17 13:46:56 -05:00
Giovanni Campagna
6ceddd626a util: fix warnings when compiling gnome-shell-wayland
Replace our version of the gettext macros with those in glib,
so that they don't conflict with gnome-shell.

https://bugzilla.gnome.org/show_bug.cgi?id=707851
2014-02-17 13:45:56 -05:00
Jasper St. Pierre
a538f36524 Move position-changed / size-changed signals to the MetaWindow
They fit more appropriately over here...

https://bugzilla.gnome.org/show_bug.cgi?id=720631
2014-02-14 23:46:24 -05:00
Jasper St. Pierre
e3a93db712 compositor: Delay meta_compositor_add_window until the first show
In order for the compositor to properly determine whether a client
is an X11 client or not, we need to wait until XWayland calls
set_window_id to mark the surface as an XWayland client. To prevent
the compositor from getting tripped up over this, make sure that
the window has been fully initialized by the time we call
meta_compositor_add_window.

https://bugzilla.gnome.org/show_bug.cgi?id=720631
2014-02-14 23:45:15 -05:00
Jasper St. Pierre
7cdf55871e Always map the client and frame windows
Traditionally, WMs unmap windows when minimizing them, and map them
when restoring them or wanting to show them for other reasons, like
upon creation.

However, as metacity morphed into mutter, we optionally chose to keep
windows mapped for the lifetime of the window under the user option
"live-window-previews", which makes the code keep windows mapped so it
can show window preview for minimized windows in other places, like
Alt-Tab and Expose.

I removed this preference two years ago mechanically, by removing all
the if statements, but never went through and cleaned up the code so
that windows are simply mapped for the lifetime of the window -- the
"architecture" of the old code that maps and unmaps on show/hide was
still there.

Remove this now.

The one case we still need to be careful of is shaded windows, in which
we do still unmap the client window. In the future, we might want to
show previews of shaded windows in the overview and Alt-Tab. In that
we'd also keep shaded windows mapped, and could remove all unmap logic,
but we'd need a more complex method of showing the shaded titlebar, such
as using a different actor.

At the same time, simplify the compositor interface by removing
meta_compositor_window_[un]mapped API, and instead adding/removing the
window on-demand.

https://bugzilla.gnome.org/show_bug.cgi?id=720631
2014-02-14 23:42:07 -05:00
Jasper St. Pierre
c78089437d window: Centralize WM_STATE management 2014-02-14 23:38:40 -05:00
Ryan Lortie
ad1e23ce7d idle-monitor: avoid XSyncBadAlarm X error
If we fail to find the IDLETIME counter, then the alarm variable will be
uninitialised.  Most code paths are careful to check this before
submitting XSync calls, but there is one check missing.

https://bugzilla.gnome.org/show_bug.cgi?id=724364
2014-02-14 10:09:47 -05:00
Giovanni Campagna
3aac2bf934 window: don't set _NET_WM_FULLSCREEN_MONITORS to bogus values
Prior to the DisplayConfig merge, we would set _NET_WM_FULLSCREEN_MONITORS
to (unsigned)-1 when unset. After that, we would have invalid
reads inside meta_screen_monitor_index_to_xinerama_index() (called
with -1).
The way I read the specification, the proper way to indicate
that the window is back to fullscreen on all monitors is to
remove the property, so do that.

Also, add an assertion that meta_screne_monitor_index_to_xinerama_index()
is doing the right thing.

https://bugzilla.gnome.org/show_bug.cgi?id=724258
2014-02-13 13:09:28 +01:00
Giovanni Campagna
e053f7f2f4 window: fix invalid read in computing the input shape
If we are reported only one rectangle in the input shape, we should
not try to read more.

https://bugzilla.gnome.org/show_bug.cgi?id=724257
2014-02-13 13:09:28 +01:00
Jasper St. Pierre
9c20de1adb default: Make the map animation more friendly 2014-02-09 11:54:08 -05:00
Adel Gadllah
45ff615b46 Disable clutter's high dpi scaling
mutter needs some work to work with high dpi scaling so disable
the scaling until that is fixed.

https://bugzilla.gnome.org/show_bug.cgi?id=723931
2014-02-09 16:22:19 +01:00
Rico Tzschichholz
101a13c86d shaped-texture: Fix unused variable warning 2014-02-05 22:50:34 +01:00
Jasper St. Pierre
18cfcc0221 shaped-texture: Make sure to set the texture tower's texture
This was part of the Wayland branch that I forgot to cherry-pick properly.
2014-02-05 15:39:28 -05:00
Jasper St. Pierre
8daefd92df shaped-texture: Move unobscured_region processing here
We want to remove a bunch of auxilliary duties from the MetaWindowActor
and MetaSurfaceActor, including some details of how culling is done.
Move the unobscured region culling code to the MetaShapedTexture, which
helps the actor become "more independent".

https://bugzilla.gnome.org/show_bug.cgi?id=720631
2014-02-05 15:18:12 -05:00
Jasper St. Pierre
b580ccfe56 cullable: Reset the culling state instead of skipping the traversal
When we traversed down to reset the culling state, previously we
would just skip any actors that wanted culling. In order to properly
reset the unobscured_region before painting, we need to traverse down
to these places as well. Do this by calling cull_out with NULL regions
for both arguments, and adapt existing cull_out implementations to
match.

https://bugzilla.gnome.org/show_bug.cgi?id=720631
2014-02-05 15:17:18 -05:00
Jasper St. Pierre
d3c2607e53 window-actor: Move all buffer management and damage correction here
We want ShapedTexture to be a dumb actor that knows how to
pick/paint fairly easily, without any "platform knowledge", so to say...
2014-02-05 15:16:38 -05:00
Jasper St. Pierre
f64cea3fc3 window-actor: Clean up whitespace 2014-02-05 14:13:33 -05:00
Jasper St. Pierre
7a33fa6817 shaped-texture: Clean up code flow a bit
This is easier for me to read.
2014-02-05 14:07:27 -05:00
Robert Ancell
6b7f7c66ec xrandr: Use specified output property name for backlight control
Backlight controls are set using the "BACKLIGHT" XRANDR output property.
This should be "Backlight" according to the XRANDR spec [1].

Some drivers (Intel) export both properties and some only the specified property (nvidia).
Users of drivers that only export the specified property cannot change their backlight using XRANDR.

[1] http://cgit.freedesktop.org/xorg/proto/randrproto/tree/randrproto.txt section 9.1

https://bugzilla.gnome.org/show_bug.cgi?id=723606
2014-02-05 08:32:34 +00:00
Jonas Ådahl
ce99362094 default plugin: Fix workspace switch type error
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=723563
2014-02-03 17:32:53 -05:00
Jasper St. Pierre
099fd2b3fb compositor: Fix crash on startup
A bad rebase in 757674a9d6 accidentally
removed the call to meta_plugin_manager_new().
2014-02-02 09:58:16 -05:00
Adel Gadllah
abebb4775b monitorManager: Fix logic bug in make_logical_config
The code that prevents the creation of multiple MonitorInfos for clones
wasn't working due to using the wrong index when getting the already
created info so fix that to use the correct one.

https://bugzilla.gnome.org/show_bug.cgi?id=710610
2014-02-02 15:14:26 +01:00
Adel Gadllah
4752d427e4 window_actor: Remove the frame_messages timeout in destroy
Otherwise it might fire off later and cause a crash.

https://bugzilla.gnome.org/show_bug.cgi?id=723468
2014-02-02 15:13:46 +01:00
Marek Ch
16a8e6ffe0 window: fix coerced value
(int) 0.5 = 0, so there always was 0 instead of 50%
2014-02-02 15:13:46 +01:00
Jasper St. Pierre
8e0bc053d4 window-actor: Fix build
This was renamed to detach_x11_pixmap on the Wayland branch, and was
blindly cherry-picked onto master.
2014-02-01 10:41:22 -05:00
Jasper St. Pierre
757674a9d6 compositor: Remove pending_input_region
Ever since the change to create the output window synchronously at startup,
there hasn't been any time where somebody could set a stage region the
output window was ready, so this was effectively dead code.

https://bugzilla.gnome.org/show_bug.cgi?id=720631
2014-01-31 17:25:18 -05:00
Jasper St. Pierre
254afc5022 window-actor: Remove old unused APIs
https://bugzilla.gnome.org/show_bug.cgi?id=720631
2014-01-31 17:25:18 -05:00
Jasper St. Pierre
56f8d32ca9 window-actor: Flip set_redirected around
I know it's confusing with the triple negative, but unredirected is how
we track it elsewhere: we have an 'unredirected' flag, and 'should_unredirect'.

https://bugzilla.gnome.org/show_bug.cgi?id=720631
2014-01-31 17:25:18 -05:00
Jasper St. Pierre
1f6158ace7 compositor: Simplify the unredirected window management code
https://bugzilla.gnome.org/show_bug.cgi?id=720631
2014-01-31 17:25:18 -05:00
Jasper St. Pierre
4cc842296e window-actor: Simplify the unredirected check in cull_out
https://bugzilla.gnome.org/show_bug.cgi?id=720631
2014-01-31 17:25:18 -05:00
Jasper St. Pierre
f6e58be4b0 screen: Make the guard window an InputOnly window
Using a full InputOutput window causes us to make a full Wayland surface
for it, and go through the X server. As the goal of the guard window is
a window for us to stack minimized windows under so we can prevent them
from getting input, it makes sense to use an InputOnly window here.
2014-01-31 14:25:33 -05:00
Adel Gadllah
a285bbbd14 window-actor: Fix unobscured_region handling when computing paint volume
We currently ignore the unobscured region when we have mapped clones in
meta_window_actor_process_damage and meta_window_actor_damage_all but
use it unconditionally when computing the paint volume.

This is wrong. We should ignore it there as well or we will end up with
empty clones if the cloned window is completly obscured
(like the tray icons in gnome-shell).

https://bugzilla.gnome.org/show_bug.cgi?id=721596
2014-01-31 15:15:16 +01:00
Florian Müllner
52c24c5c71 window: Add "skip-taskbar" property
We currently only have a method to query the skip-taskbar hint.
Add a corresponding property to allow listening for change
notifications.

https://bugzilla.gnome.org/show_bug.cgi?id=723307
2014-01-31 13:33:21 +01:00
Florian Müllner
64e09b37ac window: Remove duplicated function declaration 2014-01-30 17:26:27 +01:00
Jasper St. Pierre
f3908bb0b8 main: Make sure to free any events that we get from Clutter 2014-01-29 14:01:25 -05:00
Jasper St. Pierre
aab354b72b constraints: CSD windows need to have their titlebar kept onscreen too
GTK+ CSD windows are considered undecorated by the code, so we should
not force ourselves to only run on decorated windows.

https://bugzilla.gnome.org/show_bug.cgi?id=719772
2014-01-21 13:00:29 -05:00
Jasper St. Pierre
ae05059cef shaped-texture: Make Cullable
Make MetaWindowActor chain up to the generic default MetaCullable
implementation, and remove the helper methods for MetaSurfaceActor
and MetaShapedTexture.
2014-01-16 11:03:50 -05:00
Jasper St. Pierre
c1f5741ac0 cullable: Use relative actor coordinates for culling
This ensures that nested cullables work fine.
2014-01-16 11:03:50 -05:00
Jasper St. Pierre
3548e6da73 Properly set the number of components on the CoglTextureRectangle
We need to set the number of components on the CoglTextureRectangle to
prevent wasting too much GPU memory. As we need to do this before we call
cogl_texture_set_region, just remove the meta_texture_rectangle_new wrapper,
and make callers call cogl_texture_rectangle_new_with_size directly.
2014-01-13 13:28:11 -05:00
Jasper St. Pierre
d2a1db8834 Update for Cogl API breaks 2014-01-13 13:07:11 -05:00
Jasper St. Pierre
0b003bb895 window: Atomically unmaximize both directions from a _NET_WM_STATE ClientMessage
When GDK sends an unmaximize _NET_WM_STATE ClientMessage, it tells us to remove
the _NET_WM_STATE_MAXIMIZED_HORZ and _NET_WM_STATE_MAXIMIZED_VERT states. Before
this time, it would independently call:

  meta_window_unmaximize (window, META_MAXIMIZE_HORIZONTAL);
  meta_window_unmaximize (window, META_MAXIMIZE_VERTICAL);

Which, besides being foolishly inefficient, would also mess up our saved_rect
tracking, causing the window to only look like it was unmaximized vertically.

Make this code more intelligent, so it causes us to unmaximize in one call.

https://bugzilla.gnome.org/show_bug.cgi?id=722108
2014-01-13 11:33:49 -05:00
Andika Triwidada
fbec4718f8 Changed obsolete FSF postal address into generic URL.
Fix https://bugzilla.gnome.org/show_bug.cgi?id=721517 #2
2014-01-12 08:42:06 +07:00
Debarshi Ray
abb021e51e monitor: Suppress -Werror=unused-variable
Fallout from 477acddf64

https://bugzilla.gnome.org/show_bug.cgi?id=721674
2014-01-09 12:43:19 +01:00
Daniel Drake
02426c50cb window: don't grab server during calc_showing
This grab was added in commit caf43a123f
https://bugzilla.gnome.org/show_bug.cgi?id=381127
to minimize window flickering when switching workspaces.

While this grab is held, some signals are emitted to the shell,
which can lead to deadlocks (reproduced under Mali binary OpenGLESv2
drivers).

Now that we are a compositing window manager, we do not have to
worry about flickers, this grab should no longer be necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=721709
2014-01-07 14:14:32 -06:00
Cosimo Cecchi
477acddf64 monitor: improve heuristic to determine display output name
Under some circumstances, for example when the display controller driver
doesn't report back the correct EDID, or under VirtualBox, Mutter
returns suboptimal strings for an output display name, leading to funny
labels like 'Unknown 0"', or '(null) 0"' in the Settings panel.

This commit improves our heuristic in three ways:
- we now avoid putting inches in the display name if either dimension is
  zero
- we use the vendor name in case we're not able to lookup its PnP id
  from the database. Previously we would have passed over '(null)'
- as a special edge-case, when neither inches nor vendor are known, we
  use the string 'Unknown Display'

Finally, we make the combined vendor + inches string translatable, as
different languages might want to move the size part of the string to a
position different than the end.

https://bugzilla.gnome.org/show_bug.cgi?id=721674
2014-01-07 09:47:23 -08:00
Daniel Drake
10c1903c72 Reduce server grabs during window creation
Remove some obvious server grabs from the window creation codepath,
also ones that are taken at startup.

During startup, there is no need to grab: we install the event handlers
before querying for the already-existing windows, so there is no danger
that we will 'lose' some window. We might try to create a window twice
(if it comes back in the original query and then we get an event for it)
but the code is already protected against such conditions.

When windows are created later, we also do not need grabs, we just need
appropriate error checking as the window may be destroyed at any time
(or it may have already been destroyed).

The stack tracker is unaffected here - as it listens to CreateNotify and
DestroyNotify events and responds directly, the internal stack
representation will always be consistent even if the window goes away while
we are processing MapRequest or similar.

https://bugzilla.gnome.org/show_bug.cgi?id=721345
2014-01-06 14:27:42 -06:00
Daniel Drake
69dfd07a7f meta_window_new: clean up error handling
The return code of XGetWindowAttributes() indicates whether an error
was encountered or not. There is no need to specifically check the error
trap.

The trap around XAddToSaveSet() was superfluous. We have a global error
trap to ignore any errors here, and there is no need to XSync() as GDK
will later ignore the error asynchronously if one is raised.

Also move common error exit path to an error label.

https://bugzilla.gnome.org/show_bug.cgi?id=721345
2014-01-06 14:25:32 -06:00
Daniel Drake
bc9b923d5c screen: use stack tracker for initial window query
In meta_screen_manage_all_windows() we can use our own stack
tracker to get the list of windows - no need to query X again.

A copy is needed because the stack gets modified as part of the loop.
Specifically, meta_stack_tracker_get_stack() at this time returns the
predicted stack, and meta_window_new() performs a few operations
(e.g. framing) which cause immediate changes to the predicted stack.

https://bugzilla.gnome.org/show_bug.cgi?id=721345
2014-01-06 14:23:43 -06:00
Daniel Drake
fef32fb0d4 frame: remove unnecessary server grab
meta_window_ensure_frame() creates its own grab and has a comment
claiming that it must be called under a grab too.

But the reasoning given in the comment does not seem relevant here.
We only frame non-override-redirect windows, so we are creating
the frame in response to MapRequest. There is no way that the child
could receive a MapNotify at this point, since that only happens
much later, once we go through the CALC_SHOWING queue and call
XMapWindow() from meta_window_show().

Remove the unnecessary grab.

https://bugzilla.gnome.org/show_bug.cgi?id=721345
2014-01-06 12:56:18 -06:00