Compare commits

...

92 Commits

Author SHA1 Message Date
Florian Müllner
a742b17805 Bump version to 3.12.0
Update NEWS.
2014-03-25 16:25:28 +01:00
Petr Kovar
c4b65e0e6e Update Czech translation 2014-03-22 20:49:28 +01:00
Daniel Korostil
9ec8232417 Updated Ukrainian translation 2014-03-22 12:18:24 +02:00
Andika Triwidada
768e830f11 Updated Indonesian translation 2014-03-21 10:42:48 +00:00
Мирослав Николић
4a4a624b77 Updated Serbian translation 2014-03-21 03:06:38 +01:00
Ask H. Larsen
b13b7ea72e Updated Danish translation 2014-03-19 22:33:10 +01:00
Florian Müllner
9a89cc1198 Bump version to 3.11.92
Update NEWS.
2014-03-19 21:26:42 +01:00
A S Alam
b8eb7b883f update Punjabi Translation 17March2014: Alam 2014-03-17 16:04:20 -05:00
Jasper St. Pierre
4f9872c037 window: Export a bunch of state flags as accessor methods
This is necessary to reimplement window menus in gnome-shell.

https://bugzilla.gnome.org/show_bug.cgi?id=726352
2014-03-14 11:25:55 -04:00
Jasper St. Pierre
24e12053ea window: Add a META_MAXIMIZE_BOTH maximization flag
Which has both directions set. This is a simple cleanup to
remove the constant VERTICAL | HORIZONTAL all over the place.

https://bugzilla.gnome.org/show_bug.cgi?id=726352
2014-03-14 11:25:55 -04:00
Carlos Garnacho
991c85f6a0 core: Add minimal handling of touch events
Currently touch events are ignored in the core event handler,
and hence dealt with within GDK. If those touch events were
emulating pointer events, GDK would attempt to convert back
those events to pointer events as the frame GdkWindow doesn't
have the GDK_TOUCH_MASK set.

This results in XI_TouchBegin events being initially processed
by GDK, converted to button events, and triggering a grab op
that subverts touch events into pointer events, so the touch
is never ever seen again by GDK. This leaves GDK in an
inconsistent internal state wrt pointer grabs, so future
pointer-emulating touches will refer to the same window forever.

Fix this by handling touch events minimally, just enough to
convert XI_TouchBegin to GDK_BUTTON_PRESS within mutter, so GDK
is bypassed for every touch event just like it is for pointer
events. This, and the XIGrabDevice() that keeps coercing pointer
events when the grab operation starts, are enough to fix window
drag and drop on touch devices.

https://bugzilla.gnome.org/show_bug.cgi?id=723552
2014-03-13 20:10:07 +01:00
Duarte Loreto
4880ee9bb6 Updated Portuguese translation 2014-03-12 01:42:39 +00:00
Claude Paroz
2f77b71933 Updated French translation 2014-03-11 22:50:41 +01:00
Owen W. Taylor
47273eaab6 Fix identification of CSD windows when checking whether to force fullscreen
We try to exempt CSD windows from being forced fullscreen if they are
undecorated and the size of the screen; however, we also catch almost
all windows that *do* need to be forced fullscreen in this check, since
they also have decorations turned off.

Identify actual CSD windows by checking whether _GTK_FRAME_EXTENTS is set -
GTK+ will always set this on CSD windows even if they have no invisible
borders or shadows at the current time.

https://bugzilla.gnome.org/show_bug.cgi?id=723029
2014-03-11 12:36:55 -04:00
Owen W. Taylor
202e6bd654 Fix meta_window_titlebar_is_onscreen() for titlebar-less windows
Make the code correspond to the comment - the titlebar can't be
offscreen if there's no titlebar.

https://bugzilla.gnome.org/show_bug.cgi?id=723580
2014-03-11 12:36:55 -04:00
Tiagosdot
fd41ab93da Updated Portuguese translation 2014-03-11 16:13:04 +00:00
Yuri Myasoedov
a07fe23d7a Updated Russian translation 2014-03-11 16:03:54 +04:00
Chao-Hsiung Liao
ef0763fd04 Updated Traditional Chinese translation(Hong Kong and Taiwan) 2014-03-09 13:05:59 +08:00
Wylmer Wang
b5ef6703fc Updated Chinese (China) translation 2014-03-08 11:52:01 +00:00
Rūdolfs Mazurs
dde25e831f Updated Latvian translation 2014-03-07 23:23:53 +02:00
Rui Matos
8358b5dd24 cursor-tracker: Include gdk/gdkx.h
Needed for the call to gdk_x11_device_manager_lookup() introduced
in in the previous commit.
2014-03-06 19:19:52 +01:00
Adel Gadllah
34a9c95b7f cursor-tracker: Avoid unnecessary round trip 2014-03-06 19:17:50 +01:00
Changwoo Ryu
dd76c92f30 Updated Korean translation 2014-03-07 02:11:01 +09:00
Florian Müllner
70e3ef02a6 Bump version to 3.11.91
Update NEWS.
2014-03-05 23:41:49 +01:00
Florian Müllner
b159d6a5e1 build: Use non-deprecated feature test macros
_SVID_SOURCE has been deprecated in newer versions of glibc breaking
-WError; the recommended replacement of _DEFAULT_SOURCE is fairly
new, so switch to _XOPEN_SOURCE instead.
2014-03-05 23:28:44 +01:00
Owen W. Taylor
4c2e39bf2c Fix positioning error for manually positioned windows
The "original coordinates" passed into meta_window_place() were the
coordinates of the client rectangle not the frame rectangle. When
meta_window_place() didn't place because the window was manually
positioned (e.g., 'xterm -geometry +x+y') that resulted in a window
being offset by the frame dimensions.

https://bugzilla.gnome.org/show_bug.cgi?id=724049
2014-03-05 17:21:27 -05:00
Owen W. Taylor
4a8f7aa884 Fix handling of dynamic updates to colors/font/etc.
Since the introduction of frame sync in GTK+, updates to titlebar font and
colors haven't been working because GTK+ counts on the frame clock to
do style updates, and the frame clock doesn't run for an unmapped
GdkWindow. (It's possible that GtkStyleContext changes subsequent to
the introduction of the frame clock were also needed to fully break
things.)

We actually need to map the MetaFrames GdkWindow and let the
compositor code send out the frame sync messages in order to pick up
style changes.

Hopefully no bad side effects will occur from this - we make the window
override-redirect, 1x1, and outside the bounds of the screen.

https://bugzilla.gnome.org/show_bug.cgi?id=725751
2014-03-05 17:21:27 -05:00
Kjartan Maraas
c8f466cb85 Updated Norwegian bokmål translation 2014-03-05 19:20:11 +01:00
Daniel Mustieles
2edec1bfa8 Updated Spanish translation 2014-03-05 16:40:28 +01:00
Rui Matos
73acbdd30c keybindings: Fix ungrabs possibly failing after switching keymaps
We need to resolve the keycode from the keysym again since the keycode
might have changed if there was a keymap switch between the grab and
the ungrab.
2014-03-04 20:33:56 +01:00
Rui Matos
c07004aefe keybindings: Fix external grabs not being ungrabbed
Before starting to use display_get_keybinding() we could compare
MetaKeyBinding.modifiers with MetaKeyCombo.modifiers directly. Now, we
need to resolve the virtual modifiers to match with the mask.
2014-03-04 20:26:49 +01:00
Rui Matos
7e8833a215 keybindings: Keep keybindings in an hash table instead of an array
This allows us to look for a match with an O(1) search instead of O(n)
which is nice, particularly when running as a wayland compositor in
which case we have to do this search for every key press event (as
opposed to only when our passive grab triggers in the X compositor
case).

We actually need two hash tables. On one we keep all the keybindings
themselves which allows us to add external grabs without constantly
re-allocating the array we were using previously.

The other hash table is an index of the keybindings in the first table
by their keycodes and mask which is how we actually match the key
press events. This second table thus needs to be rebuilt when the
keymap changes since keycodes have to be resolved then but since we're
only keeping pointers to the first table it's a fast operation.

https://bugzilla.gnome.org/show_bug.cgi?id=725588
2014-03-04 14:04:51 +01:00
Rui Matos
266ac00e56 keybindings: Use display_get_keybinding() instead of looping explicitly
Instead of looping over an array of keybindings to find the correct
binding, just use display_get_keybinding().

In the next commit, we'll change the array to be a hash map, so this
helps the patch be cleaner.

https://bugzilla.gnome.org/show_bug.cgi?id=725588
2014-03-04 14:04:26 +01:00
Rui Matos
2b3fc741fb keybindings: Rename MetaKeyPref.bindings to MetaKeyPref.combos
Let's call it what it really is, otherwise it's just confusing since
MetaKeyBinding also exists.

https://bugzilla.gnome.org/show_bug.cgi?id=725588
2014-03-04 14:04:12 +01:00
Rui Matos
91389c89a1 keybindings: Make MetaKeyPref, MetaKeyCombo and MetaKeyHandler private
There's no need for these to be public and keeping them all together
in the same header makes it easier when reading the code.

https://bugzilla.gnome.org/show_bug.cgi?id=725588
2014-03-04 14:04:12 +01:00
Fran Diéguez
abb060b272 Updated Galician translations 2014-03-03 21:30:38 +01:00
Piotr Drąg
41e6cd8aa9 Updated Polish translation 2014-03-03 01:17:37 +01:00
Aurimas Černius
bb5631793c Updated Lithuanian translation 2014-03-02 20:09:01 +02:00
Yosef Or Boczko
f77fc447e0 Updated Hebrew translation 2014-03-02 01:12:27 +02:00
Enrico Nicoletto
c63d7cb692 Updated Brazilian Portuguese translation 2014-02-28 23:26:12 +00:00
Matej Urbančič
ac28b91bf6 Updated Slovenian translation 2014-02-28 23:15:35 +01:00
Balázs Úr
334e7373cd Updated Hungarian translation 2014-02-28 20:50:08 +01:00
Milo Casagrande
b9b6eb99c3 [l10n] Updated Italian translation. 2014-02-28 18:39:49 +01:00
Adel Gadllah
463318ac4c meta-shaped-texture: Check if the parent has mapped clones as well
When the  WindowActor has mapped clones we should ignore
the unobscured region as well, so we need to walk up and check it
as well.

https://bugzilla.gnome.org/show_bug.cgi?id=725180
2014-02-28 18:26:55 +01:00
Florian Müllner
3ee63d5a99 keybindings: Make move-to-monitor-* bindings known to g-c-c
Commit 0fe5c4f957 implemented new keybindings to move windows
between monitors, but did not add it to the appropriate keybinding
file.

https://bugzilla.gnome.org/show_bug.cgi?id=725338
2014-02-28 16:30:59 +01:00
Florian Müllner
eb01163656 window-actor: Guard against %NULL frame mask
Creating a new cogl texture may fail, in which case the intent to
free it will crash. While something is clearly wrong (insanely
large window, oom, ...), crashing the WM is harsh and we should
try to avoid it if at all possible, so carry on.

https://bugzilla.gnome.org/show_bug.cgi?id=722266
2014-02-28 16:30:44 +01:00
Rui Matos
2bf844d585 keybindings: Don't use the keysym to match keybindings
We don't want to match the keysym so that e.g. an accelerator
specified as "<Super>a" works if the current keymap has a keysym other
than 'a' for that keycode which means that the accelerator would
become inaccessible in a non-latin keymap.

This is inconvenient for users that often switch keyboard layouts, or
even have different layouts in different windows, since they expect
system-level keybindings to not be affected by the current layout.

https://bugzilla.gnome.org/show_bug.cgi?id=678001
2014-02-27 21:42:12 +01:00
Jasper St. Pierre
585fdd781c Remove tabpopup and friends
These are unused in gnome-shell, and add complexity. Remove them.
2014-02-27 15:31:55 -05:00
Jasper St. Pierre
54f8b5d69a window: Fix meta_window_get_client_area_rect
The shaded logic here was backwards.
2014-02-27 10:32:19 -05:00
Jasper St. Pierre
fc24552e0e Revert "window: Update the shape, input, and opaque regions immediately"
This reverts commit 64a82c8d77.

This broke everything, and the perf regressions I was seeing went
away after a reboot...
2014-02-26 20:43:01 -05:00
Jasper St. Pierre
be352c2bf1 window: Change ordering of functions to match wayland branch
... and also change some unused public functions to be statics.
2014-02-26 20:22:43 -05:00
Giovanni Campagna
36009cbae1 Fix input and bounding shapes
For decorated windows, we don't want to apply any input
shape, because the frame is always rectangular and eats
all the input.
The real check is in meta-window-actor, where we consider
if we need to apply the bounding shape and the input shape
(or the intersection of the two) to the surface-actor,
but as an optimization we avoid querying the server in
meta-window.
Additionally, for undecorated windows, the "has input shape"
check is wrong if the window has a bounding shape but not an
input shape.
2014-02-26 19:57:41 -05:00
Jasper St. Pierre
21f9bf530d window-actor: Complete the removal of update_shape
I accidentally stashed the rest of the stuff and forgot to
commit it... oops.
2014-02-26 19:57:13 -05:00
Jasper St. Pierre
64a82c8d77 window: Update the shape, input, and opaque regions immediately
... and individually. It turns out that updating the opaque region
was causing the shape region to be updated, which was causing a new
shape mask to be generated and uploaded to the GPU. Considering
GTK+ regenerates the opaque region on pretty much any focus change,
this is not good.
2014-02-26 19:43:57 -05:00
Jasper St. Pierre
29edefdfc5 window-actor: Kill off another use of MetaFrameBorders 2014-02-26 19:39:44 -05:00
Jasper St. Pierre
7253a5d274 window-actor: Don't pass around client_area
To solve a performance regression, the three update_*_region
calls are going to be split up, so just call get_client_area_rect
in the methods itself.
2014-02-26 19:39:13 -05:00
Jasper St. Pierre
ad43cbd70b window: Add meta_window_get_client_area_rect 2014-02-26 19:39:13 -05:00
Giovanni Campagna
682d6f9ee2 keybindings: fix invalid read after a keybinding is removed
The handler pointer is dangling in MetaKeyBinding until
rebuild_key_binding_table() is run, so we can't dereference it.
Because we only need the flags at ungrab time, store a copy
in the MetaKeyBinding structure.

https://bugzilla.gnome.org/show_bug.cgi?id=724402
2014-02-26 15:15:57 +01:00
Carlos Garnacho
1e01a55cdc core: prevent early MetaIdleMonitor destruction when its invoker vanishes
If the last reference of a MetaIdleMonitor is held by the caller, it may
happen that the last reference is lost when calling the GDestroyNotify,
if this happens when the watched DBus name vanishes, the object (and the
watches hashtable) are destroyed while manipulating the watches hashtable,
so bad things may happen then.

Fix this by wrapping the operation by a ref/unref pair, so the object would
be destroyed after operating on the hashtable.

https://bugzilla.gnome.org/show_bug.cgi?id=724969
2014-02-23 01:50:05 +01:00
Aurimas Černius
1acb1bb7e6 Updated Lithuanian translation 2014-02-21 22:23:12 +02:00
Adel Gadllah
487602c409 meta-window-actor: Fix paint_volume
We cannot intersect the the complete volume with the unobscured bounds
because it does not include the shadows. So just intersect it with the
windows's shape bounds and union it with the shadow bounds.

This also matches what the comment in the code says:
"We could compute an full clip region as we do for the window texture,
but the shadow is relatively cheap to draw, and a little more complex to clip,
so we just catch the case where the shadow is completely obscured
and doesn't need to be drawn at all."
2014-02-21 20:37:53 +01:00
Adel Gadllah
a7fa90b750 meta-shaped-texture: Fix typo 2014-02-21 11:26:36 +01:00
Florian Müllner
0054e637cc Bump version to 3.11.90
Update NEWS.
2014-02-19 21:49:52 +01:00
Stefano Facchini
8c69f1b33c Make tile preview a compositor plugin effect
https://bugzilla.gnome.org/show_bug.cgi?id=665758
2014-02-19 21:41:29 +01:00
Jasper St. Pierre
870c6382ed Revert "compositor: Delay meta_compositor_add_window until the first show"
This reverts commit e3a93db712.
2014-02-19 12:18:02 -05:00
Jasper St. Pierre
91770d0477 default: Use a consistent rand() for monitor backgrounds
g_random_int() is seeded with /dev/urandom, so it's not consistent.
2014-02-17 14:02:40 -05:00
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
Daniel Korostil
52d411bd85 Updated Ukrainian translation 2014-02-13 22:39:28 +02: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
Kjartan Maraas
fb6a7cda70 Updated Norwegian bokmål translation 2014-02-10 08:12:29 +01:00
Jasper St. Pierre
9c20de1adb default: Make the map animation more friendly 2014-02-09 11:54:08 -05:00
Ryan Lortie
9935b4fd66 autogen.sh: use #!/bin/sh instead of #!/bin/bash
We don't have any bashisms in this file, so we may as well use sh.

https://bugzilla.gnome.org/show_bug.cgi?id=722530
2014-02-09 10:56:26 -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
Marek Černocký
79e96a6a1a Updated Czech translation 2014-02-09 09:49:57 +01:00
Khaled Hosny
497541730f Update Arabic translation 2014-02-06 15:35:03 +02: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
Shankar Prasad
67560db7b8 updated kn.po 2014-02-05 16:25:53 +05:30
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
92 changed files with 8704 additions and 12351 deletions

56
NEWS
View File

@@ -1,3 +1,59 @@
3.12.0
======
Translations:
Ask H. Larsen [da], Мирослав Николић [sr, sr@latin], Andika Triwidada [id],
Daniel Korostil [uk], Petr Kovar [cs]
3.11.92
=======
* Fix identification of CSD windows [Owen; #723029]
* Add minimal handling of touch events [Carlos; #723552]
* Misc bug fixes and cleanups [Owen, Adel, Jasper; #723580, #726352]
Contributors:
Adel Gadllah, Carlos Garnacho, Rui Matos, Jasper St. Pierre, Owen W. Taylor
Translations:
Changwoo Ryu [ko], Rūdolfs Mazurs [lv], Wylmer Wang [zh_CN],
Chao-Hsiung Liao [zh_HK, zh_TW], Yuri Myasoedov [ru], Tiagosdot [pt],
Claude Paroz [fr], Duarte Loreto [pt], A S Alam [pa]
3.11.91
=======
* Don't use keysym to match keybindings [Rui; #678001]
* Fix message tray icons showing up blank (again) [Adel; #725180]
* Improve keybinding lookups [Rui; #725588]
* Fix dynamic updates of titlebar style properties [Owen; #725751]
* Fix positioning of manually positioned windows [Owen; #724049]
* Misc. bug fixes [Carlos, Giovanni, Florian, Jasper; #724969, #724402, #722266,
#725338]
Contributors:
Giovanni Campagna, Adel Gadllah, Carlos Garnacho, Rui Matos, Florian Müllner,
Jasper St. Pierre
Translations:
Aurimas Černius [lt], Milo Casagrande [it], Balázs Úr [hu],
Matej Urbančič [sl], Enrico Nicoletto [pt_BR], Yosef Or Boczko [he],
Piotr Drąg [pl], Fran Diéguez [gl]
3.11.90
=======
* Use correct output property for backlight control [Robert; #723606]
* Fix double-scaling on high DPI resolutions [Adel; #723931]
* Make tile previews a compositor effect [Stefano, Florian; #665758]
* Misc. bug fixes and cleanups [Ryan, Giovanni, Jasper; #722530, #724257,
#724258, #724364, #720631, #707851, #707897]
Contributors:
Robert Ancell, Giovanni Campagna, Stefano Facchini, Adel Gadllah,
Ryan Lortie, Florian Müllner, Jasper St. Pierre, Rico Tzschichholz
Translations:
Shankar Prasad [kn], Khaled Hosny [ar], Marek Černocký [cs],
Kjartan Maraas [nb], Daniel Korostil [uk]
3.11.5
======
* Fix CSD titlebars being placed off-screen [Jasper; #719772]

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
srcdir=`dirname $0`

View File

@@ -2,8 +2,8 @@ AC_PREREQ(2.50)
AC_CONFIG_MACRO_DIR([m4])
m4_define([mutter_major_version], [3])
m4_define([mutter_minor_version], [11])
m4_define([mutter_micro_version], [5])
m4_define([mutter_minor_version], [12])
m4_define([mutter_micro_version], [0])
m4_define([mutter_version],
[mutter_major_version.mutter_minor_version.mutter_micro_version])

View File

@@ -96,8 +96,6 @@ meta_compositor_hide_window
meta_compositor_switch_workspace
meta_compositor_maximize_window
meta_compositor_unmaximize_window
meta_compositor_window_mapped
meta_compositor_window_unmapped
meta_compositor_sync_window_geometry
meta_compositor_set_updates_frozen
meta_compositor_queue_frame_drawn

473
po/ar.po

File diff suppressed because it is too large Load Diff

538
po/cs.po

File diff suppressed because it is too large Load Diff

519
po/da.po

File diff suppressed because it is too large Load Diff

508
po/es.po

File diff suppressed because it is too large Load Diff

687
po/fr.po

File diff suppressed because it is too large Load Diff

132
po/gl.po
View File

@@ -14,8 +14,8 @@ msgid ""
msgstr ""
"Project-Id-Version: gl\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-01-20 23:24+0100\n"
"PO-Revision-Date: 2014-01-20 23:25+0200\n"
"POT-Creation-Date: 2014-03-03 21:29+0100\n"
"PO-Revision-Date: 2014-03-03 21:30+0200\n"
"Last-Translator: Fran Dieguez <frandieguez@gnome.org>\n"
"Language-Team: gnome-l10n-gl@gnome.org\n"
"Language: gl\n"
@@ -62,66 +62,82 @@ msgid "Move window one workspace down"
msgstr "Mover xanela un espazo de traballo cara a abaixo"
#: ../src/50-mutter-navigation.xml.in.h:10
msgid "Move window one monitor to the left"
msgstr "Mover xanela un monitor á esquerda"
#: ../src/50-mutter-navigation.xml.in.h:11
msgid "Move window one monitor to the right"
msgstr "Mover xanela un monitor á dereita"
#: ../src/50-mutter-navigation.xml.in.h:12
msgid "Move window one monitor up"
msgstr "Mover xanela un monitor arriba"
#: ../src/50-mutter-navigation.xml.in.h:13
msgid "Move window one monitor down"
msgstr "Mover xanela un espazo de traballo abaixo"
#: ../src/50-mutter-navigation.xml.in.h:14
msgid "Switch applications"
msgstr "Cambiar entre aplicativos"
#: ../src/50-mutter-navigation.xml.in.h:11
#: ../src/50-mutter-navigation.xml.in.h:15
msgid "Switch windows"
msgstr "Cambiar xanelas"
#: ../src/50-mutter-navigation.xml.in.h:12
#: ../src/50-mutter-navigation.xml.in.h:16
msgid "Switch windows of an application"
msgstr "Cambiar entre as xanelas dun aplicativo"
#: ../src/50-mutter-navigation.xml.in.h:13
#: ../src/50-mutter-navigation.xml.in.h:17
msgid "Switch system controls"
msgstr "Cambiar entre os controles do sistema"
#: ../src/50-mutter-navigation.xml.in.h:14
#: ../src/50-mutter-navigation.xml.in.h:18
msgid "Switch windows directly"
msgstr "Cambiar xanelas directamente"
#: ../src/50-mutter-navigation.xml.in.h:15
#: ../src/50-mutter-navigation.xml.in.h:19
msgid "Switch windows of an app directly"
msgstr "Cambiar entre as xanelas dun aplicativo directamente"
#: ../src/50-mutter-navigation.xml.in.h:16
#: ../src/50-mutter-navigation.xml.in.h:20
msgid "Switch system controls directly"
msgstr "Cambiar entre os controles do sistema directamente"
#: ../src/50-mutter-navigation.xml.in.h:17
#: ../src/50-mutter-navigation.xml.in.h:21
msgid "Hide all normal windows"
msgstr "Ocultar todas as xanelas normais"
#: ../src/50-mutter-navigation.xml.in.h:18
#: ../src/50-mutter-navigation.xml.in.h:22
msgid "Switch to workspace 1"
msgstr "Cambiar ao espazo de traballo 1"
#: ../src/50-mutter-navigation.xml.in.h:19
#: ../src/50-mutter-navigation.xml.in.h:23
msgid "Switch to workspace 2"
msgstr "Cambiar ao espazo de traballo 2"
#: ../src/50-mutter-navigation.xml.in.h:20
#: ../src/50-mutter-navigation.xml.in.h:24
msgid "Switch to workspace 3"
msgstr "Cambiar ao espazo de traballo 3"
#: ../src/50-mutter-navigation.xml.in.h:21
#: ../src/50-mutter-navigation.xml.in.h:25
msgid "Switch to workspace 4"
msgstr "Cambiar ao espazo de traballo 4"
#: ../src/50-mutter-navigation.xml.in.h:22
#: ../src/50-mutter-navigation.xml.in.h:26
msgid "Move to workspace left"
msgstr "Mover ao espazo da esquerda"
#: ../src/50-mutter-navigation.xml.in.h:23
#: ../src/50-mutter-navigation.xml.in.h:27
msgid "Move to workspace right"
msgstr "Mover ao espazo da dereita"
#: ../src/50-mutter-navigation.xml.in.h:24
#: ../src/50-mutter-navigation.xml.in.h:28
msgid "Move to workspace above"
msgstr "Mover ao espazo de arriba"
#: ../src/50-mutter-navigation.xml.in.h:25
#: ../src/50-mutter-navigation.xml.in.h:29
msgid "Move to workspace below"
msgstr "Mover ao espazo de traballo de abaixo"
@@ -215,7 +231,7 @@ msgstr "Dividir vista á dereita"
#. This probably means that a non-WM compositor like xcompmgr is running;
#. * we have no way to get it to exit
#: ../src/compositor/compositor.c:571
#: ../src/compositor/compositor.c:534
#, c-format
msgid ""
"Another compositing manager is already running on screen %i on display \"%s"
@@ -224,15 +240,15 @@ msgstr ""
"Xa se está a executar outro xestor de composición na pantalla %i na "
"visualización «%s»"
#: ../src/compositor/meta-background.c:1073
#: ../src/compositor/meta-background.c:1074
msgid "background texture could not be created from file"
msgstr "a textura do fondo non puido crearse desde o ficheiro"
#: ../src/core/bell.c:320
#: ../src/core/bell.c:321
msgid "Bell event"
msgstr "Evento de campá"
#: ../src/core/core.c:155
#: ../src/core/core.c:156
#, c-format
msgid "Unknown window information request: %d"
msgstr "Petición de información de xanela descoñecida: %d"
@@ -262,17 +278,17 @@ msgstr "Espe_rar"
msgid "_Force Quit"
msgstr "_Forzar a saída"
#: ../src/core/display.c:413
#: ../src/core/display.c:405
#, c-format
msgid "Missing %s extension required for compositing"
msgstr "Falta a extensión %s que se require para a composición"
#: ../src/core/display.c:505
#: ../src/core/display.c:497
#, c-format
msgid "Failed to open X Window System display '%s'\n"
msgstr "Produciuse un erro ao abrir a visualización do X Window System «%s»\n"
#: ../src/core/keybindings.c:1135
#: ../src/core/keybindings.c:1113
#, c-format
msgid ""
"Some other program is already using the key %s with modifiers %x as a "
@@ -281,7 +297,7 @@ msgstr ""
"Algún outro programa xa está usando a tecla %s cos modificadores %x como "
"combinación\n"
#: ../src/core/keybindings.c:1332
#: ../src/core/keybindings.c:1310
#, c-format
msgid "\"%s\" is not a valid accelerator\n"
msgstr "«%s» non é un acelerador correcto\n"
@@ -310,12 +326,12 @@ msgstr "Inicializar sesión desde o ficheiro de salvagarda"
msgid "Make X calls synchronous"
msgstr "Facer que as chamadas a X sexan sincrónicas"
#: ../src/core/main.c:532
#: ../src/core/main.c:544
#, c-format
msgid "Failed to scan themes directory: %s\n"
msgstr "Produciuse un erro ao dixitalizar o directorio de temas: %s\n"
#: ../src/core/main.c:548
#: ../src/core/main.c:560
#, c-format
msgid ""
"Could not find a theme! Be sure %s exists and contains the usual themes.\n"
@@ -343,7 +359,7 @@ msgstr "Pantalla descoñecida"
msgid "%s %s"
msgstr "%s %s"
#: ../src/core/mutter.c:38
#: ../src/core/mutter.c:39
#, c-format
msgid ""
"mutter %s\n"
@@ -358,15 +374,15 @@ msgstr ""
"There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A "
"PARTICULAR PURPOSE.\n"
#: ../src/core/mutter.c:52
#: ../src/core/mutter.c:53
msgid "Print version"
msgstr "Imprimir versión"
#: ../src/core/mutter.c:58
#: ../src/core/mutter.c:59
msgid "Mutter plugin to use"
msgstr "Engadido de mutter que usar"
#: ../src/core/prefs.c:1200
#: ../src/core/prefs.c:1190
msgid ""
"Workarounds for broken applications disabled. Some applications may not "
"behave properly.\n"
@@ -374,14 +390,14 @@ msgstr ""
"Desactiváronse os arranxos para aplicativos danados. Pode que algúns "
"aplicativos non se comporten correctamente.\n"
#: ../src/core/prefs.c:1275
#: ../src/core/prefs.c:1265
#, c-format
msgid "Could not parse font description \"%s\" from GSettings key %s\n"
msgstr ""
"Non foi posíbel analizar a descrición do tipo de letra «%s» da chave "
"GSettings %s\n"
#: ../src/core/prefs.c:1341
#: ../src/core/prefs.c:1331
#, c-format
msgid ""
"\"%s\" found in configuration database is not a valid value for mouse button "
@@ -390,7 +406,7 @@ msgstr ""
"«%s» atopados na base de datos de configuración non é un valor correcto para "
"o modificador do botón do rato\n"
#: ../src/core/prefs.c:1907
#: ../src/core/prefs.c:1894
#, c-format
msgid ""
"\"%s\" found in configuration database is not a valid value for keybinding "
@@ -399,17 +415,17 @@ msgstr ""
"«%s» atopados na base de datos de configuración non é un valor correcto para "
"a combinación de teclas «%s»\n"
#: ../src/core/prefs.c:1997
#: ../src/core/prefs.c:1984
#, c-format
msgid "Workspace %d"
msgstr "Espazo de traballo %d"
#: ../src/core/screen.c:538
#: ../src/core/screen.c:539
#, c-format
msgid "Screen %d on display '%s' is invalid\n"
msgstr "A pantalla %d na visualización «%s» non é válida\n"
#: ../src/core/screen.c:554
#: ../src/core/screen.c:555
#, c-format
msgid ""
"Screen %d on display \"%s\" already has a window manager; try using the --"
@@ -418,7 +434,7 @@ msgstr ""
"A visualización %d na pantalla «%s» ten xa un xestor de xanelas, tente usar "
"a opción --replace para substituír o xestor de xanelas.\n"
#: ../src/core/screen.c:581
#: ../src/core/screen.c:582
#, c-format
msgid ""
"Could not acquire window manager selection on screen %d display \"%s\"\n"
@@ -426,64 +442,64 @@ msgstr ""
"Non foi posíbel obter a selección do xestor de xanelas na pantalla %d na "
"visualización «%s»\n"
#: ../src/core/screen.c:659
#: ../src/core/screen.c:660
#, c-format
msgid "Screen %d on display \"%s\" already has a window manager\n"
msgstr "A visualización %d na pantalla «%s» ten xa un xestor de xanelas\n"
#: ../src/core/screen.c:851
#: ../src/core/screen.c:848
#, c-format
msgid "Could not release screen %d on display \"%s\"\n"
msgstr "Non foi posíbel liberar a visualización %d na pantalla «%s»\n"
#: ../src/core/session.c:841 ../src/core/session.c:848
#: ../src/core/session.c:842 ../src/core/session.c:849
#, c-format
msgid "Could not create directory '%s': %s\n"
msgstr "Non foi posíbel crear o directorio «%s»: %s\n"
#: ../src/core/session.c:858
#: ../src/core/session.c:859
#, c-format
msgid "Could not open session file '%s' for writing: %s\n"
msgstr "Non foi posíbel abrir o ficheiro de sesión «%s» para escritura: %s\n"
#: ../src/core/session.c:999
#: ../src/core/session.c:1000
#, c-format
msgid "Error writing session file '%s': %s\n"
msgstr "Produciuse un erro ao escribir o ficheiro de sesión «%s»: %s\n"
#: ../src/core/session.c:1004
#: ../src/core/session.c:1005
#, c-format
msgid "Error closing session file '%s': %s\n"
msgstr "Produciuse un erro ao pechar o ficheiro de sesión «%s»: %s\n"
#: ../src/core/session.c:1134
#: ../src/core/session.c:1135
#, c-format
msgid "Failed to parse saved session file: %s\n"
msgstr "Produciuse un erro ao analizar o ficheiro de sesión gardado: %s\n"
#: ../src/core/session.c:1183
#: ../src/core/session.c:1184
#, c-format
msgid "<mutter_session> attribute seen but we already have the session ID"
msgstr "O atributo <mutter_session> foi visto pero xa temos o ID de sesión"
#: ../src/core/session.c:1196 ../src/core/session.c:1271
#: ../src/core/session.c:1303 ../src/core/session.c:1375
#: ../src/core/session.c:1435
#: ../src/core/session.c:1197 ../src/core/session.c:1272
#: ../src/core/session.c:1304 ../src/core/session.c:1376
#: ../src/core/session.c:1436
#, c-format
msgid "Unknown attribute %s on <%s> element"
msgstr "Atributo descoñecido %s no elemento <%s>"
#: ../src/core/session.c:1213
#: ../src/core/session.c:1214
#, c-format
msgid "nested <window> tag"
msgstr "etiqueta <window> aniñada"
#: ../src/core/session.c:1455
#: ../src/core/session.c:1456
#, c-format
msgid "Unknown element %s"
msgstr "Elemento descoñecido %s"
#: ../src/core/session.c:1807
#: ../src/core/session.c:1808
msgid ""
"These windows do not support &quot;save current setup&quot; and will have to "
"be restarted manually next time you log in."
@@ -527,7 +543,7 @@ msgid "Window manager error: "
msgstr "Erro do xestor de xanelas: "
#. first time through
#: ../src/core/window.c:7578
#: ../src/core/window.c:7564
#, c-format
msgid ""
"Window %s sets SM_CLIENT_ID on itself, instead of on the WM_CLIENT_LEADER "
@@ -543,7 +559,7 @@ msgstr ""
#. * MWM but not WM_NORMAL_HINTS are basically broken. We complain
#. * about these apps but make them work.
#.
#: ../src/core/window.c:8500
#: ../src/core/window.c:8489
#, c-format
msgid ""
"Window %s sets an MWM hint indicating it isn't resizable, but sets min size "
@@ -553,23 +569,23 @@ msgstr ""
"mais configurou o tamaño mínimo a %d x %d e o tamaño máximo a %d x %d, isto "
"non ten moito sentido.\n"
#: ../src/core/window-props.c:348
#: ../src/core/window-props.c:349
#, c-format
msgid "Application set a bogus _NET_WM_PID %lu\n"
msgstr "O aplicativo configurou un _NET_WM_PID %lu falso\n"
#: ../src/core/window-props.c:464
#: ../src/core/window-props.c:465
#, c-format
msgid "%s (on %s)"
msgstr "%s (en %s)"
#: ../src/core/window-props.c:1547
#: ../src/core/window-props.c:1548
#, c-format
msgid "Invalid WM_TRANSIENT_FOR window 0x%lx specified for %s.\n"
msgstr ""
"WM_TRANSIENT_FOR non válido para a xanela 0x%lx especificada para %s.\n"
#: ../src/core/window-props.c:1558
#: ../src/core/window-props.c:1559
#, c-format
msgid "WM_TRANSIENT_FOR window 0x%lx for %s would create loop.\n"
msgstr "WM_TRANSIENT_FOR xanela 0x%lx para %s crearía un bucle.\n"

136
po/he.po
View File

@@ -4,15 +4,15 @@
# Copyright (C) 2005 THE PACKAGE'S COPYRIGHT HOLDER
# Gil 'Dolfin' Osher <dolfin@rpg.org.il>, 2002,2003.
# Yuval Tanny, 2005.
# Yosef Or Boczko <yoseforb@gmail.com>, 2013, 2014.
# Yosef Or Boczko <yoseforb@gnome.org>, 2013, 2014.
#
msgid ""
msgstr ""
"Project-Id-Version: metacity.HEAD.he\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-01-13 08:50+0200\n"
"PO-Revision-Date: 2014-01-13 08:51+0200\n"
"Last-Translator: Yosef Or Boczko <yoseforb@gmail.com>\n"
"POT-Creation-Date: 2014-03-02 01:10+0200\n"
"PO-Revision-Date: 2014-03-02 01:11+0200\n"
"Last-Translator: Yosef Or Boczko <yoseforb@gnome.org>\n"
"Language-Team: עברית <>\n"
"Language: he\n"
"MIME-Version: 1.0\n"
@@ -58,66 +58,82 @@ msgid "Move window one workspace down"
msgstr "העברת החלון למרחב העבודה שמלמטה"
#: ../src/50-mutter-navigation.xml.in.h:10
msgid "Move window one monitor to the left"
msgstr "העברת החלון לצג שמשמאל"
#: ../src/50-mutter-navigation.xml.in.h:11
msgid "Move window one monitor to the right"
msgstr "העברת החלון לצג שמימין"
#: ../src/50-mutter-navigation.xml.in.h:12
msgid "Move window one monitor up"
msgstr "העברת החלון לצג שמלמעלה"
#: ../src/50-mutter-navigation.xml.in.h:13
msgid "Move window one monitor down"
msgstr "העברת החלון לצג שמלמטה"
#: ../src/50-mutter-navigation.xml.in.h:14
msgid "Switch applications"
msgstr "החלפה בין יישומים"
#: ../src/50-mutter-navigation.xml.in.h:11
#: ../src/50-mutter-navigation.xml.in.h:15
msgid "Switch windows"
msgstr "החלפת חלונות"
#: ../src/50-mutter-navigation.xml.in.h:12
#: ../src/50-mutter-navigation.xml.in.h:16
msgid "Switch windows of an application"
msgstr "החלפה בין חלונות של יישום"
#: ../src/50-mutter-navigation.xml.in.h:13
#: ../src/50-mutter-navigation.xml.in.h:17
msgid "Switch system controls"
msgstr "החלפה בין פקדי המערכת"
#: ../src/50-mutter-navigation.xml.in.h:14
#: ../src/50-mutter-navigation.xml.in.h:18
msgid "Switch windows directly"
msgstr "החלפת החלונות באופן ישיר"
#: ../src/50-mutter-navigation.xml.in.h:15
#: ../src/50-mutter-navigation.xml.in.h:19
msgid "Switch windows of an app directly"
msgstr "החלפת חלונות של יישום באופן ישיר"
#: ../src/50-mutter-navigation.xml.in.h:16
#: ../src/50-mutter-navigation.xml.in.h:20
msgid "Switch system controls directly"
msgstr "החלפת פקדי המערכת באופן ישיר"
#: ../src/50-mutter-navigation.xml.in.h:17
#: ../src/50-mutter-navigation.xml.in.h:21
msgid "Hide all normal windows"
msgstr "הסתרת כל החלונות הרגילים"
#: ../src/50-mutter-navigation.xml.in.h:18
#: ../src/50-mutter-navigation.xml.in.h:22
msgid "Switch to workspace 1"
msgstr "מעבר למרחב עבודה 1"
#: ../src/50-mutter-navigation.xml.in.h:19
#: ../src/50-mutter-navigation.xml.in.h:23
msgid "Switch to workspace 2"
msgstr "מעבר למרחב עבודה 2"
#: ../src/50-mutter-navigation.xml.in.h:20
#: ../src/50-mutter-navigation.xml.in.h:24
msgid "Switch to workspace 3"
msgstr "מעבר למרחב עבודה 3"
#: ../src/50-mutter-navigation.xml.in.h:21
#: ../src/50-mutter-navigation.xml.in.h:25
msgid "Switch to workspace 4"
msgstr "מעבר למרחב עבודה 4"
#: ../src/50-mutter-navigation.xml.in.h:22
#: ../src/50-mutter-navigation.xml.in.h:26
msgid "Move to workspace left"
msgstr "העברה למרחב העבודה לשמאל"
#: ../src/50-mutter-navigation.xml.in.h:23
#: ../src/50-mutter-navigation.xml.in.h:27
msgid "Move to workspace right"
msgstr "העברה למרחב העבודה לימין"
#: ../src/50-mutter-navigation.xml.in.h:24
#: ../src/50-mutter-navigation.xml.in.h:28
msgid "Move to workspace above"
msgstr "העברה למרחב העבודה שמלמעלה"
#: ../src/50-mutter-navigation.xml.in.h:25
#: ../src/50-mutter-navigation.xml.in.h:29
msgid "Move to workspace below"
msgstr "העברה למרחב העבודה שמלמטה"
@@ -211,22 +227,22 @@ msgstr "פיצול הצפייה מימין"
#. This probably means that a non-WM compositor like xcompmgr is running;
#. * we have no way to get it to exit
#: ../src/compositor/compositor.c:571
#: ../src/compositor/compositor.c:534
#, c-format
msgid ""
"Another compositing manager is already running on screen %i on display \"%s"
"\"."
msgstr "מנהל תצוגת חלונות אחר כבר פועל במסך %i בתצוגה „%s“."
#: ../src/compositor/meta-background.c:1073
#: ../src/compositor/meta-background.c:1074
msgid "background texture could not be created from file"
msgstr "לא ניתן ליצור מרקם רקע מקובץ"
#: ../src/core/bell.c:320
#: ../src/core/bell.c:321
msgid "Bell event"
msgstr "אירוע פעמון"
#: ../src/core/core.c:155
#: ../src/core/core.c:156
#, c-format
msgid "Unknown window information request: %d"
msgstr "Unknown window information request: %d"
@@ -255,24 +271,24 @@ msgstr "ה_מתנה"
msgid "_Force Quit"
msgstr "_אילוץ סגירה"
#: ../src/core/display.c:413
#: ../src/core/display.c:405
#, c-format
msgid "Missing %s extension required for compositing"
msgstr "Missing %s extension required for compositing"
#: ../src/core/display.c:505
#: ../src/core/display.c:497
#, c-format
msgid "Failed to open X Window System display '%s'\n"
msgstr "Failed to open X Window System display '%s'\n"
#: ../src/core/keybindings.c:1135
#: ../src/core/keybindings.c:1113
#, c-format
msgid ""
"Some other program is already using the key %s with modifiers %x as a "
"binding\n"
msgstr "תכנית אחרת כבר משתמשת במקש %s עם המקש %x כצירוף\n"
#: ../src/core/keybindings.c:1332
#: ../src/core/keybindings.c:1310
#, c-format
msgid "\"%s\" is not a valid accelerator\n"
msgstr "\"%s\" אינו מקש האצה תקני\n"
@@ -301,12 +317,12 @@ msgstr "Initialize session from savefile"
msgid "Make X calls synchronous"
msgstr "Make X calls synchronous"
#: ../src/core/main.c:532
#: ../src/core/main.c:544
#, c-format
msgid "Failed to scan themes directory: %s\n"
msgstr "Failed to scan themes directory: %s\n"
#: ../src/core/main.c:548
#: ../src/core/main.c:560
#, c-format
msgid ""
"Could not find a theme! Be sure %s exists and contains the usual themes.\n"
@@ -333,7 +349,7 @@ msgstr "תצוגה לא ידועה"
msgid "%s %s"
msgstr "%s %s"
#: ../src/core/mutter.c:38
#: ../src/core/mutter.c:39
#, c-format
msgid ""
"mutter %s\n"
@@ -347,15 +363,15 @@ msgstr ""
"זוהי תכנה חופשית; יש לעיין במקור כדי לקבל מידע אודות תנאי ההעתקה.\n"
"לא קיימת שום אחריות; אפילו לא עבור סחר או התאמה לצרכים מסוימים.\n"
#: ../src/core/mutter.c:52
#: ../src/core/mutter.c:53
msgid "Print version"
msgstr "Print version"
#: ../src/core/mutter.c:58
#: ../src/core/mutter.c:59
msgid "Mutter plugin to use"
msgstr "תוסף ה־mutter לשימוש"
#: ../src/core/prefs.c:1200
#: ../src/core/prefs.c:1190
msgid ""
"Workarounds for broken applications disabled. Some applications may not "
"behave properly.\n"
@@ -363,12 +379,12 @@ msgstr ""
"Workarounds for broken applications disabled. Some applications may not "
"behave properly.\n"
#: ../src/core/prefs.c:1275
#: ../src/core/prefs.c:1265
#, c-format
msgid "Could not parse font description \"%s\" from GSettings key %s\n"
msgstr "Could not parse font description \"%s\" from GSettings key %s\n"
#: ../src/core/prefs.c:1341
#: ../src/core/prefs.c:1331
#, c-format
msgid ""
"\"%s\" found in configuration database is not a valid value for mouse button "
@@ -377,7 +393,7 @@ msgstr ""
"\"%s\" found in configuration database is not a valid value for mouse button "
"modifier\n"
#: ../src/core/prefs.c:1907
#: ../src/core/prefs.c:1894
#, c-format
msgid ""
"\"%s\" found in configuration database is not a valid value for keybinding "
@@ -386,17 +402,17 @@ msgstr ""
"\"%s\" found in configuration database is not a valid value for keybinding "
"\"%s\"\n"
#: ../src/core/prefs.c:1997
#: ../src/core/prefs.c:1984
#, c-format
msgid "Workspace %d"
msgstr "מרחב עבודה %d"
#: ../src/core/screen.c:538
#: ../src/core/screen.c:539
#, c-format
msgid "Screen %d on display '%s' is invalid\n"
msgstr "Screen %d on display '%s' is invalid\n"
#: ../src/core/screen.c:554
#: ../src/core/screen.c:555
#, c-format
msgid ""
"Screen %d on display \"%s\" already has a window manager; try using the --"
@@ -405,71 +421,71 @@ msgstr ""
"Screen %d on display \"%s\" already has a window manager; try using the --"
"replace option to replace the current window manager.\n"
#: ../src/core/screen.c:581
#: ../src/core/screen.c:582
#, c-format
msgid ""
"Could not acquire window manager selection on screen %d display \"%s\"\n"
msgstr ""
"Could not acquire window manager selection on screen %d display \"%s\"\n"
#: ../src/core/screen.c:659
#: ../src/core/screen.c:660
#, c-format
msgid "Screen %d on display \"%s\" already has a window manager\n"
msgstr "Screen %d on display \"%s\" already has a window manager\n"
#: ../src/core/screen.c:851
#: ../src/core/screen.c:848
#, c-format
msgid "Could not release screen %d on display \"%s\"\n"
msgstr "Could not release screen %d on display \"%s\"\n"
#: ../src/core/session.c:841 ../src/core/session.c:848
#: ../src/core/session.c:842 ../src/core/session.c:849
#, c-format
msgid "Could not create directory '%s': %s\n"
msgstr "Could not create directory '%s': %s\n"
#: ../src/core/session.c:858
#: ../src/core/session.c:859
#, c-format
msgid "Could not open session file '%s' for writing: %s\n"
msgstr "Could not open session file '%s' for writing: %s\n"
#: ../src/core/session.c:999
#: ../src/core/session.c:1000
#, c-format
msgid "Error writing session file '%s': %s\n"
msgstr "Error writing session file '%s': %s\n"
#: ../src/core/session.c:1004
#: ../src/core/session.c:1005
#, c-format
msgid "Error closing session file '%s': %s\n"
msgstr "Error closing session file '%s': %s\n"
#: ../src/core/session.c:1134
#: ../src/core/session.c:1135
#, c-format
msgid "Failed to parse saved session file: %s\n"
msgstr "Failed to parse saved session file: %s\n"
#: ../src/core/session.c:1183
#: ../src/core/session.c:1184
#, c-format
msgid "<mutter_session> attribute seen but we already have the session ID"
msgstr "התכונה <mutter_session> מופיעה אך כבר יש בידינו את מספר זיהוי ההפעלה"
#: ../src/core/session.c:1196 ../src/core/session.c:1271
#: ../src/core/session.c:1303 ../src/core/session.c:1375
#: ../src/core/session.c:1435
#: ../src/core/session.c:1197 ../src/core/session.c:1272
#: ../src/core/session.c:1304 ../src/core/session.c:1376
#: ../src/core/session.c:1436
#, c-format
msgid "Unknown attribute %s on <%s> element"
msgstr "Unknown attribute %s on <%s> element"
#: ../src/core/session.c:1213
#: ../src/core/session.c:1214
#, c-format
msgid "nested <window> tag"
msgstr "nested <window> tag"
#: ../src/core/session.c:1455
#: ../src/core/session.c:1456
#, c-format
msgid "Unknown element %s"
msgstr "Unknown element %s"
#: ../src/core/session.c:1807
#: ../src/core/session.c:1808
msgid ""
"These windows do not support &quot;save current setup&quot; and will have to "
"be restarted manually next time you log in."
@@ -513,7 +529,7 @@ msgid "Window manager error: "
msgstr "Window manager error: "
#. first time through
#: ../src/core/window.c:7588
#: ../src/core/window.c:7564
#, c-format
msgid ""
"Window %s sets SM_CLIENT_ID on itself, instead of on the WM_CLIENT_LEADER "
@@ -529,7 +545,7 @@ msgstr ""
#. * MWM but not WM_NORMAL_HINTS are basically broken. We complain
#. * about these apps but make them work.
#.
#: ../src/core/window.c:8510
#: ../src/core/window.c:8489
#, c-format
msgid ""
"Window %s sets an MWM hint indicating it isn't resizable, but sets min size "
@@ -538,22 +554,22 @@ msgstr ""
"Window %s sets an MWM hint indicating it isn't resizable, but sets min size "
"%d x %d and max size %d x %d; this doesn't make much sense.\n"
#: ../src/core/window-props.c:348
#: ../src/core/window-props.c:349
#, c-format
msgid "Application set a bogus _NET_WM_PID %lu\n"
msgstr "Application set a bogus _NET_WM_PID %lu\n"
#: ../src/core/window-props.c:464
#: ../src/core/window-props.c:465
#, c-format
msgid "%s (on %s)"
msgstr "%s (מעל %s)"
#: ../src/core/window-props.c:1547
#: ../src/core/window-props.c:1548
#, c-format
msgid "Invalid WM_TRANSIENT_FOR window 0x%lx specified for %s.\n"
msgstr "Invalid WM_TRANSIENT_FOR window 0x%lx specified for %s.\n"
#: ../src/core/window-props.c:1558
#: ../src/core/window-props.c:1559
#, c-format
msgid "WM_TRANSIENT_FOR window 0x%lx for %s would create loop.\n"
msgstr "WM_TRANSIENT_FOR window 0x%lx for %s would create loop.\n"

528
po/hu.po

File diff suppressed because it is too large Load Diff

525
po/id.po

File diff suppressed because it is too large Load Diff

515
po/it.po

File diff suppressed because it is too large Load Diff

2012
po/kn.po

File diff suppressed because it is too large Load Diff

535
po/ko.po

File diff suppressed because it is too large Load Diff

527
po/lt.po

File diff suppressed because it is too large Load Diff

532
po/lv.po

File diff suppressed because it is too large Load Diff

523
po/nb.po

File diff suppressed because it is too large Load Diff

528
po/pa.po

File diff suppressed because it is too large Load Diff

523
po/pl.po

File diff suppressed because it is too large Load Diff

533
po/pt.po

File diff suppressed because it is too large Load Diff

View File

@@ -21,8 +21,8 @@ msgstr ""
"Project-Id-Version: mutter\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
"product=mutter&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2014-01-13 16:35+0000\n"
"PO-Revision-Date: 2014-01-10 14:28-0300\n"
"POT-Creation-Date: 2014-02-28 22:53+0000\n"
"PO-Revision-Date: 2014-02-28 20:24-0300\n"
"Last-Translator: Enrico Nicoletto <liverig@gmail.com>\n"
"Language-Team: Brazilian Portuguese <gnome-pt_br-list@gnome.org>\n"
"Language: pt_BR\n"
@@ -30,7 +30,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Generator: Poedit 1.5.4\n"
"X-Generator: Poedit 1.6.3\n"
#: ../src/50-mutter-navigation.xml.in.h:1
msgid "Navigation"
@@ -68,67 +68,91 @@ msgstr "Mover a janela um espaço de trabalho acima"
msgid "Move window one workspace down"
msgstr "Mover a janela um espaço de trabalho abaixo"
# Em conformidade com a tradução do gsettings-desktop-schemas --Enrico
#: ../src/50-mutter-navigation.xml.in.h:10
#| msgid "Move window one workspace to the left"
msgid "Move window one monitor to the left"
msgstr "Mover janela para o monitor da esquerda"
# Em conformidade com a tradução do gsettings-desktop-schemas --Enrico
#: ../src/50-mutter-navigation.xml.in.h:11
#| msgid "Move window one workspace to the right"
msgid "Move window one monitor to the right"
msgstr "Mover janela para o monitor da direita"
# Em conformidade com a tradução do gsettings-desktop-schemas --Enrico
#: ../src/50-mutter-navigation.xml.in.h:12
#| msgid "Move window one workspace up"
msgid "Move window one monitor up"
msgstr "Mover janela para o monitor acima"
# Em conformidade com a tradução do gsettings-desktop-schemas --Enrico
#: ../src/50-mutter-navigation.xml.in.h:13
#| msgid "Move window one workspace down"
msgid "Move window one monitor down"
msgstr "Mover janela para o monitor abaixo"
#: ../src/50-mutter-navigation.xml.in.h:14
msgid "Switch applications"
msgstr "Alternar aplicativos"
#: ../src/50-mutter-navigation.xml.in.h:11
#: ../src/50-mutter-navigation.xml.in.h:15
msgid "Switch windows"
msgstr "Alternar janelas"
#: ../src/50-mutter-navigation.xml.in.h:12
#: ../src/50-mutter-navigation.xml.in.h:16
msgid "Switch windows of an application"
msgstr "Alternar as janelas de um aplicativo"
#: ../src/50-mutter-navigation.xml.in.h:13
#: ../src/50-mutter-navigation.xml.in.h:17
msgid "Switch system controls"
msgstr "Alternar os controles de sistema"
#: ../src/50-mutter-navigation.xml.in.h:14
#: ../src/50-mutter-navigation.xml.in.h:18
msgid "Switch windows directly"
msgstr "Alternar as janelas diretamente"
#: ../src/50-mutter-navigation.xml.in.h:15
#: ../src/50-mutter-navigation.xml.in.h:19
msgid "Switch windows of an app directly"
msgstr "Alternar as janelas de um aplicativo diretamente"
#: ../src/50-mutter-navigation.xml.in.h:16
#: ../src/50-mutter-navigation.xml.in.h:20
msgid "Switch system controls directly"
msgstr "Alternar os controles de sistema diretamente"
#: ../src/50-mutter-navigation.xml.in.h:17
#: ../src/50-mutter-navigation.xml.in.h:21
msgid "Hide all normal windows"
msgstr "Ocultar todas as janelas normais"
#: ../src/50-mutter-navigation.xml.in.h:18
#: ../src/50-mutter-navigation.xml.in.h:22
msgid "Switch to workspace 1"
msgstr "Trocar para o espaço de trabalho 1"
#: ../src/50-mutter-navigation.xml.in.h:19
#: ../src/50-mutter-navigation.xml.in.h:23
msgid "Switch to workspace 2"
msgstr "Trocar para o espaço de trabalho 2"
#: ../src/50-mutter-navigation.xml.in.h:20
#: ../src/50-mutter-navigation.xml.in.h:24
msgid "Switch to workspace 3"
msgstr "Trocar para o espaço de trabalho 3"
#: ../src/50-mutter-navigation.xml.in.h:21
#: ../src/50-mutter-navigation.xml.in.h:25
msgid "Switch to workspace 4"
msgstr "Trocar para o espaço de trabalho 4"
#: ../src/50-mutter-navigation.xml.in.h:22
#: ../src/50-mutter-navigation.xml.in.h:26
msgid "Move to workspace left"
msgstr "Move para o espaço de trabalho à esquerda"
#: ../src/50-mutter-navigation.xml.in.h:23
#: ../src/50-mutter-navigation.xml.in.h:27
msgid "Move to workspace right"
msgstr "Move para o espaço de trabalho à direita"
#: ../src/50-mutter-navigation.xml.in.h:24
#: ../src/50-mutter-navigation.xml.in.h:28
msgid "Move to workspace above"
msgstr "Mover para o espaço de trabalho acima"
#: ../src/50-mutter-navigation.xml.in.h:25
#: ../src/50-mutter-navigation.xml.in.h:29
msgid "Move to workspace below"
msgstr "Mover para o espaço de trabalho abaixo"
@@ -222,7 +246,7 @@ msgstr "Visualizar divisão à direita"
#. This probably means that a non-WM compositor like xcompmgr is running;
#. * we have no way to get it to exit
#: ../src/compositor/compositor.c:571
#: ../src/compositor/compositor.c:534
#, c-format
msgid ""
"Another compositing manager is already running on screen %i on display \"%s"
@@ -230,15 +254,15 @@ msgid ""
msgstr ""
"Outro compositor de janelas está em execução na tela %i na área \"%s\"."
#: ../src/compositor/meta-background.c:1073
#: ../src/compositor/meta-background.c:1074
msgid "background texture could not be created from file"
msgstr "textura de plano de fundo não pôde ser criado de arquivo"
#: ../src/core/bell.c:320
#: ../src/core/bell.c:321
msgid "Bell event"
msgstr "Evento de som"
#: ../src/core/core.c:155
#: ../src/core/core.c:156
#, c-format
msgid "Unknown window information request: %d"
msgstr "Informação solicitada de janela desconhecida: %d"
@@ -268,17 +292,17 @@ msgstr "_Esperar"
msgid "_Force Quit"
msgstr "_Forçar sair"
#: ../src/core/display.c:413
#: ../src/core/display.c:405
#, c-format
msgid "Missing %s extension required for compositing"
msgstr "Faltando extensão %s necessária para composição"
#: ../src/core/display.c:505
#: ../src/core/display.c:497
#, c-format
msgid "Failed to open X Window System display '%s'\n"
msgstr "Falha ao abrir a exibição \"%s\" do sistema de janelas X\n"
#: ../src/core/keybindings.c:1135
#: ../src/core/keybindings.c:1113
#, c-format
msgid ""
"Some other program is already using the key %s with modifiers %x as a "
@@ -287,7 +311,7 @@ msgstr ""
"Algum outro programa já está usando a chave %s com modificadores %x como uma "
"tecla de atalho\n"
#: ../src/core/keybindings.c:1332
#: ../src/core/keybindings.c:1310
#, c-format
msgid "\"%s\" is not a valid accelerator\n"
msgstr "\"%s\" não é um acelerador válido\n"
@@ -316,12 +340,12 @@ msgstr "Inicializar a sessão a partir do arquivo salvo"
msgid "Make X calls synchronous"
msgstr "Fazer X chamadas síncronas"
#: ../src/core/main.c:532
#: ../src/core/main.c:544
#, c-format
msgid "Failed to scan themes directory: %s\n"
msgstr "Falha ao varrer a pasta de temas: %s\n"
#: ../src/core/main.c:548
#: ../src/core/main.c:560
#, c-format
msgid ""
"Could not find a theme! Be sure %s exists and contains the usual themes.\n"
@@ -349,7 +373,7 @@ msgstr "Monitor desconhecido"
msgid "%s %s"
msgstr "%s de %s"
#: ../src/core/mutter.c:38
#: ../src/core/mutter.c:39
#, c-format
msgid ""
"mutter %s\n"
@@ -362,18 +386,18 @@ msgstr ""
"Copyright (C) 2001-%d Havoc Pennington, Red Hat, Inc., e outros\n"
"Esse programa é um software livre; veja o código fonte para obter as "
"condições de cópia.\n"
"Não há NENHUMA garantia; nem mesmo para o COMERCIALIZAÇÃO ou ADEQUAÇÃO\n"
"Não há NENHUMA garantia; nem mesmo para a COMERCIALIZAÇÃO ou ADEQUAÇÃO\n"
"PARA UM PROPÓSITO PARTICULAR.\n"
#: ../src/core/mutter.c:52
#: ../src/core/mutter.c:53
msgid "Print version"
msgstr "Versão impressa"
#: ../src/core/mutter.c:58
#: ../src/core/mutter.c:59
msgid "Mutter plugin to use"
msgstr "Plug-in do Mutter para usar"
#: ../src/core/prefs.c:1200
#: ../src/core/prefs.c:1190
msgid ""
"Workarounds for broken applications disabled. Some applications may not "
"behave properly.\n"
@@ -381,14 +405,14 @@ msgstr ""
"As alternativas para aplicativos quebrados estão desabilitadas. É possível "
"que alguns aplicativos não funcionem de maneira adequada.\n"
#: ../src/core/prefs.c:1275
#: ../src/core/prefs.c:1265
#, c-format
msgid "Could not parse font description \"%s\" from GSettings key %s\n"
msgstr ""
"Não foi possível analisar a descrição da fonte \"%s\" a partir da chave "
"GSettings %s\n"
#: ../src/core/prefs.c:1341
#: ../src/core/prefs.c:1331
#, c-format
msgid ""
"\"%s\" found in configuration database is not a valid value for mouse button "
@@ -397,7 +421,7 @@ msgstr ""
"\"%s\" localizado no banco de dados de configurações não é um valor válido "
"para o modificador de botão do mouse\n"
#: ../src/core/prefs.c:1907
#: ../src/core/prefs.c:1894
#, c-format
msgid ""
"\"%s\" found in configuration database is not a valid value for keybinding "
@@ -406,17 +430,17 @@ msgstr ""
"\"%s\" localizado no banco de dados de configurações não é um valor válido "
"para a tecla de atalho \"%s\"\n"
#: ../src/core/prefs.c:1997
#: ../src/core/prefs.c:1984
#, c-format
msgid "Workspace %d"
msgstr "Espaço de trabalho %d"
#: ../src/core/screen.c:538
#: ../src/core/screen.c:539
#, c-format
msgid "Screen %d on display '%s' is invalid\n"
msgstr "A tela %d na exibição \"%s\" é inválida\n"
#: ../src/core/screen.c:554
#: ../src/core/screen.c:555
#, c-format
msgid ""
"Screen %d on display \"%s\" already has a window manager; try using the --"
@@ -425,7 +449,7 @@ msgstr ""
"A tela %d na exibição \"%s\" já possui um gerenciador de janelas; tente usar "
"a opção --replace para substituir o gerenciador de janelas atual.\n"
#: ../src/core/screen.c:581
#: ../src/core/screen.c:582
#, c-format
msgid ""
"Could not acquire window manager selection on screen %d display \"%s\"\n"
@@ -433,64 +457,64 @@ msgstr ""
"Não foi possível obter a seleção do gerenciador de janelas na exibição \"%2$s"
"\" da tela %1$d\n"
#: ../src/core/screen.c:659
#: ../src/core/screen.c:660
#, c-format
msgid "Screen %d on display \"%s\" already has a window manager\n"
msgstr "A tela %d na exibição \"%s\" já possui um gerenciador de janelas\n"
#: ../src/core/screen.c:851
#: ../src/core/screen.c:848
#, c-format
msgid "Could not release screen %d on display \"%s\"\n"
msgstr "Não foi possível liberar a tela %d na exibição \"%s\"\n"
#: ../src/core/session.c:841 ../src/core/session.c:848
#: ../src/core/session.c:842 ../src/core/session.c:849
#, c-format
msgid "Could not create directory '%s': %s\n"
msgstr "Não foi possível criar o diretório \"%s\": %s\n"
#: ../src/core/session.c:858
#: ../src/core/session.c:859
#, c-format
msgid "Could not open session file '%s' for writing: %s\n"
msgstr "Não foi possível abrir o arquivo de sessão \"%s\" para gravação: %s\n"
#: ../src/core/session.c:999
#: ../src/core/session.c:1000
#, c-format
msgid "Error writing session file '%s': %s\n"
msgstr "Erro ao gravar o arquivo de sessão\"%s\": %s\n"
#: ../src/core/session.c:1004
#: ../src/core/session.c:1005
#, c-format
msgid "Error closing session file '%s': %s\n"
msgstr "Erro ao fechar o arquivo de sessão \"%s\": %s\n"
#: ../src/core/session.c:1134
#: ../src/core/session.c:1135
#, c-format
msgid "Failed to parse saved session file: %s\n"
msgstr "Falha ao analisar o arquivo de sessão salvo: %s\n"
#: ../src/core/session.c:1183
#: ../src/core/session.c:1184
#, c-format
msgid "<mutter_session> attribute seen but we already have the session ID"
msgstr "O atributo <mutter_session> foi visto, mas já temos o ID da sessão"
#: ../src/core/session.c:1196 ../src/core/session.c:1271
#: ../src/core/session.c:1303 ../src/core/session.c:1375
#: ../src/core/session.c:1435
#: ../src/core/session.c:1197 ../src/core/session.c:1272
#: ../src/core/session.c:1304 ../src/core/session.c:1376
#: ../src/core/session.c:1436
#, c-format
msgid "Unknown attribute %s on <%s> element"
msgstr "Atributo %s desconhecido no elemento <%s>"
#: ../src/core/session.c:1213
#: ../src/core/session.c:1214
#, c-format
msgid "nested <window> tag"
msgstr "marca de <window> aninhada"
#: ../src/core/session.c:1455
#: ../src/core/session.c:1456
#, c-format
msgid "Unknown element %s"
msgstr "Elemento %s desconhecido"
#: ../src/core/session.c:1807
#: ../src/core/session.c:1808
msgid ""
"These windows do not support &quot;save current setup&quot; and will have to "
"be restarted manually next time you log in."
@@ -535,7 +559,7 @@ msgid "Window manager error: "
msgstr "Erro do gerenciador de janelas: "
#. first time through
#: ../src/core/window.c:7578
#: ../src/core/window.c:7564
#, c-format
msgid ""
"Window %s sets SM_CLIENT_ID on itself, instead of on the WM_CLIENT_LEADER "
@@ -551,7 +575,7 @@ msgstr ""
#. * MWM but not WM_NORMAL_HINTS are basically broken. We complain
#. * about these apps but make them work.
#.
#: ../src/core/window.c:8500
#: ../src/core/window.c:8489
#, c-format
msgid ""
"Window %s sets an MWM hint indicating it isn't resizable, but sets min size "
@@ -561,22 +585,22 @@ msgstr ""
"define o tamanho mínimo %d x %d e máximo %d x %d; isso não faz muito "
"sentido.\n"
#: ../src/core/window-props.c:348
#: ../src/core/window-props.c:349
#, c-format
msgid "Application set a bogus _NET_WM_PID %lu\n"
msgstr "O aplicativo definiu um _NET_WM_PID %lu inválido\n"
#: ../src/core/window-props.c:464
#: ../src/core/window-props.c:465
#, c-format
msgid "%s (on %s)"
msgstr "%s (em %s)"
#: ../src/core/window-props.c:1547
#: ../src/core/window-props.c:1548
#, c-format
msgid "Invalid WM_TRANSIENT_FOR window 0x%lx specified for %s.\n"
msgstr "Janela WM_TRANSIENT_FOR inválida 0x%lx especificada para %s.\n"
#: ../src/core/window-props.c:1558
#: ../src/core/window-props.c:1559
#, c-format
msgid "WM_TRANSIENT_FOR window 0x%lx for %s would create loop.\n"
msgstr "Janela WM_TRANSIENT_FOR 0x%lx especificada para %s iriar criar loop.\n"

996
po/ru.po

File diff suppressed because it is too large Load Diff

526
po/sl.po

File diff suppressed because it is too large Load Diff

553
po/sr.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1224
po/uk.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -29,6 +29,18 @@
<KeyListEntry name="move-to-workspace-down"
_description="Move window one workspace down" />
<KeyListEntry name="move-to-monitor-left"
_description="Move window one monitor to the left" />
<KeyListEntry name="move-to-monitor-right"
_description="Move window one monitor to the right" />
<KeyListEntry name="move-to-monitor-up"
_description="Move window one monitor up" />
<KeyListEntry name="move-to-monitor-down"
_description="Move window one monitor down" />
<KeyListEntry name="switch-applications"
_description="Switch applications"/>

View File

@@ -65,6 +65,7 @@ libmutter_la_SOURCES = \
compositor/meta-shadow-factory.c \
compositor/meta-shadow-factory-private.h \
compositor/meta-shaped-texture.c \
compositor/meta-shaped-texture-private.h \
compositor/meta-texture-rectangle.c \
compositor/meta-texture-rectangle.h \
compositor/meta-texture-tower.c \
@@ -93,8 +94,6 @@ libmutter_la_SOURCES = \
core/display.c \
core/display-private.h \
meta/display.h \
ui/draw-workspace.c \
ui/draw-workspace.h \
core/edge-resistance.c \
core/edge-resistance.h \
core/edid-parse.c \
@@ -141,6 +140,7 @@ libmutter_la_SOURCES = \
core/stack-tracker.h \
core/util.c \
meta/util.h \
core/util-private.h \
core/window-props.c \
core/window-props.h \
core/window.c \
@@ -161,10 +161,6 @@ libmutter_la_SOURCES = \
ui/metaaccellabel.h \
ui/resizepopup.c \
ui/resizepopup.h \
ui/tabpopup.c \
ui/tabpopup.h \
ui/tile-preview.c \
ui/tile-preview.h \
ui/theme-parser.c \
ui/theme.c \
meta/theme.h \

View File

@@ -42,15 +42,6 @@
* the call, so it may be necessary to readjust the display based on the
* old_rect to start the animation.
*
* meta_compositor_window_mapped() and meta_compositor_window_unmapped() are
* notifications when the toplevel window (frame or client window) is mapped or
* unmapped. That is, when the result of meta_window_toplevel_is_mapped()
* changes. The main use of this is to drop resources when a window is unmapped.
* A window will always be mapped before meta_compositor_show_window()
* is called and will not be unmapped until after meta_compositor_hide_window()
* is called. If the live_hidden_windows preference is set, windows will never
* be unmapped.
*
* # Containers #
*
* There's two containers in the stage that are used to place window actors, here
@@ -84,6 +75,7 @@
#include "meta-window-group.h"
#include "window-private.h" /* to check window->hidden */
#include "display-private.h" /* for meta_display_lookup_x_window() */
#include "util-private.h"
#include <X11/extensions/shape.h>
#include <X11/extensions/Xcomposite.h>
@@ -1272,30 +1264,6 @@ meta_compositor_sync_stack (MetaCompositor *compositor,
sync_actor_stacking (info);
}
void
meta_compositor_window_mapped (MetaCompositor *compositor,
MetaWindow *window)
{
MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
DEBUG_TRACE ("meta_compositor_window_mapped\n");
if (!window_actor)
return;
meta_window_actor_mapped (window_actor);
}
void
meta_compositor_window_unmapped (MetaCompositor *compositor,
MetaWindow *window)
{
MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
DEBUG_TRACE ("meta_compositor_window_unmapped\n");
if (!window_actor)
return;
meta_window_actor_unmapped (window_actor);
}
void
meta_compositor_sync_window_geometry (MetaCompositor *compositor,
MetaWindow *window,
@@ -1619,3 +1587,31 @@ meta_compositor_monotonic_time_to_server_time (MetaDisplay *display,
else
return monotonic_time + compositor->server_time_offset;
}
void
meta_compositor_show_tile_preview (MetaCompositor *compositor,
MetaScreen *screen,
MetaWindow *window,
MetaRectangle *tile_rect,
int tile_monitor_number)
{
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
if (!info->plugin_mgr)
return;
meta_plugin_manager_show_tile_preview (info->plugin_mgr,
window, tile_rect, tile_monitor_number);
}
void
meta_compositor_hide_tile_preview (MetaCompositor *compositor,
MetaScreen *screen)
{
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
if (!info->plugin_mgr)
return;
meta_plugin_manager_hide_tile_preview (info->plugin_mgr);
}

View File

@@ -35,6 +35,7 @@
#include "mutter-enum-types.h"
#include <meta/errors.h>
#include <meta/meta-background.h>
#include "util-private.h"
#include "meta-background-actor-private.h"
#define FRAGMENT_SHADER_DECLARATIONS \

View File

@@ -70,10 +70,16 @@ meta_cullable_cull_out_children (MetaCullable *cullable,
while (clutter_actor_iter_prev (&iter, &child))
{
float x, y;
gboolean needs_culling;
if (!CLUTTER_ACTOR_IS_VISIBLE (child))
if (!META_IS_CULLABLE (child))
continue;
needs_culling = (unobscured_region != NULL && clip_region != NULL);
if (needs_culling && !CLUTTER_ACTOR_IS_VISIBLE (child))
needs_culling = FALSE;
/* If an actor has effects applied, then that can change the area
* it paints and the opacity, so we no longer can figure out what
* portion of the actor is obscured and what portion of the screen
@@ -90,25 +96,29 @@ meta_cullable_cull_out_children (MetaCullable *cullable,
* as well for the same reason, but omitted for simplicity in the
* hopes that no-one will do that.
*/
if (clutter_actor_has_effects (child))
continue;
if (needs_culling && clutter_actor_has_effects (child))
needs_culling = FALSE;
if (!META_IS_CULLABLE (child))
continue;
if (needs_culling && !meta_actor_is_untransformed (child, NULL, NULL))
needs_culling = FALSE;
if (!meta_actor_is_untransformed (child, NULL, NULL))
continue;
if (needs_culling)
{
clutter_actor_get_position (child, &x, &y);
clutter_actor_get_position (child, &x, &y);
/* Temporarily move to the coordinate system of the actor */
cairo_region_translate (unobscured_region, - x, - y);
cairo_region_translate (clip_region, - x, - y);
/* Temporarily move to the coordinate system of the actor */
cairo_region_translate (unobscured_region, - x, - y);
cairo_region_translate (clip_region, - x, - y);
meta_cullable_cull_out (META_CULLABLE (child), unobscured_region, clip_region);
meta_cullable_cull_out (META_CULLABLE (child), unobscured_region, clip_region);
cairo_region_translate (unobscured_region, x, y);
cairo_region_translate (clip_region, x, y);
cairo_region_translate (unobscured_region, x, y);
cairo_region_translate (clip_region, x, y);
}
else
{
meta_cullable_cull_out (META_CULLABLE (child), NULL, NULL);
}
}
}

View File

@@ -324,3 +324,44 @@ meta_plugin_manager_confirm_display_change (MetaPluginManager *plugin_mgr)
else
return meta_plugin_complete_display_change (plugin, TRUE);
}
gboolean
meta_plugin_manager_show_tile_preview (MetaPluginManager *plugin_mgr,
MetaWindow *window,
MetaRectangle *tile_rect,
int tile_monitor_number)
{
MetaPlugin *plugin = plugin_mgr->plugin;
MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
MetaDisplay *display = meta_screen_get_display (plugin_mgr->screen);
if (display->display_opening)
return FALSE;
if (klass->show_tile_preview)
{
klass->show_tile_preview (plugin, window, tile_rect, tile_monitor_number);
return TRUE;
}
return FALSE;
}
gboolean
meta_plugin_manager_hide_tile_preview (MetaPluginManager *plugin_mgr)
{
MetaPlugin *plugin = plugin_mgr->plugin;
MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
MetaDisplay *display = meta_screen_get_display (plugin_mgr->screen);
if (display->display_opening)
return FALSE;
if (klass->hide_tile_preview)
{
klass->hide_tile_preview (plugin);
return TRUE;
}
return FALSE;
}

View File

@@ -75,4 +75,9 @@ gboolean _meta_plugin_xevent_filter (MetaPlugin *plugin,
void meta_plugin_manager_confirm_display_change (MetaPluginManager *mgr);
gboolean meta_plugin_manager_show_tile_preview (MetaPluginManager *mgr,
MetaWindow *window,
MetaRectangle *tile_rect,
int tile_monitor_number);
gboolean meta_plugin_manager_hide_tile_preview (MetaPluginManager *mgr);
#endif

View File

@@ -0,0 +1,39 @@
/*
* shaped texture
*
* An actor to draw a texture clipped to a list of rectangles
*
* Authored By Neil Roberts <neil@linux.intel.com>
*
* Copyright (C) 2008 Intel Corporation
* 2013 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#ifndef __META_SHAPED_TEXTURE_PRIVATE_H__
#define __META_SHAPED_TEXTURE_PRIVATE_H__
#include <meta/meta-shaped-texture.h>
ClutterActor *meta_shaped_texture_new (void);
void meta_shaped_texture_set_texture (MetaShapedTexture *stex,
CoglTexture *texture);
gboolean meta_shaped_texture_get_unobscured_bounds (MetaShapedTexture *stex,
cairo_rectangle_int_t *unobscured_bounds);
gboolean meta_shaped_texture_is_obscured (MetaShapedTexture *self);
#endif

View File

@@ -31,9 +31,11 @@
#include "clutter-utils.h"
#include "meta-texture-tower.h"
#include "meta-shaped-texture-private.h"
#include "meta-window-actor-private.h"
#include <clutter/clutter.h>
#include <cogl/cogl.h>
#include <cogl/cogl-texture-pixmap-x11.h>
#include <gdk/gdk.h> /* for gdk_rectangle_intersect() */
#include "meta-cullable.h"
@@ -67,14 +69,19 @@ G_DEFINE_TYPE_WITH_CODE (MetaShapedTexture, meta_shaped_texture, CLUTTER_TYPE_AC
struct _MetaShapedTexturePrivate
{
MetaTextureTower *paint_tower;
Pixmap pixmap;
CoglTexturePixmapX11 *texture;
CoglTexture *texture;
CoglTexture *mask_texture;
cairo_region_t *clip_region;
cairo_region_t *opaque_region;
cairo_region_t *input_shape_region;
/* The region containing only fully opaque pixels */
cairo_region_t *opaque_region;
/* MetaCullable regions, see that documentation for more details */
cairo_region_t *clip_region;
cairo_region_t *unobscured_region;
guint tex_width, tex_height;
guint create_mipmaps : 1;
@@ -105,11 +112,27 @@ meta_shaped_texture_init (MetaShapedTexture *self)
priv = self->priv = META_SHAPED_TEXTURE_GET_PRIVATE (self);
priv->paint_tower = meta_texture_tower_new ();
priv->texture = NULL;
priv->mask_texture = NULL;
priv->create_mipmaps = TRUE;
}
static void
set_unobscured_region (MetaShapedTexture *self,
cairo_region_t *unobscured_region)
{
MetaShapedTexturePrivate *priv = self->priv;
g_clear_pointer (&priv->unobscured_region, (GDestroyNotify) cairo_region_destroy);
if (unobscured_region)
{
cairo_rectangle_int_t bounds = { 0, 0, priv->tex_width, priv->tex_height };
priv->unobscured_region = cairo_region_copy (unobscured_region);
cairo_region_intersect_rectangle (priv->unobscured_region, &bounds);
}
}
static void
set_clip_region (MetaShapedTexture *self,
cairo_region_t *clip_region)
@@ -135,6 +158,7 @@ meta_shaped_texture_dispose (GObject *object)
g_clear_pointer (&priv->opaque_region, cairo_region_destroy);
meta_shaped_texture_set_mask_texture (self, NULL);
set_unobscured_region (self, NULL);
set_clip_region (self, NULL);
G_OBJECT_CLASS (meta_shaped_texture_parent_class)->dispose (object);
@@ -206,10 +230,8 @@ paint_clipped_rectangle (CoglFramebuffer *fb,
cogl_framebuffer_draw_multitextured_rectangle (fb, pipeline,
x1, y1, x2, y2,
&coords[0], 8);
}
static void
meta_shaped_texture_paint (ClutterActor *actor)
{
@@ -497,10 +519,37 @@ meta_shaped_texture_get_preferred_height (ClutterActor *self,
}
static gboolean
meta_shaped_texture_get_paint_volume (ClutterActor *self,
meta_shaped_texture_get_paint_volume (ClutterActor *actor,
ClutterPaintVolume *volume)
{
return clutter_paint_volume_set_from_allocation (volume, self);
MetaShapedTexture *self = META_SHAPED_TEXTURE (actor);
cairo_rectangle_int_t unobscured_bounds;
if (!clutter_paint_volume_set_from_allocation (volume, actor))
return FALSE;
if (meta_shaped_texture_get_unobscured_bounds (self, &unobscured_bounds))
{
ClutterVertex origin;
cairo_rectangle_int_t bounds;
/* I hate ClutterPaintVolume so much... */
clutter_paint_volume_get_origin (volume, &origin);
bounds.x = origin.x;
bounds.y = origin.y;
bounds.width = clutter_paint_volume_get_width (volume);
bounds.height = clutter_paint_volume_get_height (volume);
gdk_rectangle_intersect (&bounds, &unobscured_bounds, &bounds);
origin.x = bounds.x;
origin.y = bounds.y;
clutter_paint_volume_set_origin (volume, &origin);
clutter_paint_volume_set_width (volume, bounds.width);
clutter_paint_volume_set_height (volume, bounds.height);
}
return TRUE;
}
void
@@ -519,8 +568,7 @@ meta_shaped_texture_set_create_mipmaps (MetaShapedTexture *stex,
{
CoglTexture *base_texture;
priv->create_mipmaps = create_mipmaps;
base_texture = create_mipmaps ?
COGL_TEXTURE (priv->texture) : NULL;
base_texture = create_mipmaps ? priv->texture : NULL;
meta_texture_tower_set_base_texture (priv->paint_tower, base_texture);
}
}
@@ -546,6 +594,49 @@ meta_shaped_texture_set_mask_texture (MetaShapedTexture *stex,
clutter_actor_queue_redraw (CLUTTER_ACTOR (stex));
}
static cairo_region_t *
effective_unobscured_region (MetaShapedTexture *self)
{
MetaShapedTexturePrivate *priv = self->priv;
ClutterActor *parent = clutter_actor_get_parent (CLUTTER_ACTOR (self));
if (clutter_actor_has_mapped_clones (CLUTTER_ACTOR (self)))
return NULL;
while (parent && !META_IS_WINDOW_ACTOR (parent))
parent = clutter_actor_get_parent (parent);
if (parent && clutter_actor_has_mapped_clones (parent))
return NULL;
return priv->unobscured_region;
}
gboolean
meta_shaped_texture_get_unobscured_bounds (MetaShapedTexture *self,
cairo_rectangle_int_t *unobscured_bounds)
{
cairo_region_t *unobscured_region = effective_unobscured_region (self);
if (unobscured_region)
{
cairo_region_get_extents (unobscured_region, unobscured_bounds);
return TRUE;
}
else
return FALSE;
}
gboolean
meta_shaped_texture_is_obscured (MetaShapedTexture *self)
{
cairo_region_t *unobscured_region = effective_unobscured_region (self);
if (unobscured_region)
return cairo_region_is_empty (unobscured_region);
else
return FALSE;
}
/**
* meta_shaped_texture_update_area:
@@ -554,14 +645,9 @@ meta_shaped_texture_set_mask_texture (MetaShapedTexture *stex,
* @y: the y coordinate of the damaged area
* @width: the width of the damaged area
* @height: the height of the damaged area
* @unobscured_region: The unobscured region of the window or %NULL if
* there is no valid one (like when the actor is transformed or
* has a mapped clone)
*
* Repairs the damaged area indicated by @x, @y, @width and @height
* and queues a redraw for the intersection @visibible_region and
* the damage area. If @visibible_region is %NULL a redraw will always
* get queued.
* and potentially queues a redraw.
*
* Return value: Whether a redraw have been queued or not
*/
@@ -570,10 +656,10 @@ meta_shaped_texture_update_area (MetaShapedTexture *stex,
int x,
int y,
int width,
int height,
cairo_region_t *unobscured_region)
int height)
{
MetaShapedTexturePrivate *priv;
cairo_region_t *unobscured_region;
const cairo_rectangle_int_t clip = { x, y, width, height };
priv = stex->priv;
@@ -581,11 +667,9 @@ meta_shaped_texture_update_area (MetaShapedTexture *stex,
if (priv->texture == NULL)
return FALSE;
cogl_texture_pixmap_x11_update_area (priv->texture,
x, y, width, height);
meta_texture_tower_update_area (priv->paint_tower, x, y, width, height);
unobscured_region = effective_unobscured_region (stex);
if (unobscured_region)
{
cairo_region_t *intersection;
@@ -602,23 +686,22 @@ meta_shaped_texture_update_area (MetaShapedTexture *stex,
cairo_region_get_extents (intersection, &damage_rect);
clutter_actor_queue_redraw_with_clip (CLUTTER_ACTOR (stex), &damage_rect);
cairo_region_destroy (intersection);
return TRUE;
}
cairo_region_destroy (intersection);
return FALSE;
}
clutter_actor_queue_redraw_with_clip (CLUTTER_ACTOR (stex), &clip);
return TRUE;
else
{
clutter_actor_queue_redraw_with_clip (CLUTTER_ACTOR (stex), &clip);
return TRUE;
}
}
static void
set_cogl_texture (MetaShapedTexture *stex,
CoglTexturePixmapX11 *cogl_tex)
set_cogl_texture (MetaShapedTexture *stex,
CoglTexture *cogl_tex)
{
MetaShapedTexturePrivate *priv;
guint width, height;
@@ -648,47 +731,33 @@ set_cogl_texture (MetaShapedTexture *stex,
}
else
{
/* size changed to 0 going to an inavlid texture */
/* size changed to 0 going to an invalid texture */
priv->tex_width = 0;
priv->tex_height = 0;
clutter_actor_queue_relayout (CLUTTER_ACTOR (stex));
}
clutter_actor_queue_redraw (CLUTTER_ACTOR (stex));
/* NB: We don't queue a redraw of the actor here because we don't
* know how much of the buffer has changed with respect to the
* previous buffer. We only queue a redraw in response to surface
* damage. */
if (priv->create_mipmaps)
meta_texture_tower_set_base_texture (priv->paint_tower, cogl_tex);
}
/**
* meta_shaped_texture_set_pixmap:
* meta_shaped_texture_set_texture:
* @stex: The #MetaShapedTexture
* @pixmap: The pixmap you want the stex to assume
* @pixmap: The #CoglTexture to display
*/
void
meta_shaped_texture_set_pixmap (MetaShapedTexture *stex,
Pixmap pixmap)
meta_shaped_texture_set_texture (MetaShapedTexture *stex,
CoglTexture *texture)
{
MetaShapedTexturePrivate *priv;
g_return_if_fail (META_IS_SHAPED_TEXTURE (stex));
priv = stex->priv;
if (priv->pixmap == pixmap)
return;
priv->pixmap = pixmap;
if (pixmap != None)
{
CoglContext *ctx =
clutter_backend_get_cogl_context (clutter_get_default_backend ());
set_cogl_texture (stex, cogl_texture_pixmap_x11_new (ctx, pixmap, FALSE, NULL));
}
else
set_cogl_texture (stex, NULL);
if (priv->create_mipmaps)
meta_texture_tower_set_base_texture (priv->paint_tower,
COGL_TEXTURE (priv->texture));
set_cogl_texture (stex, texture);
}
/**
@@ -875,14 +944,17 @@ meta_shaped_texture_cull_out (MetaCullable *cullable,
MetaShapedTexture *self = META_SHAPED_TEXTURE (cullable);
MetaShapedTexturePrivate *priv = self->priv;
set_unobscured_region (self, unobscured_region);
set_clip_region (self, clip_region);
if (clutter_actor_get_paint_opacity (CLUTTER_ACTOR (self)) == 0xff)
{
if (priv->opaque_region)
{
cairo_region_subtract (unobscured_region, priv->opaque_region);
cairo_region_subtract (clip_region, priv->opaque_region);
if (unobscured_region)
cairo_region_subtract (unobscured_region, priv->opaque_region);
if (clip_region)
cairo_region_subtract (clip_region, priv->opaque_region);
}
}
}

View File

@@ -55,9 +55,6 @@ void meta_window_actor_set_updates_frozen (MetaWindowActor *self,
void meta_window_actor_queue_frame_drawn (MetaWindowActor *self,
gboolean no_delay_frame);
void meta_window_actor_set_unobscured_region (MetaWindowActor *self,
cairo_region_t *unobscured_region);
void meta_window_actor_effect_completed (MetaWindowActor *actor,
gulong event);

View File

@@ -27,6 +27,7 @@
#include "xprops.h"
#include "compositor-private.h"
#include "meta-shaped-texture-private.h"
#include "meta-shadow-factory-private.h"
#include "meta-window-actor-private.h"
#include "meta-texture-rectangle.h"
@@ -34,15 +35,6 @@
#include "monitor-private.h"
#include "meta-cullable.h"
enum {
POSITION_CHANGED,
SIZE_CHANGED,
LAST_SIGNAL
};
static guint signals[LAST_SIGNAL] = {0};
struct _MetaWindowActorPrivate
{
MetaWindow *window;
@@ -73,9 +65,6 @@ struct _MetaWindowActorPrivate
/* The region we should clip to when painting the shadow */
cairo_region_t *shadow_clip;
/* The region that is visible, used to optimize out redraws */
cairo_region_t *unobscured_region;
guint send_frame_messages_timer;
gint64 frame_drawn_time;
@@ -104,7 +93,6 @@ struct _MetaWindowActorPrivate
GList *frames;
guint visible : 1;
guint mapped : 1;
guint argb32 : 1;
guint disposed : 1;
guint redecorating : 1;
@@ -240,19 +228,6 @@ meta_window_actor_class_init (MetaWindowActorClass *klass)
g_object_class_install_property (object_class,
PROP_SHADOW_CLASS,
pspec);
signals[POSITION_CHANGED] =
g_signal_new ("position-changed",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
0, NULL, NULL, NULL,
G_TYPE_NONE, 0);
signals[SIZE_CHANGED] =
g_signal_new ("size-changed",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
0, NULL, NULL, NULL,
G_TYPE_NONE, 0);
}
static void
@@ -394,7 +369,6 @@ meta_window_actor_dispose (GObject *object)
priv->send_frame_messages_timer = 0;
}
g_clear_pointer (&priv->unobscured_region, cairo_region_destroy);
g_clear_pointer (&priv->shape_region, cairo_region_destroy);
g_clear_pointer (&priv->shadow_clip, cairo_region_destroy);
@@ -662,7 +636,7 @@ meta_window_actor_get_paint_volume (ClutterActor *actor,
{
MetaWindowActor *self = META_WINDOW_ACTOR (actor);
MetaWindowActorPrivate *priv = self->priv;
cairo_rectangle_int_t bounds;
cairo_rectangle_int_t unobscured_bounds, bounds;
gboolean appears_focused = meta_window_appears_focused (priv->window);
ClutterVertex origin;
@@ -672,6 +646,9 @@ meta_window_actor_get_paint_volume (ClutterActor *actor,
meta_window_actor_get_shape_bounds (self, &bounds);
if (meta_shaped_texture_get_unobscured_bounds (META_SHAPED_TEXTURE (priv->actor), &unobscured_bounds))
gdk_rectangle_intersect (&bounds, &unobscured_bounds, &bounds);
if (appears_focused ? priv->focused_shadow : priv->unfocused_shadow)
{
cairo_rectangle_int_t shadow_bounds;
@@ -687,13 +664,6 @@ meta_window_actor_get_paint_volume (ClutterActor *actor,
gdk_rectangle_union (&bounds, &shadow_bounds, &bounds);
}
if (priv->unobscured_region && !clutter_actor_has_mapped_clones (actor))
{
cairo_rectangle_int_t unobscured_bounds;
cairo_region_get_extents (priv->unobscured_region, &unobscured_bounds);
gdk_rectangle_intersect (&bounds, &unobscured_bounds, &bounds);
}
origin.x = bounds.x;
origin.y = bounds.y;
origin.z = 0.0f;
@@ -717,7 +687,7 @@ meta_window_actor_has_shadow (MetaWindowActor *self)
/* Leaving out shadows for maximized and fullscreen windows is an effeciency
* win and also prevents the unsightly effect of the shadow of maximized
* window appearing on an adjacent window */
if ((meta_window_get_maximized (priv->window) == (META_MAXIMIZE_HORIZONTAL | META_MAXIMIZE_VERTICAL)) ||
if ((meta_window_get_maximized (priv->window) == META_MAXIMIZE_BOTH) ||
meta_window_is_fullscreen (priv->window))
return FALSE;
@@ -872,6 +842,19 @@ queue_send_frame_messages_timeout (MetaWindowActor *self)
priv->send_frame_messages_timer = g_timeout_add_full (META_PRIORITY_REDRAW, offset, send_frame_messages_timeout, self, NULL);
}
static void
update_area (MetaWindowActor *self,
int x, int y, int width, int height)
{
MetaWindowActorPrivate *priv = self->priv;
CoglTexture *texture;
texture = meta_shaped_texture_get_texture (META_SHAPED_TEXTURE (priv->actor));
cogl_texture_pixmap_x11_update_area (COGL_TEXTURE_PIXMAP_X11 (texture),
x, y, width, height);
}
static void
meta_window_actor_damage_all (MetaWindowActor *self)
{
@@ -884,18 +867,15 @@ meta_window_actor_damage_all (MetaWindowActor *self)
texture = meta_shaped_texture_get_texture (META_SHAPED_TEXTURE (priv->actor));
if (!priv->mapped || priv->needs_pixmap)
if (priv->needs_pixmap)
return;
update_area (self, 0, 0, cogl_texture_get_width (texture), cogl_texture_get_height (texture));
redraw_queued = meta_shaped_texture_update_area (META_SHAPED_TEXTURE (priv->actor),
0, 0,
cogl_texture_get_width (texture),
cogl_texture_get_height (texture),
clutter_actor_has_mapped_clones (priv->actor) ?
NULL : priv->unobscured_region);
priv->repaint_scheduled = priv->repaint_scheduled || redraw_queued;
cogl_texture_get_height (texture));
priv->repaint_scheduled = priv->repaint_scheduled || redraw_queued;
priv->needs_damage_all = FALSE;
}
@@ -949,17 +929,7 @@ meta_window_actor_queue_frame_drawn (MetaWindowActor *self,
if (!priv->repaint_scheduled)
{
gboolean is_obscured = FALSE;
/* Find out whether the window is completly obscured */
if (priv->unobscured_region)
{
cairo_region_t *unobscured_window_region;
unobscured_window_region = cairo_region_copy (priv->shape_region);
cairo_region_intersect (unobscured_window_region, priv->unobscured_region);
is_obscured = cairo_region_is_empty (unobscured_window_region);
cairo_region_destroy (unobscured_window_region);
}
gboolean is_obscured = meta_shaped_texture_is_obscured (META_SHAPED_TEXTURE (priv->actor));
/* A frame was marked by the client without actually doing any
* damage or any unobscured, or while we had the window frozen
@@ -973,7 +943,7 @@ meta_window_actor_queue_frame_drawn (MetaWindowActor *self,
{
queue_send_frame_messages_timeout (self);
}
else if (priv->mapped && !priv->needs_pixmap)
else
{
const cairo_rectangle_int_t clip = { 0, 0, 1, 1 };
clutter_actor_queue_redraw_with_clip (priv->actor, &clip);
@@ -1005,9 +975,6 @@ meta_window_actor_queue_create_pixmap (MetaWindowActor *self)
priv->needs_pixmap = TRUE;
if (!priv->mapped)
return;
if (is_frozen (self))
return;
@@ -1103,9 +1070,6 @@ meta_window_actor_after_effects (MetaWindowActor *self)
meta_window_actor_sync_visibility (self);
meta_window_actor_sync_actor_geometry (self, FALSE);
if (!meta_window_is_mapped (priv->window))
meta_window_actor_detach (self);
if (priv->needs_pixmap)
clutter_actor_queue_redraw (priv->actor);
}
@@ -1202,8 +1166,7 @@ meta_window_actor_detach (MetaWindowActor *self)
* you are supposed to be able to free a GLXPixmap after freeing the underlying
* pixmap, but it certainly doesn't work with current DRI/Mesa
*/
meta_shaped_texture_set_pixmap (META_SHAPED_TEXTURE (priv->actor),
None);
meta_shaped_texture_set_texture (META_SHAPED_TEXTURE (priv->actor), NULL);
cogl_flush();
XFreePixmap (xdisplay, priv->back_pixmap);
@@ -1359,8 +1322,6 @@ meta_window_actor_sync_actor_geometry (MetaWindowActor *self,
window_rect.x, window_rect.y);
clutter_actor_set_size (CLUTTER_ACTOR (self),
window_rect.width, window_rect.height);
g_signal_emit (self, signals[POSITION_CHANGED], 0);
}
void
@@ -1523,9 +1484,7 @@ meta_window_actor_new (MetaWindow *window)
priv->last_width = -1;
priv->last_height = -1;
priv->mapped = meta_window_toplevel_is_mapped (priv->window);
if (priv->mapped)
meta_window_actor_queue_create_pixmap (self);
meta_window_actor_queue_create_pixmap (self);
meta_window_actor_set_updates_frozen (self,
meta_window_updates_are_frozen (priv->window));
@@ -1560,34 +1519,6 @@ meta_window_actor_new (MetaWindow *window)
return self;
}
void
meta_window_actor_mapped (MetaWindowActor *self)
{
MetaWindowActorPrivate *priv = self->priv;
g_return_if_fail (!priv->mapped);
priv->mapped = TRUE;
meta_window_actor_queue_create_pixmap (self);
}
void
meta_window_actor_unmapped (MetaWindowActor *self)
{
MetaWindowActorPrivate *priv = self->priv;
g_return_if_fail (priv->mapped);
priv->mapped = FALSE;
if (meta_window_actor_effect_in_progress (self))
return;
meta_window_actor_detach (self);
priv->needs_pixmap = FALSE;
}
#if 0
/* Print out a region; useful for debugging */
static void
@@ -1629,30 +1560,6 @@ see_region (cairo_region_t *region,
}
#endif
/**
* meta_window_actor_set_unobscured_region:
* @self: a #MetaWindowActor
* @unobscured_region: the region of the screen that isn't completely
* obscured.
*
* Provides a hint as to what areas of the window need to queue
* redraws when damaged. Regions not in @unobscured_region are completely obscured.
*/
void
meta_window_actor_set_unobscured_region (MetaWindowActor *self,
cairo_region_t *unobscured_region)
{
MetaWindowActorPrivate *priv = self->priv;
if (priv->unobscured_region)
cairo_region_destroy (priv->unobscured_region);
if (unobscured_region)
priv->unobscured_region = cairo_region_copy (unobscured_region);
else
priv->unobscured_region = NULL;
}
/**
* meta_window_actor_set_clip_region_beneath:
* @self: a #MetaWindowActor
@@ -1675,13 +1582,19 @@ meta_window_actor_set_clip_region_beneath (MetaWindowActor *self,
if (appears_focused ? priv->focused_shadow : priv->unfocused_shadow)
{
g_clear_pointer (&priv->shadow_clip, cairo_region_destroy);
priv->shadow_clip = cairo_region_copy (beneath_region);
if (clip_shadow_under_window (self))
if (beneath_region)
{
cairo_region_t *frame_bounds = meta_window_get_frame_bounds (priv->window);
cairo_region_subtract (priv->shadow_clip, frame_bounds);
priv->shadow_clip = cairo_region_copy (beneath_region);
if (clip_shadow_under_window (self))
{
cairo_region_t *frame_bounds = meta_window_get_frame_bounds (priv->window);
cairo_region_subtract (priv->shadow_clip, frame_bounds);
}
}
else
priv->shadow_clip = NULL;
}
}
@@ -1697,7 +1610,6 @@ meta_window_actor_cull_out (MetaCullable *cullable,
if (priv->unredirected)
return;
meta_window_actor_set_unobscured_region (self, unobscured_region);
meta_cullable_cull_out_children (cullable, unobscured_region, clip_region);
meta_window_actor_set_clip_region_beneath (self, clip_region);
}
@@ -1733,9 +1645,6 @@ check_needs_pixmap (MetaWindowActor *self)
if (!priv->needs_pixmap)
return;
if (!priv->mapped)
return;
if (xwindow == meta_screen_get_xroot (screen) ||
xwindow == clutter_x11_get_stage_window (CLUTTER_STAGE (info->stage)))
return;
@@ -1752,6 +1661,7 @@ check_needs_pixmap (MetaWindowActor *self)
if (priv->back_pixmap == None)
{
CoglContext *ctx = clutter_backend_get_cogl_context (clutter_get_default_backend ());
CoglTexture *texture;
meta_error_trap_push (display);
@@ -1780,29 +1690,11 @@ check_needs_pixmap (MetaWindowActor *self)
meta_shaped_texture_set_create_mipmaps (META_SHAPED_TEXTURE (priv->actor),
FALSE);
meta_shaped_texture_set_pixmap (META_SHAPED_TEXTURE (priv->actor),
priv->back_pixmap);
texture = meta_shaped_texture_get_texture (META_SHAPED_TEXTURE (priv->actor));
/*
* This only works *after* actually setting the pixmap, so we have to
* do it here.
* See: http://bugzilla.clutter-project.org/show_bug.cgi?id=2236
*/
texture = COGL_TEXTURE (cogl_texture_pixmap_x11_new (ctx, priv->back_pixmap, FALSE, NULL));
if (G_UNLIKELY (!cogl_texture_pixmap_x11_is_using_tfp_extension (COGL_TEXTURE_PIXMAP_X11 (texture))))
g_warning ("NOTE: Not using GLX TFP!\n");
/* ::size-changed is supposed to refer to meta_window_get_frame_rect().
* Emitting it here works pretty much OK because a new value of the
* *input* rect (which is the outer rect with the addition of invisible
* borders) forces a new pixmap and we get here. In the rare case where
* a change to the window size was exactly balanced by a change to the
* invisible borders, we would miss emitting the signal. We would also
* emit spurious signals when we get a new pixmap without a new size,
* but that should be mostly harmless.
*/
g_signal_emit (self, signals[SIZE_CHANGED], 0);
meta_shaped_texture_set_texture (META_SHAPED_TEXTURE (priv->actor), texture);
}
priv->needs_pixmap = FALSE;
@@ -1821,9 +1713,6 @@ check_needs_shadow (MetaWindowActor *self)
gboolean should_have_shadow;
gboolean appears_focused;
if (!priv->mapped)
return;
/* Calling meta_window_actor_has_shadow() here at every pre-paint is cheap
* and avoids the need to explicitly handle window type changes, which
* we would do if tried to keep track of when we might be adding or removing
@@ -1927,19 +1816,16 @@ meta_window_actor_process_damage (MetaWindowActor *self,
return;
}
if (!priv->mapped || priv->needs_pixmap)
if (priv->needs_pixmap)
return;
update_area (self, event->area.x, event->area.y, event->area.width, event->area.height);
redraw_queued = meta_shaped_texture_update_area (META_SHAPED_TEXTURE (priv->actor),
event->area.x,
event->area.y,
event->area.width,
event->area.height,
clutter_actor_has_mapped_clones (priv->actor) ?
NULL : priv->unobscured_region);
priv->repaint_scheduled = priv->repaint_scheduled || redraw_queued;
event->area.height);
priv->repaint_scheduled = priv->repaint_scheduled || redraw_queued;
}
void
@@ -2082,22 +1968,25 @@ build_and_scan_frame_mask (MetaWindowActor *self,
meta_shaped_texture_set_mask_texture (META_SHAPED_TEXTURE (priv->actor),
mask_texture);
cogl_object_unref (mask_texture);
if (mask_texture)
cogl_object_unref (mask_texture);
g_free (mask_data);
}
static void
meta_window_actor_update_shape_region (MetaWindowActor *self,
cairo_rectangle_int_t *client_area)
meta_window_actor_update_shape_region (MetaWindowActor *self)
{
MetaWindowActorPrivate *priv = self->priv;
cairo_region_t *region = NULL;
cairo_rectangle_int_t client_area;
meta_window_get_client_area_rect (priv->window, &client_area);
if (priv->window->frame != NULL && priv->window->shape_region != NULL)
{
region = cairo_region_copy (priv->window->shape_region);
cairo_region_translate (region, client_area->x, client_area->y);
cairo_region_translate (region, client_area.x, client_area.y);
}
else if (priv->window->shape_region != NULL)
{
@@ -2108,12 +1997,12 @@ meta_window_actor_update_shape_region (MetaWindowActor *self,
/* If we don't have a shape on the server, that means that
* we have an implicit shape of one rectangle covering the
* entire window. */
region = cairo_region_create_rectangle (client_area);
region = cairo_region_create_rectangle (&client_area);
}
meta_shaped_texture_set_mask_texture (META_SHAPED_TEXTURE (priv->actor), NULL);
if ((priv->window->shape_region != NULL) || (priv->window->frame != NULL))
build_and_scan_frame_mask (self, client_area, region);
build_and_scan_frame_mask (self, &client_area, region);
g_clear_pointer (&priv->shape_region, cairo_region_destroy);
priv->shape_region = region;
@@ -2124,35 +2013,44 @@ meta_window_actor_update_shape_region (MetaWindowActor *self,
}
static void
meta_window_actor_update_input_region (MetaWindowActor *self,
cairo_rectangle_int_t *client_area)
meta_window_actor_update_input_region (MetaWindowActor *self)
{
MetaWindowActorPrivate *priv = self->priv;
MetaShapedTexture *stex = META_SHAPED_TEXTURE (priv->actor);
cairo_region_t *region = NULL;
cairo_rectangle_int_t client_area;
if (priv->window->frame != NULL && priv->window->input_region != NULL)
meta_window_get_client_area_rect (priv->window, &client_area);
if (priv->window->frame != NULL)
{
region = meta_frame_get_frame_bounds (priv->window->frame);
cairo_region_subtract_rectangle (region, client_area);
/* input_region is in client window coordinates, so translate the
/* client area is in client window coordinates, so translate the
* input region into that coordinate system and back */
cairo_region_translate (region, -client_area->x, -client_area->y);
cairo_region_union (region, priv->window->input_region);
cairo_region_translate (region, client_area->x, client_area->y);
cairo_region_translate (region, -client_area.x, -client_area.y);
cairo_region_union_rectangle (region, &client_area);
cairo_region_translate (region, client_area.x, client_area.y);
}
else if (priv->window->input_region != NULL)
else if (priv->window->shape_region != NULL ||
priv->window->input_region != NULL)
{
region = cairo_region_reference (priv->window->input_region);
if (priv->window->shape_region != NULL)
{
region = cairo_region_copy (priv->window->shape_region);
if (priv->window->input_region != NULL)
cairo_region_intersect (region, priv->window->input_region);
}
else
region = cairo_region_reference (priv->window->input_region);
}
else
{
/* If we don't have a shape on the server, that means that
* we have an implicit shape of one rectangle covering the
* entire window. */
region = cairo_region_create_rectangle (client_area);
region = cairo_region_create_rectangle (&client_area);
}
meta_shaped_texture_set_input_shape_region (stex, region);
@@ -2167,9 +2065,9 @@ meta_window_actor_update_opaque_region (MetaWindowActor *self)
if (priv->argb32 && priv->window->opaque_region != NULL)
{
MetaFrameBorders borders;
cairo_rectangle_int_t client_area;
meta_frame_calc_borders (priv->window->frame, &borders);
meta_window_get_client_area_rect (priv->window, &client_area);
/* The opaque region is defined to be a part of the
* window which ARGB32 will always paint with opaque
@@ -2182,7 +2080,7 @@ meta_window_actor_update_opaque_region (MetaWindowActor *self)
* case, graphical glitches will occur.
*/
opaque_region = cairo_region_copy (priv->window->opaque_region);
cairo_region_translate (opaque_region, borders.total.left, borders.total.top);
cairo_region_translate (opaque_region, client_area.x, client_area.y);
cairo_region_intersect (opaque_region, priv->shape_region);
}
else if (priv->argb32)
@@ -2198,27 +2096,12 @@ static void
check_needs_reshape (MetaWindowActor *self)
{
MetaWindowActorPrivate *priv = self->priv;
MetaFrameBorders borders;
cairo_rectangle_int_t client_area;
if (!priv->mapped)
return;
if (!priv->needs_reshape)
return;
meta_frame_calc_borders (priv->window->frame, &borders);
client_area.x = borders.total.left;
client_area.y = borders.total.top;
client_area.width = priv->window->rect.width;
if (priv->window->shaded)
client_area.height = 0;
else
client_area.height = priv->window->rect.height;
meta_window_actor_update_shape_region (self, &client_area);
meta_window_actor_update_input_region (self, &client_area);
meta_window_actor_update_shape_region (self);
meta_window_actor_update_input_region (self);
meta_window_actor_update_opaque_region (self);
priv->needs_reshape = FALSE;

View File

@@ -115,8 +115,6 @@ meta_window_group_paint (ClutterActor *actor)
{
cairo_region_t *clip_region;
cairo_region_t *unobscured_region;
ClutterActorIter iter;
ClutterActor *child;
cairo_rectangle_int_t visible_rect, clip_rect;
int paint_x_offset, paint_y_offset;
int paint_x_origin, paint_y_origin;
@@ -126,18 +124,6 @@ meta_window_group_paint (ClutterActor *actor)
ClutterActor *stage = clutter_actor_get_stage (actor);
MetaCompScreen *info = meta_screen_get_compositor_data (window_group->screen);
/* Start off by treating all windows as completely unobscured, so damage anywhere
* in a window queues redraws, but confine it more below. */
clutter_actor_iter_init (&iter, actor);
while (clutter_actor_iter_next (&iter, &child))
{
if (META_IS_WINDOW_ACTOR (child))
{
MetaWindowActor *window_actor = META_WINDOW_ACTOR (child);
meta_window_actor_set_unobscured_region (window_actor, NULL);
}
}
/* Normally we expect an actor to be drawn at it's position on the screen.
* However, if we're inside the paint of a ClutterClone, that won't be the
* case and we need to compensate. We look at the position of the window

View File

@@ -19,15 +19,14 @@
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include <meta/meta-plugin.h>
#include <meta/window.h>
#include <meta/util.h>
#include <meta/meta-background-group.h>
#include <meta/meta-background-actor.h>
#include <libintl.h>
#define _(x) dgettext (GETTEXT_PACKAGE, x)
#define N_(x) x
#include <meta/util.h>
#include <glib/gi18n-lib.h>
#include <clutter/clutter.h>
#include <gmodule.h>
@@ -40,6 +39,7 @@
#define SWITCH_TIMEOUT 500
#define ACTOR_DATA_KEY "MCCP-Default-actor-data"
#define SCREEN_TILE_PREVIEW_DATA_KEY "MCCP-Default-screen-tile-preview-data"
#define META_TYPE_DEFAULT_PLUGIN (meta_default_plugin_get_type ())
#define META_DEFAULT_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_DEFAULT_PLUGIN, MetaDefaultPlugin))
@@ -68,6 +68,7 @@ struct _MetaDefaultPluginClass
};
static GQuark actor_data_quark = 0;
static GQuark screen_tile_preview_data_quark = 0;
static void start (MetaPlugin *plugin);
static void minimize (MetaPlugin *plugin,
@@ -98,6 +99,12 @@ static void kill_window_effects (MetaPlugin *plugin,
MetaWindowActor *actor);
static void kill_switch_workspace (MetaPlugin *plugin);
static void show_tile_preview (MetaPlugin *plugin,
MetaWindow *window,
MetaRectangle *tile_rect,
int tile_monitor_number);
static void hide_tile_preview (MetaPlugin *plugin);
static void confirm_display_change (MetaPlugin *plugin);
static const MetaPluginInfo * plugin_info (MetaPlugin *plugin);
@@ -144,6 +151,15 @@ typedef struct
} EffectCompleteData;
typedef struct _ScreenTilePreview
{
ClutterActor *actor;
GdkRGBA *preview_color;
MetaRectangle tile_rect;
} ScreenTilePreview;
static void
meta_default_plugin_dispose (GObject *object)
{
@@ -204,6 +220,8 @@ meta_default_plugin_class_init (MetaDefaultPluginClass *klass)
plugin_class->unmaximize = unmaximize;
plugin_class->destroy = destroy;
plugin_class->switch_workspace = switch_workspace;
plugin_class->show_tile_preview = show_tile_preview;
plugin_class->hide_tile_preview = hide_tile_preview;
plugin_class->plugin_info = plugin_info;
plugin_class->kill_window_effects = kill_window_effects;
plugin_class->kill_switch_workspace = kill_switch_workspace;
@@ -290,26 +308,13 @@ on_switch_workspace_effect_complete (ClutterTimeline *timeline, gpointer data)
meta_plugin_switch_workspace_completed (plugin);
}
static gboolean
show_stage (MetaPlugin *plugin)
{
MetaScreen *screen;
ClutterActor *stage;
screen = meta_plugin_get_screen (plugin);
stage = meta_get_stage_for_screen (screen);
clutter_actor_show (stage);
return FALSE;
}
static void
on_monitors_changed (MetaScreen *screen,
MetaPlugin *plugin)
{
MetaDefaultPlugin *self = META_DEFAULT_PLUGIN (plugin);
int i, n;
GRand *rand = g_rand_new_with_seed (12345);
clutter_actor_destroy_all_children (self->priv->background_group);
@@ -332,14 +337,16 @@ on_monitors_changed (MetaScreen *screen,
reproducible.
*/
clutter_color_init (&color,
g_random_int () % 255,
g_random_int () % 255,
g_random_int () % 255,
g_rand_int_range (rand, 0, 255),
g_rand_int_range (rand, 0, 255),
g_rand_int_range (rand, 0, 255),
255);
clutter_actor_set_background_color (background, &color);
clutter_actor_add_child (self->priv->background_group, background);
}
g_rand_free (rand);
}
static void
@@ -356,10 +363,7 @@ start (MetaPlugin *plugin)
G_CALLBACK (on_monitors_changed), plugin);
on_monitors_changed (screen, plugin);
meta_later_add (META_LATER_BEFORE_REDRAW,
(GSourceFunc) show_stage,
plugin,
NULL);
clutter_actor_show (meta_get_stage_for_screen (screen));
}
static void
@@ -705,15 +709,15 @@ map (MetaPlugin *plugin, MetaWindowActor *window_actor)
EffectCompleteData *data = g_new0 (EffectCompleteData, 1);
ActorPrivate *apriv = get_actor_private (window_actor);
clutter_actor_move_anchor_point_from_gravity (actor,
CLUTTER_GRAVITY_CENTER);
clutter_actor_set_scale (actor, 0.0, 0.0);
clutter_actor_set_pivot_point (actor, 0.5, 0.5);
clutter_actor_set_opacity (actor, 0);
clutter_actor_set_scale (actor, 0.5, 0.5);
clutter_actor_show (actor);
animation = clutter_actor_animate (actor,
CLUTTER_EASE_IN_SINE,
CLUTTER_EASE_OUT_QUAD,
MAP_TIMEOUT,
"opacity", 255,
"scale-x", 1.0,
"scale-y", 1.0,
NULL);
@@ -785,6 +789,82 @@ destroy (MetaPlugin *plugin, MetaWindowActor *window_actor)
meta_plugin_destroy_completed (plugin, window_actor);
}
/*
* Tile preview private data accessor
*/
static void
free_screen_tile_preview (gpointer data)
{
ScreenTilePreview *preview = data;
if (G_LIKELY (preview != NULL)) {
clutter_actor_destroy (preview->actor);
g_slice_free (ScreenTilePreview, preview);
}
}
static ScreenTilePreview *
get_screen_tile_preview (MetaScreen *screen)
{
ScreenTilePreview *preview = g_object_get_qdata (G_OBJECT (screen), screen_tile_preview_data_quark);
if (G_UNLIKELY (screen_tile_preview_data_quark == 0))
screen_tile_preview_data_quark = g_quark_from_static_string (SCREEN_TILE_PREVIEW_DATA_KEY);
if (G_UNLIKELY (!preview))
{
preview = g_slice_new0 (ScreenTilePreview);
preview->actor = clutter_actor_new ();
clutter_actor_set_background_color (preview->actor, CLUTTER_COLOR_Blue);
clutter_actor_set_opacity (preview->actor, 100);
clutter_actor_add_child (meta_get_window_group_for_screen (screen), preview->actor);
g_object_set_qdata_full (G_OBJECT (screen),
screen_tile_preview_data_quark, preview,
free_screen_tile_preview);
}
return preview;
}
static void
show_tile_preview (MetaPlugin *plugin,
MetaWindow *window,
MetaRectangle *tile_rect,
int tile_monitor_number)
{
MetaScreen *screen = meta_plugin_get_screen (plugin);
ScreenTilePreview *preview = get_screen_tile_preview (screen);
ClutterActor *window_actor;
if (CLUTTER_ACTOR_IS_VISIBLE (preview->actor)
&& preview->tile_rect.x == tile_rect->x
&& preview->tile_rect.y == tile_rect->y
&& preview->tile_rect.width == tile_rect->width
&& preview->tile_rect.height == tile_rect->height)
return; /* nothing to do */
clutter_actor_set_position (preview->actor, tile_rect->x, tile_rect->y);
clutter_actor_set_size (preview->actor, tile_rect->width, tile_rect->height);
clutter_actor_show (preview->actor);
window_actor = CLUTTER_ACTOR (meta_window_get_compositor_private (window));
clutter_actor_lower (preview->actor, window_actor);
preview->tile_rect = *tile_rect;
}
static void
hide_tile_preview (MetaPlugin *plugin)
{
MetaScreen *screen = meta_plugin_get_screen (plugin);
ScreenTilePreview *preview = get_screen_tile_preview (screen);
clutter_actor_hide (preview->actor);
}
static void
kill_switch_workspace (MetaPlugin *plugin)
{

View File

@@ -51,6 +51,7 @@
#include "bell.h"
#include "screen-private.h"
#include "window-private.h"
#include "util-private.h"
#include <meta/prefs.h>
#include <meta/compositor.h>
#ifdef HAVE_LIBCANBERRA

View File

@@ -426,7 +426,7 @@ setup_constraint_info (ConstraintInfo *info,
*/
if (meta_prefs_get_force_fullscreen() &&
!window->hide_titlebar_when_maximized &&
window->decorated &&
(window->decorated || !meta_window_is_client_decorated (window)) &&
meta_rectangle_equal (new, &monitor_info->rect) &&
window->has_fullscreen_func &&
!window->fullscreen)
@@ -491,12 +491,17 @@ place_window_if_needed(MetaWindow *window,
!window->minimized &&
!window->fullscreen)
{
MetaRectangle orig_rect;
MetaRectangle placed_rect;
MetaWorkspace *cur_workspace;
const MetaMonitorInfo *monitor_info;
meta_window_get_frame_rect (window, &placed_rect);
meta_window_place (window, info->orig.x, info->orig.y,
orig_rect = info->orig;
extend_by_frame (window, &orig_rect);
meta_window_place (window, orig_rect.x, orig_rect.y,
&placed_rect.x, &placed_rect.y);
did_placement = TRUE;

View File

@@ -27,6 +27,7 @@
#include "workspace-private.h"
#include <meta/prefs.h>
#include <meta/errors.h>
#include "util-private.h"
/* Looks up the MetaWindow representing the frame of the given X window.
* Used as a helper function by a bunch of the functions below.
@@ -321,8 +322,7 @@ meta_core_maximize (Display *xdisplay,
if (meta_prefs_get_raise_on_click ())
meta_window_raise (window);
meta_window_maximize (window,
META_MAXIMIZE_HORIZONTAL | META_MAXIMIZE_VERTICAL);
meta_window_maximize (window, META_MAXIMIZE_BOTH);
}
void
@@ -335,11 +335,9 @@ meta_core_toggle_maximize_vertically (Display *xdisplay,
meta_window_raise (window);
if (META_WINDOW_MAXIMIZED_VERTICALLY (window))
meta_window_unmaximize (window,
META_MAXIMIZE_VERTICAL);
meta_window_unmaximize (window, META_MAXIMIZE_VERTICAL);
else
meta_window_maximize (window,
META_MAXIMIZE_VERTICAL);
meta_window_maximize (window, META_MAXIMIZE_VERTICAL);
}
void
@@ -352,11 +350,9 @@ meta_core_toggle_maximize_horizontally (Display *xdisplay,
meta_window_raise (window);
if (META_WINDOW_MAXIMIZED_HORIZONTALLY (window))
meta_window_unmaximize (window,
META_MAXIMIZE_HORIZONTAL);
meta_window_unmaximize (window, META_MAXIMIZE_HORIZONTAL);
else
meta_window_maximize (window,
META_MAXIMIZE_HORIZONTAL);
meta_window_maximize (window, META_MAXIMIZE_HORIZONTAL);
}
void
@@ -369,11 +365,9 @@ meta_core_toggle_maximize (Display *xdisplay,
meta_window_raise (window);
if (META_WINDOW_MAXIMIZED (window))
meta_window_unmaximize (window,
META_MAXIMIZE_HORIZONTAL | META_MAXIMIZE_VERTICAL);
meta_window_unmaximize (window, META_MAXIMIZE_BOTH);
else
meta_window_maximize (window,
META_MAXIMIZE_HORIZONTAL | META_MAXIMIZE_VERTICAL);
meta_window_maximize (window, META_MAXIMIZE_BOTH);
}
void
@@ -385,8 +379,7 @@ meta_core_unmaximize (Display *xdisplay,
if (meta_prefs_get_raise_on_click ())
meta_window_raise (window);
meta_window_unmaximize (window,
META_MAXIMIZE_HORIZONTAL | META_MAXIMIZE_VERTICAL);
meta_window_unmaximize (window, META_MAXIMIZE_BOTH);
}
void

View File

@@ -23,7 +23,7 @@
#define _XOPEN_SOURCE /* for kill() */
#include <config.h>
#include <meta/util.h>
#include "util-private.h"
#include "window-private.h"
#include <meta/errors.h>
#include <meta/workspace.h>

View File

@@ -230,8 +230,8 @@ struct _MetaDisplay
int grab_resize_timeout_id;
/* Keybindings stuff */
MetaKeyBinding *key_bindings;
int n_key_bindings;
GHashTable *key_bindings;
GHashTable *key_bindings_index;
int min_keycode;
int max_keycode;
KeySym *keymap;

View File

@@ -32,7 +32,7 @@
#include <config.h>
#include "display-private.h"
#include <meta/util.h>
#include "util-private.h"
#include <meta/main.h>
#include "screen-private.h"
#include "window-private.h"
@@ -72,14 +72,6 @@
#include <string.h>
#include <unistd.h>
#define GRAB_OP_IS_WINDOW_SWITCH(g) \
(g == META_GRAB_OP_KEYBOARD_TABBING_NORMAL || \
g == META_GRAB_OP_KEYBOARD_TABBING_DOCK || \
g == META_GRAB_OP_KEYBOARD_TABBING_GROUP || \
g == META_GRAB_OP_KEYBOARD_ESCAPING_NORMAL || \
g == META_GRAB_OP_KEYBOARD_ESCAPING_DOCK || \
g == META_GRAB_OP_KEYBOARD_ESCAPING_GROUP)
/*
* SECTION:pings
*
@@ -1366,13 +1358,6 @@ grab_op_is_keyboard (MetaGrabOp op)
case META_GRAB_OP_KEYBOARD_RESIZING_NE:
case META_GRAB_OP_KEYBOARD_RESIZING_SW:
case META_GRAB_OP_KEYBOARD_RESIZING_NW:
case META_GRAB_OP_KEYBOARD_TABBING_NORMAL:
case META_GRAB_OP_KEYBOARD_TABBING_DOCK:
case META_GRAB_OP_KEYBOARD_TABBING_GROUP:
case META_GRAB_OP_KEYBOARD_ESCAPING_NORMAL:
case META_GRAB_OP_KEYBOARD_ESCAPING_DOCK:
case META_GRAB_OP_KEYBOARD_ESCAPING_GROUP:
case META_GRAB_OP_KEYBOARD_WORKSPACE_SWITCHING:
case META_GRAB_OP_COMPOSITOR:
return TRUE;
@@ -1830,6 +1815,9 @@ get_input_event (MetaDisplay *display,
switch (input_event->evtype)
{
case XI_TouchBegin:
case XI_TouchUpdate:
case XI_TouchEnd:
case XI_Motion:
case XI_ButtonPress:
case XI_ButtonRelease:
@@ -2308,6 +2296,7 @@ event_callback (XEvent *event,
{
XIDeviceEvent *device_event = (XIDeviceEvent *) input_event;
XIEnterEvent *enter_event = (XIEnterEvent *) input_event;
gint button = 0;
if (window && !window->override_redirect &&
((input_event->evtype == XI_KeyPress) || (input_event->evtype == XI_ButtonPress)))
@@ -2343,20 +2332,33 @@ event_callback (XEvent *event,
if (meta_display_process_key_event (display, window, (XIDeviceEvent *) input_event))
filter_out_event = bypass_compositor = TRUE;
break;
case XI_TouchBegin:
/* Filter out non-pointer-emulating touches */
if ((((XIDeviceEvent *) input_event)->flags & XITouchEmulatingPointer) == 0)
break;
/* Fall through */
case XI_ButtonPress:
if (display->grab_op == META_GRAB_OP_COMPOSITOR)
break;
display->overlay_key_only_pressed = FALSE;
if (device_event->detail == 4 || device_event->detail == 5)
/* Scrollwheel event, do nothing and deliver event to compositor below */
break;
if (input_event->evtype == XI_ButtonPress)
{
if (device_event->detail == 4 || device_event->detail == 5)
/* Scrollwheel event, do nothing and deliver event to compositor below */
break;
else
button = device_event->detail;
}
else if (input_event->evtype == XI_TouchBegin)
button = 1;
if ((window &&
meta_grab_op_is_mouse (display->grab_op) &&
(device_event->mods.effective & display->window_grab_modifiers) &&
display->grab_button != device_event->detail &&
display->grab_button != button &&
display->grab_window == window) ||
grab_op_is_keyboard (display->grab_op))
{
@@ -2366,18 +2368,6 @@ event_callback (XEvent *event,
(display->grab_window ?
display->grab_window->desc :
"none"));
if (GRAB_OP_IS_WINDOW_SWITCH (display->grab_op))
{
MetaScreen *screen;
meta_topic (META_DEBUG_WINDOW_OPS,
"Syncing to old stack positions.\n");
screen =
meta_display_screen_for_root (display, device_event->event);
if (screen!=NULL)
meta_stack_set_positions (screen->stack,
display->grab_old_window_stacking);
}
meta_display_end_grab_op (display,
device_event->time);
}
@@ -2398,8 +2388,7 @@ event_callback (XEvent *event,
*/
unmodified = (device_event->mods.effective & grab_mask) == 0;
if (unmodified ||
device_event->detail == 1)
if (unmodified || button == 1)
{
/* don't focus if frame received, will be lowered in
* frames.c or special-cased if the click was on a
@@ -2420,7 +2409,7 @@ event_callback (XEvent *event,
{
meta_topic (META_DEBUG_FOCUS,
"Focusing %s due to unmodified button %u press (display.c)\n",
window->desc, device_event->detail);
window->desc, button);
meta_window_focus (window, device_event->time);
}
else
@@ -2436,7 +2425,7 @@ event_callback (XEvent *event,
if (!unmodified)
begin_move = TRUE;
}
else if (!unmodified && device_event->detail == meta_prefs_get_mouse_button_resize())
else if (!unmodified && button == meta_prefs_get_mouse_button_resize())
{
if (window->has_resize_func)
{
@@ -2478,21 +2467,21 @@ event_callback (XEvent *event,
op,
TRUE,
FALSE,
device_event->detail,
button,
0,
device_event->time,
device_event->root_x,
device_event->root_y);
}
}
else if (device_event->detail == meta_prefs_get_mouse_button_menu())
else if (button == meta_prefs_get_mouse_button_menu())
{
if (meta_prefs_get_raise_on_click ())
meta_window_raise (window);
meta_window_show_menu (window,
device_event->root_x,
device_event->root_y,
device_event->detail,
button,
device_event->time);
}
@@ -2517,7 +2506,7 @@ event_callback (XEvent *event,
META_GRAB_OP_MOVING,
TRUE,
FALSE,
device_event->detail,
button,
0,
device_event->time,
device_event->root_x,
@@ -2667,6 +2656,18 @@ event_callback (XEvent *event,
filter_out_event = bypass_compositor = TRUE;
break;
#endif /* HAVE_XI23 */
case XI_TouchUpdate:
case XI_TouchEnd:
/* Filter out non-pointer-emulating touches */
if ((((XIDeviceEvent *) input_event)->flags & XITouchEmulatingPointer) == 0)
break;
/* Currently unhandled, if any grab_op is started through XI_TouchBegin,
* the XIGrabDevice() evmask drops touch events, so only emulated
* XI_Motions and XI_ButtonRelease will follow.
*/
g_assert_not_reached ();
break;
}
}
else
@@ -2746,7 +2747,7 @@ event_callback (XEvent *event,
if (display->grab_op != META_GRAB_OP_NONE &&
display->grab_window == window &&
((window->frame == NULL) || !window->frame->mapped))
window->frame == NULL)
meta_display_end_grab_op (display, timestamp);
if (!frame_was_receiver)
@@ -3142,6 +3143,9 @@ event_get_modified_window (MetaDisplay *display,
case XI_ButtonRelease:
case XI_KeyPress:
case XI_KeyRelease:
case XI_TouchBegin:
case XI_TouchUpdate:
case XI_TouchEnd:
return ((XIDeviceEvent *) input_event)->event;
case XI_FocusIn:
case XI_FocusOut:
@@ -3428,6 +3432,15 @@ meta_spew_xi2_event (MetaDisplay *display,
case XI_Leave:
name = "XI_Leave";
break;
case XI_TouchBegin:
name = "XI_TouchBegin";
break;
case XI_TouchUpdate:
name = "XI_TouchUpdate";
break;
case XI_TouchEnd:
name = "XI_TouchEnd";
break;
#ifdef HAVE_XI23
case XI_BarrierHit:
name = "XI_BarrierHit";
@@ -3485,6 +3498,18 @@ meta_spew_xi2_event (MetaDisplay *display,
enter_event->root_x,
enter_event->root_y);
break;
case XI_TouchBegin:
case XI_TouchUpdate:
case XI_TouchEnd:
extra = g_strdup_printf ("win: 0x%lx root: 0x%lx touch sequence: %d x: %g y: %g state: 0x%x flags: 0x%x",
device_event->event,
device_event->root,
device_event->detail,
device_event->root_x,
device_event->root_y,
device_event->mods.effective,
device_event->flags);
break;
}
*name_p = name;
@@ -4124,16 +4149,6 @@ meta_display_begin_grab_op (MetaDisplay *display,
g_assert (display->grab_window != NULL || display->grab_screen != NULL);
g_assert (display->grab_op != META_GRAB_OP_NONE);
/* Save the old stacking */
if (GRAB_OP_IS_WINDOW_SWITCH (display->grab_op))
{
meta_topic (META_DEBUG_WINDOW_OPS,
"Saving old stack positions; old pointer was %p.\n",
display->grab_old_window_stacking);
display->grab_old_window_stacking =
meta_stack_get_positions (screen->stack);
}
if (display->grab_window)
{
meta_window_refresh_resize_popup (display->grab_window);
@@ -4175,20 +4190,6 @@ meta_display_end_grab_op (MetaDisplay *display,
if (!display->grab_threshold_movement_reached)
meta_window_raise (display->grab_window);
}
if (GRAB_OP_IS_WINDOW_SWITCH (display->grab_op) ||
display->grab_op == META_GRAB_OP_KEYBOARD_WORKSPACE_SWITCHING)
{
if (GRAB_OP_IS_WINDOW_SWITCH (display->grab_op))
meta_screen_tab_popup_destroy (display->grab_screen);
else
meta_screen_workspace_popup_destroy (display->grab_screen);
/* If the ungrab here causes an EnterNotify, ignore it for
* sloppy focus
*/
display->ungrab_should_not_cause_focus_window = display->grab_xwindow;
}
/* If this was a move or resize clear out the edge cache */
if (meta_grab_op_is_resizing (display->grab_op) ||

View File

@@ -61,7 +61,6 @@ meta_window_ensure_frame (MetaWindow *window)
frame->right_width = 0;
frame->current_cursor = 0;
frame->mapped = FALSE;
frame->is_flashing = FALSE;
frame->borders_cached = FALSE;
@@ -153,6 +152,8 @@ meta_window_ensure_frame (MetaWindow *window)
/* Move keybindings to frame instead of window */
meta_window_grab_keys (window);
meta_ui_map_frame (frame->window->screen->ui, frame->xwindow);
}
void

View File

@@ -47,7 +47,6 @@ struct _MetaFrame
int right_width;
int bottom_height;
guint mapped : 1;
guint need_reapply_frame_shape : 1;
guint is_flashing : 1; /* used by the visual bell flash */
guint borders_cached : 1;

View File

@@ -30,6 +30,7 @@
#include <gio/gio.h>
#include <meta/keybindings.h>
typedef struct _MetaKeyHandler MetaKeyHandler;
struct _MetaKeyHandler
{
char *name;
@@ -47,9 +48,48 @@ struct _MetaKeyBinding
KeyCode keycode;
unsigned int mask;
MetaVirtualModifier modifiers;
gint flags;
MetaKeyHandler *handler;
};
/**
* MetaKeyCombo:
* @keysym: keysym
* @keycode: keycode
* @modifiers: modifiers
*/
typedef struct _MetaKeyCombo MetaKeyCombo;
struct _MetaKeyCombo
{
unsigned int keysym;
unsigned int keycode;
MetaVirtualModifier modifiers;
};
typedef struct
{
char *name;
GSettings *settings;
MetaKeyBindingAction action;
/*
* A list of MetaKeyCombos. Each of them is bound to
* this keypref. If one has keysym==modifiers==0, it is
* ignored.
*/
GSList *combos;
/* for keybindings that can have shift or not like Alt+Tab */
gboolean add_shift:1;
/* for keybindings that apply only to a window */
gboolean per_window:1;
/* for keybindings not added with meta_display_add_keybinding() */
gboolean builtin:1;
} MetaKeyPref;
void meta_display_init_keys (MetaDisplay *display);
void meta_display_shutdown_keys (MetaDisplay *display);
void meta_screen_grab_keys (MetaScreen *screen);
@@ -77,6 +117,9 @@ gboolean meta_prefs_add_keybinding (const char *name,
gboolean meta_prefs_remove_keybinding (const char *name);
GList *meta_prefs_get_keybindings (void);
void meta_prefs_get_overlay_binding (MetaKeyCombo *combo);
const char *meta_prefs_get_iso_next_group_option (void);
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -42,11 +42,11 @@
*/
#define _GNU_SOURCE
#define _SVID_SOURCE /* for putenv() and some signal-related functions */
#define _XOPEN_SOURCE /* for putenv() and some signal-related functions */
#include <config.h>
#include <meta/main.h>
#include <meta/util.h>
#include "util-private.h"
#include "display-private.h"
#include <meta/errors.h>
#include "ui.h"
@@ -384,6 +384,7 @@ meta_init (void)
struct sigaction act;
sigset_t empty_mask;
GIOChannel *channel;
ClutterSettings *clutter_settings;
sigemptyset (&empty_mask);
act.sa_handler = SIG_IGN;
@@ -447,6 +448,13 @@ meta_init (void)
* Clutter can only be initialized after the UI.
*/
meta_clutter_init ();
/*
* XXX: We cannot handle high dpi scaling yet, so fix the scale to 1
* for now.
*/
clutter_settings = clutter_settings_get_default ();
g_object_set (clutter_settings, "window-scaling-factor", 1, NULL);
}
/**

View File

@@ -34,6 +34,7 @@
#include <clutter/clutter.h>
#include <gdk/gdk.h>
#include <gdk/gdkx.h>
#include <X11/cursorfont.h>
#include <X11/extensions/Xfixes.h>
@@ -386,7 +387,7 @@ meta_cursor_tracker_get_pointer (MetaCursorTracker *tracker,
GdkScreen *gscreen;
gmanager = gdk_display_get_device_manager (gdk_display_get_default ());
gdevice = gdk_device_manager_get_client_pointer (gmanager);
gdevice = gdk_x11_device_manager_lookup (gmanager, META_VIRTUAL_CORE_POINTER_ID);
gdk_device_get_position (gdevice, &gscreen, x, y);
gdk_device_get_state (gdevice,

View File

@@ -499,7 +499,7 @@ make_watch (MetaIdleMonitor *monitor,
if (meta_idle_monitor_get_idletime (monitor) > (gint64)timeout_msec)
watch->idle_source_id = g_idle_add (fire_watch_idle, watch);
}
else
else if (monitor->user_active_alarm != None)
{
watch->xalarm = monitor->user_active_alarm;
@@ -605,8 +605,10 @@ meta_idle_monitor_remove_watch (MetaIdleMonitor *monitor,
{
g_return_if_fail (META_IS_IDLE_MONITOR (monitor));
g_object_ref (monitor);
g_hash_table_remove (monitor->watches,
GUINT_TO_POINTER (id));
g_object_unref (monitor);
}
/**

View File

@@ -185,7 +185,7 @@ output_get_backlight_xrandr (MetaMonitorManagerXrandr *manager_xrandr,
XRRGetOutputProperty (manager_xrandr->xdisplay,
(XID)output->output_id,
display->atom_BACKLIGHT,
display->atom_Backlight,
0, G_MAXLONG, False, False, XA_INTEGER,
&actual_type, &actual_format,
&nitems, &bytes_after, &buffer);
@@ -210,7 +210,7 @@ output_get_backlight_limits_xrandr (MetaMonitorManagerXrandr *manager_xrandr,
meta_error_trap_push (display);
info = XRRQueryOutputProperty (manager_xrandr->xdisplay,
(XID)output->output_id,
display->atom_BACKLIGHT);
display->atom_Backlight);
meta_error_trap_pop (display);
if (info == NULL)
@@ -948,7 +948,7 @@ meta_monitor_manager_xrandr_change_backlight (MetaMonitorManager *manager,
meta_error_trap_push (display);
XRRChangeOutputProperty (manager_xrandr->xdisplay,
(XID)output->output_id,
display->atom_BACKLIGHT,
display->atom_Backlight,
XA_INTEGER, 32, PropModeReplace,
(unsigned char *) &hw_value, 1);
meta_error_trap_pop (display);

View File

@@ -31,7 +31,7 @@
#include <clutter/clutter.h>
#include <meta/main.h>
#include <meta/util.h>
#include "util-private.h"
#include <meta/errors.h>
#include "monitor-private.h"

View File

@@ -23,6 +23,7 @@
#include <meta/main.h>
#include <meta/util.h>
#include <glib/gi18n-lib.h>
#include "meta-plugin-manager.h"
#include <glib.h>

View File

@@ -29,7 +29,7 @@
#include <config.h>
#include <meta/prefs.h>
#include "ui.h"
#include <meta/util.h>
#include "util-private.h"
#include "meta-plugin-manager.h"
#include <glib.h>
#include <gio/gio.h>
@@ -57,7 +57,6 @@
#define KEY_OVERLAY_KEY "overlay-key"
#define KEY_WORKSPACES_ONLY_ON_PRIMARY "workspaces-only-on-primary"
#define KEY_NO_TAB_POPUP "no-tab-popup"
/* These are the different schemas we are keeping
* a GSettings instance for */
@@ -112,8 +111,6 @@ static char **workspace_names = NULL;
static gboolean workspaces_only_on_primary = FALSE;
static gboolean no_tab_popup = FALSE;
static char *iso_next_group_option = NULL;
static void handle_preference_update_enum (GSettings *settings,
@@ -365,13 +362,6 @@ static MetaBoolPreference preferences_bool[] =
},
&workspaces_only_on_primary,
},
{
{ KEY_NO_TAB_POPUP,
SCHEMA_MUTTER,
META_PREF_NO_TAB_POPUP,
},
&no_tab_popup,
},
{
{ "auto-maximize",
SCHEMA_MUTTER,
@@ -1813,9 +1803,6 @@ meta_preference_to_string (MetaPreference pref)
case META_PREF_WORKSPACES_ONLY_ON_PRIMARY:
return "WORKSPACES_ONLY_ON_PRIMARY";
case META_PREF_NO_TAB_POPUP:
return "NO_TAB_POPUP";
case META_PREF_DRAGGABLE_BORDER_WIDTH:
return "DRAGGABLE_BORDER_WIDTH";
@@ -1869,7 +1856,7 @@ init_bindings (void)
pref = g_new0 (MetaKeyPref, 1);
pref->name = g_strdup ("overlay-key");
pref->action = META_KEYBINDING_ACTION_OVERLAY_KEY;
pref->bindings = g_slist_prepend (pref->bindings, &overlay_key_combo);
pref->combos = g_slist_prepend (pref->combos, &overlay_key_combo);
pref->builtin = 1;
g_hash_table_insert (key_bindings, g_strdup ("overlay-key"), pref);
@@ -1879,7 +1866,7 @@ static gboolean
update_binding (MetaKeyPref *binding,
gchar **strokes)
{
GSList *old_bindings, *a, *b;
GSList *old_combos, *a, *b;
gboolean changed;
unsigned int keysym;
unsigned int keycode;
@@ -1891,8 +1878,8 @@ update_binding (MetaKeyPref *binding,
"Binding \"%s\" has new GSettings value\n",
binding->name);
old_bindings = binding->bindings;
binding->bindings = NULL;
old_combos = binding->combos;
binding->combos = NULL;
for (i = 0; strokes && strokes[i]; i++)
{
@@ -1933,17 +1920,17 @@ update_binding (MetaKeyPref *binding,
combo->keysym = keysym;
combo->keycode = keycode;
combo->modifiers = mods;
binding->bindings = g_slist_prepend (binding->bindings, combo);
binding->combos = g_slist_prepend (binding->combos, combo);
meta_topic (META_DEBUG_KEYBINDINGS,
"New keybinding for \"%s\" is keysym = 0x%x keycode = 0x%x mods = 0x%x\n",
binding->name, keysym, keycode, mods);
}
binding->bindings = g_slist_reverse (binding->bindings);
binding->combos = g_slist_reverse (binding->combos);
a = old_bindings;
b = binding->bindings;
a = old_combos;
b = binding->combos;
while (TRUE)
{
if ((!a && b) || (a && !b))
@@ -1968,7 +1955,7 @@ update_binding (MetaKeyPref *binding,
}
}
g_slist_free_full (old_bindings, g_free);
g_slist_free_full (old_combos, g_free);
return changed;
}
@@ -2103,7 +2090,7 @@ meta_prefs_add_keybinding (const char *name,
pref->name = g_strdup (name);
pref->settings = g_object_ref (settings);
pref->action = action;
pref->bindings = NULL;
pref->combos = NULL;
pref->add_shift = (flags & META_KEY_BINDING_REVERSES) != 0;
pref->per_window = (flags & META_KEY_BINDING_PER_WINDOW) != 0;
pref->builtin = (flags & META_KEY_BINDING_BUILTIN) != 0;
@@ -2167,11 +2154,6 @@ meta_prefs_remove_keybinding (const char *name)
return TRUE;
}
/**
* meta_prefs_get_keybindings:
*
* Returns: (element-type MetaKeyPref) (transfer container):
*/
GList *
meta_prefs_get_keybindings ()
{
@@ -2272,7 +2254,7 @@ meta_prefs_get_window_binding (const char *name,
if (pref->per_window)
{
GSList *s = pref->bindings;
GSList *s = pref->combos;
while (s)
{
@@ -2320,25 +2302,6 @@ meta_prefs_get_workspaces_only_on_primary (void)
return workspaces_only_on_primary;
}
gboolean
meta_prefs_get_no_tab_popup (void)
{
return no_tab_popup;
}
void
meta_prefs_set_no_tab_popup (gboolean whether)
{
MetaBasePreference *pref;
if (find_pref (preferences_bool, sizeof(MetaBoolPreference),
KEY_NO_TAB_POPUP, &pref))
{
g_settings_set_boolean (SETTINGS (pref->schema), KEY_NO_TAB_POPUP, whether);
}
}
int
meta_prefs_get_draggable_border_width (void)
{

View File

@@ -64,8 +64,6 @@ struct _MetaScreen
Visual *default_xvisual;
MetaRectangle rect; /* Size of screen; rect.x & rect.y are always 0 */
MetaUI *ui;
MetaTabPopup *tab_popup, *ws_popup;
MetaTilePreview *tile_preview;
guint tile_preview_timeout_id;
@@ -151,25 +149,9 @@ void meta_screen_foreach_window (MetaScreen *scree
void meta_screen_update_cursor (MetaScreen *screen);
void meta_screen_tab_popup_create (MetaScreen *screen,
MetaTabList list_type,
MetaTabShowType show_type,
MetaWindow *initial_window);
void meta_screen_tab_popup_forward (MetaScreen *screen);
void meta_screen_tab_popup_backward (MetaScreen *screen);
MetaWindow* meta_screen_tab_popup_get_selected (MetaScreen *screen);
void meta_screen_tab_popup_destroy (MetaScreen *screen);
void meta_screen_workspace_popup_create (MetaScreen *screen,
MetaWorkspace *initial_selection);
void meta_screen_workspace_popup_select (MetaScreen *screen,
MetaWorkspace *workspace);
MetaWorkspace*meta_screen_workspace_popup_get_selected (MetaScreen *screen);
void meta_screen_workspace_popup_destroy (MetaScreen *screen);
void meta_screen_tile_preview_update (MetaScreen *screen,
void meta_screen_update_tile_preview (MetaScreen *screen,
gboolean delay);
void meta_screen_tile_preview_hide (MetaScreen *screen);
void meta_screen_hide_tile_preview (MetaScreen *screen);
MetaWindow* meta_screen_get_mouse_window (MetaScreen *screen,
MetaWindow *not_this_one);

View File

@@ -31,7 +31,7 @@
#include <config.h>
#include "screen-private.h"
#include <meta/main.h>
#include <meta/util.h>
#include "util-private.h"
#include <meta/errors.h>
#include "window-private.h"
#include "frame.h"
@@ -390,6 +390,8 @@ int
meta_screen_monitor_index_to_xinerama_index (MetaScreen *screen,
int index)
{
g_return_val_if_fail (index >= 0 && index < screen->n_monitor_infos, -1);
meta_screen_ensure_xinerama_indices (screen);
return screen->monitor_infos[index].xinerama_index;
@@ -758,10 +760,6 @@ meta_screen_new (MetaDisplay *display,
screen->ui = meta_ui_new (screen->display->xdisplay,
screen->xscreen);
screen->tab_popup = NULL;
screen->ws_popup = NULL;
screen->tile_preview = NULL;
screen->tile_preview_timeout_id = 0;
screen->stack = meta_stack_new (screen);
@@ -866,9 +864,6 @@ meta_screen_free (MetaScreen *screen,
if (screen->tile_preview_timeout_id)
g_source_remove (screen->tile_preview_timeout_id);
if (screen->tile_preview)
meta_tile_preview_free (screen->tile_preview);
g_free (screen->screen_name);
g_object_unref (screen);
@@ -1427,255 +1422,8 @@ meta_screen_update_cursor (MetaScreen *screen)
screen->current_cursor);
}
void
meta_screen_tab_popup_create (MetaScreen *screen,
MetaTabList list_type,
MetaTabShowType show_type,
MetaWindow *initial_selection)
{
MetaTabEntry *entries;
GList *tab_list;
GList *tmp;
int len;
int i;
if (screen->tab_popup)
return;
tab_list = meta_display_get_tab_list (screen->display,
list_type,
screen,
screen->active_workspace);
len = g_list_length (tab_list);
entries = g_new (MetaTabEntry, len + 1);
entries[len].key = NULL;
entries[len].title = NULL;
entries[len].icon = NULL;
i = 0;
tmp = tab_list;
while (i < len)
{
MetaWindow *window;
MetaRectangle r;
window = tmp->data;
entries[i].key = (MetaTabEntryKey) window;
entries[i].title = window->title;
entries[i].icon = g_object_ref (window->icon);
entries[i].blank = FALSE;
entries[i].hidden = !meta_window_showing_on_its_workspace (window);
entries[i].demands_attention = window->wm_state_demands_attention;
if (show_type == META_TAB_SHOW_INSTANTLY ||
!entries[i].hidden ||
!meta_window_get_icon_geometry (window, &r))
meta_window_get_frame_rect (window, &r);
entries[i].rect = r;
/* Find inside of highlight rectangle to be used when window is
* outlined for tabbing. This should be the size of the
* east/west frame, and the size of the south frame, on those
* sides. On the top it should be the size of the south frame
* edge.
*/
#define OUTLINE_WIDTH 5
/* Top side */
if (!entries[i].hidden &&
window->frame && window->frame->bottom_height > 0 &&
window->frame->child_y >= window->frame->bottom_height)
entries[i].inner_rect.y = window->frame->bottom_height;
else
entries[i].inner_rect.y = OUTLINE_WIDTH;
/* Bottom side */
if (!entries[i].hidden &&
window->frame && window->frame->bottom_height != 0)
entries[i].inner_rect.height = r.height
- entries[i].inner_rect.y - window->frame->bottom_height;
else
entries[i].inner_rect.height = r.height
- entries[i].inner_rect.y - OUTLINE_WIDTH;
/* Left side */
if (!entries[i].hidden && window->frame && window->frame->child_x != 0)
entries[i].inner_rect.x = window->frame->child_x;
else
entries[i].inner_rect.x = OUTLINE_WIDTH;
/* Right side */
if (!entries[i].hidden &&
window->frame && window->frame->right_width != 0)
entries[i].inner_rect.width = r.width
- entries[i].inner_rect.x - window->frame->right_width;
else
entries[i].inner_rect.width = r.width
- entries[i].inner_rect.x - OUTLINE_WIDTH;
++i;
tmp = tmp->next;
}
if (!meta_prefs_get_no_tab_popup ())
screen->tab_popup = meta_ui_tab_popup_new (entries,
screen->number,
len,
5, /* FIXME */
TRUE);
for (i = 0; i < len; i++)
g_object_unref (entries[i].icon);
g_free (entries);
g_list_free (tab_list);
meta_ui_tab_popup_select (screen->tab_popup,
(MetaTabEntryKey) initial_selection);
if (show_type != META_TAB_SHOW_INSTANTLY)
meta_ui_tab_popup_set_showing (screen->tab_popup, TRUE);
}
void
meta_screen_tab_popup_forward (MetaScreen *screen)
{
g_return_if_fail (screen->tab_popup != NULL);
meta_ui_tab_popup_forward (screen->tab_popup);
}
void
meta_screen_tab_popup_backward (MetaScreen *screen)
{
g_return_if_fail (screen->tab_popup != NULL);
meta_ui_tab_popup_backward (screen->tab_popup);
}
MetaWindow *
meta_screen_tab_popup_get_selected (MetaScreen *screen)
{
g_return_val_if_fail (screen->tab_popup != NULL, NULL);
return (MetaWindow *) meta_ui_tab_popup_get_selected (screen->tab_popup);
}
void
meta_screen_tab_popup_destroy (MetaScreen *screen)
{
if (screen->tab_popup)
{
meta_ui_tab_popup_free (screen->tab_popup);
screen->tab_popup = NULL;
}
}
void
meta_screen_workspace_popup_create (MetaScreen *screen,
MetaWorkspace *initial_selection)
{
MetaTabEntry *entries;
int len;
int i;
MetaWorkspaceLayout layout;
int n_workspaces;
int current_workspace;
if (screen->ws_popup || meta_prefs_get_no_tab_popup ())
return;
current_workspace = meta_workspace_index (screen->active_workspace);
n_workspaces = meta_screen_get_n_workspaces (screen);
meta_screen_calc_workspace_layout (screen, n_workspaces,
current_workspace, &layout);
len = layout.grid_area;
entries = g_new (MetaTabEntry, len + 1);
entries[len].key = NULL;
entries[len].title = NULL;
entries[len].icon = NULL;
i = 0;
while (i < len)
{
if (layout.grid[i] >= 0)
{
MetaWorkspace *workspace;
workspace = meta_screen_get_workspace_by_index (screen,
layout.grid[i]);
entries[i].key = (MetaTabEntryKey) workspace;
entries[i].title = meta_workspace_get_name (workspace);
entries[i].icon = NULL;
entries[i].blank = FALSE;
g_assert (entries[i].title != NULL);
}
else
{
entries[i].key = NULL;
entries[i].title = NULL;
entries[i].icon = NULL;
entries[i].blank = TRUE;
}
entries[i].hidden = FALSE;
entries[i].demands_attention = FALSE;
++i;
}
screen->ws_popup = meta_ui_tab_popup_new (entries,
screen->number,
len,
layout.cols,
FALSE);
g_free (entries);
meta_screen_free_workspace_layout (&layout);
meta_ui_tab_popup_select (screen->ws_popup,
(MetaTabEntryKey) initial_selection);
meta_ui_tab_popup_set_showing (screen->ws_popup, TRUE);
}
void
meta_screen_workspace_popup_select (MetaScreen *screen,
MetaWorkspace *workspace)
{
g_return_if_fail (screen->ws_popup != NULL);
meta_ui_tab_popup_select (screen->ws_popup,
(MetaTabEntryKey) workspace);
}
MetaWorkspace *
meta_screen_workspace_popup_get_selected (MetaScreen *screen)
{
g_return_val_if_fail (screen->ws_popup != NULL, NULL);
return (MetaWorkspace *) meta_ui_tab_popup_get_selected (screen->ws_popup);
}
void
meta_screen_workspace_popup_destroy (MetaScreen *screen)
{
if (screen->ws_popup)
{
meta_ui_tab_popup_free (screen->ws_popup);
screen->ws_popup = NULL;
}
}
static gboolean
meta_screen_tile_preview_update_timeout (gpointer data)
meta_screen_update_tile_preview_timeout (gpointer data)
{
MetaScreen *screen = data;
MetaWindow *window = screen->display->grab_window;
@@ -1683,19 +1431,6 @@ meta_screen_tile_preview_update_timeout (gpointer data)
screen->tile_preview_timeout_id = 0;
if (!screen->tile_preview)
{
Window xwindow;
gulong create_serial;
screen->tile_preview = meta_tile_preview_new (screen->number);
xwindow = meta_tile_preview_get_xwindow (screen->tile_preview,
&create_serial);
meta_stack_tracker_record_add (screen->stack_tracker,
xwindow,
create_serial);
}
if (window)
{
switch (window->tile_mode)
@@ -1720,12 +1455,16 @@ meta_screen_tile_preview_update_timeout (gpointer data)
if (needs_preview)
{
MetaRectangle tile_rect;
int monitor;
monitor = meta_window_get_current_tile_monitor_number (window);
meta_window_get_current_tile_area (window, &tile_rect);
meta_tile_preview_show (screen->tile_preview, &tile_rect);
meta_compositor_show_tile_preview (screen->display->compositor,
screen, window, &tile_rect, monitor);
}
else
meta_tile_preview_hide (screen->tile_preview);
meta_compositor_hide_tile_preview (screen->display->compositor,
screen);
return FALSE;
}
@@ -1733,7 +1472,7 @@ meta_screen_tile_preview_update_timeout (gpointer data)
#define TILE_PREVIEW_TIMEOUT_MS 200
void
meta_screen_tile_preview_update (MetaScreen *screen,
meta_screen_update_tile_preview (MetaScreen *screen,
gboolean delay)
{
if (delay)
@@ -1743,7 +1482,7 @@ meta_screen_tile_preview_update (MetaScreen *screen,
screen->tile_preview_timeout_id =
g_timeout_add (TILE_PREVIEW_TIMEOUT_MS,
meta_screen_tile_preview_update_timeout,
meta_screen_update_tile_preview_timeout,
screen);
}
else
@@ -1751,18 +1490,18 @@ meta_screen_tile_preview_update (MetaScreen *screen,
if (screen->tile_preview_timeout_id > 0)
g_source_remove (screen->tile_preview_timeout_id);
meta_screen_tile_preview_update_timeout ((gpointer)screen);
meta_screen_update_tile_preview_timeout ((gpointer)screen);
}
}
void
meta_screen_tile_preview_hide (MetaScreen *screen)
meta_screen_hide_tile_preview (MetaScreen *screen)
{
if (screen->tile_preview_timeout_id > 0)
g_source_remove (screen->tile_preview_timeout_id);
if (screen->tile_preview)
meta_tile_preview_hide (screen->tile_preview);
meta_compositor_hide_tile_preview (screen->display->compositor,
screen);
}
MetaWindow*

View File

@@ -23,6 +23,7 @@
#include <config.h>
#include "util-private.h"
#include "session.h"
#include <X11/Xatom.h>

36
src/core/util-private.h Normal file
View File

@@ -0,0 +1,36 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* Mutter utilities */
/*
* Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2005 Elijah Newren
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#ifndef META_UTIL_PRIVATE_H
#define META_UTIL_PRIVATE_H
#include <meta/util.h>
#include <glib/gi18n-lib.h>
void meta_set_verbose (gboolean setting);
void meta_set_debugging (gboolean setting);
void meta_set_syncing (gboolean setting);
void meta_set_replace_current_wm (gboolean setting);
#endif

View File

@@ -29,7 +29,7 @@
#include <config.h>
#include <meta/common.h>
#include <meta/util.h>
#include "util-private.h"
#include <meta/main.h>
#include <clutter/clutter.h> /* For clutter_threads_add_repaint_func() */

View File

@@ -607,9 +607,6 @@ void meta_window_show_menu (MetaWindow *window,
int button,
guint32 timestamp);
gboolean meta_window_titlebar_is_onscreen (MetaWindow *window);
void meta_window_shove_titlebar_onscreen (MetaWindow *window);
void meta_window_set_gravity (MetaWindow *window,
int gravity);
@@ -623,6 +620,7 @@ void meta_window_handle_mouse_grab_op_event (MetaWindow *window,
GList* meta_window_get_workspaces (MetaWindow *window);
int meta_window_get_current_tile_monitor_number (MetaWindow *window);
void meta_window_get_current_tile_area (MetaWindow *window,
MetaRectangle *tile_area);
@@ -681,20 +679,18 @@ void meta_window_compute_tile_match (MetaWindow *window);
gboolean meta_window_updates_are_frozen (MetaWindow *window);
void meta_window_set_opaque_region (MetaWindow *window,
cairo_region_t *region);
void meta_window_update_opaque_region_x11 (MetaWindow *window);
void meta_window_set_input_region (MetaWindow *window,
cairo_region_t *region);
void meta_window_update_input_region_x11 (MetaWindow *window);
void meta_window_set_shape_region (MetaWindow *window,
cairo_region_t *region);
void meta_window_update_shape_region_x11 (MetaWindow *window);
void meta_window_set_opacity (MetaWindow *window,
guint opacity);
Window meta_window_get_toplevel_xwindow (MetaWindow *window);
void meta_window_get_client_area_rect (const MetaWindow *window,
cairo_rectangle_int_t *rect);
gboolean meta_window_is_client_decorated (MetaWindow *window);
#endif

View File

@@ -35,7 +35,7 @@
*/
#define _GNU_SOURCE
#define _SVID_SOURCE /* for gethostname() */
#define _XOPEN_SOURCE 500 /* for gethostname() */
#include <config.h>
#include "window-props.h"
@@ -46,6 +46,7 @@
#include <X11/Xatom.h>
#include <unistd.h>
#include <string.h>
#include "util-private.h"
#ifndef HOST_NAME_MAX
/* Solaris headers apparently don't define this so do so manually; #326745 */

View File

@@ -30,7 +30,7 @@
#include "window-private.h"
#include "boxes-private.h"
#include "edge-resistance.h"
#include <meta/util.h>
#include "util-private.h"
#include "frame.h"
#include <meta/errors.h>
#include "workspace-private.h"
@@ -77,8 +77,7 @@ static void invalidate_work_areas (MetaWindow *window);
static void set_wm_state_on_xwindow (MetaDisplay *display,
Window xwindow,
int state);
static void set_wm_state (MetaWindow *window,
int state);
static void set_wm_state (MetaWindow *window);
static void set_net_wm_state (MetaWindow *window);
static void meta_window_set_above (MetaWindow *window,
gboolean new_value);
@@ -192,6 +191,8 @@ enum
FOCUS,
RAISED,
UNMANAGED,
SIZE_CHANGED,
POSITION_CHANGED,
LAST_SIGNAL
};
@@ -596,6 +597,40 @@ meta_window_class_init (MetaWindowClass *klass)
G_STRUCT_OFFSET (MetaWindowClass, unmanaged),
NULL, NULL, NULL,
G_TYPE_NONE, 0);
/**
* MetaWindow::position-changed:
* @window: a #MetaWindow
*
* This is emitted when the position of a window might
* have changed. Specifically, this is emitted when the
* position of the toplevel window has changed, or when
* the position of the client window has changed.
*/
window_signals[POSITION_CHANGED] =
g_signal_new ("position-changed",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
0,
NULL, NULL, NULL,
G_TYPE_NONE, 0);
/**
* MetaWindow::size-changed:
* @window: a #MetaWindow
*
* This is emitted when the position of a window might
* have changed. Specifically, this is emitted when the
* size of the toplevel window has changed, or when the
* size of the client window has changed.
*/
window_signals[SIZE_CHANGED] =
g_signal_new ("size-changed",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
0,
NULL, NULL, NULL,
G_TYPE_NONE, 0);
}
static void
@@ -777,6 +812,35 @@ meta_window_should_attach_to_parent (MetaWindow *window)
}
}
static gboolean
client_window_should_be_mapped (MetaWindow *window)
{
return !window->shaded;
}
static void
sync_client_window_mapped (MetaWindow *window)
{
gboolean should_be_mapped = client_window_should_be_mapped (window);
if (window->mapped == should_be_mapped)
return;
window->mapped = should_be_mapped;
meta_error_trap_push (window->display);
if (should_be_mapped)
{
XMapWindow (window->display->xdisplay, window->xwindow);
}
else
{
XUnmapWindow (window->display->xdisplay, window->xwindow);
window->unmaps_pending ++;
}
meta_error_trap_pop (window->display);
}
MetaWindow*
meta_window_new (MetaDisplay *display,
Window xwindow,
@@ -1367,9 +1431,6 @@ meta_window_new (MetaDisplay *display,
if (!window->override_redirect)
meta_stack_add (window->screen->stack,
window);
else if (window->screen->tile_preview != NULL &&
meta_tile_preview_get_xwindow (window->screen->tile_preview, NULL) == xwindow)
window->layer = META_LAYER_NORMAL;
else
window->layer = META_LAYER_OVERRIDE_REDIRECT; /* otherwise set by MetaStack */
@@ -1406,7 +1467,7 @@ meta_window_new (MetaDisplay *display,
/* FIXME we have a tendency to set this then immediately
* change it again.
*/
set_wm_state (window, window->iconic ? IconicState : NormalState);
set_wm_state (window);
set_net_wm_state (window);
}
@@ -1426,6 +1487,8 @@ meta_window_new (MetaDisplay *display,
/* disable show desktop mode unless we're a desktop component */
maybe_leave_show_desktop_mode (window);
sync_client_window_mapped (window);
meta_window_queue (window, META_QUEUE_CALC_SHOWING);
/* See bug 303284; a transient of the given window can already exist, in which
* case we think it should probably be shown.
@@ -1499,9 +1562,7 @@ meta_window_apply_session_info (MetaWindow *window,
if (window->has_maximize_func && info->maximized)
{
meta_window_maximize (window,
META_MAXIMIZE_HORIZONTAL |
META_MAXIMIZE_VERTICAL);
meta_window_maximize (window, META_MAXIMIZE_BOTH);
if (info->saved_rect_set)
{
@@ -1807,7 +1868,7 @@ meta_window_unmanage (MetaWindow *window,
XDeleteProperty (window->display->xdisplay,
window->xwindow,
window->display->atom__NET_WM_FULLSCREEN_MONITORS);
set_wm_state (window, WithdrawnState);
set_wm_state (window);
meta_error_trap_pop (window->display);
}
else
@@ -1818,7 +1879,7 @@ meta_window_unmanage (MetaWindow *window,
if (!window->minimized)
{
meta_error_trap_push (window->display);
set_wm_state (window, NormalState);
set_wm_state (window);
meta_error_trap_pop (window->display);
}
@@ -1968,11 +2029,16 @@ set_wm_state_on_xwindow (MetaDisplay *display,
}
static void
set_wm_state (MetaWindow *window,
int state)
set_wm_state (MetaWindow *window)
{
meta_verbose ("Setting wm state %s on %s\n",
wm_state_to_string (state), window->desc);
int state;
if (window->withdrawn)
state = WithdrawnState;
else if (window->iconic)
state = IconicState;
else
state = NormalState;
set_wm_state_on_xwindow (window->display, window->xwindow, state);
}
@@ -2061,23 +2127,35 @@ set_net_wm_state (MetaWindow *window)
if (window->fullscreen)
{
data[0] = meta_screen_monitor_index_to_xinerama_index (window->screen,
window->fullscreen_monitors[0]);
data[1] = meta_screen_monitor_index_to_xinerama_index (window->screen,
window->fullscreen_monitors[1]);
data[2] = meta_screen_monitor_index_to_xinerama_index (window->screen,
window->fullscreen_monitors[2]);
data[3] = meta_screen_monitor_index_to_xinerama_index (window->screen,
window->fullscreen_monitors[3]);
if (window->fullscreen_monitors[0] >= 0)
{
data[0] = meta_screen_monitor_index_to_xinerama_index (window->screen,
window->fullscreen_monitors[0]);
data[1] = meta_screen_monitor_index_to_xinerama_index (window->screen,
window->fullscreen_monitors[1]);
data[2] = meta_screen_monitor_index_to_xinerama_index (window->screen,
window->fullscreen_monitors[2]);
data[3] = meta_screen_monitor_index_to_xinerama_index (window->screen,
window->fullscreen_monitors[3]);
meta_verbose ("Setting _NET_WM_FULLSCREEN_MONITORS\n");
meta_error_trap_push (window->display);
XChangeProperty (window->display->xdisplay,
window->xwindow,
window->display->atom__NET_WM_FULLSCREEN_MONITORS,
XA_CARDINAL, 32, PropModeReplace,
(guchar*) data, 4);
meta_error_trap_pop (window->display);
meta_verbose ("Setting _NET_WM_FULLSCREEN_MONITORS\n");
meta_error_trap_push (window->display);
XChangeProperty (window->display->xdisplay,
window->xwindow,
window->display->atom__NET_WM_FULLSCREEN_MONITORS,
XA_CARDINAL, 32, PropModeReplace,
(guchar*) data, 4);
meta_error_trap_pop (window->display);
}
else
{
meta_verbose ("Clearing _NET_WM_FULLSCREEN_MONITORS\n");
meta_error_trap_push (window->display);
XDeleteProperty (window->display->xdisplay,
window->xwindow,
window->display->atom__NET_WM_FULLSCREEN_MONITORS);
meta_error_trap_pop (window->display);
}
}
}
@@ -2213,6 +2291,8 @@ implement_showing (MetaWindow *window,
meta_verbose ("Implement showing = %d for window %s\n",
showing, window->desc);
sync_client_window_mapped (window);
if (!showing)
{
/* When we manage a new window, we normally delay placing it
@@ -2801,94 +2881,6 @@ window_would_be_covered (const MetaWindow *newbie)
return FALSE; /* none found */
}
static gboolean
map_frame (MetaWindow *window)
{
if (window->frame && !window->frame->mapped)
{
meta_topic (META_DEBUG_WINDOW_STATE,
"Frame actually needs map\n");
window->frame->mapped = TRUE;
meta_ui_map_frame (window->screen->ui, window->frame->xwindow);
return TRUE;
}
else
return FALSE;
}
static gboolean
map_client_window (MetaWindow *window)
{
if (!window->mapped)
{
meta_topic (META_DEBUG_WINDOW_STATE,
"%s actually needs map\n", window->desc);
window->mapped = TRUE;
meta_error_trap_push (window->display);
XMapWindow (window->display->xdisplay, window->xwindow);
meta_error_trap_pop (window->display);
return TRUE;
}
else
return FALSE;
}
static gboolean
unmap_client_window (MetaWindow *window,
const char *reason)
{
if (window->mapped)
{
meta_topic (META_DEBUG_WINDOW_STATE,
"%s actually needs unmap%s\n",
window->desc, reason);
meta_topic (META_DEBUG_WINDOW_STATE,
"Incrementing unmaps_pending on %s%s\n",
window->desc, reason);
window->mapped = FALSE;
window->unmaps_pending += 1;
meta_error_trap_push (window->display);
XUnmapWindow (window->display->xdisplay, window->xwindow);
meta_error_trap_pop (window->display);
return TRUE;
}
else
return FALSE;
}
/**
* meta_window_is_mapped:
* @window: a #MetaWindow
*
* Determines whether the X window for the MetaWindow is mapped.
*/
gboolean
meta_window_is_mapped (MetaWindow *window)
{
return window->mapped;
}
/**
* meta_window_toplevel_is_mapped:
* @window: a #MetaWindow
*
* Determines whether the toplevel X window for the MetaWindow is
* mapped. (The frame window is mapped even without the client window
* when a window is shaded.)
*
* Return Value: %TRUE if the toplevel is mapped.
*/
gboolean
meta_window_toplevel_is_mapped (MetaWindow *window)
{
/* The frame is mapped but not the client window when the window
* is shaded.
*/
return window->mapped || (window->frame && window->frame->mapped);
}
static void
meta_window_force_placement (MetaWindow *window)
{
@@ -2927,16 +2919,12 @@ meta_window_show (MetaWindow *window)
gboolean place_on_top_on_map;
gboolean needs_stacking_adjustment;
MetaWindow *focus_window;
gboolean toplevel_was_mapped;
gboolean toplevel_now_mapped;
gboolean notify_demands_attention = FALSE;
meta_topic (META_DEBUG_WINDOW_STATE,
"Showing window %s, shaded: %d iconic: %d placed: %d\n",
window->desc, window->shaded, window->iconic, window->placed);
toplevel_was_mapped = meta_window_toplevel_is_mapped (window);
focus_window = window->display->focus_window; /* May be NULL! */
did_show = FALSE;
window_state_on_map (window, &takes_focus_on_map, &place_on_top_on_map);
@@ -3063,46 +3051,18 @@ meta_window_show (MetaWindow *window)
}
}
/* Shaded means the frame is mapped but the window is not */
if (map_frame (window))
did_show = TRUE;
if (window->shaded)
if (window->hidden)
{
unmap_client_window (window, " (shading)");
if (!window->iconic)
{
window->iconic = TRUE;
set_wm_state (window, IconicState);
}
}
else
{
if (map_client_window (window))
did_show = TRUE;
if (window->hidden)
{
meta_stack_freeze (window->screen->stack);
window->hidden = FALSE;
meta_stack_thaw (window->screen->stack);
did_show = TRUE;
}
if (window->iconic)
{
window->iconic = FALSE;
set_wm_state (window, NormalState);
}
meta_stack_freeze (window->screen->stack);
window->hidden = FALSE;
meta_stack_thaw (window->screen->stack);
did_show = TRUE;
}
toplevel_now_mapped = meta_window_toplevel_is_mapped (window);
if (toplevel_now_mapped != toplevel_was_mapped)
if (window->iconic)
{
if (window->display->compositor)
meta_compositor_window_mapped (window->display->compositor, window);
window->iconic = FALSE;
set_wm_state (window);
}
if (!window->visible_to_compositor)
@@ -3191,14 +3151,10 @@ static void
meta_window_hide (MetaWindow *window)
{
gboolean did_hide;
gboolean toplevel_was_mapped;
gboolean toplevel_now_mapped;
meta_topic (META_DEBUG_WINDOW_STATE,
"Hiding window %s\n", window->desc);
toplevel_was_mapped = meta_window_toplevel_is_mapped (window);
if (window->visible_to_compositor)
{
window->visible_to_compositor = FALSE;
@@ -3219,19 +3175,12 @@ meta_window_hide (MetaWindow *window)
break;
}
meta_compositor_hide_window (window->display->compositor,
window, effect);
meta_compositor_hide_window (window->display->compositor, window, effect);
}
}
did_hide = FALSE;
/* If this is the first time that we've calculating the showing
* state of the window, the frame and client window might not
* yet be mapped, so we need to map them now */
map_frame (window);
map_client_window (window);
if (!window->hidden)
{
meta_stack_freeze (window->screen->stack);
@@ -3244,20 +3193,7 @@ meta_window_hide (MetaWindow *window)
if (!window->iconic)
{
window->iconic = TRUE;
set_wm_state (window, IconicState);
}
toplevel_now_mapped = meta_window_toplevel_is_mapped (window);
if (toplevel_now_mapped != toplevel_was_mapped)
{
if (window->display->compositor)
{
/* As above, we may be *mapping* live hidden windows */
if (toplevel_now_mapped)
meta_compositor_window_mapped (window->display->compositor, window);
else
meta_compositor_window_unmapped (window->display->compositor, window);
}
set_wm_state (window);
}
set_net_wm_state (window);
@@ -3738,12 +3674,12 @@ meta_window_tile (MetaWindow *window)
return;
if (window->tile_mode == META_TILE_MAXIMIZED)
directions = META_MAXIMIZE_VERTICAL | META_MAXIMIZE_HORIZONTAL;
directions = META_MAXIMIZE_BOTH;
else
directions = META_MAXIMIZE_VERTICAL;
meta_window_maximize_internal (window, directions, NULL);
meta_screen_tile_preview_update (window->screen, FALSE);
meta_screen_update_tile_preview (window->screen, FALSE);
if (window->display->compositor)
{
@@ -5249,6 +5185,12 @@ meta_window_move_resize_internal (MetaWindow *window,
else if (is_user_action)
save_user_window_placement (window);
if (need_move_client || need_move_frame)
g_signal_emit (window, window_signals[POSITION_CHANGED], 0);
if (need_resize_client || need_resize_frame)
g_signal_emit (window, window_signals[SIZE_CHANGED], 0);
if (need_move_frame || need_resize_frame ||
need_move_client || need_resize_client ||
did_placement)
@@ -5888,6 +5830,37 @@ meta_window_get_outer_rect (const MetaWindow *window,
meta_window_get_frame_rect (window, rect);
}
/**
* meta_window_get_client_area_rect:
* @window: a #MetaWindow
* @rect: (out): pointer to a cairo rectangle
*
* Gets the rectangle for the boundaries of the client area, relative
* to the frame. If the window is shaded, the height of the rectangle
* is 0.
*/
void
meta_window_get_client_area_rect (const MetaWindow *window,
cairo_rectangle_int_t *rect)
{
if (window->frame)
{
rect->x = window->frame->child_x;
rect->y = window->frame->child_y;
}
else
{
rect->x = 0;
rect->y = 0;
}
rect->width = window->rect.width;
if (window->shaded)
rect->height = 0;
else
rect->height = window->rect.height;
}
const char*
meta_window_get_startup_id (MetaWindow *window)
{
@@ -7692,7 +7665,7 @@ meta_window_update_net_wm_type (MetaWindow *window)
meta_window_recalc_window_type (window);
}
void
static void
meta_window_set_opaque_region (MetaWindow *window,
cairo_region_t *region)
{
@@ -7778,14 +7751,14 @@ region_create_from_x_rectangles (const XRectangle *rects,
return cairo_region_create_rectangles (cairo_rects, n_rects);
}
void
meta_window_set_shape_region (MetaWindow *window,
static void
meta_window_set_input_region (MetaWindow *window,
cairo_region_t *region)
{
g_clear_pointer (&window->shape_region, cairo_region_destroy);
g_clear_pointer (&window->input_region, cairo_region_destroy);
if (region != NULL)
window->shape_region = cairo_region_reference (region);
window->input_region = cairo_region_reference (region);
if (window->display->compositor)
meta_compositor_window_shape_changed (window->display->compositor, window);
@@ -7796,6 +7769,17 @@ meta_window_update_input_region_x11 (MetaWindow *window)
{
cairo_region_t *region = NULL;
/* Decorated windows don't have an input region, because
we don't shape the frame to match the client windows
(so the events are blocked by the frame anyway)
*/
if (window->decorated)
{
if (window->input_region)
meta_window_set_input_region (window, NULL);
return;
}
#ifdef HAVE_SHAPE
if (META_DISPLAY_HAS_SHAPE (window->display))
{
@@ -7804,17 +7788,7 @@ meta_window_update_input_region_x11 (MetaWindow *window)
XRectangle *rects = NULL;
int n_rects, ordering;
int x_bounding, y_bounding, x_clip, y_clip;
unsigned w_bounding, h_bounding, w_clip, h_clip;
int bounding_shaped, clip_shaped;
meta_error_trap_push (window->display);
XShapeQueryExtents (window->display->xdisplay, window->xwindow,
&bounding_shaped, &x_bounding, &y_bounding,
&w_bounding, &h_bounding,
&clip_shaped, &x_clip, &y_clip,
&w_clip, &h_clip);
rects = XShapeGetRectangles (window->display->xdisplay,
window->xwindow,
ShapeInput,
@@ -7829,10 +7803,10 @@ meta_window_update_input_region_x11 (MetaWindow *window)
{
if (n_rects > 1 ||
(n_rects == 1 &&
(rects[0].x != x_bounding ||
rects[1].y != y_bounding ||
rects[2].width != w_bounding ||
rects[3].height != h_bounding)))
(rects[0].x != 0 ||
rects[0].y != 0 ||
rects[0].width != window->rect.width ||
rects[0].height != window->rect.height)))
region = region_create_from_x_rectangles (rects, n_rects);
XFree (rects);
@@ -7863,14 +7837,14 @@ meta_window_update_input_region_x11 (MetaWindow *window)
cairo_region_destroy (region);
}
void
meta_window_set_input_region (MetaWindow *window,
static void
meta_window_set_shape_region (MetaWindow *window,
cairo_region_t *region)
{
g_clear_pointer (&window->input_region, cairo_region_destroy);
g_clear_pointer (&window->shape_region, cairo_region_destroy);
if (region != NULL)
window->input_region = cairo_region_reference (region);
window->shape_region = cairo_region_reference (region);
if (window->display->compositor)
meta_compositor_window_shape_changed (window->display->compositor, window);
@@ -7947,7 +7921,7 @@ redraw_icon (MetaWindow *window)
/* We could probably be smart and just redraw the icon here,
* instead of the whole frame.
*/
if (window->frame && (window->mapped || window->frame->mapped))
if (window->frame)
meta_ui_queue_frame_draw (window->screen->ui, window->frame->xwindow);
}
@@ -8736,15 +8710,11 @@ menu_callback (MetaWindowMenu *menu,
break;
case META_MENU_OP_UNMAXIMIZE:
meta_window_unmaximize (window,
META_MAXIMIZE_HORIZONTAL |
META_MAXIMIZE_VERTICAL);
meta_window_unmaximize (window, META_MAXIMIZE_BOTH);
break;
case META_MENU_OP_MAXIMIZE:
meta_window_maximize (window,
META_MAXIMIZE_HORIZONTAL |
META_MAXIMIZE_VERTICAL);
meta_window_maximize (window, META_MAXIMIZE_BOTH);
break;
case META_MENU_OP_UNSHADE:
@@ -9029,7 +8999,7 @@ meta_window_titlebar_is_onscreen (MetaWindow *window)
/* Titlebar can't be offscreen if there is no titlebar... */
if (!window->frame)
return FALSE;
return TRUE;
/* Get the rectangle corresponding to the titlebar */
meta_window_get_frame_rect (window, &titlebar_rect);
@@ -9261,10 +9231,7 @@ update_move (MetaWindow *window,
display->grab_anchor_root_x = x;
display->grab_anchor_root_y = y;
meta_window_unmaximize (window,
META_MAXIMIZE_HORIZONTAL |
META_MAXIMIZE_VERTICAL);
meta_window_unmaximize (window, META_MAXIMIZE_BOTH);
return;
}
@@ -9308,9 +9275,7 @@ update_move (MetaWindow *window,
window->user_rect.x = window->saved_rect.x;
window->user_rect.y = window->saved_rect.y;
meta_window_unmaximize (window,
META_MAXIMIZE_HORIZONTAL |
META_MAXIMIZE_VERTICAL);
meta_window_unmaximize (window, META_MAXIMIZE_BOTH);
}
display->grab_initial_window_pos = work_area;
@@ -9318,10 +9283,7 @@ update_move (MetaWindow *window,
display->grab_anchor_root_y = y;
window->shaken_loose = FALSE;
meta_window_maximize (window,
META_MAXIMIZE_HORIZONTAL |
META_MAXIMIZE_VERTICAL);
meta_window_maximize (window, META_MAXIMIZE_BOTH);
return;
}
}
@@ -9331,7 +9293,7 @@ update_move (MetaWindow *window,
* trigger it unwittingly, e.g. when shaking loose the window or moving
* it to another monitor.
*/
meta_screen_tile_preview_update (window->screen,
meta_screen_update_tile_preview (window->screen,
window->tile_mode != META_TILE_NONE);
meta_window_get_client_root_coords (window, &old);
@@ -10087,6 +10049,20 @@ meta_window_get_work_area_all_monitors (MetaWindow *window,
window->desc, area->x, area->y, area->width, area->height);
}
int
meta_window_get_current_tile_monitor_number (MetaWindow *window)
{
int tile_monitor_number = window->tile_monitor_number;
if (tile_monitor_number < 0)
{
meta_warning ("%s called with an invalid monitor number; using 0 instead\n", G_STRFUNC);
tile_monitor_number = 0;
}
return tile_monitor_number;
}
void
meta_window_get_current_tile_area (MetaWindow *window,
MetaRectangle *tile_area)
@@ -10095,12 +10071,7 @@ meta_window_get_current_tile_area (MetaWindow *window,
g_return_if_fail (window->tile_mode != META_TILE_NONE);
tile_monitor_number = window->tile_monitor_number;
if (tile_monitor_number < 0)
{
meta_warning ("%s called with an invalid monitor number; using 0 instead\n", G_STRFUNC);
tile_monitor_number = 0;
}
tile_monitor_number = meta_window_get_current_tile_monitor_number (window);
meta_window_get_work_area_for_monitor (window, tile_monitor_number, tile_area);
@@ -10142,6 +10113,24 @@ meta_window_same_client (MetaWindow *window,
(other_window->xwindow & ~resource_mask));
}
/**
* meta_window_is_client_decorated:
*
* Check if if the window has decorations drawn by the client.
* (window->decorated refers only to whether we should add decorations)
*/
gboolean
meta_window_is_client_decorated (MetaWindow *window)
{
/* Currently the implementation here is hackish -
* has_custom_frame_extents() is set if _GTK_FRAME_EXTENTS is set
* to any value even 0. GTK+ always sets _GTK_FRAME_EXTENTS for
* client-side-decorated window, even if the value is 0 because
* the window is maxized and has no invisible borders or shadows.
*/
return window->has_custom_frame_extents;
}
void
meta_window_refresh_resize_popup (MetaWindow *window)
{
@@ -11414,12 +11403,6 @@ meta_window_compute_tile_match (MetaWindow *window)
}
}
gboolean
meta_window_can_close (MetaWindow *window)
{
return window->has_close_func;
}
Window
meta_window_get_toplevel_xwindow (MetaWindow *window)
{
@@ -11435,3 +11418,51 @@ meta_window_set_opacity (MetaWindow *window,
if (window->display->compositor)
meta_compositor_window_opacity_changed (window->display->compositor, window);
}
gboolean
meta_window_can_maximize (MetaWindow *window)
{
return window->has_maximize_func;
}
gboolean
meta_window_can_minimize (MetaWindow *window)
{
return window->has_minimize_func;
}
gboolean
meta_window_can_shade (MetaWindow *window)
{
return window->has_shade_func;
}
gboolean
meta_window_can_close (MetaWindow *window)
{
return window->has_close_func;
}
gboolean
meta_window_is_always_on_all_workspaces (MetaWindow *window)
{
return window->always_sticky;
}
gboolean
meta_window_is_above (MetaWindow *window)
{
return window->wm_state_above;
}
gboolean
meta_window_allows_move (MetaWindow *window)
{
return META_WINDOW_ALLOWS_MOVE (window);
}
gboolean
meta_window_allows_resize (MetaWindow *window)
{
return META_WINDOW_ALLOWS_RESIZE (window);
}

View File

@@ -81,7 +81,7 @@ from The Open Group.
#include <config.h>
#include "xprops.h"
#include <meta/errors.h>
#include <meta/util.h>
#include "util-private.h"
#include "async-getprop.h"
#include "ui.h"
#include "mutter-Xatomtype.h"

View File

@@ -78,7 +78,7 @@ item(MULTIPLE)
item(TIMESTAMP)
item(VERSION)
item(ATOM_PAIR)
item(BACKLIGHT)
item(Backlight)
item(hotplug_mode_update)
/* Oddities: These are used, and we need atoms for them,

View File

@@ -213,21 +213,6 @@ typedef enum
META_GRAB_OP_KEYBOARD_RESIZING_SW,
META_GRAB_OP_KEYBOARD_RESIZING_NW,
/* Alt+Tab */
META_GRAB_OP_KEYBOARD_TABBING_NORMAL,
META_GRAB_OP_KEYBOARD_TABBING_DOCK,
/* Alt+Esc */
META_GRAB_OP_KEYBOARD_ESCAPING_NORMAL,
META_GRAB_OP_KEYBOARD_ESCAPING_DOCK,
META_GRAB_OP_KEYBOARD_ESCAPING_GROUP,
/* Alt+F6 */
META_GRAB_OP_KEYBOARD_TABBING_GROUP,
META_GRAB_OP_KEYBOARD_WORKSPACE_SWITCHING,
/* Frame button ops */
META_GRAB_OP_CLICKING_MINIMIZE,
META_GRAB_OP_CLICKING_MAXIMIZE,

View File

@@ -75,11 +75,10 @@ gboolean meta_compositor_filter_keybinding (MetaCompositor *compositor,
MetaScreen *screen,
MetaKeyBinding *binding);
void meta_compositor_add_window (MetaCompositor *compositor,
MetaWindow *window);
void meta_compositor_remove_window (MetaCompositor *compositor,
MetaWindow *window);
void meta_compositor_add_window (MetaCompositor *compositor,
MetaWindow *window);
void meta_compositor_remove_window (MetaCompositor *compositor,
MetaWindow *window);
void meta_compositor_show_window (MetaCompositor *compositor,
MetaWindow *window,
MetaCompEffect effect);
@@ -101,10 +100,6 @@ void meta_compositor_unmaximize_window (MetaCompositor *compositor,
MetaRectangle *old_rect,
MetaRectangle *new_rect);
void meta_compositor_window_mapped (MetaCompositor *compositor,
MetaWindow *window);
void meta_compositor_window_unmapped (MetaCompositor *compositor,
MetaWindow *window);
void meta_compositor_sync_window_geometry (MetaCompositor *compositor,
MetaWindow *window,
gboolean did_placement);
@@ -126,4 +121,12 @@ void meta_compositor_sync_screen_size (MetaCompositor *compositor,
void meta_compositor_flash_screen (MetaCompositor *compositor,
MetaScreen *screen);
void meta_compositor_show_tile_preview (MetaCompositor *compositor,
MetaScreen *screen,
MetaWindow *window,
MetaRectangle *tile_rect,
int tile_monitor_number);
void meta_compositor_hide_tile_preview (MetaCompositor *compositor,
MetaScreen *screen);
#endif /* META_COMPOSITOR_H */

View File

@@ -158,6 +158,11 @@ struct _MetaPluginClass
gint to,
MetaMotionDirection direction);
void (*show_tile_preview) (MetaPlugin *plugin,
MetaWindow *window,
MetaRectangle *tile_rect,
int tile_monitor_number);
void (*hide_tile_preview) (MetaPlugin *plugin);
/**
* MetaPluginClass::kill_window_effects:

View File

@@ -62,8 +62,6 @@ struct _MetaShapedTexture
GType meta_shaped_texture_get_type (void) G_GNUC_CONST;
ClutterActor *meta_shaped_texture_new (void);
void meta_shaped_texture_set_create_mipmaps (MetaShapedTexture *stex,
gboolean create_mipmaps);
@@ -71,11 +69,7 @@ gboolean meta_shaped_texture_update_area (MetaShapedTexture *stex,
int x,
int y,
int width,
int height,
cairo_region_t *unobscured_region);
void meta_shaped_texture_set_pixmap (MetaShapedTexture *stex,
Pixmap pixmap);
int height);
CoglTexture * meta_shaped_texture_get_texture (MetaShapedTexture *stex);

View File

@@ -62,7 +62,6 @@
* @META_PREF_EDGE_TILING: edge tiling
* @META_PREF_FORCE_FULLSCREEN: force fullscreen
* @META_PREF_WORKSPACES_ONLY_ON_PRIMARY: workspaces only on primary
* @META_PREF_NO_TAB_POPUP: no tab popup
* @META_PREF_DRAGGABLE_BORDER_WIDTH: draggable border width
* @META_PREF_AUTO_MAXIMIZE: auto-maximize
*/
@@ -100,7 +99,6 @@ typedef enum
META_PREF_EDGE_TILING,
META_PREF_FORCE_FULLSCREEN,
META_PREF_WORKSPACES_ONLY_ON_PRIMARY,
META_PREF_NO_TAB_POPUP,
META_PREF_DRAGGABLE_BORDER_WIDTH,
META_PREF_AUTO_MAXIMIZE
} MetaPreference;
@@ -163,9 +161,6 @@ void meta_prefs_set_force_fullscreen (gboolean whether);
gboolean meta_prefs_get_workspaces_only_on_primary (void);
gboolean meta_prefs_get_no_tab_popup (void);
void meta_prefs_set_no_tab_popup (gboolean whether);
int meta_prefs_get_draggable_border_width (void);
gboolean meta_prefs_get_ignore_request_hide_titlebar (void);
@@ -204,8 +199,6 @@ void meta_prefs_set_ignore_request_hide_titlebar (gboolean whether);
* @META_KEYBINDING_ACTION_CYCLE_WINDOWS_BACKWARD: FILLME
* @META_KEYBINDING_ACTION_CYCLE_PANELS: FILLME
* @META_KEYBINDING_ACTION_CYCLE_PANELS_BACKWARD: FILLME
* @META_KEYBINDING_ACTION_TAB_POPUP_SELECT: FILLME
* @META_KEYBINDING_ACTION_TAB_POPUP_CANCEL: FILLME
* @META_KEYBINDING_ACTION_SHOW_DESKTOP: FILLME
* @META_KEYBINDING_ACTION_PANEL_MAIN_MENU: FILLME
* @META_KEYBINDING_ACTION_PANEL_RUN_DIALOG: FILLME
@@ -301,8 +294,6 @@ typedef enum _MetaKeyBindingAction
META_KEYBINDING_ACTION_CYCLE_WINDOWS_BACKWARD,
META_KEYBINDING_ACTION_CYCLE_PANELS,
META_KEYBINDING_ACTION_CYCLE_PANELS_BACKWARD,
META_KEYBINDING_ACTION_TAB_POPUP_SELECT,
META_KEYBINDING_ACTION_TAB_POPUP_CANCEL,
META_KEYBINDING_ACTION_SHOW_DESKTOP,
META_KEYBINDING_ACTION_PANEL_MAIN_MENU,
META_KEYBINDING_ACTION_PANEL_RUN_DIALOG,
@@ -380,20 +371,6 @@ typedef enum
META_KEY_BINDING_IS_REVERSED = 1 << 3
} MetaKeyBindingFlags;
/**
* MetaKeyCombo:
* @keysym: keysym
* @keycode: keycode
* @modifiers: modifiers
*/
typedef struct _MetaKeyCombo MetaKeyCombo;
struct _MetaKeyCombo
{
unsigned int keysym;
unsigned int keycode;
MetaVirtualModifier modifiers;
};
/**
* MetaKeyHandlerFunc:
* @display: a #MetaDisplay
@@ -411,45 +388,14 @@ typedef void (* MetaKeyHandlerFunc) (MetaDisplay *display,
MetaKeyBinding *binding,
gpointer user_data);
typedef struct _MetaKeyHandler MetaKeyHandler;
typedef struct
{
char *name;
GSettings *settings;
MetaKeyBindingAction action;
/*
* A list of MetaKeyCombos. Each of them is bound to
* this keypref. If one has keysym==modifiers==0, it is
* ignored.
*/
GSList *bindings;
/* for keybindings that can have shift or not like Alt+Tab */
gboolean add_shift:1;
/* for keybindings that apply only to a window */
gboolean per_window:1;
/* for keybindings not added with meta_display_add_keybinding() */
gboolean builtin:1;
} MetaKeyPref;
GType meta_key_binding_get_type (void);
GList *meta_prefs_get_keybindings (void);
MetaKeyBindingAction meta_prefs_get_keybinding_action (const char *name);
void meta_prefs_get_window_binding (const char *name,
unsigned int *keysym,
MetaVirtualModifier *modifiers);
void meta_prefs_get_overlay_binding (MetaKeyCombo *combo);
const char *meta_prefs_get_iso_next_group_option (void);
gboolean meta_prefs_get_visual_bell (void);
gboolean meta_prefs_bell_is_audible (void);
GDesktopVisualBellType meta_prefs_get_visual_bell_type (void);

View File

@@ -29,12 +29,8 @@
#include <meta/common.h>
gboolean meta_is_verbose (void);
void meta_set_verbose (gboolean setting);
gboolean meta_is_debugging (void);
void meta_set_debugging (gboolean setting);
gboolean meta_is_syncing (void);
void meta_set_syncing (gboolean setting);
void meta_set_replace_current_wm (gboolean setting);
void meta_debug_spew_real (const char *format,
...) G_GNUC_PRINTF (1, 2);
@@ -120,10 +116,6 @@ const char* meta_gravity_to_string (int gravity);
char* meta_external_binding_name_for_action (guint keybinding_action);
#include <libintl.h>
#define _(x) dgettext (GETTEXT_PACKAGE, x)
#define N_(x) x
char* meta_g_utf8_strndup (const gchar *src, gsize n);
void meta_free_gslist_and_elements (GSList *list_to_deep_free);

View File

@@ -72,11 +72,13 @@ typedef enum
* MetaMaximizeFlags:
* @META_MAXIMIZE_HORIZONTAL: Horizontal
* @META_MAXIMIZE_VERTICAL: Vertical
* @META_MAXIMIZE_BOTH: Both
*/
typedef enum
{
META_MAXIMIZE_HORIZONTAL = 1 << 0,
META_MAXIMIZE_VERTICAL = 1 << 1
META_MAXIMIZE_VERTICAL = 1 << 1,
META_MAXIMIZE_BOTH = (1 << 0 | 1 << 1),
} MetaMaximizeFlags;
#define META_TYPE_WINDOW (meta_window_get_type ())
@@ -179,8 +181,6 @@ gboolean meta_window_requested_bypass_compositor (MetaWindow *window);
gboolean meta_window_requested_dont_bypass_compositor (MetaWindow *window);
gint *meta_window_get_all_monitors (MetaWindow *window, gsize *length);
gboolean meta_window_is_mapped (MetaWindow *window);
gboolean meta_window_toplevel_is_mapped (MetaWindow *window);
gboolean meta_window_get_icon_geometry (MetaWindow *window,
MetaRectangle *rect);
void meta_window_set_icon_geometry (MetaWindow *window,
@@ -244,6 +244,16 @@ void meta_window_begin_grab_op (MetaWindow *window,
gboolean frame_action,
guint32 timestamp);
gboolean meta_window_can_maximize (MetaWindow *window);
gboolean meta_window_can_minimize (MetaWindow *window);
gboolean meta_window_can_shade (MetaWindow *window);
gboolean meta_window_can_close (MetaWindow *window);
gboolean meta_window_is_always_on_all_workspaces (MetaWindow *window);
gboolean meta_window_is_above (MetaWindow *window);
gboolean meta_window_allows_move (MetaWindow *window);
gboolean meta_window_allows_resize (MetaWindow *window);
gboolean meta_window_titlebar_is_onscreen (MetaWindow *window);
void meta_window_shove_titlebar_onscreen (MetaWindow *window);
#endif

View File

@@ -1,224 +0,0 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* Draw a workspace */
/* This file should not be modified to depend on other files in
* libwnck or mutter, since it's used in both of them
*/
/*
* Copyright (C) 2002 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "draw-workspace.h"
#include "theme-private.h"
static void
get_window_rect (const WnckWindowDisplayInfo *win,
int screen_width,
int screen_height,
const GdkRectangle *workspace_rect,
GdkRectangle *rect)
{
double width_ratio, height_ratio;
int x, y, width, height;
width_ratio = (double) workspace_rect->width / (double) screen_width;
height_ratio = (double) workspace_rect->height / (double) screen_height;
x = win->x;
y = win->y;
width = win->width;
height = win->height;
x *= width_ratio;
y *= height_ratio;
width *= width_ratio;
height *= height_ratio;
x += workspace_rect->x;
y += workspace_rect->y;
if (width < 3)
width = 3;
if (height < 3)
height = 3;
rect->x = x;
rect->y = y;
rect->width = width;
rect->height = height;
}
static void
draw_window (GtkWidget *widget,
cairo_t *cr,
const WnckWindowDisplayInfo *win,
const GdkRectangle *winrect,
GtkStateFlags state)
{
GdkPixbuf *icon;
int icon_x, icon_y, icon_w, icon_h;
gboolean is_active;
GdkRGBA color;
GtkStyleContext *style;
is_active = win->is_active;
cairo_save (cr);
cairo_rectangle (cr, winrect->x, winrect->y, winrect->width, winrect->height);
cairo_clip (cr);
style = gtk_widget_get_style_context (widget);
if (is_active)
meta_gtk_style_get_light_color (style, state, &color);
else
gtk_style_context_get_background_color (style, state, &color);
gdk_cairo_set_source_rgba (cr, &color);
cairo_rectangle (cr,
winrect->x + 1, winrect->y + 1,
MAX (0, winrect->width - 2), MAX (0, winrect->height - 2));
cairo_fill (cr);
icon = win->icon;
icon_w = icon_h = 0;
if (icon)
{
icon_w = gdk_pixbuf_get_width (icon);
icon_h = gdk_pixbuf_get_height (icon);
/* If the icon is too big, fall back to mini icon.
* We don't arbitrarily scale the icon, because it's
* just too slow on my Athlon 850.
*/
if (icon_w > (winrect->width - 2) ||
icon_h > (winrect->height - 2))
{
icon = win->mini_icon;
if (icon)
{
icon_w = gdk_pixbuf_get_width (icon);
icon_h = gdk_pixbuf_get_height (icon);
/* Give up. */
if (icon_w > (winrect->width - 2) ||
icon_h > (winrect->height - 2))
icon = NULL;
}
}
}
if (icon)
{
icon_x = winrect->x + (winrect->width - icon_w) / 2;
icon_y = winrect->y + (winrect->height - icon_h) / 2;
cairo_save (cr);
gdk_cairo_set_source_pixbuf (cr, icon, icon_x, icon_y);
cairo_rectangle (cr, icon_x, icon_y, icon_w, icon_h);
cairo_clip (cr);
cairo_paint (cr);
cairo_restore (cr);
}
gtk_style_context_get_color (style, state, &color);
gdk_cairo_set_source_rgba (cr, &color);
cairo_set_line_width (cr, 1.0);
cairo_rectangle (cr,
winrect->x + 0.5, winrect->y + 0.5,
MAX (0, winrect->width - 1), MAX (0, winrect->height - 1));
cairo_stroke (cr);
cairo_restore (cr);
}
void
wnck_draw_workspace (GtkWidget *widget,
cairo_t *cr,
int x,
int y,
int width,
int height,
int screen_width,
int screen_height,
GdkPixbuf *workspace_background,
gboolean is_active,
const WnckWindowDisplayInfo *windows,
int n_windows)
{
int i;
GdkRectangle workspace_rect;
GtkStateFlags state;
GtkStyleContext *style;
workspace_rect.x = x;
workspace_rect.y = y;
workspace_rect.width = width;
workspace_rect.height = height;
if (is_active)
state = GTK_STATE_FLAG_SELECTED;
else if (workspace_background)
state = GTK_STATE_FLAG_PRELIGHT;
else
state = GTK_STATE_FLAG_NORMAL;
style = gtk_widget_get_style_context (widget);
cairo_save (cr);
if (workspace_background)
{
gdk_cairo_set_source_pixbuf (cr, workspace_background, x, y);
cairo_paint (cr);
}
else
{
GdkRGBA color;
meta_gtk_style_get_dark_color (style,state, &color);
gdk_cairo_set_source_rgba (cr, &color);
cairo_rectangle (cr, x, y, width, height);
cairo_fill (cr);
}
i = 0;
while (i < n_windows)
{
const WnckWindowDisplayInfo *win = &windows[i];
GdkRectangle winrect;
get_window_rect (win, screen_width,
screen_height, &workspace_rect, &winrect);
draw_window (widget,
cr,
win,
&winrect,
state);
++i;
}
cairo_restore (cr);
}

View File

@@ -1,59 +0,0 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* Draw a workspace */
/* This file should not be modified to depend on other files in
* libwnck or metacity, since it's used in both of them
*/
/*
* Copyright (C) 2002 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef WNCK_DRAW_WORKSPACE_H
#define WNCK_DRAW_WORKSPACE_H
#include <gdk/gdk.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gtk/gtk.h>
typedef struct
{
GdkPixbuf *icon;
GdkPixbuf *mini_icon;
int x;
int y;
int width;
int height;
guint is_active : 1;
} WnckWindowDisplayInfo;
void wnck_draw_workspace (GtkWidget *widget,
cairo_t *cr,
int x,
int y,
int width,
int height,
int screen_width,
int screen_height,
GdkPixbuf *workspace_background,
gboolean is_active,
const WnckWindowDisplayInfo *windows,
int n_windows);
#endif

View File

@@ -44,8 +44,6 @@
static void meta_frames_destroy (GtkWidget *object);
static void meta_frames_finalize (GObject *object);
static void meta_frames_style_updated (GtkWidget *widget);
static void meta_frames_map (GtkWidget *widget);
static void meta_frames_unmap (GtkWidget *widget);
static void meta_frames_update_prelit_control (MetaFrames *frames,
MetaUIFrame *frame,
@@ -134,9 +132,6 @@ meta_frames_class_init (MetaFramesClass *class)
widget_class->style_updated = meta_frames_style_updated;
widget_class->map = meta_frames_map;
widget_class->unmap = meta_frames_unmap;
widget_class->draw = meta_frames_draw;
widget_class->destroy_event = meta_frames_destroy_event;
widget_class->button_press_event = meta_frames_button_press_event;
@@ -231,6 +226,7 @@ meta_frames_init (MetaFrames *frames)
frames->style_variants = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, g_object_unref);
update_style_contexts (frames);
gtk_widget_set_double_buffered (GTK_WIDGET (frames), FALSE);
@@ -522,13 +518,26 @@ MetaFrames*
meta_frames_new (int screen_number)
{
GdkScreen *screen;
MetaFrames *frames;
screen = gdk_display_get_screen (gdk_display_get_default (),
screen_number);
return g_object_new (META_TYPE_FRAMES,
"screen", screen,
NULL);
frames = g_object_new (META_TYPE_FRAMES,
"screen", screen,
"type", GTK_WINDOW_POPUP,
NULL);
/* Put the window at an arbitrary offscreen location; the one place
* it can't be is at -100x-100, since the meta_window_new() will
* mistake it for a window created via meta_create_offscreen_window()
* and ignore it, and we need this window to get frame-synchronization
* messages so that GTK+'s style change handling works.
*/
gtk_window_move (GTK_WINDOW (frames), -200, -200);
gtk_window_resize (GTK_WINDOW (frames), 1, 1);
return frames;
}
/* In order to use a style with a window it has to be attached to that
@@ -635,22 +644,6 @@ meta_frames_unmanage_window (MetaFrames *frames,
meta_warning ("Frame 0x%lx not managed, can't unmanage\n", xwindow);
}
static void
meta_frames_map (GtkWidget *widget)
{
/* We override the parent map function to a no-op because we don't
* want to actually show the GDK window. But GTK needs to think that
* the widget is mapped or it won't deliver the events we care about.
*/
gtk_widget_set_mapped (widget, TRUE);
}
static void
meta_frames_unmap (GtkWidget *widget)
{
gtk_widget_set_mapped (widget, FALSE);
}
static MetaUIFrame*
meta_frames_lookup_window (MetaFrames *frames,
Window xwindow)

View File

@@ -26,7 +26,7 @@
#include <string.h>
#include "menu.h"
#include <meta/main.h>
#include <meta/util.h>
#include "util-private.h"
#include "core.h"
#include "metaaccellabel.h"
#include "ui.h"

View File

@@ -33,7 +33,7 @@
#include "metaaccellabel.h"
#include <gtk/gtk.h>
#include <string.h>
#include <meta/util.h>
#include "util-private.h"
static void meta_accel_label_destroy (GtkWidget *object);
static void meta_accel_label_finalize (GObject *object);

View File

@@ -21,7 +21,7 @@
#include <config.h>
#include "resizepopup.h"
#include <meta/util.h>
#include "util-private.h"
#include <gtk/gtk.h>
#include <gdk/gdkx.h>

View File

@@ -1,963 +0,0 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* Mutter popup window thing showing windows you can tab to */
/*
* Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2002 Red Hat, Inc.
* Copyright (C) 2005 Elijah Newren
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include <meta/util.h>
#include "core.h"
#include "tabpopup.h"
/* FIXME these two includes are 100% broken ...
*/
#include "workspace-private.h"
#include "frame.h"
#include "draw-workspace.h"
#include <gtk/gtk.h>
#include <math.h>
#define OUTSIDE_SELECT_RECT 2
#define INSIDE_SELECT_RECT 2
typedef struct _TabEntry TabEntry;
struct _TabEntry
{
MetaTabEntryKey key;
char *title;
GdkPixbuf *icon, *dimmed_icon;
GtkWidget *widget;
GdkRectangle rect;
GdkRectangle inner_rect;
guint blank : 1;
};
struct _MetaTabPopup
{
GtkWidget *window;
GtkWidget *label;
GList *current;
GList *entries;
TabEntry *current_selected_entry;
GtkWidget *outline_window;
gboolean outline;
};
static GtkWidget* selectable_image_new (GdkPixbuf *pixbuf);
static void select_image (GtkWidget *widget);
static void unselect_image (GtkWidget *widget);
static GtkWidget* selectable_workspace_new (MetaWorkspace *workspace);
static void select_workspace (GtkWidget *widget);
static void unselect_workspace (GtkWidget *widget);
static gboolean
outline_window_draw (GtkWidget *widget,
cairo_t *cr,
gpointer data)
{
MetaTabPopup *popup;
TabEntry *te;
popup = data;
if (!popup->outline || popup->current_selected_entry == NULL)
return FALSE;
te = popup->current_selected_entry;
cairo_set_line_width (cr, 1.0);
cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
cairo_rectangle (cr,
0.5, 0.5,
te->rect.width - 1,
te->rect.height - 1);
cairo_stroke (cr);
cairo_rectangle (cr,
te->inner_rect.x - 0.5, te->inner_rect.y - 0.5,
te->inner_rect.width + 1,
te->inner_rect.height + 1);
cairo_stroke (cr);
return FALSE;
}
static GdkPixbuf*
dimm_icon (GdkPixbuf *pixbuf)
{
int x, y, pixel_stride, row_stride;
guchar *row, *pixels;
int w, h;
GdkPixbuf *dimmed_pixbuf;
if (gdk_pixbuf_get_has_alpha (pixbuf))
{
dimmed_pixbuf = gdk_pixbuf_copy (pixbuf);
}
else
{
dimmed_pixbuf = gdk_pixbuf_add_alpha (pixbuf, FALSE, 0, 0, 0);
}
w = gdk_pixbuf_get_width (dimmed_pixbuf);
h = gdk_pixbuf_get_height (dimmed_pixbuf);
pixel_stride = 4;
row = gdk_pixbuf_get_pixels (dimmed_pixbuf);
row_stride = gdk_pixbuf_get_rowstride (dimmed_pixbuf);
for (y = 0; y < h; y++)
{
pixels = row;
for (x = 0; x < w; x++)
{
pixels[3] /= 2;
pixels += pixel_stride;
}
row += row_stride;
}
return dimmed_pixbuf;
}
static TabEntry*
tab_entry_new (const MetaTabEntry *entry,
gint screen_width,
gboolean outline)
{
TabEntry *te;
te = g_new (TabEntry, 1);
te->key = entry->key;
te->title = NULL;
if (entry->title)
{
gchar *str;
gchar *tmp;
gchar *formatter = "%s";
str = meta_g_utf8_strndup (entry->title, 4096);
if (entry->hidden)
{
formatter = "[%s]";
}
tmp = g_markup_printf_escaped (formatter, str);
g_free (str);
str = tmp;
if (entry->demands_attention)
{
/* Escape the whole line of text then markup the text and
* copy it back into the original buffer.
*/
tmp = g_strdup_printf ("<b>%s</b>", str);
g_free (str);
str = tmp;
}
te->title=g_strdup(str);
g_free (str);
}
te->widget = NULL;
te->icon = entry->icon;
te->blank = entry->blank;
te->dimmed_icon = NULL;
if (te->icon)
{
g_object_ref (G_OBJECT (te->icon));
if (entry->hidden)
te->dimmed_icon = dimm_icon (entry->icon);
}
if (outline)
{
te->rect.x = entry->rect.x;
te->rect.y = entry->rect.y;
te->rect.width = entry->rect.width;
te->rect.height = entry->rect.height;
te->inner_rect.x = entry->inner_rect.x;
te->inner_rect.y = entry->inner_rect.y;
te->inner_rect.width = entry->inner_rect.width;
te->inner_rect.height = entry->inner_rect.height;
}
return te;
}
MetaTabPopup*
meta_ui_tab_popup_new (const MetaTabEntry *entries,
int screen_number,
int entry_count,
int width,
gboolean outline)
{
MetaTabPopup *popup;
int i, left, top;
int height;
GtkWidget *grid;
GtkWidget *vbox;
GtkWidget *align;
GList *tmp;
GtkWidget *frame;
int max_label_width; /* the actual max width of the labels we create */
AtkObject *obj;
GdkScreen *screen;
int screen_width;
popup = g_new (MetaTabPopup, 1);
popup->outline_window = gtk_window_new (GTK_WINDOW_POPUP);
screen = gdk_display_get_screen (gdk_display_get_default (),
screen_number);
gtk_window_set_screen (GTK_WINDOW (popup->outline_window),
screen);
gtk_widget_set_app_paintable (popup->outline_window, TRUE);
gtk_widget_realize (popup->outline_window);
g_signal_connect (G_OBJECT (popup->outline_window), "draw",
G_CALLBACK (outline_window_draw), popup);
popup->window = gtk_window_new (GTK_WINDOW_POPUP);
gtk_window_set_screen (GTK_WINDOW (popup->window),
screen);
gtk_window_set_position (GTK_WINDOW (popup->window),
GTK_WIN_POS_CENTER_ALWAYS);
/* enable resizing, to get never-shrink behavior */
gtk_window_set_resizable (GTK_WINDOW (popup->window),
TRUE);
popup->current = NULL;
popup->entries = NULL;
popup->current_selected_entry = NULL;
popup->outline = outline;
screen_width = gdk_screen_get_width (screen);
for (i = 0; i < entry_count; ++i)
{
TabEntry* new_entry = tab_entry_new (&entries[i], screen_width, outline);
popup->entries = g_list_prepend (popup->entries, new_entry);
}
popup->entries = g_list_reverse (popup->entries);
g_assert (width > 0);
height = i / width;
if (i % width)
height += 1;
grid = gtk_grid_new ();
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT);
gtk_container_set_border_width (GTK_CONTAINER (grid), 1);
gtk_container_add (GTK_CONTAINER (popup->window),
frame);
gtk_container_add (GTK_CONTAINER (frame),
vbox);
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
gtk_box_pack_start (GTK_BOX (vbox), align, TRUE, TRUE, 0);
gtk_container_add (GTK_CONTAINER (align),
grid);
popup->label = gtk_label_new ("");
/* Set the accessible role of the label to a status bar so it
* will emit name changed events that can be used by screen
* readers.
*/
obj = gtk_widget_get_accessible (popup->label);
atk_object_set_role (obj, ATK_ROLE_STATUSBAR);
gtk_misc_set_padding (GTK_MISC (popup->label), 3, 3);
gtk_box_pack_end (GTK_BOX (vbox), popup->label, FALSE, FALSE, 0);
max_label_width = 0;
top = 0;
tmp = popup->entries;
while (tmp && top < height)
{
left = 0;
while (tmp && left < width)
{
GtkWidget *image;
GtkRequisition req;
TabEntry *te;
te = tmp->data;
if (te->blank)
{
/* just stick a widget here to avoid special cases */
image = gtk_alignment_new (0.0, 0.0, 0.0, 0.0);
}
else if (outline)
{
if (te->dimmed_icon)
{
image = selectable_image_new (te->dimmed_icon);
}
else
{
image = selectable_image_new (te->icon);
}
gtk_misc_set_padding (GTK_MISC (image),
INSIDE_SELECT_RECT + OUTSIDE_SELECT_RECT + 1,
INSIDE_SELECT_RECT + OUTSIDE_SELECT_RECT + 1);
gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.5);
}
else
{
image = selectable_workspace_new ((MetaWorkspace *) te->key);
}
te->widget = image;
gtk_grid_attach (GTK_GRID (grid),
te->widget,
left, top, 1, 1);
/* Efficiency rules! */
gtk_label_set_markup (GTK_LABEL (popup->label),
te->title);
gtk_widget_get_preferred_size (popup->label, &req, NULL);
max_label_width = MAX (max_label_width, req.width);
tmp = tmp->next;
++left;
}
++top;
}
/* remove all the temporary text */
gtk_label_set_text (GTK_LABEL (popup->label), "");
/* Make it so that we ellipsize if the text is too long */
gtk_label_set_ellipsize (GTK_LABEL (popup->label), PANGO_ELLIPSIZE_END);
/* Limit the window size to no bigger than screen_width/4 */
if (max_label_width>(screen_width/4))
{
max_label_width = screen_width/4;
}
max_label_width += 20; /* add random padding */
gtk_window_set_default_size (GTK_WINDOW (popup->window),
max_label_width,
-1);
return popup;
}
static void
free_tab_entry (gpointer data, gpointer user_data)
{
TabEntry *te;
te = data;
g_free (te->title);
if (te->icon)
g_object_unref (G_OBJECT (te->icon));
if (te->dimmed_icon)
g_object_unref (G_OBJECT (te->dimmed_icon));
g_free (te);
}
void
meta_ui_tab_popup_free (MetaTabPopup *popup)
{
meta_verbose ("Destroying tab popup window\n");
if (!popup)
{
meta_warning ("NULL passed to meta_ui_tab_popup_free\n");
return;
}
gtk_widget_destroy (popup->outline_window);
gtk_widget_destroy (popup->window);
g_list_foreach (popup->entries, free_tab_entry, NULL);
g_list_free (popup->entries);
g_free (popup);
}
void
meta_ui_tab_popup_set_showing (MetaTabPopup *popup,
gboolean showing)
{
if (showing)
{
gtk_widget_show_all (popup->window);
}
else
{
if (gtk_widget_get_visible (popup->window))
{
meta_verbose ("Hiding tab popup window\n");
gtk_widget_hide (popup->window);
meta_core_increment_event_serial (
GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
}
}
}
static void
display_entry (MetaTabPopup *popup,
TabEntry *te)
{
GdkRectangle rect;
GdkWindow *window;
if (popup->current_selected_entry)
{
if (popup->outline)
unselect_image (popup->current_selected_entry->widget);
else
unselect_workspace (popup->current_selected_entry->widget);
}
gtk_label_set_markup (GTK_LABEL (popup->label), te->title);
if (popup->outline)
select_image (te->widget);
else
select_workspace (te->widget);
if (popup->outline)
{
cairo_region_t *region;
cairo_region_t *inner_region;
GdkRGBA black = { 0.0, 0.0, 0.0, 1.0 };
window = gtk_widget_get_window (popup->outline_window);
/* Do stuff behind gtk's back */
gdk_window_hide (window);
meta_core_increment_event_serial (
GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
rect = te->rect;
rect.x = 0;
rect.y = 0;
gdk_window_move_resize (window,
te->rect.x, te->rect.y,
te->rect.width, te->rect.height);
gdk_window_set_background_rgba (window, &black);
region = cairo_region_create_rectangle (&rect);
inner_region = cairo_region_create_rectangle (&te->inner_rect);
cairo_region_subtract (region, inner_region);
cairo_region_destroy (inner_region);
gdk_window_shape_combine_region (window,
region,
0, 0);
cairo_region_destroy (region);
/* This should piss off gtk a bit, but we don't want to raise
* above the tab popup. So, instead of calling gtk_widget_show,
* we manually set the window as mapped and then manually map it
* with gdk functions.
*/
gtk_widget_set_mapped (popup->outline_window, TRUE);
gdk_window_show_unraised (window);
}
/* Must be before we handle an expose for the outline window */
popup->current_selected_entry = te;
}
void
meta_ui_tab_popup_forward (MetaTabPopup *popup)
{
if (popup->current != NULL)
popup->current = popup->current->next;
if (popup->current == NULL)
popup->current = popup->entries;
if (popup->current != NULL)
{
TabEntry *te;
te = popup->current->data;
display_entry (popup, te);
}
}
void
meta_ui_tab_popup_backward (MetaTabPopup *popup)
{
if (popup->current != NULL)
popup->current = popup->current->prev;
if (popup->current == NULL)
popup->current = g_list_last (popup->entries);
if (popup->current != NULL)
{
TabEntry *te;
te = popup->current->data;
display_entry (popup, te);
}
}
MetaTabEntryKey
meta_ui_tab_popup_get_selected (MetaTabPopup *popup)
{
if (popup->current)
{
TabEntry *te;
te = popup->current->data;
return te->key;
}
else
return (MetaTabEntryKey)None;
}
void
meta_ui_tab_popup_select (MetaTabPopup *popup,
MetaTabEntryKey key)
{
GList *tmp;
/* Note, "key" may not be in the list of entries; other code assumes
* it's OK to pass in a key that isn't.
*/
tmp = popup->entries;
while (tmp != NULL)
{
TabEntry *te;
te = tmp->data;
if (te->key == key)
{
popup->current = tmp;
display_entry (popup, te);
return;
}
tmp = tmp->next;
}
}
#define META_TYPE_SELECT_IMAGE (meta_select_image_get_type ())
#define META_SELECT_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_SELECT_IMAGE, MetaSelectImage))
typedef struct _MetaSelectImage MetaSelectImage;
typedef struct _MetaSelectImageClass MetaSelectImageClass;
struct _MetaSelectImage
{
GtkImage parent_instance;
guint selected : 1;
};
struct _MetaSelectImageClass
{
GtkImageClass parent_class;
};
static GType meta_select_image_get_type (void) G_GNUC_CONST;
static GtkWidget*
selectable_image_new (GdkPixbuf *pixbuf)
{
GtkWidget *w;
w = g_object_new (meta_select_image_get_type (), NULL);
gtk_image_set_from_pixbuf (GTK_IMAGE (w), pixbuf);
return w;
}
static void
select_image (GtkWidget *widget)
{
META_SELECT_IMAGE (widget)->selected = TRUE;
gtk_widget_queue_draw (widget);
}
static void
unselect_image (GtkWidget *widget)
{
META_SELECT_IMAGE (widget)->selected = FALSE;
gtk_widget_queue_draw (widget);
}
static void meta_select_image_class_init (MetaSelectImageClass *klass);
static gboolean meta_select_image_draw (GtkWidget *widget,
cairo_t *cr);
static GtkImageClass *parent_class;
GType
meta_select_image_get_type (void)
{
static GType image_type = 0;
if (!image_type)
{
static const GTypeInfo image_info =
{
sizeof (MetaSelectImageClass),
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) meta_select_image_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (MetaSelectImage),
16, /* n_preallocs */
(GInstanceInitFunc) NULL,
};
image_type = g_type_register_static (GTK_TYPE_IMAGE, "MetaSelectImage", &image_info, 0);
}
return image_type;
}
static void
meta_select_image_class_init (MetaSelectImageClass *klass)
{
GtkWidgetClass *widget_class;
parent_class = g_type_class_peek (gtk_image_get_type ());
widget_class = GTK_WIDGET_CLASS (klass);
widget_class->draw = meta_select_image_draw;
}
static gboolean
meta_select_image_draw (GtkWidget *widget,
cairo_t *cr)
{
GtkAllocation allocation;
gtk_widget_get_allocation (widget, &allocation);
if (META_SELECT_IMAGE (widget)->selected)
{
GtkMisc *misc;
GtkRequisition requisition;
GtkStyleContext *context;
GdkRGBA color;
int x, y, w, h;
gint xpad, ypad;
gfloat xalign, yalign;
misc = GTK_MISC (widget);
gtk_widget_get_requisition (widget, &requisition);
gtk_misc_get_alignment (misc, &xalign, &yalign);
gtk_misc_get_padding (misc, &xpad, &ypad);
x = (allocation.width - (requisition.width - xpad * 2)) * xalign + 0.5;
y = (allocation.height - (requisition.height - ypad * 2)) * yalign + 0.5;
x -= INSIDE_SELECT_RECT + 1;
y -= INSIDE_SELECT_RECT + 1;
w = requisition.width - OUTSIDE_SELECT_RECT * 2 - 1;
h = requisition.height - OUTSIDE_SELECT_RECT * 2 - 1;
context = gtk_widget_get_style_context (widget);
gtk_style_context_set_state (context,
gtk_widget_get_state_flags (widget));
gtk_style_context_lookup_color (context, "color", &color);
cairo_set_line_width (cr, 2.0);
cairo_set_source_rgb (cr, color.red, color.green, color.blue);
cairo_rectangle (cr, x, y, w + 1, h + 1);
cairo_stroke (cr);
cairo_set_line_width (cr, 1.0);
}
return GTK_WIDGET_CLASS (parent_class)->draw (widget, cr);
}
#define META_TYPE_SELECT_WORKSPACE (meta_select_workspace_get_type ())
#define META_SELECT_WORKSPACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_SELECT_WORKSPACE, MetaSelectWorkspace))
typedef struct _MetaSelectWorkspace MetaSelectWorkspace;
typedef struct _MetaSelectWorkspaceClass MetaSelectWorkspaceClass;
struct _MetaSelectWorkspace
{
GtkDrawingArea parent_instance;
MetaWorkspace *workspace;
guint selected : 1;
};
struct _MetaSelectWorkspaceClass
{
GtkDrawingAreaClass parent_class;
};
static GType meta_select_workspace_get_type (void) G_GNUC_CONST;
#define SELECT_OUTLINE_WIDTH 2
#define MINI_WORKSPACE_WIDTH 48
static GtkWidget*
selectable_workspace_new (MetaWorkspace *workspace)
{
GtkWidget *widget;
double screen_aspect;
widget = g_object_new (meta_select_workspace_get_type (), NULL);
screen_aspect = (double) workspace->screen->rect.height /
(double) workspace->screen->rect.width;
/* account for select rect */
gtk_widget_set_size_request (widget,
MINI_WORKSPACE_WIDTH + SELECT_OUTLINE_WIDTH * 2,
MINI_WORKSPACE_WIDTH * screen_aspect + SELECT_OUTLINE_WIDTH * 2);
META_SELECT_WORKSPACE (widget)->workspace = workspace;
return widget;
}
static void
select_workspace (GtkWidget *widget)
{
META_SELECT_WORKSPACE(widget)->selected = TRUE;
gtk_widget_queue_draw (widget);
}
static void
unselect_workspace (GtkWidget *widget)
{
META_SELECT_WORKSPACE (widget)->selected = FALSE;
gtk_widget_queue_draw (widget);
}
static void meta_select_workspace_class_init (MetaSelectWorkspaceClass *klass);
static gboolean meta_select_workspace_draw (GtkWidget *widget,
cairo_t *cr);
GType
meta_select_workspace_get_type (void)
{
static GType workspace_type = 0;
if (!workspace_type)
{
static const GTypeInfo workspace_info =
{
sizeof (MetaSelectWorkspaceClass),
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) meta_select_workspace_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (MetaSelectWorkspace),
16, /* n_preallocs */
(GInstanceInitFunc) NULL,
};
workspace_type = g_type_register_static (GTK_TYPE_DRAWING_AREA,
"MetaSelectWorkspace",
&workspace_info,
0);
}
return workspace_type;
}
static void
meta_select_workspace_class_init (MetaSelectWorkspaceClass *klass)
{
GtkWidgetClass *widget_class;
widget_class = GTK_WIDGET_CLASS (klass);
widget_class->draw = meta_select_workspace_draw;
}
/**
* meta_convert_meta_to_wnck:
* @window: the #MetaWindow
* @screen: the #MetaScreen the window is on
*
* Converts a #MetaWindow to a #WnckWindowDisplayInfo window
* that is used to build a thumbnail of a workspace.
**/
static WnckWindowDisplayInfo
meta_convert_meta_to_wnck (MetaWindow *window, MetaScreen *screen)
{
WnckWindowDisplayInfo wnck_window;
wnck_window.icon = window->icon;
wnck_window.mini_icon = window->mini_icon;
wnck_window.is_active = window->has_focus;
if (window->frame)
{
wnck_window.x = window->frame->rect.x;
wnck_window.y = window->frame->rect.y;
wnck_window.width = window->frame->rect.width;
wnck_window.height = window->frame->rect.height;
}
else
{
wnck_window.x = window->rect.x;
wnck_window.y = window->rect.y;
wnck_window.width = window->rect.width;
wnck_window.height = window->rect.height;
}
return wnck_window;
}
static gboolean
meta_select_workspace_draw (GtkWidget *widget,
cairo_t *cr)
{
MetaWorkspace *workspace;
WnckWindowDisplayInfo *windows;
GtkAllocation allocation;
int i, n_windows;
GList *tmp, *list;
workspace = META_SELECT_WORKSPACE (widget)->workspace;
list = meta_stack_list_windows (workspace->screen->stack, workspace);
n_windows = g_list_length (list);
windows = g_new (WnckWindowDisplayInfo, n_windows);
tmp = list;
i = 0;
while (tmp != NULL)
{
MetaWindow *window;
gboolean ignoreable_sticky;
window = tmp->data;
ignoreable_sticky = window->on_all_workspaces &&
workspace != workspace->screen->active_workspace;
if (window->skip_pager ||
!meta_window_showing_on_its_workspace (window) ||
window->unmaps_pending ||
ignoreable_sticky)
{
--n_windows;
}
else
{
windows[i] = meta_convert_meta_to_wnck (window, workspace->screen);
i++;
}
tmp = tmp->next;
}
g_list_free (list);
gtk_widget_get_allocation (widget, &allocation);
wnck_draw_workspace (widget,
cr,
SELECT_OUTLINE_WIDTH,
SELECT_OUTLINE_WIDTH,
allocation.width - SELECT_OUTLINE_WIDTH * 2,
allocation.height - SELECT_OUTLINE_WIDTH * 2,
workspace->screen->rect.width,
workspace->screen->rect.height,
NULL,
(workspace->screen->active_workspace == workspace),
windows,
n_windows);
g_free (windows);
if (META_SELECT_WORKSPACE (widget)->selected)
{
GtkStyleContext *context;
GdkRGBA color;
context = gtk_widget_get_style_context (widget);
gtk_style_context_set_state (context,
gtk_widget_get_state_flags (widget));
gtk_style_context_lookup_color (context, "color", &color);
cairo_set_line_width (cr, SELECT_OUTLINE_WIDTH);
cairo_set_source_rgb (cr, color.red, color.green, color.blue);
cairo_rectangle (cr,
SELECT_OUTLINE_WIDTH / 2.0, SELECT_OUTLINE_WIDTH / 2.0,
allocation.width - SELECT_OUTLINE_WIDTH,
allocation.height - SELECT_OUTLINE_WIDTH);
cairo_stroke (cr);
}
return TRUE;
}

View File

@@ -1,65 +0,0 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* Mutter tab popup window */
/*
* Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2005 Elijah Newren
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef META_TABPOPUP_H
#define META_TABPOPUP_H
/* Don't include gtk.h or gdk.h here */
#include <meta/common.h>
#include <meta/boxes.h>
#include <X11/Xlib.h>
#include <glib.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
typedef struct _MetaTabEntry MetaTabEntry;
typedef struct _MetaTabPopup MetaTabPopup;
typedef void *MetaTabEntryKey;
struct _MetaTabEntry
{
MetaTabEntryKey key;
const char *title;
GdkPixbuf *icon;
MetaRectangle rect;
MetaRectangle inner_rect;
guint blank : 1;
guint hidden : 1;
guint demands_attention : 1;
};
MetaTabPopup* meta_ui_tab_popup_new (const MetaTabEntry *entries,
int screen_number,
int entry_count,
int width,
gboolean outline);
void meta_ui_tab_popup_free (MetaTabPopup *popup);
void meta_ui_tab_popup_set_showing (MetaTabPopup *popup,
gboolean showing);
void meta_ui_tab_popup_forward (MetaTabPopup *popup);
void meta_ui_tab_popup_backward (MetaTabPopup *popup);
MetaTabEntryKey meta_ui_tab_popup_get_selected (MetaTabPopup *popup);
void meta_ui_tab_popup_select (MetaTabPopup *popup,
MetaTabEntryKey key);
#endif

View File

@@ -21,7 +21,7 @@
#include <config.h>
#include "theme-private.h"
#include <meta/util.h>
#include "util-private.h"
#include <string.h>
#include <stdlib.h>

View File

@@ -37,7 +37,7 @@
#include <config.h>
#include "theme-private.h"
#include "frames.h" /* for META_TYPE_FRAMES */
#include <meta/util.h>
#include "util-private.h"
#include <meta/gradient.h>
#include <meta/prefs.h>
#include <gtk/gtk.h>

View File

@@ -1,196 +0,0 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* Mutter tile-preview marks the area a window will *ehm* snap to */
/*
* Copyright (C) 2010 Florian Müllner
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include <gtk/gtk.h>
#include <cairo.h>
#include "tile-preview.h"
#include "core.h"
#define OUTLINE_WIDTH 5 /* frame width in non-composite case */
struct _MetaTilePreview {
GtkWidget *preview_window;
gulong create_serial;
GdkRGBA *preview_color;
MetaRectangle tile_rect;
};
static gboolean
meta_tile_preview_draw (GtkWidget *widget,
cairo_t *cr,
gpointer user_data)
{
MetaTilePreview *preview = user_data;
cairo_set_line_width (cr, 1.0);
/* Fill the preview area with a transparent color */
gdk_cairo_set_source_rgba (cr, preview->preview_color);
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
cairo_paint (cr);
/* Use the opaque color for the border */
cairo_set_source_rgb (cr,
preview->preview_color->red,
preview->preview_color->green,
preview->preview_color->blue);
cairo_rectangle (cr,
0.5, 0.5,
preview->tile_rect.width - 1,
preview->tile_rect.height - 1);
cairo_stroke (cr);
return FALSE;
}
MetaTilePreview *
meta_tile_preview_new (int screen_number)
{
MetaTilePreview *preview;
GdkScreen *screen;
GtkStyleContext *context;
GtkWidgetPath *path;
guchar selection_alpha = 0xFF;
screen = gdk_display_get_screen (gdk_display_get_default (), screen_number);
preview = g_new (MetaTilePreview, 1);
preview->preview_window = gtk_window_new (GTK_WINDOW_POPUP);
gtk_window_set_screen (GTK_WINDOW (preview->preview_window), screen);
gtk_widget_set_app_paintable (preview->preview_window, TRUE);
preview->preview_color = NULL;
preview->tile_rect.x = preview->tile_rect.y = 0;
preview->tile_rect.width = preview->tile_rect.height = 0;
gtk_widget_set_visual (preview->preview_window,
gdk_screen_get_rgba_visual (screen));
path = gtk_widget_path_new ();
gtk_widget_path_append_type (path, GTK_TYPE_ICON_VIEW);
context = gtk_style_context_new ();
gtk_style_context_set_path (context, path);
gtk_style_context_add_class (context,
GTK_STYLE_CLASS_RUBBERBAND);
gtk_widget_path_free (path);
gtk_style_context_get (context, GTK_STATE_FLAG_SELECTED,
"background-color", &preview->preview_color,
NULL);
/* The background-color for the .rubberband class should probably
* contain the correct alpha value - unfortunately, at least for now
* it doesn't. Hopefully the following workaround can be removed
* when GtkIconView gets ported to GtkStyleContext.
*/
gtk_style_context_get_style (context,
"selection-box-alpha", &selection_alpha,
NULL);
preview->preview_color->alpha = (double)selection_alpha / 0xFF;
g_object_unref (context);
/* We make an assumption that XCreateWindow will be the first operation
* when calling gtk_widget_realize() (via gdk_window_new()), or that it
* is at least "close enough".
*/
preview->create_serial = XNextRequest (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
gtk_widget_realize (preview->preview_window);
g_signal_connect (preview->preview_window, "draw",
G_CALLBACK (meta_tile_preview_draw), preview);
return preview;
}
void
meta_tile_preview_free (MetaTilePreview *preview)
{
gtk_widget_destroy (preview->preview_window);
if (preview->preview_color)
gdk_rgba_free (preview->preview_color);
g_free (preview);
}
void
meta_tile_preview_show (MetaTilePreview *preview,
MetaRectangle *tile_rect)
{
GdkWindow *window;
GdkRectangle old_rect;
if (gtk_widget_get_visible (preview->preview_window)
&& preview->tile_rect.x == tile_rect->x
&& preview->tile_rect.y == tile_rect->y
&& preview->tile_rect.width == tile_rect->width
&& preview->tile_rect.height == tile_rect->height)
return; /* nothing to do */
gtk_widget_show (preview->preview_window);
window = gtk_widget_get_window (preview->preview_window);
meta_core_lower_beneath_grab_window (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
GDK_WINDOW_XID (window),
gtk_get_current_event_time ());
old_rect.x = old_rect.y = 0;
old_rect.width = preview->tile_rect.width;
old_rect.height = preview->tile_rect.height;
gdk_window_invalidate_rect (window, &old_rect, FALSE);
preview->tile_rect = *tile_rect;
gdk_window_move_resize (window,
preview->tile_rect.x, preview->tile_rect.y,
preview->tile_rect.width, preview->tile_rect.height);
}
void
meta_tile_preview_hide (MetaTilePreview *preview)
{
gtk_widget_hide (preview->preview_window);
}
Window
meta_tile_preview_get_xwindow (MetaTilePreview *preview,
gulong *create_serial)
{
GdkWindow *window = gtk_widget_get_window (preview->preview_window);
if (create_serial)
*create_serial = preview->create_serial;
return GDK_WINDOW_XID (window);
}

View File

@@ -1,36 +0,0 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* Meta tile preview */
/*
* Copyright (C) 2010 Florian Müllner
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef META_TILE_PREVIEW_H
#define META_TILE_PREVIEW_H
#include <meta/boxes.h>
typedef struct _MetaTilePreview MetaTilePreview;
MetaTilePreview *meta_tile_preview_new (int screen_number);
void meta_tile_preview_free (MetaTilePreview *preview);
void meta_tile_preview_show (MetaTilePreview *preview,
MetaRectangle *rect);
void meta_tile_preview_hide (MetaTilePreview *preview);
Window meta_tile_preview_get_xwindow (MetaTilePreview *preview,
gulong *create_serial);
#endif /* META_TILE_PREVIEW_H */

View File

@@ -123,6 +123,7 @@ maybe_redirect_mouse_event (XEvent *xevent)
switch (xev->evtype)
{
case XI_TouchBegin:
case XI_ButtonPress:
case XI_ButtonRelease:
case XI_Motion:
@@ -159,20 +160,27 @@ maybe_redirect_mouse_event (XEvent *xevent)
switch (xev->evtype)
{
case XI_TouchBegin:
case XI_ButtonPress:
case XI_ButtonRelease:
if (xev_d->evtype == XI_ButtonPress)
if (xev_d->evtype == XI_ButtonPress || xev_d->evtype == XI_TouchBegin)
{
GtkSettings *settings = gtk_settings_get_default ();
int double_click_time;
int double_click_distance;
int button;
g_object_get (settings,
"gtk-double-click-time", &double_click_time,
"gtk-double-click-distance", &double_click_distance,
NULL);
if (xev_d->detail == ui->button_click_number &&
if (xev->evtype == XI_TouchBegin)
button = 1;
else
button = xev_d->detail;
if (button == ui->button_click_number &&
xev_d->event == ui->button_click_window &&
xev_d->time < ui->button_click_time + double_click_time &&
ABS (xev_d->event_x - ui->button_click_x) <= double_click_distance &&
@@ -185,20 +193,22 @@ maybe_redirect_mouse_event (XEvent *xevent)
else
{
gevent = gdk_event_new (GDK_BUTTON_PRESS);
ui->button_click_number = xev_d->detail;
ui->button_click_number = button;
ui->button_click_window = xev_d->event;
ui->button_click_time = xev_d->time;
ui->button_click_x = xev_d->event_x;
ui->button_click_y = xev_d->event_y;
}
gevent->button.button = button;
}
else
{
gevent = gdk_event_new (GDK_BUTTON_RELEASE);
gevent->button.button = xev_d->detail;
}
gevent->button.window = g_object_ref (gdk_window);
gevent->button.button = xev_d->detail;
gevent->button.time = xev_d->time;
gevent->button.x = xev_d->event_x;
gevent->button.y = xev_d->event_y;
@@ -298,9 +308,12 @@ meta_ui_new (Display *xdisplay,
g_assert (gdisplay == gdk_display_get_default ());
ui->frames = meta_frames_new (XScreenNumberOfScreen (screen));
/* This does not actually show any widget. MetaFrames has been hacked so
* that showing it doesn't actually do anything. But we need the flags
* set for GTK to deliver events properly. */
/* GTK+ needs the frame-sync protocol to work in order to properly
* handle style changes. This means that the dummy widget we create
* to get the style for title bars actually needs to be mapped
* and fully tracked as a MetaWindow. Horrible, but mostly harmless -
* the window is a 1x1 overide redirect window positioned offscreen.
*/
gtk_widget_show (GTK_WIDGET (ui->frames));
g_object_set_data (G_OBJECT (gdisplay), "meta-ui", ui);

View File

@@ -178,7 +178,4 @@ int meta_ui_get_drag_threshold (MetaUI *ui);
MetaUIDirection meta_ui_get_direction (void);
#include "tabpopup.h"
#include "tile-preview.h"
#endif