Compare commits

...

13 Commits

Author SHA1 Message Date
ea901abd61 frame: Don't allow resizing of edges that are constrained
https://bugzilla.gnome.org/show_bug.cgi?id=751857
2016-04-04 14:51:56 -07:00
4e5e6aa7f8 window: Add new tiling code
The new tiling code, instead of based around "tiling states", is instead
based around constrained edges. This allows us to have windows that have
three constrained edges, but keep one free-floating, e.g. a window tiled
to the left has the left, top, and bottom edges constrained, but the
right edge can be left resizable.

This system also is easily extended to support corner tiling. We also,
using the new "size state" system, also keep normal, tiled, and
maximized sizes independently, allowing the maximize button to bounce
between maximized and tiled states without reverting to normal in
between. Dragging from the top will always restore the normal state,
though.

https://bugzilla.gnome.org/show_bug.cgi?id=751857
2016-04-04 14:50:57 -07:00
8e587e2e42 Add "size states" which save window size information
https://bugzilla.gnome.org/show_bug.cgi?id=751857
2016-04-04 14:50:56 -07:00
93901dc32f window: Remove old tiling code
We'll soon replace this with a better scheme

https://bugzilla.gnome.org/show_bug.cgi?id=751857
2016-04-04 14:50:56 -07:00
7173937a7d wayland/cursor: Keep a private use count and reference to active buffer
In order for the native cursor renderer to be able to create a hw
cursor in response to wl_pointer.set_cursor(), keep a private use-count
and reference to the active buffer, stopping it from being released
until it is consumed, replaced, or the surface is destroyed.

https://bugzilla.gnome.org/show_bug.cgi?id=762828
2016-03-29 18:26:10 +08:00
f44238a72f MetaWaylandSurface: Keep an extra buffer use count for role-less surfaces
Whether a surface needs to keep the committed wl_buffer un-released
depends on what role the surface gets assigned to. For example a cursor
role may need an unreleased shm buffer in order to create a hw cursor from
it.

In order to support this, keep a separate reference and use count to
the buffer on behalf of the in the future assigned role, and release
those references after the surface was assigned a role. A role that
needs its own references and use counts, must in its assign function
make sure to add those.

https://bugzilla.gnome.org/show_bug.cgi?id=762828
2016-03-29 18:26:10 +08:00
10a0114856 wayland: Move buffer use count to MetaWaylandSurface
Each wl_surface.commit with a newly attached buffer should result in
one wl_buffer.release for the attached buffer. For example attaching
the same buffer to two different surfaces must always result in two
wl_buffer.release events being emitted by the server. The client is
responsible for counting the wl_buffer.release events and be sure to
have received as many release events as it has attached and committed
the buffer, before reusing it.

https://bugzilla.gnome.org/show_bug.cgi?id=762828
2016-03-29 18:26:10 +08:00
aa7bc501d5 wayland: Replace buffer destroy wl_signal with a GObject signal
Don't use the libwayland-* utilities when we have our own that do the
same thing.

https://bugzilla.gnome.org/show_bug.cgi?id=762828
2016-03-29 18:02:31 +08:00
623eb6eacc Updated Vietnamese translation
Signed-off-by: Trần Ngọc Quân <vnwildman@gmail.com>
2016-03-27 07:25:53 +07:00
12a3125132 Updated Friulian translation 2016-03-25 16:54:40 +00:00
2ca3d30485 Added Friulian translation 2016-03-25 11:55:58 +00:00
0559b8fe03 Updated Dutch translation by Nathan Follens 2016-03-23 22:42:11 +01:00
0e0915ed79 Updated Basque language 2016-03-23 17:06:28 +01:00
29 changed files with 2497 additions and 2171 deletions

View File

@ -29,6 +29,7 @@ eu
fa
fi
fr
fur
ga
gl
gu

View File

@ -2,24 +2,23 @@
# This file is distributed under the same license as the PACKAGE package.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER.
#
#
# Hizkuntza Politikarako Sailburuordetza <hizpol@ej-gv.es>, 2004.
# Iñaki Larrañaga Murgoitio <dooteo@zundan.com>, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011.
# Iñaki Larrañaga Murgoitio <dooteo@zundan.com>, 2012, 2013, 2014, 2015.
#
# Iñaki Larrañaga Murgoitio <dooteo@zundan.com>, 2012, 2013, 2014, 2015, 2016.
msgid ""
msgstr ""
"Project-Id-Version: mutter master\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
"product=mutter&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2015-03-21 15:50+0100\n"
"PO-Revision-Date: 2015-03-21 15:51+0100\n"
"Last-Translator: Iñaki Larrañaga Murgoitio <dooteo@zundan.com>\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-03-23 17:05+0100\n"
"PO-Revision-Date: 2016-03-23 17:06+0100\n"
"Last-Translator: dooteo <dooteo@zundan.com>\n"
"Language-Team: Basque <librezale@librezale.org>\n"
"Language: eu\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Lokalize 1.4\n"
"X-Generator: Lokalize 2.0\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: ../data/50-mutter-navigation.xml.in.h:1
@ -455,22 +454,22 @@ msgstr "Aldatu 11. TBra"
msgid "Switch to VT 12"
msgstr "Aldatu 12. TBra"
#: ../src/backends/meta-monitor-manager.c:364
#: ../src/backends/meta-monitor-manager.c:518
msgid "Built-in display"
msgstr "Bertako pantaila"
#: ../src/backends/meta-monitor-manager.c:391
#: ../src/backends/meta-monitor-manager.c:544
msgid "Unknown"
msgstr "Ezezaguna"
#: ../src/backends/meta-monitor-manager.c:393
#: ../src/backends/meta-monitor-manager.c:546
msgid "Unknown Display"
msgstr "Pantaila ezezaguna"
#. TRANSLATORS: this is a monitor vendor name, followed by a
#. * size in inches, like 'Dell 15"'
#.
#: ../src/backends/meta-monitor-manager.c:401
#: ../src/backends/meta-monitor-manager.c:554
#, c-format
msgid "%s %s"
msgstr "%s %s"
@ -486,7 +485,7 @@ msgstr ""
"Dagoeneko beste konposatze-kudeatzailea ari da exekutatzen \"%2$s\" "
"pantailako %1$i. monitorean \"."
#: ../src/core/bell.c:185
#: ../src/core/bell.c:194
msgid "Bell event"
msgstr "Soinuaren gertaera"
@ -515,40 +514,44 @@ msgstr "_Itxaron"
msgid "_Force Quit"
msgstr "_Behartu ixtera"
#: ../src/core/display.c:562
#: ../src/core/display.c:555
#, c-format
msgid "Failed to open X Window System display '%s'\n"
msgstr "Huts egin du X Window sistemaren '%s' pantaila irekitzean\n"
#: ../src/core/main.c:176
#: ../src/core/main.c:181
msgid "Disable connection to session manager"
msgstr "Desgaitu saio-kudeatzailearen konexioa"
#: ../src/core/main.c:182
#: ../src/core/main.c:187
msgid "Replace the running window manager"
msgstr "Ordeztu exekutatzen dagoen leiho-kudeatzailea"
#: ../src/core/main.c:188
#: ../src/core/main.c:193
msgid "Specify session management ID"
msgstr "Zehaztu saio-kudeatzailearen IDa"
#: ../src/core/main.c:193
#: ../src/core/main.c:198
msgid "X Display to use"
msgstr "X pantaila erabiltzeko"
#: ../src/core/main.c:199
#: ../src/core/main.c:204
msgid "Initialize session from savefile"
msgstr "Hasieratu saioa babes-fitxategitik"
#: ../src/core/main.c:205
#: ../src/core/main.c:210
msgid "Make X calls synchronous"
msgstr "Egin X deiak sinkronoak izatea"
#: ../src/core/main.c:212
#: ../src/core/main.c:217
msgid "Run as a wayland compositor"
msgstr "Exekutatu wayland konposatzaile gisa"
#: ../src/core/main.c:220
#: ../src/core/main.c:223
msgid "Run as a nested compositor"
msgstr "Exekutatu habiaratutako konposatzaile gisa"
#: ../src/core/main.c:231
msgid "Run as a full display server, rather than nested"
msgstr "Exekutatu pantaila-zerbitzari oso bezala, habiaratuta baino"
@ -575,12 +578,12 @@ msgstr "Erakutsi bertsioa"
msgid "Mutter plugin to use"
msgstr "Mutter-en osagaia erabiltzeko"
#: ../src/core/prefs.c:2004
#: ../src/core/prefs.c:1997
#, c-format
msgid "Workspace %d"
msgstr "%d. laneko area"
#: ../src/core/screen.c:525
#: ../src/core/screen.c:521
#, c-format
msgid ""
"Display \"%s\" already has a window manager; try using the --replace option "
@ -589,12 +592,12 @@ msgstr ""
"'%s' pantailak badu leiho-kudeatzailea; erabili --replace aukera uneko leiho-"
"kudeatzailea ordezteko."
#: ../src/core/screen.c:607
#: ../src/core/screen.c:603
#, c-format
msgid "Screen %d on display '%s' is invalid\n"
msgstr "'%2$s' bistaratzeko %1$d pantaila ez da baliozkoa\n"
#: ../src/core/util.c:118
#: ../src/core/util.c:121
msgid "Mutter was compiled without support for verbose mode\n"
msgstr "Mutter modu xehatuaren euskarririk gabe konpilatu da\n"
@ -676,11 +679,11 @@ msgstr "%s (%s)"
#~ "\" ez dator bat formatuarekin"
#~ msgid ""
#~ "GTK color specification must have the state in brackets, e.g. gtk:fg"
#~ "[NORMAL] where NORMAL is the state; could not parse \"%s\""
#~ "GTK color specification must have the state in brackets, e.g. gtk:"
#~ "fg[NORMAL] where NORMAL is the state; could not parse \"%s\""
#~ msgstr ""
#~ "GTK kolore-zehaztapenak egoera kortxete artean izan behar du, adib. gtk:fg"
#~ "[NORMAL], NORMAL egoera izanik; \"%s\" ezin da analizatu"
#~ "GTK kolore-zehaztapenak egoera kortxete artean izan behar du, adib. gtk:"
#~ "fg[NORMAL], NORMAL egoera izanik; \"%s\" ezin da analizatu"
#~ msgid ""
#~ "GTK color specification must have a close bracket after the state, e.g. "

583
po/fur.po Normal file
View File

@ -0,0 +1,583 @@
# Friulian translation for mutter.
# Copyright (C) 2016 mutter's COPYRIGHT HOLDER
# This file is distributed under the same license as the mutter package.
# Fabio Tomat <f.t.public@gmail.com>, 2016.
#
msgid ""
msgstr ""
"Project-Id-Version: mutter master\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
"product=mutter&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2016-03-25 01:58+0000\n"
"PO-Revision-Date: 2016-03-25 17:54+0100\n"
"Language-Team: Friulian <fur@li.org>\n"
"Language: fur\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Last-Translator: Fabio Tomat <f.t.public@gmail.com>\n"
"X-Generator: Poedit 1.8.5\n"
#: ../data/50-mutter-navigation.xml.in.h:1
msgid "Navigation"
msgstr "Navigazion"
#: ../data/50-mutter-navigation.xml.in.h:2
msgid "Move window to workspace 1"
msgstr "Sposte barcon tal spazi di lavôr 1"
#: ../data/50-mutter-navigation.xml.in.h:3
msgid "Move window to workspace 2"
msgstr "Sposte barcon tal spazi di lavôr 2"
#: ../data/50-mutter-navigation.xml.in.h:4
msgid "Move window to workspace 3"
msgstr "Sposte barcon tal spazi di lavôr 3"
#: ../data/50-mutter-navigation.xml.in.h:5
msgid "Move window to workspace 4"
msgstr "Sposte barcon tal spazi di lavôr 4"
#: ../data/50-mutter-navigation.xml.in.h:6
msgid "Move window to last workspace"
msgstr "Sposte barcon tal ultin spazi di lavôr"
#: ../data/50-mutter-navigation.xml.in.h:7
msgid "Move window one workspace to the left"
msgstr "Sposte barcon tal spazi di lavôr a çampe"
#: ../data/50-mutter-navigation.xml.in.h:8
msgid "Move window one workspace to the right"
msgstr "Sposte barcon tal spazi di lavôr a drete"
#: ../data/50-mutter-navigation.xml.in.h:9
msgid "Move window one workspace up"
msgstr "Sposte barcon tal spazi di lavôr parsore"
#: ../data/50-mutter-navigation.xml.in.h:10
msgid "Move window one workspace down"
msgstr "Sposte barcon tal spazi di lavôr sot"
#: ../data/50-mutter-navigation.xml.in.h:11
msgid "Move window one monitor to the left"
msgstr "Sposte barcon tal visôr a çampe"
#: ../data/50-mutter-navigation.xml.in.h:12
msgid "Move window one monitor to the right"
msgstr "Sposte barcon tal visôr a drete"
#: ../data/50-mutter-navigation.xml.in.h:13
msgid "Move window one monitor up"
msgstr "Sposte barcon tal visôr parsore"
#: ../data/50-mutter-navigation.xml.in.h:14
msgid "Move window one monitor down"
msgstr "Sposte barcon tal visôr sot"
#: ../data/50-mutter-navigation.xml.in.h:15
msgid "Switch applications"
msgstr "Passâ di une aplicazion in chê altre"
#: ../data/50-mutter-navigation.xml.in.h:16
msgid "Switch to previous application"
msgstr "Passe ae aplicazion prime"
#: ../data/50-mutter-navigation.xml.in.h:17
msgid "Switch windows"
msgstr "Passâ di un barcon in chel altri"
#: ../data/50-mutter-navigation.xml.in.h:18
msgid "Switch to previous window"
msgstr "Passe al barcon prime"
#: ../data/50-mutter-navigation.xml.in.h:19
msgid "Switch windows of an application"
msgstr "Passâ di un barcon in chel altri di une aplicazion"
#: ../data/50-mutter-navigation.xml.in.h:20
msgid "Switch to previous window of an application"
msgstr "Passe al barcon prime di une aplicazion"
#: ../data/50-mutter-navigation.xml.in.h:21
msgid "Switch system controls"
msgstr "Passâ di un control di sisteme in chel altri"
#: ../data/50-mutter-navigation.xml.in.h:22
msgid "Switch to previous system control"
msgstr "Passe al control di sisteme precedent"
#: ../data/50-mutter-navigation.xml.in.h:23
msgid "Switch windows directly"
msgstr ""
#: ../data/50-mutter-navigation.xml.in.h:24
msgid "Switch directly to previous window"
msgstr ""
#: ../data/50-mutter-navigation.xml.in.h:25
msgid "Switch windows of an app directly"
msgstr ""
#: ../data/50-mutter-navigation.xml.in.h:26
msgid "Switch directly to previous window of an app"
msgstr ""
#: ../data/50-mutter-navigation.xml.in.h:27
msgid "Switch system controls directly"
msgstr ""
#: ../data/50-mutter-navigation.xml.in.h:28
msgid "Switch directly to previous system control"
msgstr ""
#: ../data/50-mutter-navigation.xml.in.h:29
msgid "Hide all normal windows"
msgstr "Plate ducj i barcons normâi"
#: ../data/50-mutter-navigation.xml.in.h:30
msgid "Switch to workspace 1"
msgstr "Passe al spazi di lavôr 1"
#: ../data/50-mutter-navigation.xml.in.h:31
msgid "Switch to workspace 2"
msgstr "Passe al spazi di lavôr 2"
#: ../data/50-mutter-navigation.xml.in.h:32
msgid "Switch to workspace 3"
msgstr "Passe al spazi di lavôr 3"
#: ../data/50-mutter-navigation.xml.in.h:33
msgid "Switch to workspace 4"
msgstr "Passe al spazi di lavôr 4"
#: ../data/50-mutter-navigation.xml.in.h:34
msgid "Switch to last workspace"
msgstr "Passe al ultin spazi di lavôr"
#: ../data/50-mutter-navigation.xml.in.h:35
msgid "Move to workspace left"
msgstr "Sposte il spazi di lavôr a çampe"
#: ../data/50-mutter-navigation.xml.in.h:36
msgid "Move to workspace right"
msgstr "Sposte il spazi di lavôr a drete"
#: ../data/50-mutter-navigation.xml.in.h:37
msgid "Move to workspace above"
msgstr "Sposte il spazi di lavôr parsore"
#: ../data/50-mutter-navigation.xml.in.h:38
msgid "Move to workspace below"
msgstr "Sposte il spazi di lavôr sot"
#: ../data/50-mutter-system.xml.in.h:1
msgid "System"
msgstr "Sisteme"
#: ../data/50-mutter-system.xml.in.h:2
msgid "Show the run command prompt"
msgstr ""
#: ../data/50-mutter-system.xml.in.h:3
msgid "Show the activities overview"
msgstr "Mostre la panoramiche ativitâts"
#: ../data/50-mutter-windows.xml.in.h:1
msgid "Windows"
msgstr "Barcons"
#: ../data/50-mutter-windows.xml.in.h:2
msgid "Activate the window menu"
msgstr "Ative il menù dal barcon"
#: ../data/50-mutter-windows.xml.in.h:3
msgid "Toggle fullscreen mode"
msgstr "Ative/Disative modalitât plen visôr"
#: ../data/50-mutter-windows.xml.in.h:4
msgid "Toggle maximization state"
msgstr "Ative/Disative il stât slargjât"
#: ../data/50-mutter-windows.xml.in.h:5
msgid "Maximize window"
msgstr "Slargje il barcon"
#: ../data/50-mutter-windows.xml.in.h:6
msgid "Restore window"
msgstr "Ripristine barcon"
#: ../data/50-mutter-windows.xml.in.h:7
msgid "Toggle shaded state"
msgstr "Ative/Disative stât inrodolât"
#: ../data/50-mutter-windows.xml.in.h:8
msgid "Close window"
msgstr "Siere il barcon"
#: ../data/50-mutter-windows.xml.in.h:9
msgid "Hide window"
msgstr "Plate il barcon"
#: ../data/50-mutter-windows.xml.in.h:10
msgid "Move window"
msgstr "Sposte il barcon"
#: ../data/50-mutter-windows.xml.in.h:11
msgid "Resize window"
msgstr "Ridimensione barcon"
#: ../data/50-mutter-windows.xml.in.h:12
msgid "Toggle window on all workspaces or one"
msgstr "Ative/Disative barcon su ducj i spazis di lavôr o nome un"
#: ../data/50-mutter-windows.xml.in.h:13
msgid "Raise window if covered, otherwise lower it"
msgstr "Tire sù il barcon se al è cuviert, se no sbassilu"
#: ../data/50-mutter-windows.xml.in.h:14
msgid "Raise window above other windows"
msgstr "Met il barcon parsore di chei altris"
#: ../data/50-mutter-windows.xml.in.h:15
msgid "Lower window below other windows"
msgstr "Bute il barcon sot di chei altris"
#: ../data/50-mutter-windows.xml.in.h:16
msgid "Maximize window vertically"
msgstr "Slargje il barcon par verticâl"
#: ../data/50-mutter-windows.xml.in.h:17
msgid "Maximize window horizontally"
msgstr "Slargje il barcon par orizontâl"
#: ../data/50-mutter-windows.xml.in.h:18
msgid "View split on left"
msgstr ""
#: ../data/50-mutter-windows.xml.in.h:19
msgid "View split on right"
msgstr ""
#: ../data/mutter.desktop.in.h:1
msgid "Mutter"
msgstr "Mutter"
#: ../data/org.gnome.mutter.gschema.xml.in.h:1
msgid "Modifier to use for extended window management operations"
msgstr ""
#: ../data/org.gnome.mutter.gschema.xml.in.h:2
msgid ""
"This key will initiate the \"overlay\", which is a combination window "
"overview and application launching system. The default is intended to be the "
"\"Windows key\" on PC hardware. It's expected that this binding either the "
"default or set to the empty string."
msgstr ""
#: ../data/org.gnome.mutter.gschema.xml.in.h:3
msgid "Attach modal dialogs"
msgstr ""
#: ../data/org.gnome.mutter.gschema.xml.in.h:4
msgid ""
"When true, instead of having independent titlebars, modal dialogs appear "
"attached to the titlebar of the parent window and are moved together with "
"the parent window."
msgstr ""
#: ../data/org.gnome.mutter.gschema.xml.in.h:5
msgid "Enable edge tiling when dropping windows on screen edges"
msgstr ""
#: ../data/org.gnome.mutter.gschema.xml.in.h:6
msgid ""
"If enabled, dropping windows on vertical screen edges maximizes them "
"vertically and resizes them horizontally to cover half of the available "
"area. Dropping windows on the top screen edge maximizes them completely."
msgstr ""
#: ../data/org.gnome.mutter.gschema.xml.in.h:7
msgid "Workspaces are managed dynamically"
msgstr "I spazis di vore a son ministrât in maniere dinamiche"
#: ../data/org.gnome.mutter.gschema.xml.in.h:8
msgid ""
"Determines whether workspaces are managed dynamically or whether there's a "
"static number of workspaces (determined by the num-workspaces key in org."
"gnome.desktop.wm.preferences)."
msgstr ""
#: ../data/org.gnome.mutter.gschema.xml.in.h:9
msgid "Workspaces only on primary"
msgstr "Spazis di vore nome tal visôr primari"
#: ../data/org.gnome.mutter.gschema.xml.in.h:10
msgid ""
"Determines whether workspace switching should happen for windows on all "
"monitors or only for windows on the primary monitor."
msgstr ""
#: ../data/org.gnome.mutter.gschema.xml.in.h:11
msgid "No tab popup"
msgstr ""
#: ../data/org.gnome.mutter.gschema.xml.in.h:12
msgid ""
"Determines whether the use of popup and highlight frame should be disabled "
"for window cycling."
msgstr ""
#: ../data/org.gnome.mutter.gschema.xml.in.h:13
msgid "Delay focus changes until the pointer stops moving"
msgstr ""
#: ../data/org.gnome.mutter.gschema.xml.in.h:14
msgid ""
"If set to true, and the focus mode is either \"sloppy\" or \"mouse\" then "
"the focus will not be changed immediately when entering a window, but only "
"after the pointer stops moving."
msgstr ""
#: ../data/org.gnome.mutter.gschema.xml.in.h:15
msgid "Draggable border width"
msgstr ""
#: ../data/org.gnome.mutter.gschema.xml.in.h:16
msgid ""
"The amount of total draggable borders. If the theme's visible borders are "
"not enough, invisible borders will be added to meet this value."
msgstr ""
#: ../data/org.gnome.mutter.gschema.xml.in.h:17
msgid "Auto maximize nearly monitor sized windows"
msgstr ""
#: ../data/org.gnome.mutter.gschema.xml.in.h:18
msgid ""
"If enabled, new windows that are initially the size of the monitor "
"automatically get maximized."
msgstr ""
#: ../data/org.gnome.mutter.gschema.xml.in.h:19
msgid "Place new windows in the center"
msgstr "Place i gnûfs barcons tal mieç"
#: ../data/org.gnome.mutter.gschema.xml.in.h:20
msgid ""
"When true, the new windows will always be put in the center of the active "
"screen of the monitor."
msgstr ""
#: ../data/org.gnome.mutter.gschema.xml.in.h:21
msgid "Select window from tab popup"
msgstr ""
#: ../data/org.gnome.mutter.gschema.xml.in.h:22
msgid "Cancel tab popup"
msgstr ""
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:1
msgid "Switch to VT 1"
msgstr "Passe al VT 1"
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:2
msgid "Switch to VT 2"
msgstr "Passe al VT 2"
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:3
msgid "Switch to VT 3"
msgstr "Passe al VT 3"
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:4
msgid "Switch to VT 4"
msgstr "Passe al VT 4"
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:5
msgid "Switch to VT 5"
msgstr "Passe al VT 5"
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:6
msgid "Switch to VT 6"
msgstr "Passe al VT 6"
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:7
msgid "Switch to VT 7"
msgstr "Passe al VT 7"
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:8
msgid "Switch to VT 8"
msgstr "Passe al VT 8"
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:9
msgid "Switch to VT 9"
msgstr "Passe al VT 9"
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:10
msgid "Switch to VT 10"
msgstr "Passe al VT 10"
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:11
msgid "Switch to VT 11"
msgstr "Passe al VT 11"
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:12
msgid "Switch to VT 12"
msgstr "Passe al VT 12"
#: ../src/backends/meta-monitor-manager.c:518
msgid "Built-in display"
msgstr "Display integrât"
#: ../src/backends/meta-monitor-manager.c:544
msgid "Unknown"
msgstr "No cognossût"
#: ../src/backends/meta-monitor-manager.c:546
msgid "Unknown Display"
msgstr "Display no cognossût"
#. TRANSLATORS: this is a monitor vendor name, followed by a
#. * size in inches, like 'Dell 15"'
#.
#: ../src/backends/meta-monitor-manager.c:554
#, c-format
msgid "%s %s"
msgstr "%s %s"
#. 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:456
#, c-format
msgid ""
"Another compositing manager is already running on screen %i on display \"%s"
"\"."
msgstr ""
"Un altri compositing manager al è za in esecuzion sul schermi %i sul display "
"\"%s\"."
#: ../src/core/bell.c:194
msgid "Bell event"
msgstr "Event cjampane"
#: ../src/core/delete.c:127
#, c-format
msgid "“%s” is not responding."
msgstr "“%s” nol rispuint."
#: ../src/core/delete.c:129
msgid "Application is not responding."
msgstr "La aplicazion no rispuint."
#: ../src/core/delete.c:134
msgid ""
"You may choose to wait a short while for it to continue or force the "
"application to quit entirely."
msgstr ""
#: ../src/core/delete.c:141
msgid "_Wait"
msgstr "_Spiete"
#: ../src/core/delete.c:141
msgid "_Force Quit"
msgstr "Sfuarce _Jessude"
#: ../src/core/display.c:555
#, c-format
msgid "Failed to open X Window System display '%s'\n"
msgstr "Impussibil vierzi il display '%s' di X Window System\n"
#: ../src/core/main.c:181
msgid "Disable connection to session manager"
msgstr ""
#: ../src/core/main.c:187
msgid "Replace the running window manager"
msgstr "Rimplace il window manager in vore"
#: ../src/core/main.c:193
msgid "Specify session management ID"
msgstr ""
#: ../src/core/main.c:198
msgid "X Display to use"
msgstr "Display X di doprâ"
#: ../src/core/main.c:204
msgid "Initialize session from savefile"
msgstr "Inizialize session da file salvât"
#: ../src/core/main.c:210
msgid "Make X calls synchronous"
msgstr "Fâs lis clamadis X sincronis"
#: ../src/core/main.c:217
msgid "Run as a wayland compositor"
msgstr "Eseguìs come compositor wayland"
#: ../src/core/main.c:223
msgid "Run as a nested compositor"
msgstr "Eseguìs come compositor nidiât"
#: ../src/core/main.c:231
msgid "Run as a full display server, rather than nested"
msgstr "Eseguìs come servidôr display complet, invezit che nidiât"
#: ../src/core/mutter.c:39
#, c-format
msgid ""
"mutter %s\n"
"Copyright (C) 2001-%d Havoc Pennington, Red Hat, Inc., and others\n"
"This is free software; see the source for copying conditions.\n"
"There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A "
"PARTICULAR PURPOSE.\n"
msgstr ""
"mutter %s\n"
"Copyright (C) 2001-%d Havoc Pennington, Red Hat, Inc., e altris\n"
"Chest al è software libar; viodi i sorzints pes condizions di copie.\n"
"No je NISSUNE garanzie; nancje di COMERCIABILITÂT o IDONEITÂT A UNE "
"FINALITÂT PARTICOLÂR.\n"
#: ../src/core/mutter.c:53
msgid "Print version"
msgstr "Stampe version"
#: ../src/core/mutter.c:59
msgid "Mutter plugin to use"
msgstr "Plugin Mutter di doprâ"
#: ../src/core/prefs.c:1997
#, c-format
msgid "Workspace %d"
msgstr "Spazi di lavôr %d"
#: ../src/core/screen.c:521
#, c-format
msgid ""
"Display \"%s\" already has a window manager; try using the --replace option "
"to replace the current window manager."
msgstr ""
"Il display \"%s\" al à za un window manager; prove dopre la opzion --replace "
"par rimplaçâ chel atuâl."
#: ../src/core/screen.c:603
#, c-format
msgid "Screen %d on display '%s' is invalid\n"
msgstr "Schermi %d su display '%s' no valit\n"
#: ../src/core/util.c:121
msgid "Mutter was compiled without support for verbose mode\n"
msgstr "Mutter al è stât compilât cence supuart pe modalitât fetose\n"
#: ../src/x11/session.c:1815
msgid ""
"These windows do not support &quot;save current setup&quot; and will have to "
"be restarted manually next time you log in."
msgstr ""
"Chescj barcons no supuartin la funzion &quot;salve impostazions atuâi&quot; "
"e si scugnarà tornâ a inviâlis a man tal prossim acès."
#: ../src/x11/window-props.c:549
#, c-format
msgid "%s (on %s)"
msgstr "%s (su %s)"

2274
po/nl.po

File diff suppressed because it is too large Load Diff

View File

@ -1,17 +1,17 @@
# Vietnamese translation for Metacity.
# Copyright © 2015 GNOME i18n Project for Vietnamese.
# Copyright © 2016 GNOME i18n Project for Vietnamese.
# This file is distributed under the same license as the Metacity package.
# Nguyễn Thái Ngọc Duy <pclouds@gmail.com>, 2002-2004, 2007, 2008, 2011-2013.
# Clytie Siddall <clytie@riverland.net.au>, 2005-2009.
# Trần Ngọc Quân <vnwildman@gmail.com>, 2014, 2015.
# Trần Ngọc Quân <vnwildman@gmail.com>, 2014, 2015, 2016.
#
msgid ""
msgstr ""
"Project-Id-Version: metacity master\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
"product=mutter&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2015-03-09 23:13+0000\n"
"PO-Revision-Date: 2015-03-10 13:28+0700\n"
"POT-Creation-Date: 2016-03-26 14:03+0000\n"
"PO-Revision-Date: 2016-03-27 07:22+0700\n"
"Last-Translator: Trần Ngọc Quân <vnwildman@gmail.com>\n"
"Language-Team: Vietnamese <gnome-vi-list@gnome.org>\n"
"Language: vi\n"
@ -19,11 +19,11 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: LocFactoryEditor 1.8\n"
"X-Generator: Gtranslator 2.91.7\n"
#: ../data/50-mutter-navigation.xml.in.h:1
msgid "Navigation"
msgstr "Di chuyển"
msgstr "Điều hướng"
#: ../data/50-mutter-navigation.xml.in.h:2
msgid "Move window to workspace 1"
@ -447,22 +447,22 @@ msgstr "Chuyển sang VT 11"
msgid "Switch to VT 12"
msgstr "Chuyển sang VT 12"
#: ../src/backends/meta-monitor-manager.c:364
#: ../src/backends/meta-monitor-manager.c:518
msgid "Built-in display"
msgstr "Màn hình tích hợp"
#: ../src/backends/meta-monitor-manager.c:391
#: ../src/backends/meta-monitor-manager.c:544
msgid "Unknown"
msgstr "Không rõ"
#: ../src/backends/meta-monitor-manager.c:393
#: ../src/backends/meta-monitor-manager.c:546
msgid "Unknown Display"
msgstr "Không hiểu màn hình"
#. TRANSLATORS: this is a monitor vendor name, followed by a
#. * size in inches, like 'Dell 15"'
#.
#: ../src/backends/meta-monitor-manager.c:401
#: ../src/backends/meta-monitor-manager.c:554
#, c-format
msgid "%s %s"
msgstr "%s %s"
@ -477,7 +477,7 @@ msgid ""
msgstr ""
"Bộ quản lý cửa sổ đã đang chạy trên Màn hình %i trên bộ trình bày \"%s\"."
#: ../src/core/bell.c:185
#: ../src/core/bell.c:194
msgid "Bell event"
msgstr "Sự kiện chuông"
@ -506,40 +506,44 @@ msgstr "_Chờ"
msgid "_Force Quit"
msgstr "_Buộc thoát"
#: ../src/core/display.c:562
#: ../src/core/display.c:555
#, c-format
msgid "Failed to open X Window System display '%s'\n"
msgstr "Gặp lỗi khi mở bộ trình bày Hệ thống Cửa sổ X \"%s\".\n"
#: ../src/core/main.c:176
#: ../src/core/main.c:181
msgid "Disable connection to session manager"
msgstr "Vô hiệu hóa kết nối với bộ quản lý phiên làm việc"
#: ../src/core/main.c:182
#: ../src/core/main.c:187
msgid "Replace the running window manager"
msgstr "Thay thế bộ quản lý cửa sổ đang chạy"
#: ../src/core/main.c:188
#: ../src/core/main.c:193
msgid "Specify session management ID"
msgstr "Ghi rõ mã số quản lý phiên làm việc"
#: ../src/core/main.c:193
#: ../src/core/main.c:198
msgid "X Display to use"
msgstr "Bộ trình bày X cần dùng"
#: ../src/core/main.c:199
#: ../src/core/main.c:204
msgid "Initialize session from savefile"
msgstr "Khởi động phiên làm việc từ tập tin lưu"
#: ../src/core/main.c:205
#: ../src/core/main.c:210
msgid "Make X calls synchronous"
msgstr "Khiến các lời gọi X đồng bộ với nhau"
#: ../src/core/main.c:212
#: ../src/core/main.c:217
msgid "Run as a wayland compositor"
msgstr "Chạy như là một “wayland compositor”"
#: ../src/core/main.c:220
#: ../src/core/main.c:223
msgid "Run as a nested compositor"
msgstr "Chạy như là một “nested compositor”"
#: ../src/core/main.c:231
msgid "Run as a full display server, rather than nested"
msgstr "Chạy như là một dịch vụ hiển thị đầy đủ, thay cho lồng nhau"
@ -567,12 +571,12 @@ msgstr "Hiển thị phiên bản"
msgid "Mutter plugin to use"
msgstr "Phần bổ sung Mutter cần dùng"
#: ../src/core/prefs.c:2004
#: ../src/core/prefs.c:1997
#, c-format
msgid "Workspace %d"
msgstr "Vùng làm việc %d"
#: ../src/core/screen.c:525
#: ../src/core/screen.c:521
#, c-format
msgid ""
"Display \"%s\" already has a window manager; try using the --replace option "
@ -581,12 +585,12 @@ msgstr ""
"Màn hình \"%s\" đã có bộ quản lý cửa sổ rồi; hãy thử dùng tùy chọn “--"
"replace” để thay thế bộ quản lý cửa sổ đang dùng."
#: ../src/core/screen.c:607
#: ../src/core/screen.c:603
#, c-format
msgid "Screen %d on display '%s' is invalid\n"
msgstr "Màn hình %d trên bộ trình bày \"%s\" không hợp lệ.\n"
#: ../src/core/util.c:118
#: ../src/core/util.c:121
msgid "Mutter was compiled without support for verbose mode\n"
msgstr "Mutter đã được biên dịch không hỗ trợ chế độ chi tiết\n"

View File

@ -136,7 +136,8 @@ meta_surface_actor_wayland_get_subsurface_rect (MetaSurfaceActorWayland *self,
MetaRectangle *rect)
{
MetaWaylandSurface *surface = meta_surface_actor_wayland_get_surface (self);
CoglTexture *texture = surface->buffer->texture;
MetaWaylandBuffer *buffer = meta_wayland_surface_get_buffer (surface);
CoglTexture *texture = buffer->texture;
MetaWindow *toplevel_window;
int monitor_scale;
float x, y;

View File

@ -817,13 +817,6 @@ meta_window_actor_has_shadow (MetaWindowActor *self)
meta_window_is_fullscreen (priv->window))
return FALSE;
/*
* If we have two snap-tiled windows, we don't want the shadow to obstruct
* the other window.
*/
if (meta_window_get_tile_match (priv->window))
return FALSE;
/*
* Always put a shadow around windows with a frame - This should override
* the restriction about not putting a shadow around ARGB windows.

View File

@ -97,7 +97,7 @@ typedef enum
PRIORITY_ENTIRELY_VISIBLE_ON_WORKAREA = 1,
PRIORITY_SIZE_HINTS_INCREMENTS = 1,
PRIORITY_MAXIMIZATION = 2,
PRIORITY_TILING = 2,
PRIORITY_CONSTRAINED_EDGES = 2,
PRIORITY_FULLSCREEN = 2,
PRIORITY_SIZE_HINTS_LIMITS = 3,
PRIORITY_TITLEBAR_VISIBLE = 4,
@ -152,7 +152,7 @@ static gboolean constrain_maximization (MetaWindow *window,
ConstraintInfo *info,
ConstraintPriority priority,
gboolean check_only);
static gboolean constrain_tiling (MetaWindow *window,
static gboolean constrain_constrained_edges (MetaWindow *window,
ConstraintInfo *info,
ConstraintPriority priority,
gboolean check_only);
@ -213,7 +213,7 @@ typedef struct {
static const Constraint all_constraints[] = {
{constrain_modal_dialog, "constrain_modal_dialog"},
{constrain_maximization, "constrain_maximization"},
{constrain_tiling, "constrain_tiling"},
{constrain_constrained_edges, "constrain_constrained_edges"},
{constrain_fullscreen, "constrain_fullscreen"},
{constrain_size_increments, "constrain_size_increments"},
{constrain_size_limits, "constrain_size_limits"},
@ -701,16 +701,11 @@ constrain_maximization (MetaWindow *window,
return TRUE;
/* Determine whether constraint applies; exit if it doesn't */
if ((!window->maximized_horizontally && !window->maximized_vertically) ||
META_WINDOW_TILED_SIDE_BY_SIDE (window))
if (!window->maximized_horizontally && !window->maximized_vertically)
return TRUE;
/* Calculate target_size = maximized size of (window + frame) */
if (META_WINDOW_TILED_MAXIMIZED (window))
{
meta_window_get_current_tile_area (window, &target_size);
}
else if (META_WINDOW_MAXIMIZED (window))
if (META_WINDOW_MAXIMIZED (window))
{
target_size = info->work_area_monitor;
}
@ -773,58 +768,6 @@ constrain_maximization (MetaWindow *window,
return TRUE;
}
static gboolean
constrain_tiling (MetaWindow *window,
ConstraintInfo *info,
ConstraintPriority priority,
gboolean check_only)
{
MetaRectangle target_size;
MetaRectangle min_size, max_size;
gboolean hminbad, vminbad;
gboolean horiz_equal, vert_equal;
gboolean constraint_already_satisfied;
if (priority > PRIORITY_TILING)
return TRUE;
/* Determine whether constraint applies; exit if it doesn't */
if (!META_WINDOW_TILED_SIDE_BY_SIDE (window))
return TRUE;
/* Calculate target_size - as the tile previews need this as well, we
* use an external function for the actual calculation
*/
meta_window_get_current_tile_area (window, &target_size);
/* Check min size constraints; max size constraints are ignored as for
* maximized windows.
*/
get_size_limits (window, &min_size, &max_size);
hminbad = target_size.width < min_size.width;
vminbad = target_size.height < min_size.height;
if (hminbad || vminbad)
return TRUE;
/* Determine whether constraint is already satisfied; exit if it is */
horiz_equal = target_size.x == info->current.x &&
target_size.width == info->current.width;
vert_equal = target_size.y == info->current.y &&
target_size.height == info->current.height;
constraint_already_satisfied = horiz_equal && vert_equal;
if (check_only || constraint_already_satisfied)
return constraint_already_satisfied;
/*** Enforce constraint ***/
info->current.x = target_size.x;
info->current.width = target_size.width;
info->current.y = target_size.y;
info->current.height = target_size.height;
return TRUE;
}
static gboolean
constrain_fullscreen (MetaWindow *window,
ConstraintInfo *info,
@ -860,6 +803,45 @@ constrain_fullscreen (MetaWindow *window,
return TRUE;
}
static gboolean
constrain_constrained_edges (MetaWindow *window,
ConstraintInfo *info,
ConstraintPriority priority,
gboolean check_only)
{
MetaRectangle monitor, new_rectangle;
gboolean constraint_already_satisfied;
if (priority > PRIORITY_CONSTRAINED_EDGES)
return TRUE;
/* Determine whether constraint applies; exit if it doesn't */
if (!window->constrained_edges)
return TRUE;
new_rectangle = info->current;
monitor = info->work_area_monitor;
if (window->constrained_edges & META_DIRECTION_LEFT)
new_rectangle.x = monitor.x;
if (window->constrained_edges & META_DIRECTION_RIGHT)
new_rectangle.x = monitor.x + monitor.width - new_rectangle.width;
if (window->constrained_edges & META_DIRECTION_TOP)
new_rectangle.y = monitor.y;
if (window->constrained_edges & META_DIRECTION_BOTTOM)
new_rectangle.y = monitor.y + monitor.height - new_rectangle.height;
constraint_already_satisfied =
meta_rectangle_equal (&info->current, &new_rectangle);
if (check_only || constraint_already_satisfied)
return constraint_already_satisfied;
/*** Enforce constraint ***/
info->current = new_rectangle;
return TRUE;
}
static gboolean
constrain_size_increments (MetaWindow *window,
ConstraintInfo *info,
@ -877,7 +859,6 @@ constrain_size_increments (MetaWindow *window,
/* Determine whether constraint applies; exit if it doesn't */
if (META_WINDOW_MAXIMIZED (window) || window->fullscreen ||
META_WINDOW_TILED_SIDE_BY_SIDE (window) ||
info->action_type == ACTION_MOVE)
return TRUE;
@ -1020,7 +1001,6 @@ constrain_aspect_ratio (MetaWindow *window,
constraints_are_inconsistent = minr > maxr;
if (constraints_are_inconsistent ||
META_WINDOW_MAXIMIZED (window) || window->fullscreen ||
META_WINDOW_TILED_SIDE_BY_SIDE (window) ||
info->action_type == ACTION_MOVE)
return TRUE;

View File

@ -74,13 +74,6 @@ typedef enum {
*/
#define N_IGNORED_CROSSING_SERIALS 10
typedef enum {
META_TILE_NONE,
META_TILE_LEFT,
META_TILE_RIGHT,
META_TILE_MAXIMIZED
} MetaTileMode;
typedef enum {
/* Normal interaction where you're interacting with windows.
* Events go to windows normally. */
@ -211,8 +204,6 @@ struct _MetaDisplay
int grab_anchor_root_x;
int grab_anchor_root_y;
MetaRectangle grab_anchor_window_pos;
MetaTileMode grab_tile_mode;
int grab_tile_monitor_number;
int grab_latest_motion_x;
int grab_latest_motion_y;
guint grab_have_pointer : 1;

View File

@ -649,8 +649,6 @@ meta_display_open (void)
display->grab_op = META_GRAB_OP_NONE;
display->grab_window = NULL;
display->grab_tile_mode = META_TILE_NONE;
display->grab_tile_monitor_number = -1;
display->grab_edge_resistance_data = NULL;
@ -1894,8 +1892,6 @@ meta_display_begin_grab_op (MetaDisplay *display,
display->grab_op = op;
display->grab_window = grab_window;
display->grab_button = button;
display->grab_tile_mode = grab_window->tile_mode;
display->grab_tile_monitor_number = grab_window->tile_monitor_number;
display->grab_anchor_root_x = root_x;
display->grab_anchor_root_y = root_y;
display->grab_latest_motion_x = root_x;
@ -1993,8 +1989,6 @@ meta_display_end_grab_op (MetaDisplay *display,
display->event_route = META_EVENT_ROUTE_NORMAL;
display->grab_window = NULL;
display->grab_tile_mode = META_TILE_NONE;
display->grab_tile_monitor_number = -1;
meta_display_update_cursor (display);

View File

@ -274,12 +274,6 @@ meta_frame_get_flags (MetaFrame *frame)
if (META_WINDOW_MAXIMIZED (frame->window))
flags |= META_FRAME_MAXIMIZED;
if (META_WINDOW_TILED_LEFT (frame->window))
flags |= META_FRAME_TILED_LEFT;
if (META_WINDOW_TILED_RIGHT (frame->window))
flags |= META_FRAME_TILED_RIGHT;
if (frame->window->fullscreen)
flags |= META_FRAME_FULLSCREEN;
@ -289,6 +283,18 @@ meta_frame_get_flags (MetaFrame *frame)
if (frame->window->wm_state_above)
flags |= META_FRAME_ABOVE;
if (frame->window->constrained_edges & META_DIRECTION_LEFT)
flags |= META_FRAME_CONSTRAINED_LEFT_EDGE;
if (frame->window->constrained_edges & META_DIRECTION_RIGHT)
flags |= META_FRAME_CONSTRAINED_RIGHT_EDGE;
if (frame->window->constrained_edges & META_DIRECTION_TOP)
flags |= META_FRAME_CONSTRAINED_TOP_EDGE;
if (frame->window->constrained_edges & META_DIRECTION_BOTTOM)
flags |= META_FRAME_CONSTRAINED_BOTTOM_EDGE;
return flags;
}

View File

@ -2001,23 +2001,13 @@ process_mouse_move_resize_grab (MetaDisplay *display,
if (event->keyval == CLUTTER_KEY_Escape)
{
/* Hide the tiling preview if necessary */
if (window->tile_mode != META_TILE_NONE)
meta_screen_hide_tile_preview (screen);
/* Restore the original tile mode */
window->tile_mode = display->grab_tile_mode;
window->tile_monitor_number = display->grab_tile_monitor_number;
/* End move or resize and restore to original state. If the
* window was a maximized window that had been "shaken loose" we
* need to remaximize it. In normal cases, we need to do a
* moveresize now to get the position back to the original.
*/
if (window->shaken_loose || window->tile_mode == META_TILE_MAXIMIZED)
if (window->shaken_loose)
meta_window_maximize (window, META_MAXIMIZE_BOTH);
else if (window->tile_mode != META_TILE_NONE)
meta_window_tile (window);
else
meta_window_move_resize_frame (display->grab_window,
TRUE,
@ -2939,41 +2929,25 @@ handle_toggle_above (MetaDisplay *display,
}
static void
handle_toggle_tiled (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
gpointer dummy)
handle_toggle_tiled_left (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
gpointer dummy)
{
MetaTileMode mode = binding->handler->data;
meta_window_toggle_tile (window, META_TILE_ZONE_W);
}
if ((META_WINDOW_TILED_LEFT (window) && mode == META_TILE_LEFT) ||
(META_WINDOW_TILED_RIGHT (window) && mode == META_TILE_RIGHT))
{
window->tile_monitor_number = window->saved_maximize ? window->monitor->number
: -1;
window->tile_mode = window->saved_maximize ? META_TILE_MAXIMIZED
: META_TILE_NONE;
if (window->saved_maximize)
meta_window_maximize (window, META_MAXIMIZE_BOTH);
else
meta_window_unmaximize (window, META_MAXIMIZE_BOTH);
}
else if (meta_window_can_tile_side_by_side (window))
{
window->tile_monitor_number = window->monitor->number;
window->tile_mode = mode;
/* Maximization constraints beat tiling constraints, so if the window
* is maximized, tiling won't have any effect unless we unmaximize it
* horizontally first; rather than calling meta_window_unmaximize(),
* we just set the flag and rely on meta_window_tile() syncing it to
* save an additional roundtrip.
*/
window->maximized_horizontally = FALSE;
meta_window_tile (window);
}
static void
handle_toggle_tiled_right (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
gpointer dummy)
{
meta_window_toggle_tile (window, META_TILE_ZONE_E);
}
static void
@ -3706,14 +3680,14 @@ init_builtin_key_bindings (MetaDisplay *display)
mutter_keybindings,
META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_TOGGLE_TILED_LEFT,
handle_toggle_tiled, META_TILE_LEFT);
handle_toggle_tiled_left, 0);
add_builtin_keybinding (display,
"toggle-tiled-right",
mutter_keybindings,
META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_TOGGLE_TILED_RIGHT,
handle_toggle_tiled, META_TILE_RIGHT);
handle_toggle_tiled_right, 0);
add_builtin_keybinding (display,
"toggle-above",

View File

@ -57,7 +57,13 @@ struct _MetaScreen
MetaRectangle rect; /* Size of screen; rect.x & rect.y are always 0 */
MetaUI *ui;
guint tile_preview_timeout_id;
struct {
gboolean exists;
guint timeout_id;
MetaWindow *window;
MetaRectangle area;
int monitor;
} tile_preview;
MetaWorkspace *active_workspace;
@ -132,9 +138,12 @@ void meta_screen_foreach_window (MetaScreen *scree
void meta_screen_update_cursor (MetaScreen *screen);
void meta_screen_update_tile_preview (MetaScreen *screen,
gboolean delay);
void meta_screen_hide_tile_preview (MetaScreen *screen);
void meta_screen_update_tile_preview (MetaScreen *screen,
MetaWindow *window,
MetaRectangle area,
int monitor,
gboolean delay);
void meta_screen_hide_tile_preview (MetaScreen *screen);
MetaWindow* meta_screen_get_mouse_window (MetaScreen *screen,
MetaWindow *not_this_one);

View File

@ -718,8 +718,6 @@ meta_screen_new (MetaDisplay *display,
screen->ui = meta_ui_new (screen->display->xdisplay,
screen->xscreen);
screen->tile_preview_timeout_id = 0;
screen->stack = meta_stack_new (screen);
screen->stack_tracker = meta_stack_tracker_new (screen);
@ -807,8 +805,8 @@ meta_screen_free (MetaScreen *screen,
g_free (screen->monitor_infos);
if (screen->tile_preview_timeout_id)
g_source_remove (screen->tile_preview_timeout_id);
if (screen->tile_preview.timeout_id)
g_source_remove (screen->tile_preview.timeout_id);
g_free (screen->screen_name);
@ -1288,44 +1286,20 @@ static gboolean
meta_screen_update_tile_preview_timeout (gpointer data)
{
MetaScreen *screen = data;
MetaWindow *window = screen->display->grab_window;
gboolean needs_preview = FALSE;
screen->tile_preview_timeout_id = 0;
screen->tile_preview.timeout_id = 0;
if (window)
if (screen->tile_preview.exists)
{
switch (window->tile_mode)
{
case META_TILE_LEFT:
case META_TILE_RIGHT:
if (!META_WINDOW_TILED_SIDE_BY_SIDE (window))
needs_preview = TRUE;
break;
case META_TILE_MAXIMIZED:
if (!META_WINDOW_MAXIMIZED (window))
needs_preview = TRUE;
break;
default:
needs_preview = FALSE;
break;
}
}
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_compositor_show_tile_preview (screen->display->compositor,
window, &tile_rect, monitor);
screen->tile_preview.window,
&screen->tile_preview.area,
screen->tile_preview.monitor);
}
else
meta_compositor_hide_tile_preview (screen->display->compositor);
{
meta_compositor_hide_tile_preview (screen->display->compositor);
}
return FALSE;
}
@ -1333,37 +1307,47 @@ meta_screen_update_tile_preview_timeout (gpointer data)
#define TILE_PREVIEW_TIMEOUT_MS 200
void
meta_screen_update_tile_preview (MetaScreen *screen,
gboolean delay)
meta_screen_update_tile_preview (MetaScreen *screen,
MetaWindow *window,
MetaRectangle area,
int monitor,
gboolean delay)
{
screen->tile_preview.exists = TRUE;
screen->tile_preview.window = window;
screen->tile_preview.area = area;
screen->tile_preview.monitor = monitor;
if (delay)
{
if (screen->tile_preview_timeout_id > 0)
if (screen->tile_preview.timeout_id > 0)
return;
screen->tile_preview_timeout_id =
screen->tile_preview.timeout_id =
g_timeout_add (TILE_PREVIEW_TIMEOUT_MS,
meta_screen_update_tile_preview_timeout,
screen);
g_source_set_name_by_id (screen->tile_preview_timeout_id,
g_source_set_name_by_id (screen->tile_preview.timeout_id,
"[mutter] meta_screen_update_tile_preview_timeout");
}
else
{
if (screen->tile_preview_timeout_id > 0)
g_source_remove (screen->tile_preview_timeout_id);
if (screen->tile_preview.timeout_id > 0)
g_source_remove (screen->tile_preview.timeout_id);
meta_screen_update_tile_preview_timeout ((gpointer)screen);
meta_screen_update_tile_preview_timeout ((gpointer) screen);
}
}
void
meta_screen_hide_tile_preview (MetaScreen *screen)
{
if (screen->tile_preview_timeout_id > 0)
g_source_remove (screen->tile_preview_timeout_id);
screen->tile_preview.exists = FALSE;
meta_compositor_hide_tile_preview (screen->display->compositor);
if (screen->tile_preview.timeout_id > 0)
g_source_remove (screen->tile_preview.timeout_id);
meta_screen_update_tile_preview_timeout ((gpointer) screen);
}
MetaWindow*

View File

@ -117,7 +117,6 @@ meta_stack_add (MetaStack *stack,
window->desc, window->stack_position);
stack_sync_to_xserver (stack);
meta_stack_update_window_tile_matches (stack, window->screen->active_workspace);
}
void
@ -153,7 +152,6 @@ meta_stack_remove (MetaStack *stack,
GUINT_TO_POINTER (window->frame->xwindow));
stack_sync_to_xserver (stack);
meta_stack_update_window_tile_matches (stack, window->screen->active_workspace);
}
void
@ -163,7 +161,6 @@ meta_stack_update_layer (MetaStack *stack,
stack->need_relayer = TRUE;
stack_sync_to_xserver (stack);
meta_stack_update_window_tile_matches (stack, window->screen->active_workspace);
}
void
@ -173,7 +170,6 @@ meta_stack_update_transient (MetaStack *stack,
stack->need_constrain = TRUE;
stack_sync_to_xserver (stack);
meta_stack_update_window_tile_matches (stack, window->screen->active_workspace);
}
/* raise/lower within a layer */
@ -202,7 +198,6 @@ meta_stack_raise (MetaStack *stack,
meta_window_set_stack_position_no_sync (window, max_stack_position);
stack_sync_to_xserver (stack);
meta_stack_update_window_tile_matches (stack, window->screen->active_workspace);
}
void
@ -230,7 +225,6 @@ meta_stack_lower (MetaStack *stack,
meta_window_set_stack_position_no_sync (window, min_stack_position);
stack_sync_to_xserver (stack);
meta_stack_update_window_tile_matches (stack, window->screen->active_workspace);
}
void
@ -246,27 +240,6 @@ meta_stack_thaw (MetaStack *stack)
stack->freeze_count -= 1;
stack_sync_to_xserver (stack);
meta_stack_update_window_tile_matches (stack, NULL);
}
void
meta_stack_update_window_tile_matches (MetaStack *stack,
MetaWorkspace *workspace)
{
GList *windows, *tmp;
if (stack->freeze_count > 0)
return;
windows = meta_stack_list_windows (stack, workspace);
tmp = windows;
while (tmp)
{
meta_window_compute_tile_match ((MetaWindow *) tmp->data);
tmp = tmp->next;
}
g_list_free (windows);
}
static gboolean
@ -1448,7 +1421,6 @@ meta_stack_set_positions (MetaStack *stack,
"Reset the stack positions of (nearly) all windows\n");
stack_sync_to_xserver (stack);
meta_stack_update_window_tile_matches (stack, NULL);
}
void
@ -1511,6 +1483,4 @@ meta_window_set_stack_position (MetaWindow *window,
{
meta_window_set_stack_position_no_sync (window, position);
stack_sync_to_xserver (window->screen->stack);
meta_stack_update_window_tile_matches (window->screen->stack,
window->screen->active_workspace);
}

View File

@ -413,6 +413,4 @@ GList* meta_stack_get_positions (MetaStack *stack);
void meta_stack_set_positions (MetaStack *stack,
GList *windows);
void meta_stack_update_window_tile_matches (MetaStack *stack,
MetaWorkspace *workspace);
#endif

View File

@ -88,6 +88,20 @@ typedef enum
META_MOVE_RESIZE_RESULT_FRAME_SHAPE_CHANGED = 1 << 2,
} MetaMoveResizeResultFlags;
/* This contains all the "state" needed for a certain size configuration.
* We have three of these size configurations: normal, tiled, and
* maximized. The idea here is that if the user tiles a normal window,
* then maximizes it, we should, upon unmaximizing and untiling the window,
* return to a normal state. We need a way of storing this information
* while maximized, so we use this structure. */
struct _MetaWindowSizeState
{
guint maximized_horizontally : 1;
guint maximized_vertically : 1;
MetaRectangle rect;
};
typedef struct _MetaWindowSizeState MetaWindowSizeState;
struct _MetaWindow
{
GObject parent_instance;
@ -157,14 +171,6 @@ struct _MetaWindow
guint maximize_vertically_after_placement : 1;
guint minimize_after_placement : 1;
/* The current or requested tile mode. If maximized_vertically is true,
* this is the current mode. If not, it is the mode which will be
* requested after the window grab is released */
guint tile_mode : 2;
/* The last "full" maximized/unmaximized state. We need to keep track of
* that to toggle between normal/tiled or maximized/tiled states. */
guint saved_maximize : 1;
int tile_monitor_number;
int preferred_output_winsys_id;
/* Whether we're shaded */
@ -401,9 +407,6 @@ struct _MetaWindow
/* The current window geometry of the window. */
MetaRectangle rect;
/* The geometry to restore when we unmaximize. */
MetaRectangle saved_rect;
/* This is the geometry the window will have if no constraints have
* applied. We use this whenever we are moving implicitly (for example,
* if we move to avoid a panel, we can snap back to this position if
@ -441,11 +444,16 @@ struct _MetaWindow
/* Focused window that is (directly or indirectly) attached to this one */
MetaWindow *attached_focus_window;
/* The currently complementary tiled window, if any */
MetaWindow *tile_match;
/* Bypass compositor hints */
guint bypass_compositor;
/* This is where we store data while in another state. The information
* above in MetaWindow is always the current state of the window. */
struct {
MetaWindowSizeState normal, tiled, maximized;
} size_states;
MetaDirection constrained_edges;
};
struct _MetaWindowClass
@ -492,17 +500,8 @@ struct _MetaWindowClass
(w)->maximized_vertically)
#define META_WINDOW_MAXIMIZED_VERTICALLY(w) ((w)->maximized_vertically)
#define META_WINDOW_MAXIMIZED_HORIZONTALLY(w) ((w)->maximized_horizontally)
#define META_WINDOW_TILED_SIDE_BY_SIDE(w) ((w)->maximized_vertically && \
!(w)->maximized_horizontally && \
(w)->tile_mode != META_TILE_NONE)
#define META_WINDOW_TILED_LEFT(w) (META_WINDOW_TILED_SIDE_BY_SIDE(w) && \
(w)->tile_mode == META_TILE_LEFT)
#define META_WINDOW_TILED_RIGHT(w) (META_WINDOW_TILED_SIDE_BY_SIDE(w) && \
(w)->tile_mode == META_TILE_RIGHT)
#define META_WINDOW_TILED_MAXIMIZED(w)(META_WINDOW_MAXIMIZED(w) && \
(w)->tile_mode == META_TILE_MAXIMIZED)
#define META_WINDOW_ALLOWS_MOVE(w) ((w)->has_move_func && !(w)->fullscreen)
#define META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS(w) ((w)->has_resize_func && !META_WINDOW_MAXIMIZED (w) && !META_WINDOW_TILED_SIDE_BY_SIDE(w) && !(w)->fullscreen && !(w)->shaded)
#define META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS(w) ((w)->has_resize_func && !META_WINDOW_MAXIMIZED (w) && !(w)->fullscreen && !(w)->shaded)
#define META_WINDOW_ALLOWS_RESIZE(w) (META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS (w) && \
(((w)->size_hints.min_width < (w)->size_hints.max_width) || \
((w)->size_hints.min_height < (w)->size_hints.max_height)))
@ -522,7 +521,6 @@ void meta_window_unmanage (MetaWindow *window,
guint32 timestamp);
void meta_window_queue (MetaWindow *window,
guint queuebits);
void meta_window_tile (MetaWindow *window);
void meta_window_maximize_internal (MetaWindow *window,
MetaMaximizeFlags directions,
MetaRectangle *saved_rect);
@ -584,11 +582,6 @@ gboolean 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);
gboolean meta_window_same_application (MetaWindow *window,
MetaWindow *other_window);
@ -626,9 +619,6 @@ void meta_window_update_for_monitors_changed (MetaWindow *window);
void meta_window_on_all_workspaces_changed (MetaWindow *window);
gboolean meta_window_should_attach_to_parent (MetaWindow *window);
gboolean meta_window_can_tile_side_by_side (MetaWindow *window);
void meta_window_compute_tile_match (MetaWindow *window);
gboolean meta_window_updates_are_frozen (MetaWindow *window);
@ -695,4 +685,7 @@ gboolean meta_window_has_pointer (MetaWindow *window);
void meta_window_emit_size_changed (MetaWindow *window);
void meta_window_toggle_tile (MetaWindow *window,
MetaTileZone tile_zone);
#endif

File diff suppressed because it is too large Load Diff

View File

@ -83,7 +83,11 @@ typedef enum
META_FRAME_IS_FLASHING = 1 << 14,
META_FRAME_ABOVE = 1 << 15,
META_FRAME_TILED_LEFT = 1 << 16,
META_FRAME_TILED_RIGHT = 1 << 17
META_FRAME_TILED_RIGHT = 1 << 17,
META_FRAME_CONSTRAINED_LEFT_EDGE = 1 << 18,
META_FRAME_CONSTRAINED_RIGHT_EDGE = 1 << 19,
META_FRAME_CONSTRAINED_TOP_EDGE = 1 << 20,
META_FRAME_CONSTRAINED_BOTTOM_EDGE = 1 << 21,
} MetaFrameFlags;
/**
@ -317,6 +321,26 @@ typedef enum
META_DIRECTION_VERTICAL = META_DIRECTION_UP | META_DIRECTION_DOWN,
} MetaDirection;
/* Tile zones are specified in terms of their constrained edges.
* So, "top left corner" is top and left, which should be obvious,
* but "left side of the screen" is top, bottom, and left
*/
typedef enum {
META_TILE_ZONE_MAXIMIZED_HORZ = META_DIRECTION_HORIZONTAL,
META_TILE_ZONE_MAXIMIZED_VERT = META_DIRECTION_VERTICAL,
META_TILE_ZONE_MAXIMIZED = META_TILE_ZONE_MAXIMIZED_HORZ | META_TILE_ZONE_MAXIMIZED_VERT,
META_TILE_ZONE_W = META_TILE_ZONE_MAXIMIZED_VERT | META_DIRECTION_LEFT,
META_TILE_ZONE_E = META_TILE_ZONE_MAXIMIZED_VERT | META_DIRECTION_RIGHT,
META_TILE_ZONE_N = META_TILE_ZONE_MAXIMIZED_HORZ | META_DIRECTION_TOP,
META_TILE_ZONE_S = META_TILE_ZONE_MAXIMIZED_HORZ | META_DIRECTION_BOTTOM,
META_TILE_ZONE_NW = META_DIRECTION_TOP | META_DIRECTION_LEFT,
META_TILE_ZONE_NE = META_DIRECTION_TOP | META_DIRECTION_RIGHT,
META_TILE_ZONE_SW = META_DIRECTION_BOTTOM | META_DIRECTION_LEFT,
META_TILE_ZONE_SE = META_DIRECTION_BOTTOM | META_DIRECTION_RIGHT,
} MetaTileZone;
/**
* MetaMotionDirection:
* @META_MOTION_UP: Upwards motion

View File

@ -214,8 +214,6 @@ MetaFrameType meta_window_get_frame_type (MetaWindow *window);
cairo_region_t *meta_window_get_frame_bounds (MetaWindow *window);
MetaWindow *meta_window_get_tile_match (MetaWindow *window);
void meta_window_make_fullscreen (MetaWindow *window);
void meta_window_unmake_fullscreen (MetaWindow *window);
void meta_window_make_above (MetaWindow *window);
@ -260,4 +258,8 @@ gboolean meta_window_is_client_decorated (MetaWindow *window);
gboolean meta_window_titlebar_is_onscreen (MetaWindow *window);
void meta_window_shove_titlebar_onscreen (MetaWindow *window);
void meta_window_tile (MetaWindow *window,
MetaTileZone tile_zone);
void meta_window_untile (MetaWindow *window);
#endif

View File

@ -100,22 +100,25 @@ meta_frame_layout_get_borders (const MetaFrameLayout *layout,
if (flags & META_FRAME_ALLOWS_HORIZONTAL_RESIZE)
{
borders->invisible.left = MAX (borders->invisible.left,
draggable_borders - borders->visible.left);
borders->invisible.right = MAX (borders->invisible.right,
draggable_borders - borders->visible.right);
if (!(flags & META_FRAME_CONSTRAINED_LEFT_EDGE))
borders->invisible.left = MAX (borders->invisible.left,
draggable_borders - borders->visible.left);
if (!(flags & META_FRAME_CONSTRAINED_RIGHT_EDGE))
borders->invisible.right = MAX (borders->invisible.right,
draggable_borders - borders->visible.right);
}
if (flags & META_FRAME_ALLOWS_VERTICAL_RESIZE)
{
borders->invisible.bottom = MAX (borders->invisible.bottom,
draggable_borders - borders->visible.bottom);
/* borders.visible.top is the height of the *title bar*. We can't do the same
* algorithm here, titlebars are expectedly much bigger. Just subtract a couple
* pixels to get a proper feel. */
if (type != META_FRAME_TYPE_ATTACHED)
if (!(flags & META_FRAME_CONSTRAINED_TOP_EDGE) && type != META_FRAME_TYPE_ATTACHED)
borders->invisible.top = MAX (borders->invisible.top, draggable_borders - 2);
if (!(flags & META_FRAME_CONSTRAINED_BOTTOM_EDGE))
borders->invisible.bottom = MAX (borders->invisible.bottom,
draggable_borders - borders->visible.bottom);
}
borders->total.left = borders->invisible.left + borders->visible.left;

View File

@ -30,6 +30,15 @@
#include <cogl/cogl-wayland-server.h>
#include <meta/util.h>
enum
{
RESOURCE_DESTROYED,
LAST_SIGNAL
};
guint signals[LAST_SIGNAL];
G_DEFINE_TYPE (MetaWaylandBuffer, meta_wayland_buffer, G_TYPE_OBJECT);
static void
@ -40,29 +49,10 @@ meta_wayland_buffer_destroy_handler (struct wl_listener *listener,
wl_container_of (listener, buffer, destroy_listener);
buffer->resource = NULL;
wl_signal_emit (&buffer->destroy_signal, buffer);
g_signal_emit (buffer, signals[RESOURCE_DESTROYED], 0);
g_object_unref (buffer);
}
void
meta_wayland_buffer_ref_use_count (MetaWaylandBuffer *buffer)
{
g_warn_if_fail (buffer->resource);
buffer->use_count++;
}
void
meta_wayland_buffer_unref_use_count (MetaWaylandBuffer *buffer)
{
g_return_if_fail (buffer->use_count != 0);
buffer->use_count--;
if (buffer->use_count == 0 && buffer->resource)
wl_resource_queue_event (buffer->resource, WL_BUFFER_RELEASE);
}
MetaWaylandBuffer *
meta_wayland_buffer_from_resource (struct wl_resource *resource)
{
@ -82,7 +72,6 @@ meta_wayland_buffer_from_resource (struct wl_resource *resource)
buffer = g_object_new (META_TYPE_WAYLAND_BUFFER, NULL);
buffer->resource = resource;
wl_signal_init (&buffer->destroy_signal);
buffer->destroy_listener.notify = meta_wayland_buffer_destroy_handler;
wl_resource_add_destroy_listener (resource, &buffer->destroy_listener);
}
@ -98,7 +87,6 @@ meta_wayland_buffer_ensure_texture (MetaWaylandBuffer *buffer)
CoglTexture *texture;
struct wl_shm_buffer *shm_buffer;
g_return_val_if_fail (buffer->use_count != 0, NULL);
g_return_val_if_fail (buffer->resource, NULL);
if (buffer->texture)
@ -134,8 +122,6 @@ meta_wayland_buffer_process_damage (MetaWaylandBuffer *buffer,
{
struct wl_shm_buffer *shm_buffer;
g_return_if_fail (buffer->use_count != 0);
shm_buffer = wl_shm_buffer_get (buffer->resource);
if (shm_buffer)
@ -181,4 +167,11 @@ meta_wayland_buffer_class_init (MetaWaylandBufferClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = meta_wayland_buffer_finalize;
signals[RESOURCE_DESTROYED] = g_signal_new ("resource-destroyed",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
0,
NULL, NULL, NULL,
G_TYPE_NONE, 0);
}

View File

@ -36,11 +36,9 @@ struct _MetaWaylandBuffer
GObject parent;
struct wl_resource *resource;
struct wl_signal destroy_signal;
struct wl_listener destroy_listener;
CoglTexture *texture;
uint32_t use_count;
};
#define META_TYPE_WAYLAND_BUFFER (meta_wayland_buffer_get_type ())
@ -48,8 +46,6 @@ G_DECLARE_FINAL_TYPE (MetaWaylandBuffer, meta_wayland_buffer,
META, WAYLAND_BUFFER, GObject);
MetaWaylandBuffer * meta_wayland_buffer_from_resource (struct wl_resource *resource);
void meta_wayland_buffer_ref_use_count (MetaWaylandBuffer *buffer);
void meta_wayland_buffer_unref_use_count (MetaWaylandBuffer *buffer);
CoglTexture * meta_wayland_buffer_ensure_texture (MetaWaylandBuffer *buffer);
void meta_wayland_buffer_process_damage (MetaWaylandBuffer *buffer,
cairo_region_t *region);

View File

@ -80,6 +80,8 @@ struct _MetaWaylandSurfaceRoleCursor
int hot_x;
int hot_y;
MetaCursorSprite *cursor_sprite;
MetaWaylandBuffer *buffer;
};
G_DEFINE_TYPE (MetaWaylandSurfaceRoleCursor,
@ -966,24 +968,29 @@ update_cursor_sprite_texture (MetaWaylandSurface *surface)
MetaWaylandSurfaceRoleCursor *cursor_role =
META_WAYLAND_SURFACE_ROLE_CURSOR (surface->role);
MetaCursorSprite *cursor_sprite = cursor_role->cursor_sprite;
MetaWaylandBuffer *buffer = meta_wayland_surface_get_buffer (surface);
g_return_if_fail (!surface->buffer || surface->buffer->texture);
g_return_if_fail (!buffer || buffer->texture);
if (surface->buffer)
if (buffer)
{
meta_cursor_sprite_set_texture (cursor_sprite,
surface->buffer->texture,
buffer->texture,
cursor_role->hot_x * surface->scale,
cursor_role->hot_y * surface->scale);
if (surface->using_buffer)
if (cursor_role->buffer)
{
struct wl_resource *buffer;
struct wl_resource *buffer_resource;
buffer = surface->buffer->resource;
g_assert (cursor_role->buffer == buffer);
buffer_resource = buffer->resource;
meta_cursor_renderer_realize_cursor_from_wl_buffer (cursor_renderer,
cursor_sprite,
buffer);
buffer_resource);
meta_wayland_surface_unref_buffer_use_count (surface);
g_clear_object (&cursor_role->buffer);
}
}
else
@ -1259,18 +1266,53 @@ meta_wayland_pointer_get_seat (MetaWaylandPointer *pointer)
static void
cursor_surface_role_assigned (MetaWaylandSurfaceRole *surface_role)
{
MetaWaylandSurfaceRoleCursor *cursor_role =
META_WAYLAND_SURFACE_ROLE_CURSOR (surface_role);
MetaWaylandSurface *surface =
meta_wayland_surface_role_get_surface (surface_role);
MetaWaylandBuffer *buffer = meta_wayland_surface_get_buffer (surface);
if (buffer)
{
g_set_object (&cursor_role->buffer, buffer);
meta_wayland_surface_ref_buffer_use_count (surface);
}
meta_wayland_surface_queue_pending_frame_callbacks (surface);
}
static void
cursor_surface_role_pre_commit (MetaWaylandSurfaceRole *surface_role,
MetaWaylandPendingState *pending)
{
MetaWaylandSurfaceRoleCursor *cursor_role =
META_WAYLAND_SURFACE_ROLE_CURSOR (surface_role);
MetaWaylandSurface *surface =
meta_wayland_surface_role_get_surface (surface_role);
meta_wayland_surface_queue_pending_frame_callbacks (surface);
if (pending->newly_attached && cursor_role->buffer)
{
meta_wayland_surface_unref_buffer_use_count (surface);
g_clear_object (&cursor_role->buffer);
}
}
static void
cursor_surface_role_commit (MetaWaylandSurfaceRole *surface_role,
MetaWaylandPendingState *pending)
{
MetaWaylandSurfaceRoleCursor *cursor_role =
META_WAYLAND_SURFACE_ROLE_CURSOR (surface_role);
MetaWaylandSurface *surface =
meta_wayland_surface_role_get_surface (surface_role);
MetaWaylandBuffer *buffer = meta_wayland_surface_get_buffer (surface);
if (pending->newly_attached)
{
g_set_object (&cursor_role->buffer, buffer);
if (cursor_role->buffer)
meta_wayland_surface_ref_buffer_use_count (surface);
}
meta_wayland_surface_queue_pending_state_frame_callbacks (surface, pending);
@ -1325,6 +1367,12 @@ cursor_surface_role_dispose (GObject *object)
g_clear_object (&cursor_role->cursor_sprite);
if (cursor_role->buffer)
{
meta_wayland_surface_unref_buffer_use_count (surface);
g_clear_object (&cursor_role->buffer);
}
G_OBJECT_CLASS (meta_wayland_surface_role_cursor_parent_class)->dispose (object);
}
@ -1341,6 +1389,7 @@ meta_wayland_surface_role_cursor_class_init (MetaWaylandSurfaceRoleCursorClass *
GObjectClass *object_class = G_OBJECT_CLASS (klass);
surface_role_class->assigned = cursor_surface_role_assigned;
surface_role_class->pre_commit = cursor_surface_role_pre_commit;
surface_role_class->commit = cursor_surface_role_commit;
surface_role_class->is_on_output = cursor_surface_role_is_on_output;

View File

@ -140,6 +140,10 @@ G_DEFINE_TYPE (MetaWaylandSurfaceRoleDND,
static void
meta_wayland_surface_role_assigned (MetaWaylandSurfaceRole *surface_role);
static void
meta_wayland_surface_role_pre_commit (MetaWaylandSurfaceRole *surface_role,
MetaWaylandPendingState *pending);
static void
meta_wayland_surface_role_commit (MetaWaylandSurfaceRole *surface_role,
MetaWaylandPendingState *pending);
@ -163,6 +167,13 @@ meta_wayland_surface_assign_role (MetaWaylandSurface *surface,
meta_wayland_surface_role_assigned (surface->role);
/* Release the use count held on behalf of the just assigned role. */
if (surface->unassigned.buffer)
{
meta_wayland_surface_unref_buffer_use_count (surface);
g_clear_object (&surface->unassigned.buffer);
}
return TRUE;
}
else if (G_OBJECT_TYPE (surface->role) != role_type)
@ -175,56 +186,29 @@ meta_wayland_surface_assign_role (MetaWaylandSurface *surface,
}
}
static void
surface_use_buffer (MetaWaylandSurface *surface)
{
g_return_if_fail (!surface->using_buffer);
meta_wayland_buffer_ref_use_count (surface->buffer);
surface->using_buffer = TRUE;
}
static void
surface_stop_using_buffer (MetaWaylandSurface *surface)
{
if (!surface->using_buffer)
return;
meta_wayland_buffer_unref_use_count (surface->buffer);
surface->using_buffer = FALSE;
}
static void
surface_set_buffer (MetaWaylandSurface *surface,
MetaWaylandBuffer *buffer)
{
if (surface->buffer == buffer)
return;
if (surface->buffer)
surface_stop_using_buffer (surface);
g_set_object (&surface->buffer, buffer);
}
static void
surface_process_damage (MetaWaylandSurface *surface,
cairo_region_t *region)
{
MetaWaylandBuffer *buffer = surface->buffer_ref.buffer;
unsigned int buffer_width;
unsigned int buffer_height;
cairo_rectangle_int_t surface_rect;
cairo_region_t *scaled_region;
int i, n_rectangles;
if (!surface->buffer)
/* If the client destroyed the buffer it attached before committing, but
* still posted damage, or posted damage without any buffer, don't try to
* process it on the non-existing buffer.
*/
if (!buffer)
return;
/* Intersect the damage region with the surface region before scaling in
* order to avoid integer overflow when scaling a damage region is too large
* (for example INT32_MAX which mesa passes). */
buffer_width = cogl_texture_get_width (surface->buffer->texture);
buffer_height = cogl_texture_get_height (surface->buffer->texture);
buffer_width = cogl_texture_get_width (buffer->texture);
buffer_height = cogl_texture_get_height (buffer->texture);
surface_rect = (cairo_rectangle_int_t) {
.width = buffer_width / surface->scale,
.height = buffer_height / surface->scale,
@ -236,7 +220,7 @@ surface_process_damage (MetaWaylandSurface *surface,
scaled_region = meta_region_scale (region, surface->scale);
/* First update the buffer. */
meta_wayland_buffer_process_damage (surface->buffer, scaled_region);
meta_wayland_buffer_process_damage (buffer, scaled_region);
/* Now damage the actor. The actor expects damage in the unscaled texture
* coordinate space, i.e. same as the buffer. */
@ -290,7 +274,7 @@ calculate_surface_window_geometry (MetaWaylandSurface *surface,
if (!CLUTTER_ACTOR_IS_VISIBLE (CLUTTER_ACTOR (surface_actor)))
return;
if (!surface->buffer)
if (!surface->buffer_ref.buffer)
return;
meta_surface_actor_wayland_get_subsurface_rect (surface_actor,
@ -326,6 +310,36 @@ destroy_window (MetaWaylandSurface *surface)
g_assert (surface->window == NULL);
}
MetaWaylandBuffer *
meta_wayland_surface_get_buffer (MetaWaylandSurface *surface)
{
return surface->buffer_ref.buffer;
}
void
meta_wayland_surface_ref_buffer_use_count (MetaWaylandSurface *surface)
{
g_return_if_fail (surface->buffer_ref.buffer);
g_warn_if_fail (surface->buffer_ref.buffer->resource);
surface->buffer_ref.use_count++;
}
void
meta_wayland_surface_unref_buffer_use_count (MetaWaylandSurface *surface)
{
MetaWaylandBuffer *buffer = surface->buffer_ref.buffer;
g_return_if_fail (surface->buffer_ref.use_count != 0);
surface->buffer_ref.use_count--;
g_return_if_fail (buffer);
if (surface->buffer_ref.use_count == 0 && buffer->resource)
wl_resource_queue_event (buffer->resource, WL_BUFFER_RELEASE);
}
static void
queue_surface_actor_frame_callbacks (MetaWaylandSurface *surface,
MetaWaylandPendingState *pending)
@ -344,6 +358,7 @@ toplevel_surface_commit (MetaWaylandSurfaceRole *surface_role,
{
MetaWaylandSurface *surface =
meta_wayland_surface_role_get_surface (surface_role);
MetaWaylandBuffer *buffer = surface->buffer_ref.buffer;
MetaWindow *window = surface->window;
queue_surface_actor_frame_callbacks (surface, pending);
@ -359,12 +374,12 @@ toplevel_surface_commit (MetaWaylandSurfaceRole *surface_role,
/* For wl_shell, it's equivalent to an unmap. Semantics
* are poorly defined, so we can choose some that are
* convenient for us. */
if (surface->buffer && !window)
if (buffer && !window)
{
window = meta_window_wayland_new (meta_get_display (), surface);
meta_wayland_surface_set_window (surface, window);
}
else if (surface->buffer == NULL && window)
else if (buffer == NULL && window)
{
destroy_window (surface);
return;
@ -372,7 +387,7 @@ toplevel_surface_commit (MetaWaylandSurfaceRole *surface_role,
}
else
{
if (surface->buffer == NULL)
if (buffer == NULL)
{
/* XDG surfaces can't commit NULL buffers */
wl_resource_post_error (surface->resource,
@ -390,7 +405,7 @@ toplevel_surface_commit (MetaWaylandSurfaceRole *surface_role,
{
MetaRectangle geom = { 0 };
CoglTexture *texture = surface->buffer->texture;
CoglTexture *texture = buffer->texture;
/* Update the buffer rect immediately. */
window->buffer_rect.width = cogl_texture_get_width (texture);
window->buffer_rect.height = cogl_texture_get_height (texture);
@ -432,11 +447,11 @@ toplevel_surface_commit (MetaWaylandSurfaceRole *surface_role,
}
static void
surface_handle_pending_buffer_destroy (struct wl_listener *listener, void *data)
pending_buffer_resource_destroyed (MetaWaylandBuffer *buffer,
MetaWaylandPendingState *pending)
{
MetaWaylandPendingState *state = wl_container_of (listener, state, buffer_destroy_listener);
state->buffer = NULL;
g_signal_handler_disconnect (buffer, pending->buffer_destroy_handler_id);
pending->buffer = NULL;
}
static void
@ -454,7 +469,6 @@ pending_state_init (MetaWaylandPendingState *state)
state->opaque_region_set = FALSE;
state->damage = cairo_region_create ();
state->buffer_destroy_listener.notify = surface_handle_pending_buffer_destroy;
wl_list_init (&state->frame_callback_list);
state->has_new_geometry = FALSE;
@ -470,7 +484,8 @@ pending_state_destroy (MetaWaylandPendingState *state)
g_clear_pointer (&state->opaque_region, cairo_region_destroy);
if (state->buffer)
wl_list_remove (&state->buffer_destroy_listener.link);
g_signal_handler_disconnect (state->buffer,
state->buffer_destroy_handler_id);
wl_list_for_each_safe (cb, next, &state->frame_callback_list, link)
wl_resource_destroy (cb->resource);
}
@ -487,7 +502,7 @@ move_pending_state (MetaWaylandPendingState *from,
MetaWaylandPendingState *to)
{
if (from->buffer)
wl_list_remove (&from->buffer_destroy_listener.link);
g_signal_handler_disconnect (from->buffer, from->buffer_destroy_handler_id);
to->newly_attached = from->newly_attached;
to->buffer = from->buffer;
@ -506,7 +521,12 @@ move_pending_state (MetaWaylandPendingState *from,
wl_list_insert_list (&to->frame_callback_list, &from->frame_callback_list);
if (to->buffer)
wl_signal_add (&to->buffer->destroy_signal, &to->buffer_destroy_listener);
{
to->buffer_destroy_handler_id =
g_signal_connect (to->buffer, "resource-destroyed",
G_CALLBACK (pending_buffer_resource_destroyed),
to);
}
pending_state_init (from);
}
@ -554,7 +574,7 @@ subsurface_surface_commit (MetaWaylandSurfaceRole *surface_role,
queue_surface_actor_frame_callbacks (surface, pending);
if (surface->buffer != NULL)
if (surface->buffer_ref.buffer != NULL)
clutter_actor_show (CLUTTER_ACTOR (surface_actor));
else
clutter_actor_hide (CLUTTER_ACTOR (surface_actor));
@ -651,28 +671,59 @@ static void
apply_pending_state (MetaWaylandSurface *surface,
MetaWaylandPendingState *pending)
{
gboolean release_new_buffer = FALSE;
MetaSurfaceActorWayland *surface_actor_wayland =
META_SURFACE_ACTOR_WAYLAND (surface->surface_actor);
if (surface->role)
{
meta_wayland_surface_role_pre_commit (surface->role, pending);
}
else
{
if (pending->newly_attached && surface->unassigned.buffer)
{
meta_wayland_surface_unref_buffer_use_count (surface);
g_clear_object (&surface->unassigned.buffer);
}
}
if (pending->newly_attached)
{
if (!surface->buffer && surface->window)
gboolean switched_buffer;
if (!surface->buffer_ref.buffer && surface->window)
meta_window_queue (surface->window, META_QUEUE_CALC_SHOWING);
surface_set_buffer (surface, pending->buffer);
/* Always release any previously held buffer. If the buffer held is same
* as the newly attached buffer, we still need to release it here, because
* wl_surface.attach+commit and wl_buffer.release on the attached buffer
* is symmetric.
*/
if (surface->buffer_held)
meta_wayland_surface_unref_buffer_use_count (surface);
if (pending->buffer && !surface->using_buffer)
switched_buffer = g_set_object (&surface->buffer_ref.buffer,
pending->buffer);
if (pending->buffer)
meta_wayland_surface_ref_buffer_use_count (surface);
if (switched_buffer && pending->buffer)
{
struct wl_shm_buffer *shm_buffer = wl_shm_buffer_get (pending->buffer->resource);
CoglTexture *texture;
surface_use_buffer (surface);
CoglTexture *texture = meta_wayland_buffer_ensure_texture (pending->buffer);
meta_surface_actor_wayland_set_texture (META_SURFACE_ACTOR_WAYLAND (surface->surface_actor), texture);
/* Release the buffer as soon as possible, so the client can reuse it
*/
if (shm_buffer)
release_new_buffer = TRUE;
texture = meta_wayland_buffer_ensure_texture (pending->buffer);
meta_surface_actor_wayland_set_texture (surface_actor_wayland,
texture);
}
/* If the newly attached buffer is going to be accessed directly without
* making a copy, such as an EGL buffer, mark it as in-use don't release
* it until is replaced by a subsequent wl_surface.commit or when the
* wl_surface is destroyed.
*/
surface->buffer_held = (pending->buffer &&
!wl_shm_buffer_get (pending->buffer->resource));
}
if (pending->scale > 0)
@ -681,9 +732,6 @@ apply_pending_state (MetaWaylandSurface *surface,
if (!cairo_region_is_empty (pending->damage))
surface_process_damage (surface, pending->damage);
if (release_new_buffer)
surface_stop_using_buffer (surface);
surface->offset_x += pending->dx;
surface->offset_y += pending->dy;
@ -721,14 +769,31 @@ apply_pending_state (MetaWaylandSurface *surface,
wl_list_insert_list (&surface->pending_frame_callback_list,
&pending->frame_callback_list);
wl_list_init (&pending->frame_callback_list);
if (pending->newly_attached)
{
/* The need to keep the wl_buffer from being released depends on what
* role the surface is given. That means we need to also keep a use
* count for wl_buffer's that are used by unassigned wl_surface's.
*/
g_set_object (&surface->unassigned.buffer, surface->buffer_ref.buffer);
if (surface->unassigned.buffer)
meta_wayland_surface_ref_buffer_use_count (surface);
}
}
/* If we have a buffer that we are not using, decrease the use count so it may
* be released if no-one else has a use-reference to it.
*/
if (pending->newly_attached &&
!surface->buffer_held && surface->buffer_ref.buffer)
meta_wayland_surface_unref_buffer_use_count (surface);
g_signal_emit (pending,
pending_state_signals[PENDING_STATE_SIGNAL_APPLIED],
0);
meta_surface_actor_wayland_sync_state (
META_SURFACE_ACTOR_WAYLAND (surface->surface_actor));
meta_surface_actor_wayland_sync_state (surface_actor_wayland);
pending_state_reset (pending);
@ -779,7 +844,10 @@ wl_surface_attach (struct wl_client *client,
buffer = NULL;
if (surface->pending->buffer)
wl_list_remove (&surface->pending->buffer_destroy_listener.link);
{
g_signal_handler_disconnect (surface->pending->buffer,
surface->pending->buffer_destroy_handler_id);
}
surface->pending->newly_attached = TRUE;
surface->pending->buffer = buffer;
@ -787,8 +855,12 @@ wl_surface_attach (struct wl_client *client,
surface->pending->dy = dy;
if (buffer)
wl_signal_add (&buffer->destroy_signal,
&surface->pending->buffer_destroy_listener);
{
surface->pending->buffer_destroy_handler_id =
g_signal_connect (buffer, "resource-destroyed",
G_CALLBACK (pending_buffer_resource_destroyed),
surface->pending);
}
}
static void
@ -1110,7 +1182,16 @@ wl_surface_destructor (struct wl_resource *resource)
if (surface->window)
destroy_window (surface);
surface_set_buffer (surface, NULL);
if (surface->unassigned.buffer)
{
meta_wayland_surface_unref_buffer_use_count (surface);
g_clear_object (&surface->unassigned.buffer);
}
if (surface->buffer_held)
meta_wayland_surface_unref_buffer_use_count (surface);
g_clear_object (&surface->buffer_ref.buffer);
g_clear_object (&surface->pending);
if (surface->opaque_region)
@ -2613,6 +2694,17 @@ meta_wayland_surface_role_assigned (MetaWaylandSurfaceRole *surface_role)
META_WAYLAND_SURFACE_ROLE_GET_CLASS (surface_role)->assigned (surface_role);
}
static void
meta_wayland_surface_role_pre_commit (MetaWaylandSurfaceRole *surface_role,
MetaWaylandPendingState *pending)
{
MetaWaylandSurfaceRoleClass *klass;
klass = META_WAYLAND_SURFACE_ROLE_GET_CLASS (surface_role);
if (klass->pre_commit)
klass->pre_commit (surface_role, pending);
}
static void
meta_wayland_surface_role_commit (MetaWaylandSurfaceRole *surface_role,
MetaWaylandPendingState *pending)
@ -2759,10 +2851,10 @@ meta_wayland_surface_calculate_input_region (MetaWaylandSurface *surface)
cairo_rectangle_int_t buffer_rect;
CoglTexture *texture;
if (!surface->buffer)
if (!surface->buffer_ref.buffer)
return NULL;
texture = surface->buffer->texture;
texture = surface->buffer_ref.buffer->texture;
buffer_rect = (cairo_rectangle_int_t) {
.width = cogl_texture_get_width (texture) / surface->scale,
.height = cogl_texture_get_height (texture) / surface->scale,

View File

@ -56,6 +56,8 @@ struct _MetaWaylandSurfaceRoleClass
GObjectClass parent_class;
void (*assigned) (MetaWaylandSurfaceRole *surface_role);
void (*pre_commit) (MetaWaylandSurfaceRole *surface_role,
MetaWaylandPendingState *pending);
void (*commit) (MetaWaylandSurfaceRole *surface_role,
MetaWaylandPendingState *pending);
gboolean (*is_on_output) (MetaWaylandSurfaceRole *surface_role,
@ -104,7 +106,7 @@ struct _MetaWaylandPendingState
/* wl_surface.attach */
gboolean newly_attached;
MetaWaylandBuffer *buffer;
struct wl_listener buffer_destroy_listener;
gulong buffer_destroy_handler_id;
int32_t dx;
int32_t dy;
@ -151,8 +153,6 @@ struct _MetaWaylandSurface
MetaSurfaceActor *surface_actor;
MetaWaylandSurfaceRole *role;
MetaWindow *window;
MetaWaylandBuffer *buffer;
gboolean using_buffer;
cairo_region_t *input_region;
cairo_region_t *opaque_region;
int scale;
@ -160,11 +160,25 @@ struct _MetaWaylandSurface
GList *subsurfaces;
GHashTable *outputs_to_destroy_notify_id;
/* Buffer reference state. */
struct {
MetaWaylandBuffer *buffer;
unsigned int use_count;
} buffer_ref;
/* Buffer renderer state. */
gboolean buffer_held;
/* List of pending frame callbacks that needs to stay queued longer than one
* commit sequence, such as when it has not yet been assigned a role.
*/
struct wl_list pending_frame_callback_list;
/* Intermediate state for when no role has been assigned. */
struct {
MetaWaylandBuffer *buffer;
} unassigned;
struct {
const MetaWaylandDragDestFuncs *funcs;
} dnd;
@ -230,6 +244,12 @@ MetaWaylandSurface *meta_wayland_surface_create (MetaWaylandCompositor *composit
gboolean meta_wayland_surface_assign_role (MetaWaylandSurface *surface,
GType role_type);
MetaWaylandBuffer *meta_wayland_surface_get_buffer (MetaWaylandSurface *surface);
void meta_wayland_surface_ref_buffer_use_count (MetaWaylandSurface *surface);
void meta_wayland_surface_unref_buffer_use_count (MetaWaylandSurface *surface);
void meta_wayland_surface_set_window (MetaWaylandSurface *surface,
MetaWindow *window);

View File

@ -363,7 +363,9 @@ meta_window_wayland_main_monitor_changed (MetaWindow *window,
/* Window size. */
scale_rect_size (&window->rect, scale_factor);
scale_rect_size (&window->unconstrained_rect, scale_factor);
scale_rect_size (&window->saved_rect, scale_factor);
scale_rect_size (&window->size_states.normal.rect, scale_factor);
scale_rect_size (&window->size_states.tiled.rect, scale_factor);
scale_rect_size (&window->size_states.maximized.rect, scale_factor);
/* Window geometry offset (XXX: Need a better place, see
* meta_window_wayland_move_resize). */

View File

@ -965,10 +965,10 @@ save_state (void)
{
fprintf (outfile,
" <maximized saved_x=\"%d\" saved_y=\"%d\" saved_width=\"%d\" saved_height=\"%d\"/>\n",
window->saved_rect.x,
window->saved_rect.y,
window->saved_rect.width,
window->saved_rect.height);
window->size_states.normal.rect.x,
window->size_states.normal.rect.y,
window->size_states.normal.rect.width,
window->size_states.normal.rect.height);
}
/* Gravity */

View File

@ -413,10 +413,10 @@ meta_window_apply_session_info (MetaWindow *window,
info->saved_rect.height,
window->desc);
window->saved_rect.x = info->saved_rect.x;
window->saved_rect.y = info->saved_rect.y;
window->saved_rect.width = info->saved_rect.width;
window->saved_rect.height = info->saved_rect.height;
window->size_states.normal.rect.x = info->saved_rect.x;
window->size_states.normal.rect.y = info->saved_rect.y;
window->size_states.normal.rect.width = info->saved_rect.width;
window->size_states.normal.rect.height = info->saved_rect.height;
}
}
}