Compare commits
	
		
			3 Commits
		
	
	
		
			3.14.2
			...
			wip/backgr
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					3c2284e69a | ||
| 
						 | 
					c632dcdd98 | ||
| 
						 | 
					786f358888 | 
							
								
								
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -44,9 +44,6 @@ po/*.pot
 | 
			
		||||
libmutter.pc
 | 
			
		||||
mutter
 | 
			
		||||
mutter-restart-helper
 | 
			
		||||
mutter-test-client
 | 
			
		||||
mutter-test-runner
 | 
			
		||||
mutter-all.test
 | 
			
		||||
org.gnome.mutter.gschema.valid
 | 
			
		||||
org.gnome.mutter.gschema.xml
 | 
			
		||||
org.gnome.mutter.wayland.gschema.valid
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										92
									
								
								NEWS
									
									
									
									
									
								
							
							
						
						
									
										92
									
								
								NEWS
									
									
									
									
									
								
							@@ -1,95 +1,3 @@
 | 
			
		||||
3.14.2
 | 
			
		||||
======
 | 
			
		||||
* Prevent crash applying monitor config for a closed lid [Rui; #739450]
 | 
			
		||||
* Misc. fixes [Rui, Jonathon, Jasper; #738630]
 | 
			
		||||
 | 
			
		||||
Contributors:
 | 
			
		||||
  Jonathon Jongsma, Rui Matos, Jasper St. Pierre
 | 
			
		||||
 | 
			
		||||
3.14.1.5
 | 
			
		||||
========
 | 
			
		||||
* Fix wayland hiDPI regressions [Adel; #739161]
 | 
			
		||||
 | 
			
		||||
Contributors:
 | 
			
		||||
  Adel Gadllah, Florian Müllner, Jasper St. Pierre
 | 
			
		||||
 | 
			
		||||
Translations:
 | 
			
		||||
  Dušan Kazik [sk]
 | 
			
		||||
 | 
			
		||||
3.14.1
 | 
			
		||||
======
 | 
			
		||||
* Fix move-titlebar-onscreen function [Florian; #736915]
 | 
			
		||||
* Fix stacking of the guard window [Owen; #737233]
 | 
			
		||||
* Fix keycode lookup for non-default layouts [Rui; #737134]
 | 
			
		||||
* Fix workspaces-only-on-primary handling [Florian; #737178]
 | 
			
		||||
* Don't unstick sticky windows on workspace removal [Florian; #737625]
 | 
			
		||||
* Do not auto-minimize fullscreen windows [Jasper; #705177]
 | 
			
		||||
* Upload keymap to newly added keyboard devices [Rui; #737673]
 | 
			
		||||
* Apply keyboard repeat settings [Rui; #728055]
 | 
			
		||||
* Don't send pressed keys on enter [Rui; #727178]
 | 
			
		||||
* Fix build without wayland/native [Rico; #738225]
 | 
			
		||||
* Send modifiers after the key event [Rui; #738238]
 | 
			
		||||
* Fix unredirect heuristic [Adel; #738271]
 | 
			
		||||
* Do not show system chrome over fullscreen windows [Florian; #693991]
 | 
			
		||||
* Misc. bug fixes [Florian, Adel, Tom; #737135, #737581, #738146, #738384]
 | 
			
		||||
 | 
			
		||||
Contributors:
 | 
			
		||||
  Tom Beckmann, Adel Gadllah, Carlos Garnacho, Rui Matos, Florian Müllner,
 | 
			
		||||
  Jasper St. Pierre, Rico Tzschichholz, Owen W. Taylor
 | 
			
		||||
 | 
			
		||||
Translations:
 | 
			
		||||
  Krishnababu Krothapalli [te], Мирослав Николић [sr, sr@latin],
 | 
			
		||||
  Alexander Shopov [bg], Saibal Ray [bn_IN], Milo Casagrande [it],
 | 
			
		||||
  Rūdolfs Mazurs [lv]
 | 
			
		||||
 | 
			
		||||
3.14.0
 | 
			
		||||
======
 | 
			
		||||
* Fix placement of popup windows on wayland [Jasper; #736812]
 | 
			
		||||
* Only increment serial once per event [Jasper; #736840]
 | 
			
		||||
* Fix window positioning regression with non-GTK+ toolkits [Owen; #736719]
 | 
			
		||||
 | 
			
		||||
Contributors:
 | 
			
		||||
  Jasper St. Pierre, Owen W. Taylor
 | 
			
		||||
 | 
			
		||||
Translations:
 | 
			
		||||
  Saibal Ray [bn_IN], Dušan Kazik [sk], Manoj Kumar Giri [or],
 | 
			
		||||
  Christian Kirbach [de], Ask H. Larsen [da], YunQiang Su [zh_CN],
 | 
			
		||||
  Bernd Homuth [de], Shankar Prasad [kn], Petr Kovar [cs], Rajesh Ranjan [hi]
 | 
			
		||||
 | 
			
		||||
3.13.92
 | 
			
		||||
=======
 | 
			
		||||
* Rewrite background code [Owen; #735637, #736568]
 | 
			
		||||
* Fix size in nested mode [Owen; #736279]
 | 
			
		||||
* Fix destroy animation of background windows [Florian; #735927]
 | 
			
		||||
* Wire keymap changes up to the wayland frontend [Rui; #736433]
 | 
			
		||||
* Add a test framework and stacking tests [Owen; #736505]
 | 
			
		||||
* Simplify handling of the merged X and wayland stack [Owen; #736559]
 | 
			
		||||
* Fix cursor size on HiDPI [Adel; #729337]
 | 
			
		||||
* Misc. bug fixes [Owen; #735632, #736589, #736694]
 | 
			
		||||
 | 
			
		||||
Contributors:
 | 
			
		||||
  Adel Gadllah, Rui Matos, Florian Müllner, Jasper St. Pierre, Owen W. Taylor
 | 
			
		||||
 | 
			
		||||
Translations:
 | 
			
		||||
  Andika Triwidada [id], Piotr Drąg [pl], Changwoo Ryu [ko],
 | 
			
		||||
  Kjartan Maraas [nb], Ville-Pekka Vainio [fi], Yuri Myasoedov [ru],
 | 
			
		||||
  Aurimas Černius [lt], Balázs Úr [hu], Sweta Kothari [gu], A S Alam [pa],
 | 
			
		||||
  Sandeep Sheshrao Shedmake [mr], Shantha kumar [ta], Gil Forcada [ca],
 | 
			
		||||
  Carles Ferrando [ca@valencia], Mattias Eriksson [sv]
 | 
			
		||||
 | 
			
		||||
3.13.91
 | 
			
		||||
=======
 | 
			
		||||
* Misc. bug fixes [Carlos; #735452]
 | 
			
		||||
 | 
			
		||||
Contributors:
 | 
			
		||||
  Adel Gadllah, Carlos Garnacho, Rui Matos, Jasper St. Pierre,
 | 
			
		||||
  Rico Tzschichholz
 | 
			
		||||
 | 
			
		||||
Translations:
 | 
			
		||||
  Chao-Hsiung Liao po/zh_HK, zh_TW.po, Enrico Nicoletto [pt_BR],
 | 
			
		||||
  Kjartan Maraas [nb], Fran Diéguez [gl], Yosef Or Boczko [he],
 | 
			
		||||
  Maria  Mavridou [el], Claude Paroz [fr]
 | 
			
		||||
 | 
			
		||||
3.13.90
 | 
			
		||||
=======
 | 
			
		||||
* Only call XSync() once per frame [Rui; #728464]
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										14
									
								
								configure.ac
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								configure.ac
									
									
									
									
									
								
							@@ -1,8 +1,8 @@
 | 
			
		||||
AC_PREREQ(2.62)
 | 
			
		||||
 | 
			
		||||
m4_define([mutter_major_version], [3])
 | 
			
		||||
m4_define([mutter_minor_version], [14])
 | 
			
		||||
m4_define([mutter_micro_version], [2])
 | 
			
		||||
m4_define([mutter_minor_version], [13])
 | 
			
		||||
m4_define([mutter_micro_version], [90])
 | 
			
		||||
 | 
			
		||||
m4_define([mutter_version],
 | 
			
		||||
          [mutter_major_version.mutter_minor_version.mutter_micro_version])
 | 
			
		||||
@@ -77,7 +77,9 @@ MUTTER_PC_MODULES="
 | 
			
		||||
   cairo >= 1.10.0
 | 
			
		||||
   gsettings-desktop-schemas >= 3.7.3
 | 
			
		||||
   $CLUTTER_PACKAGE >= 1.19.5
 | 
			
		||||
   clutter-egl-1.0
 | 
			
		||||
   cogl-1.0 >= 1.17.1
 | 
			
		||||
   gbm
 | 
			
		||||
   upower-glib >= 0.99.0
 | 
			
		||||
   gnome-desktop-3.0
 | 
			
		||||
   xcomposite >= 0.2
 | 
			
		||||
@@ -125,12 +127,6 @@ AC_ARG_WITH([xwayland-path],
 | 
			
		||||
            [XWAYLAND_PATH="$withval"],
 | 
			
		||||
            [XWAYLAND_PATH="$bindir/Xwayland"])
 | 
			
		||||
 | 
			
		||||
AC_ARG_ENABLE(installed_tests,
 | 
			
		||||
              AS_HELP_STRING([--enable-installed-tests],
 | 
			
		||||
                             [Install test programs (default: no)]),,
 | 
			
		||||
              [enable_installed_tests=no])
 | 
			
		||||
AM_CONDITIONAL(BUILDOPT_INSTALL_TESTS, test x$enable_installed_tests = xyes)
 | 
			
		||||
 | 
			
		||||
## here we get the flags we'll actually use
 | 
			
		||||
 | 
			
		||||
# Unconditionally use this dir to avoid a circular dep with gnomecc
 | 
			
		||||
@@ -200,7 +196,7 @@ AC_SUBST(XWAYLAND_PATH)
 | 
			
		||||
 | 
			
		||||
PKG_CHECK_MODULES(MUTTER, $MUTTER_PC_MODULES)
 | 
			
		||||
 | 
			
		||||
PKG_CHECK_MODULES(MUTTER_NATIVE_BACKEND, [clutter-egl-1.0 libdrm libsystemd libinput gbm >= 10.3], [have_native_backend=yes], [have_native_backend=no])
 | 
			
		||||
PKG_CHECK_MODULES(MUTTER_NATIVE_BACKEND, [libdrm libsystemd libinput], [have_native_backend=yes], [have_native_backend=no])
 | 
			
		||||
if test $have_native_backend = yes; then
 | 
			
		||||
   AC_DEFINE([HAVE_NATIVE_BACKEND],[1],[Define if you want to enable the native (KMS) backend based on systemd])
 | 
			
		||||
fi
 | 
			
		||||
 
 | 
			
		||||
@@ -111,13 +111,6 @@ IGNORE_HFILES= \
 | 
			
		||||
	xprops.h \
 | 
			
		||||
	$(NULL)
 | 
			
		||||
 | 
			
		||||
if !HAVE_WAYLAND
 | 
			
		||||
IGNORE_HFILES += \
 | 
			
		||||
	meta-surface-actor-wayland.h	\
 | 
			
		||||
	wayland				\
 | 
			
		||||
	$(NULL)
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
MKDB_OPTIONS+=--ignore-files="$(IGNORE_HFILES)"
 | 
			
		||||
 | 
			
		||||
# Images to copy into HTML directory.
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2681
									
								
								po/bn_IN.po
									
									
									
									
									
								
							
							
						
						
									
										2681
									
								
								po/bn_IN.po
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										1275
									
								
								po/ca@valencia.po
									
									
									
									
									
								
							
							
						
						
									
										1275
									
								
								po/ca@valencia.po
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										110
									
								
								po/el.po
									
									
									
									
									
								
							
							
						
						
									
										110
									
								
								po/el.po
									
									
									
									
									
								
							@@ -18,16 +18,16 @@ msgstr ""
 | 
			
		||||
"Project-Id-Version: metacity.gnome-2-26\n"
 | 
			
		||||
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
 | 
			
		||||
"product=mutter&keywords=I18N+L10N&component=general\n"
 | 
			
		||||
"POT-Creation-Date: 2014-08-20 21:50+0000\n"
 | 
			
		||||
"PO-Revision-Date: 2014-08-21 12:13+0200\n"
 | 
			
		||||
"Last-Translator: Maria Mavridou <mavridou@gmail.com>\n"
 | 
			
		||||
"POT-Creation-Date: 2014-07-15 21:19+0000\n"
 | 
			
		||||
"PO-Revision-Date: 2014-07-16 13:25+0200\n"
 | 
			
		||||
"Last-Translator: Tom Tryfonidis <tomtryf@gmail.com>\n"
 | 
			
		||||
"Language-Team: www.gnome.gr\n"
 | 
			
		||||
"Language: el\n"
 | 
			
		||||
"MIME-Version: 1.0\n"
 | 
			
		||||
"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.6.4\n"
 | 
			
		||||
"X-Generator: Poedit 1.6.5\n"
 | 
			
		||||
"X-Project-Style: gnome\n"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:1
 | 
			
		||||
@@ -91,100 +91,66 @@ msgid "Switch applications"
 | 
			
		||||
msgstr "Εναλλαγή εφαρμογών"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:16
 | 
			
		||||
#| msgid "Switch applications"
 | 
			
		||||
msgid "Switch to previous application"
 | 
			
		||||
msgstr "Εναλλαγή στην προηγούμενη εφαρμογή"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:17
 | 
			
		||||
msgid "Switch windows"
 | 
			
		||||
msgstr "Εναλλαγή παραθύρων"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:18
 | 
			
		||||
#| msgid "Switch windows"
 | 
			
		||||
msgid "Switch to previous window"
 | 
			
		||||
msgstr "Εναλλαγή στο προηγούμενο παράθυρο"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:19
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:17
 | 
			
		||||
msgid "Switch windows of an application"
 | 
			
		||||
msgstr "Εναλλαγή παραθύρων μιας εφαρμογής"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:20
 | 
			
		||||
#| msgid "Switch windows of an application"
 | 
			
		||||
msgid "Switch to previous window of an application"
 | 
			
		||||
msgstr "Εναλλαγή στο προηγούμενο παράθυρο μιας εφαρμογής"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:21
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:18
 | 
			
		||||
msgid "Switch system controls"
 | 
			
		||||
msgstr "Εναλλαγή ελέγχων συστήματος"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:22
 | 
			
		||||
#| msgid "Switch system controls"
 | 
			
		||||
msgid "Switch to previous system control"
 | 
			
		||||
msgstr "Εναλλαγή σε προηγούμενους ελέγχους συστήματος"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:23
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:19
 | 
			
		||||
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
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:20
 | 
			
		||||
msgid "Switch windows of an app directly"
 | 
			
		||||
msgstr "Άμεση εναλλαγή παραθύρων μιας εφαρμογής"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:26
 | 
			
		||||
#| msgid "Switch windows of an application"
 | 
			
		||||
msgid "Switch directly to previous window of an app"
 | 
			
		||||
msgstr "Άμεση εναλλαγή στο προηγούμενο παράθυρο μιας εφαρμογής"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:27
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:21
 | 
			
		||||
msgid "Switch system controls directly"
 | 
			
		||||
msgstr "Άμεση εναλλαγή ελέγχων συστήματος"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:28
 | 
			
		||||
#| msgid "Switch system controls"
 | 
			
		||||
msgid "Switch directly to previous system control"
 | 
			
		||||
msgstr "Άμεση εναλλαγή σε προηγούμενους ελέγχους συστήματος"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:29
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:22
 | 
			
		||||
msgid "Hide all normal windows"
 | 
			
		||||
msgstr "Απόκρυψη όλων των κανονικών παραθύρων"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:30
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:23
 | 
			
		||||
msgid "Switch to workspace 1"
 | 
			
		||||
msgstr "Εναλλαγή στον χώρο εργασίας 1"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:31
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:24
 | 
			
		||||
msgid "Switch to workspace 2"
 | 
			
		||||
msgstr "Εναλλαγή στον χώρο εργασίας 2"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:32
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:25
 | 
			
		||||
msgid "Switch to workspace 3"
 | 
			
		||||
msgstr "Εναλλαγή στον χώρο εργασίας 3"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:33
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:26
 | 
			
		||||
msgid "Switch to workspace 4"
 | 
			
		||||
msgstr "Εναλλαγή στον χώρο εργασίας 4"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:34
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:27
 | 
			
		||||
msgid "Switch to last workspace"
 | 
			
		||||
msgstr "Εναλλαγή στον τελευταίο χώρο εργασίας"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:35
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:28
 | 
			
		||||
msgid "Move to workspace left"
 | 
			
		||||
msgstr "Μετακίνηση στον χώρο εργασίας αριστερά"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:36
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:29
 | 
			
		||||
msgid "Move to workspace right"
 | 
			
		||||
msgstr "Μετακίνηση στον χώρο εργασίας δεξιά"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:37
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:30
 | 
			
		||||
msgid "Move to workspace above"
 | 
			
		||||
msgstr "Μετακίνηση στον χώρο εργασίας επάνω"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:38
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:31
 | 
			
		||||
msgid "Move to workspace below"
 | 
			
		||||
msgstr "Μετακίνηση στον χώρο εργασίας κάτω"
 | 
			
		||||
 | 
			
		||||
@@ -478,7 +444,7 @@ 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:441
 | 
			
		||||
#: ../src/compositor/compositor.c:445
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Another compositing manager is already running on screen %i on display \"%s"
 | 
			
		||||
@@ -486,11 +452,11 @@ msgid ""
 | 
			
		||||
msgstr ""
 | 
			
		||||
"Εκτελείται ένας άλλος διαχειριστής παραθύρων στην οθόνη %i προβολή \"%s\"."
 | 
			
		||||
 | 
			
		||||
#: ../src/compositor/meta-background.c:1044
 | 
			
		||||
#: ../src/compositor/meta-background.c:990
 | 
			
		||||
msgid "background texture could not be created from file"
 | 
			
		||||
msgstr "η υφή παρασκηνίου δεν μπόρεσε να δημιουργηθεί από αρχείο"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/bell.c:185
 | 
			
		||||
#: ../src/core/bell.c:215
 | 
			
		||||
msgid "Bell event"
 | 
			
		||||
msgstr "Ηχητικό συμβάν κουδουνιού"
 | 
			
		||||
 | 
			
		||||
@@ -520,49 +486,49 @@ msgid "_Force Quit"
 | 
			
		||||
msgstr "_Εξαναγκασμός σε τερματισμό"
 | 
			
		||||
 | 
			
		||||
# gconf/gconf-internals.c:2416
 | 
			
		||||
#: ../src/core/display.c:547
 | 
			
		||||
#: ../src/core/display.c:464
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Failed to open X Window System display '%s'\n"
 | 
			
		||||
msgstr "Αποτυχία ανοίγματος οθόνης του συστήματος παραθύρων Χ '%s'\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:176
 | 
			
		||||
#: ../src/core/main.c:172
 | 
			
		||||
msgid "Disable connection to session manager"
 | 
			
		||||
msgstr "Απενεργοποίηση σύνδεσης στο διαχειριστή συνεδρίας"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:182
 | 
			
		||||
#: ../src/core/main.c:178
 | 
			
		||||
msgid "Replace the running window manager"
 | 
			
		||||
msgstr "Αντικατάσταση του τρέχοντος διαχειριστή παραθύρων"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:188
 | 
			
		||||
#: ../src/core/main.c:184
 | 
			
		||||
msgid "Specify session management ID"
 | 
			
		||||
msgstr "Καθορισμός αναγνωριστικού διαχείρισης συνεδρίας"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:193
 | 
			
		||||
#: ../src/core/main.c:189
 | 
			
		||||
msgid "X Display to use"
 | 
			
		||||
msgstr "Εμφάνιση Χ για χρήση"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:199
 | 
			
		||||
#: ../src/core/main.c:195
 | 
			
		||||
msgid "Initialize session from savefile"
 | 
			
		||||
msgstr "Εκκίνηση συνεδρίας από savefile"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:205
 | 
			
		||||
#: ../src/core/main.c:201
 | 
			
		||||
msgid "Make X calls synchronous"
 | 
			
		||||
msgstr "Να καταστούν σύγχρονες οι κλήσεις του X"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:212
 | 
			
		||||
#: ../src/core/main.c:207
 | 
			
		||||
msgid "Run as a wayland compositor"
 | 
			
		||||
msgstr "Εκτέλεση ως συνθετητής wayland"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:220
 | 
			
		||||
#: ../src/core/main.c:214
 | 
			
		||||
msgid "Run as a full display server, rather than nested"
 | 
			
		||||
msgstr "Εκτέλεση ως διακομιστής πλήρους οθόνης, αντί ενσωματωμένης"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:459
 | 
			
		||||
#: ../src/core/main.c:448
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Failed to scan themes directory: %s\n"
 | 
			
		||||
msgstr "Αποτυχία σάρωσης καταλόγου θεμάτων: %s\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:475
 | 
			
		||||
#: ../src/core/main.c:464
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Could not find a theme! Be sure %s exists and contains the usual themes.\n"
 | 
			
		||||
@@ -594,17 +560,17 @@ msgstr "Εμφάνιση έκδοσης"
 | 
			
		||||
msgid "Mutter plugin to use"
 | 
			
		||||
msgstr "Πρόσθετα του Mutter για χρήση"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/prefs.c:2101
 | 
			
		||||
#: ../src/core/prefs.c:2086
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Workspace %d"
 | 
			
		||||
msgstr "Χώρος εργασίας %d"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/screen.c:548
 | 
			
		||||
#: ../src/core/screen.c:553
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Screen %d on display '%s' is invalid\n"
 | 
			
		||||
msgstr "Η οθόνη %d στην προβολή '%s' δεν είναι έγκυρη\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/screen.c:564
 | 
			
		||||
#: ../src/core/screen.c:569
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Screen %d on display \"%s\" already has a window manager; try using the --"
 | 
			
		||||
@@ -614,7 +580,7 @@ msgstr ""
 | 
			
		||||
"προσπαθήστε να χρησιμοποιήσετε την επιλογή --replace για να αντικαταστήσετε "
 | 
			
		||||
"τον τρέχων διαχειριστή παραθύρων.\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/screen.c:657
 | 
			
		||||
#: ../src/core/screen.c:662
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Screen %d on display \"%s\" already has a window manager\n"
 | 
			
		||||
msgstr "Η οθόνη %d στην προβολή \"%s\" έχει ήδη ένα διαχειριστή παραθύρων\n"
 | 
			
		||||
@@ -1344,7 +1310,7 @@ msgstr ""
 | 
			
		||||
"εγκατάστασης" και θα πρέπει να επανεκκινηθούν χειροκίνητα στην επόμενη "
 | 
			
		||||
"είσοδο σας."
 | 
			
		||||
 | 
			
		||||
#: ../src/x11/window-props.c:515
 | 
			
		||||
#: ../src/x11/window-props.c:513
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "%s (on %s)"
 | 
			
		||||
msgstr "%s (σε %s)"
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										176
									
								
								po/fi.po
									
									
									
									
									
								
							
							
						
						
									
										176
									
								
								po/fi.po
									
									
									
									
									
								
							@@ -7,15 +7,15 @@
 | 
			
		||||
# Gnome 2012-03 Finnish translation sprint participants:
 | 
			
		||||
# Pauli Virtanen <pauli.virtanen@hut.fi>, 2003-2005.
 | 
			
		||||
# Tommi Vainikainen <thv@iki.fi>, 2011.
 | 
			
		||||
# Jiri Grönroos <jiri.gronroos+l10n@iki.fi>, 2012, 2013, 2014.
 | 
			
		||||
# Jiri Grönroos <jiri.gronroos+l10n@iki.fi>, 2012, 2013.
 | 
			
		||||
#
 | 
			
		||||
msgid ""
 | 
			
		||||
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-09-06 21:56+0000\n"
 | 
			
		||||
"PO-Revision-Date: 2014-09-07 12:25+0300\n"
 | 
			
		||||
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug."
 | 
			
		||||
"cgi?product=mutter&keywords=I18N+L10N&component=general\n"
 | 
			
		||||
"POT-Creation-Date: 2014-08-08 21:51+0000\n"
 | 
			
		||||
"PO-Revision-Date: 2013-09-06 22:23+0300\n"
 | 
			
		||||
"Last-Translator: Jiri Grönroos <jiri.gronroos+l10n@iki.fi>\n"
 | 
			
		||||
"Language-Team: suomi <gnome-fi-laatu@lists.sourceforge.net>\n"
 | 
			
		||||
"Language: fi\n"
 | 
			
		||||
@@ -47,9 +47,10 @@ msgid "Move window to workspace 4"
 | 
			
		||||
msgstr "Siirrä ikkuna työtilaan 4"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:6
 | 
			
		||||
#, fuzzy
 | 
			
		||||
#| msgid "Move window to workspace 1"
 | 
			
		||||
msgid "Move window to last workspace"
 | 
			
		||||
msgstr "Siirrä ikkuna viimeiseen työtilaan"
 | 
			
		||||
msgstr "Siirrä ikkuna työtilaan 1"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:7
 | 
			
		||||
msgid "Move window one workspace to the left"
 | 
			
		||||
@@ -68,128 +69,98 @@ msgid "Move window one workspace down"
 | 
			
		||||
msgstr "Siirrä ikkunaa yksi työtila alas"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:11
 | 
			
		||||
#, fuzzy
 | 
			
		||||
#| msgid "Move window one workspace to the left"
 | 
			
		||||
msgid "Move window one monitor to the left"
 | 
			
		||||
msgstr "Siirrä ikkuna yhden näytön verran vasemmalle"
 | 
			
		||||
msgstr "Siirrä ikkunaa yksi työtila vasemmalle"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:12
 | 
			
		||||
#, fuzzy
 | 
			
		||||
#| msgid "Move window one workspace to the right"
 | 
			
		||||
msgid "Move window one monitor to the right"
 | 
			
		||||
msgstr "Siirrä ikkuna yhden näytön verran oikealle"
 | 
			
		||||
msgstr "Siirrä ikkunaa yksi työtila oikealle"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:13
 | 
			
		||||
#, fuzzy
 | 
			
		||||
#| msgid "Move window one workspace up"
 | 
			
		||||
msgid "Move window one monitor up"
 | 
			
		||||
msgstr "Siirrä ikkuna yhden näytön verran ylös"
 | 
			
		||||
msgstr "Siirrä ikkunaa yksi työtila ylös"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:14
 | 
			
		||||
#, fuzzy
 | 
			
		||||
#| msgid "Move window one workspace down"
 | 
			
		||||
msgid "Move window one monitor down"
 | 
			
		||||
msgstr "Siirrä ikkuna yhden näytön verran alas"
 | 
			
		||||
msgstr "Siirrä ikkunaa yksi työtila alas"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:15
 | 
			
		||||
msgid "Switch applications"
 | 
			
		||||
msgstr "Vaihda sovelluksia"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:16
 | 
			
		||||
#| msgid "Switch applications"
 | 
			
		||||
msgid "Switch to previous application"
 | 
			
		||||
msgstr "Vaihda edelliseen sovellukseen"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:17
 | 
			
		||||
msgid "Switch windows"
 | 
			
		||||
msgstr "Vaihda ikkunoita"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:18
 | 
			
		||||
#| msgid "Switch windows"
 | 
			
		||||
msgid "Switch to previous window"
 | 
			
		||||
msgstr "Vaihda edelliseen ikkunaan"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:19
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:17
 | 
			
		||||
msgid "Switch windows of an application"
 | 
			
		||||
msgstr "Vaihda sovelluksen ikkunoiden välillä"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:20
 | 
			
		||||
#| msgid "Switch windows of an application"
 | 
			
		||||
msgid "Switch to previous window of an application"
 | 
			
		||||
msgstr "Vaihda sovelluksen edelliseen ikkunaan"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:21
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:18
 | 
			
		||||
#, fuzzy
 | 
			
		||||
msgid "Switch system controls"
 | 
			
		||||
msgstr "Vaihda järjestelmän kontrolleja"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:22
 | 
			
		||||
#, fuzzy
 | 
			
		||||
msgid "Switch to previous system control"
 | 
			
		||||
msgstr "Vaihda järjestelmän kontrolleja"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:23
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:19
 | 
			
		||||
msgid "Switch windows directly"
 | 
			
		||||
msgstr "Vaihda ikkunoita suoraan"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:24
 | 
			
		||||
msgid "Switch directly to previous window"
 | 
			
		||||
msgstr "Vaihda suoraan edelliseen ikkunaan"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:25
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:20
 | 
			
		||||
msgid "Switch windows of an app directly"
 | 
			
		||||
msgstr "Vaihda sovelluksen ikkunoiden välillä suoraan"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:26
 | 
			
		||||
#, fuzzy
 | 
			
		||||
#| msgid "Switch windows of an application"
 | 
			
		||||
msgid "Switch directly to previous window of an app"
 | 
			
		||||
msgstr "Vaihda sovelluksen ikkunoiden välillä"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:27
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:21
 | 
			
		||||
#, fuzzy
 | 
			
		||||
msgid "Switch system controls directly"
 | 
			
		||||
msgstr "Vaihda järjestelmän kontrolleja suoraan"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:28
 | 
			
		||||
#, fuzzy
 | 
			
		||||
msgid "Switch directly to previous system control"
 | 
			
		||||
msgstr "Vaihda järjestelmän kontrolleja"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:29
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:22
 | 
			
		||||
msgid "Hide all normal windows"
 | 
			
		||||
msgstr "Piilota kaikki tavalliset ikkunat"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:30
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:23
 | 
			
		||||
msgid "Switch to workspace 1"
 | 
			
		||||
msgstr "Siirry työtilaan 1"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:31
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:24
 | 
			
		||||
msgid "Switch to workspace 2"
 | 
			
		||||
msgstr "Siirry työtilaan 2"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:32
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:25
 | 
			
		||||
msgid "Switch to workspace 3"
 | 
			
		||||
msgstr "Siirry työtilaan 3"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:33
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:26
 | 
			
		||||
msgid "Switch to workspace 4"
 | 
			
		||||
msgstr "Siirry työtilaan 4"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:34
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:27
 | 
			
		||||
#, fuzzy
 | 
			
		||||
#| msgid "Switch to workspace 1"
 | 
			
		||||
msgid "Switch to last workspace"
 | 
			
		||||
msgstr "Siirry viimeiseen työtilaan"
 | 
			
		||||
msgstr "Siirry työtilaan 1"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:35
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:28
 | 
			
		||||
msgid "Move to workspace left"
 | 
			
		||||
msgstr "Siirrä vasemmalla olevaan työtilaan"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:36
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:29
 | 
			
		||||
msgid "Move to workspace right"
 | 
			
		||||
msgstr "Siirrä oikealla olevaan työtilaan"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:37
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:30
 | 
			
		||||
msgid "Move to workspace above"
 | 
			
		||||
msgstr "Siirrä yllä olevaan työtilaan"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:38
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:31
 | 
			
		||||
msgid "Move to workspace below"
 | 
			
		||||
msgstr "Siirrä alla olevaan työtilaan"
 | 
			
		||||
 | 
			
		||||
@@ -398,7 +369,7 @@ msgstr ""
 | 
			
		||||
 | 
			
		||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:19
 | 
			
		||||
msgid "Place new windows in the center"
 | 
			
		||||
msgstr "Aseta uudet ikkunat keskelle näyttöä"
 | 
			
		||||
msgstr ""
 | 
			
		||||
 | 
			
		||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:20
 | 
			
		||||
msgid ""
 | 
			
		||||
@@ -416,53 +387,62 @@ msgid "Cancel tab popup"
 | 
			
		||||
msgstr ""
 | 
			
		||||
 | 
			
		||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:1
 | 
			
		||||
#, fuzzy
 | 
			
		||||
#| msgid "Switch to workspace 1"
 | 
			
		||||
msgid "Switch to VT 1"
 | 
			
		||||
msgstr "Siirry virtuaalikonsoliin 1"
 | 
			
		||||
msgstr "Siirry työtilaan 1"
 | 
			
		||||
 | 
			
		||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:2
 | 
			
		||||
#, fuzzy
 | 
			
		||||
#| msgid "Switch to workspace 2"
 | 
			
		||||
msgid "Switch to VT 2"
 | 
			
		||||
msgstr "Siirry virtuaalikonsoliin 2"
 | 
			
		||||
msgstr "Siirry työtilaan 2"
 | 
			
		||||
 | 
			
		||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:3
 | 
			
		||||
#, fuzzy
 | 
			
		||||
#| msgid "Switch to workspace 3"
 | 
			
		||||
msgid "Switch to VT 3"
 | 
			
		||||
msgstr "Siirry virtuaalikonsoliin 3"
 | 
			
		||||
msgstr "Siirry työtilaan 3"
 | 
			
		||||
 | 
			
		||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:4
 | 
			
		||||
#, fuzzy
 | 
			
		||||
#| msgid "Switch to workspace 4"
 | 
			
		||||
msgid "Switch to VT 4"
 | 
			
		||||
msgstr "Siirry virtuaalikonsoliin 4"
 | 
			
		||||
msgstr "Siirry työtilaan 4"
 | 
			
		||||
 | 
			
		||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:5
 | 
			
		||||
#, fuzzy
 | 
			
		||||
#| msgid "Switch to workspace 1"
 | 
			
		||||
msgid "Switch to VT 5"
 | 
			
		||||
msgstr "Siirry virtuaalikonsoliin 5"
 | 
			
		||||
msgstr "Siirry työtilaan 1"
 | 
			
		||||
 | 
			
		||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:6
 | 
			
		||||
#, fuzzy
 | 
			
		||||
#| msgid "Switch to workspace 1"
 | 
			
		||||
msgid "Switch to VT 6"
 | 
			
		||||
msgstr "Siirry virtuaalikonsoliin 6"
 | 
			
		||||
msgstr "Siirry työtilaan 1"
 | 
			
		||||
 | 
			
		||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:7
 | 
			
		||||
#, fuzzy
 | 
			
		||||
#| msgid "Switch to workspace 1"
 | 
			
		||||
msgid "Switch to VT 7"
 | 
			
		||||
msgstr "Siirry virtuaalikonsoliin 7"
 | 
			
		||||
msgstr "Siirry työtilaan 1"
 | 
			
		||||
 | 
			
		||||
#: ../src/backends/meta-monitor-manager.c:412
 | 
			
		||||
msgid "Built-in display"
 | 
			
		||||
msgstr "Sisäänrakennettu näyttö"
 | 
			
		||||
 | 
			
		||||
#: ../src/backends/meta-monitor-manager.c:437
 | 
			
		||||
#, fuzzy
 | 
			
		||||
#| msgid "Unknown %s"
 | 
			
		||||
msgid "Unknown"
 | 
			
		||||
msgstr "Tuntematon"
 | 
			
		||||
msgstr "Tuntematon %s"
 | 
			
		||||
 | 
			
		||||
#: ../src/backends/meta-monitor-manager.c:439
 | 
			
		||||
#, fuzzy
 | 
			
		||||
#| msgid "Unknown %s"
 | 
			
		||||
msgid "Unknown Display"
 | 
			
		||||
msgstr "Tuntematon näyttö"
 | 
			
		||||
msgstr "Tuntematon %s"
 | 
			
		||||
 | 
			
		||||
#. TRANSLATORS: this is a monitor vendor name, followed by a
 | 
			
		||||
#. * size in inches, like 'Dell 15"'
 | 
			
		||||
@@ -470,19 +450,23 @@ msgstr "Tuntematon näyttö"
 | 
			
		||||
#: ../src/backends/meta-monitor-manager.c:447
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "%s %s"
 | 
			
		||||
msgstr "%s %s"
 | 
			
		||||
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:443
 | 
			
		||||
#: ../src/compositor/compositor.c:450
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Another compositing manager is already running on screen %i on display \"%s"
 | 
			
		||||
"\"."
 | 
			
		||||
"Another compositing manager is already running on screen %i on display \""
 | 
			
		||||
"%s\"."
 | 
			
		||||
msgstr ""
 | 
			
		||||
"Näytön ”%2$s” ruudullä %1$d on jo käynnissä toinen ikkunoidenladontaohjelman."
 | 
			
		||||
 | 
			
		||||
#: ../src/core/bell.c:185
 | 
			
		||||
#: ../src/compositor/meta-background.c:1044
 | 
			
		||||
msgid "background texture could not be created from file"
 | 
			
		||||
msgstr ""
 | 
			
		||||
 | 
			
		||||
#: ../src/core/bell.c:214
 | 
			
		||||
msgid "Bell event"
 | 
			
		||||
msgstr "Äänimerkki"
 | 
			
		||||
 | 
			
		||||
@@ -510,49 +494,49 @@ msgstr "_Odota"
 | 
			
		||||
msgid "_Force Quit"
 | 
			
		||||
msgstr "Sulje _väkisin"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/display.c:547
 | 
			
		||||
#: ../src/core/display.c:539
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Failed to open X Window System display '%s'\n"
 | 
			
		||||
msgstr "X-ikkunointijärjestelmän näytön ”%s” avaaminen epäonnistui\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:176
 | 
			
		||||
#: ../src/core/main.c:172
 | 
			
		||||
msgid "Disable connection to session manager"
 | 
			
		||||
msgstr "Estä yhteys sessionhallintaan"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:182
 | 
			
		||||
#: ../src/core/main.c:178
 | 
			
		||||
msgid "Replace the running window manager"
 | 
			
		||||
msgstr "Vaihda käytössä oleva ikkunanhallinta"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:188
 | 
			
		||||
#: ../src/core/main.c:184
 | 
			
		||||
msgid "Specify session management ID"
 | 
			
		||||
msgstr "Anna sessionhallinnan ID"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:193
 | 
			
		||||
#: ../src/core/main.c:189
 | 
			
		||||
msgid "X Display to use"
 | 
			
		||||
msgstr "Käytettävä X-näyttö"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:199
 | 
			
		||||
#: ../src/core/main.c:195
 | 
			
		||||
msgid "Initialize session from savefile"
 | 
			
		||||
msgstr "Alusta sessio tiedostosta"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:205
 | 
			
		||||
#: ../src/core/main.c:201
 | 
			
		||||
msgid "Make X calls synchronous"
 | 
			
		||||
msgstr "Käytä synkronisia X-kutsuja"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:212
 | 
			
		||||
#: ../src/core/main.c:207
 | 
			
		||||
msgid "Run as a wayland compositor"
 | 
			
		||||
msgstr "Suorita wayland-koostajana"
 | 
			
		||||
msgstr ""
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:220
 | 
			
		||||
#: ../src/core/main.c:214
 | 
			
		||||
msgid "Run as a full display server, rather than nested"
 | 
			
		||||
msgstr ""
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:459
 | 
			
		||||
#: ../src/core/main.c:450
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Failed to scan themes directory: %s\n"
 | 
			
		||||
msgstr "Teemakansion lukeminen epäonnistui: %s\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:475
 | 
			
		||||
#: ../src/core/main.c:466
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Could not find a theme! Be sure %s exists and contains the usual themes.\n"
 | 
			
		||||
@@ -583,17 +567,17 @@ msgstr "Näytä versio"
 | 
			
		||||
msgid "Mutter plugin to use"
 | 
			
		||||
msgstr "Käytettävä Mutter-liitännäinen"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/prefs.c:2101
 | 
			
		||||
#: ../src/core/prefs.c:2102
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Workspace %d"
 | 
			
		||||
msgstr "Työtila %d"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/screen.c:548
 | 
			
		||||
#: ../src/core/screen.c:553
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Screen %d on display '%s' is invalid\n"
 | 
			
		||||
msgstr "Näytön ”%2$s” ruutu %1$d ei ole kelvollinen\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/screen.c:564
 | 
			
		||||
#: ../src/core/screen.c:569
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Screen %d on display \"%s\" already has a window manager; try using the --"
 | 
			
		||||
@@ -602,7 +586,7 @@ msgstr ""
 | 
			
		||||
"Näytön ”%2$s” ruudulla %1$d on jo ikkunointiohjelma: kokeile valitsinta --"
 | 
			
		||||
"replace, jos haluat korvata nykyisen ikkunointiohjelman.\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/screen.c:657
 | 
			
		||||
#: ../src/core/screen.c:662
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Screen %d on display \"%s\" already has a window manager\n"
 | 
			
		||||
msgstr "Näytön ”%2$s” ruudulla %1$d on jo ikkunointiohjelma\n"
 | 
			
		||||
@@ -666,8 +650,8 @@ msgid ""
 | 
			
		||||
"GTK custom color specification must have color name and fallback in "
 | 
			
		||||
"parentheses, e.g. gtk:custom(foo,bar); could not parse \"%s\""
 | 
			
		||||
msgstr ""
 | 
			
		||||
"GTK-värimääritteessä täytyy olla värin nimi ja vara-arvo suluissa, esim. gtk:"
 | 
			
		||||
"custom(foo,bar). ”%s” ei jäsenny"
 | 
			
		||||
"GTK-värimääritteessä täytyy olla värin nimi ja vara-arvo suluissa, esim. "
 | 
			
		||||
"gtk:custom(foo,bar). ”%s” ei jäsenny"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1227
 | 
			
		||||
#, c-format
 | 
			
		||||
@@ -699,8 +683,8 @@ msgstr ""
 | 
			
		||||
#: ../src/ui/theme.c:1300
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"GTK color specification must have a close bracket after the state, e.g. gtk:"
 | 
			
		||||
"fg[NORMAL] where NORMAL is the state; could not parse \"%s\""
 | 
			
		||||
"GTK color specification must have a close bracket after the state, e.g. "
 | 
			
		||||
"gtk:fg[NORMAL] where NORMAL is the state; could not parse \"%s\""
 | 
			
		||||
msgstr ""
 | 
			
		||||
"GTK-värimääritteessä täytyy olla loppuhakasulku tilan jälkeen. Esimerkiksi "
 | 
			
		||||
"gtk:fg[NORMAL], jossa NORMAL on tila. ”%s” ei jäsenny"
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										157
									
								
								po/lt.po
									
									
									
									
									
								
							
							
						
						
									
										157
									
								
								po/lt.po
									
									
									
									
									
								
							@@ -13,8 +13,8 @@ msgstr ""
 | 
			
		||||
"Project-Id-Version: lt\n"
 | 
			
		||||
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
 | 
			
		||||
"product=mutter&keywords=I18N+L10N&component=general\n"
 | 
			
		||||
"POT-Creation-Date: 2014-09-10 09:53+0000\n"
 | 
			
		||||
"PO-Revision-Date: 2014-09-10 20:22+0300\n"
 | 
			
		||||
"POT-Creation-Date: 2014-07-05 09:54+0000\n"
 | 
			
		||||
"PO-Revision-Date: 2014-07-05 13:56+0300\n"
 | 
			
		||||
"Last-Translator: Aurimas Černius <aurisc4@gmail.com>\n"
 | 
			
		||||
"Language-Team: Lietuvių <gnome-lt@lists.akl.lt>\n"
 | 
			
		||||
"Language: lt\n"
 | 
			
		||||
@@ -46,6 +46,7 @@ msgid "Move window to workspace 4"
 | 
			
		||||
msgstr "Perkelti langą į darbalaukį Nr.4"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:6
 | 
			
		||||
#| msgid "Move window to workspace 1"
 | 
			
		||||
msgid "Move window to last workspace"
 | 
			
		||||
msgstr "Perkelti langą į pastarąjį darbalaukį"
 | 
			
		||||
 | 
			
		||||
@@ -83,103 +84,70 @@ msgstr "Perkelti langą į žemiau esantį monitorių"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:15
 | 
			
		||||
msgid "Switch applications"
 | 
			
		||||
msgstr "Pereiti tarp programų"
 | 
			
		||||
msgstr "Persijungti tarp programų"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:16
 | 
			
		||||
#| msgid "Switch applications"
 | 
			
		||||
msgid "Switch to previous application"
 | 
			
		||||
msgstr "Pereiti į ankstesnę programą"
 | 
			
		||||
msgid "Switch windows"
 | 
			
		||||
msgstr "Persijungti tarp langų"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:17
 | 
			
		||||
msgid "Switch windows"
 | 
			
		||||
msgstr "Pereiti tarp langų"
 | 
			
		||||
msgid "Switch windows of an application"
 | 
			
		||||
msgstr "Persijungti tarp programos langų"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:18
 | 
			
		||||
#| msgid "Switch windows"
 | 
			
		||||
msgid "Switch to previous window"
 | 
			
		||||
msgstr "Pereiti į ankstesnį langą"
 | 
			
		||||
msgid "Switch system controls"
 | 
			
		||||
msgstr "Persijungti tarp sistemos valdiklių"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:19
 | 
			
		||||
msgid "Switch windows of an application"
 | 
			
		||||
msgstr "Pereiti tarp programos langų"
 | 
			
		||||
msgid "Switch windows directly"
 | 
			
		||||
msgstr "Tiesiogiai persijungti tarp langų"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:20
 | 
			
		||||
#| msgid "Switch windows of an application"
 | 
			
		||||
msgid "Switch to previous window of an application"
 | 
			
		||||
msgstr "Pereiti į ankstesnį programos langą"
 | 
			
		||||
msgid "Switch windows of an app directly"
 | 
			
		||||
msgstr "Tiesiogiai persijungti tarp programos langų"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:21
 | 
			
		||||
msgid "Switch system controls"
 | 
			
		||||
msgstr "Pereiti tarp sistemos valdiklių"
 | 
			
		||||
msgid "Switch system controls directly"
 | 
			
		||||
msgstr "Tiesiogiai persijungti tarp sistemos valdiklių"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:22
 | 
			
		||||
#| msgid "Switch system controls"
 | 
			
		||||
msgid "Switch to previous system control"
 | 
			
		||||
msgstr "Pereiti prie ankstesnio sistemos valdiklio"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:23
 | 
			
		||||
msgid "Switch windows directly"
 | 
			
		||||
msgstr "Tiesiogiai pereiti tarp langų"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:24
 | 
			
		||||
msgid "Switch directly to previous window"
 | 
			
		||||
msgstr "Tiesiogiai pereiti į ankstesnį langą"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:25
 | 
			
		||||
msgid "Switch windows of an app directly"
 | 
			
		||||
msgstr "Tiesiogiai pereiti tarp programos langų"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:26
 | 
			
		||||
#| msgid "Switch windows of an application"
 | 
			
		||||
msgid "Switch directly to previous window of an app"
 | 
			
		||||
msgstr "Tiesiogiai pereiti prie ankstesnio programos lango"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:27
 | 
			
		||||
msgid "Switch system controls directly"
 | 
			
		||||
msgstr "Tiesiogiai pereiti tarp sistemos valdiklių"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:28
 | 
			
		||||
#| msgid "Switch system controls"
 | 
			
		||||
msgid "Switch directly to previous system control"
 | 
			
		||||
msgstr "Tiesiogiai pereiti prie ankstesnio sistemos valdiklio"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:29
 | 
			
		||||
msgid "Hide all normal windows"
 | 
			
		||||
msgstr "Paslėpti visus įprastinius langus"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:30
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:23
 | 
			
		||||
msgid "Switch to workspace 1"
 | 
			
		||||
msgstr "Persijungti į darbalaukį Nr.1"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:31
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:24
 | 
			
		||||
msgid "Switch to workspace 2"
 | 
			
		||||
msgstr "Persijungti į darbalaukį Nr.2"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:32
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:25
 | 
			
		||||
msgid "Switch to workspace 3"
 | 
			
		||||
msgstr "Persijungti į darbalaukį Nr.3"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:33
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:26
 | 
			
		||||
msgid "Switch to workspace 4"
 | 
			
		||||
msgstr "Persijungti į darbalaukį Nr.4"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:34
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:27
 | 
			
		||||
#| msgid "Switch to workspace 1"
 | 
			
		||||
msgid "Switch to last workspace"
 | 
			
		||||
msgstr "Persijungti į pastarąjį darbalaukį"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:35
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:28
 | 
			
		||||
msgid "Move to workspace left"
 | 
			
		||||
msgstr "Perkelti į darbalaukį kairėje"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:36
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:29
 | 
			
		||||
msgid "Move to workspace right"
 | 
			
		||||
msgstr "Perkelti į darbalaukį dešinėje"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:37
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:30
 | 
			
		||||
msgid "Move to workspace above"
 | 
			
		||||
msgstr "Perkelti į darbalaukį viršuje"
 | 
			
		||||
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:38
 | 
			
		||||
#: ../data/50-mutter-navigation.xml.in.h:31
 | 
			
		||||
msgid "Move to workspace below"
 | 
			
		||||
msgstr "Perkelti į darbalaukį apačioje"
 | 
			
		||||
 | 
			
		||||
@@ -416,30 +384,37 @@ msgid "Cancel tab popup"
 | 
			
		||||
msgstr "Atšaukti tab iššokimą"
 | 
			
		||||
 | 
			
		||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:1
 | 
			
		||||
#| msgid "Switch to workspace 1"
 | 
			
		||||
msgid "Switch to VT 1"
 | 
			
		||||
msgstr "Persijungti į VT 1"
 | 
			
		||||
 | 
			
		||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:2
 | 
			
		||||
#| msgid "Switch to workspace 2"
 | 
			
		||||
msgid "Switch to VT 2"
 | 
			
		||||
msgstr "Persijungti į VT 2"
 | 
			
		||||
 | 
			
		||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:3
 | 
			
		||||
#| msgid "Switch to workspace 3"
 | 
			
		||||
msgid "Switch to VT 3"
 | 
			
		||||
msgstr "Persijungti į VT 3"
 | 
			
		||||
 | 
			
		||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:4
 | 
			
		||||
#| msgid "Switch to workspace 4"
 | 
			
		||||
msgid "Switch to VT 4"
 | 
			
		||||
msgstr "Persijungti į VT 4"
 | 
			
		||||
 | 
			
		||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:5
 | 
			
		||||
#| msgid "Switch to workspace 1"
 | 
			
		||||
msgid "Switch to VT 5"
 | 
			
		||||
msgstr "Persijungti į VT 5"
 | 
			
		||||
 | 
			
		||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:6
 | 
			
		||||
#| msgid "Switch to workspace 1"
 | 
			
		||||
msgid "Switch to VT 6"
 | 
			
		||||
msgstr "Persijungti į VT 6"
 | 
			
		||||
 | 
			
		||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:7
 | 
			
		||||
#| msgid "Switch to workspace 1"
 | 
			
		||||
msgid "Switch to VT 7"
 | 
			
		||||
msgstr "Persijungti į VT 7"
 | 
			
		||||
 | 
			
		||||
@@ -465,83 +440,87 @@ 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:443
 | 
			
		||||
#: ../src/compositor/compositor.c:464
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Another compositing manager is already running on screen %i on display \"%s"
 | 
			
		||||
"\"."
 | 
			
		||||
msgstr "Kita kompozicijos valdyklė jau veikia ekrane %i vaizduoklyje „%s“."
 | 
			
		||||
 | 
			
		||||
#: ../src/core/bell.c:185
 | 
			
		||||
#: ../src/compositor/meta-background.c:990
 | 
			
		||||
msgid "background texture could not be created from file"
 | 
			
		||||
msgstr "nepavyko sukurti fono tekstūros iš failo"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/bell.c:215
 | 
			
		||||
msgid "Bell event"
 | 
			
		||||
msgstr "Skambučio įvykis"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/delete.c:127
 | 
			
		||||
#: ../src/core/delete.c:129
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "“%s” is not responding."
 | 
			
		||||
msgstr "%s neatsiliepia į komandas."
 | 
			
		||||
 | 
			
		||||
#: ../src/core/delete.c:129
 | 
			
		||||
#: ../src/core/delete.c:131
 | 
			
		||||
msgid "Application is not responding."
 | 
			
		||||
msgstr "Programa neatsiliepia į komandas."
 | 
			
		||||
 | 
			
		||||
#: ../src/core/delete.c:134
 | 
			
		||||
#: ../src/core/delete.c:136
 | 
			
		||||
msgid ""
 | 
			
		||||
"You may choose to wait a short while for it to continue or force the "
 | 
			
		||||
"application to quit entirely."
 | 
			
		||||
msgstr "Galite šiek tiek palaukti arba priverstinai uždaryti programą."
 | 
			
		||||
 | 
			
		||||
#: ../src/core/delete.c:141
 | 
			
		||||
#: ../src/core/delete.c:143
 | 
			
		||||
msgid "_Wait"
 | 
			
		||||
msgstr "_Laukti"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/delete.c:141
 | 
			
		||||
#: ../src/core/delete.c:143
 | 
			
		||||
msgid "_Force Quit"
 | 
			
		||||
msgstr "_Priverstinai išeiti"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/display.c:547
 | 
			
		||||
#: ../src/core/display.c:448
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Failed to open X Window System display '%s'\n"
 | 
			
		||||
msgstr "Nepavyko atverti X Window sistemos ekrano „%s“\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:176
 | 
			
		||||
#: ../src/core/main.c:172
 | 
			
		||||
msgid "Disable connection to session manager"
 | 
			
		||||
msgstr "Išjungti susijungimą su sesijos valdykle"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:182
 | 
			
		||||
#: ../src/core/main.c:178
 | 
			
		||||
msgid "Replace the running window manager"
 | 
			
		||||
msgstr "Pakeisti veikiančią langų valdyklę"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:188
 | 
			
		||||
#: ../src/core/main.c:184
 | 
			
		||||
msgid "Specify session management ID"
 | 
			
		||||
msgstr "Nurodyti sesijos valdymo ID"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:193
 | 
			
		||||
#: ../src/core/main.c:189
 | 
			
		||||
msgid "X Display to use"
 | 
			
		||||
msgstr "Naudotinas X ekranas"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:199
 | 
			
		||||
#: ../src/core/main.c:195
 | 
			
		||||
msgid "Initialize session from savefile"
 | 
			
		||||
msgstr "Inicializuoti sesiją iš išsaugojimo failo"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:205
 | 
			
		||||
#: ../src/core/main.c:201
 | 
			
		||||
msgid "Make X calls synchronous"
 | 
			
		||||
msgstr "Sinchronizuoti X iškvietimus"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:212
 | 
			
		||||
#: ../src/core/main.c:207
 | 
			
		||||
msgid "Run as a wayland compositor"
 | 
			
		||||
msgstr "Vykdyti kaip wayland kompozitorių"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:220
 | 
			
		||||
#: ../src/core/main.c:214
 | 
			
		||||
msgid "Run as a full display server, rather than nested"
 | 
			
		||||
msgstr "Vykdyti kaip visą vaizduoklio serverį, o ne vidinį"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:451
 | 
			
		||||
#: ../src/core/main.c:448
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Failed to scan themes directory: %s\n"
 | 
			
		||||
msgstr "Nepavyko nuskanuoti temų aplanko: %s\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:467
 | 
			
		||||
#: ../src/core/main.c:464
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Could not find a theme! Be sure %s exists and contains the usual themes.\n"
 | 
			
		||||
@@ -574,17 +553,17 @@ msgstr "Parodyti versiją"
 | 
			
		||||
msgid "Mutter plugin to use"
 | 
			
		||||
msgstr "Naudojamas Mutter įskiepis"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/prefs.c:2101
 | 
			
		||||
#: ../src/core/prefs.c:2086
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Workspace %d"
 | 
			
		||||
msgstr "Darbalaukis %d"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/screen.c:548
 | 
			
		||||
#: ../src/core/screen.c:539
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Screen %d on display '%s' is invalid\n"
 | 
			
		||||
msgstr "Ekranas %d vaizduoklyje „%s“ netinkamas\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/screen.c:564
 | 
			
		||||
#: ../src/core/screen.c:555
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Screen %d on display \"%s\" already has a window manager; try using the --"
 | 
			
		||||
@@ -593,7 +572,7 @@ msgstr ""
 | 
			
		||||
"Ekranas %d vaizduoklyje „%s“ jau turi langų valdyklę; pabandykite "
 | 
			
		||||
"pasinaudoti parinktimi --replace, jei norite pakeisti esamą langų valdyklę.\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/screen.c:657
 | 
			
		||||
#: ../src/core/screen.c:660
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Screen %d on display \"%s\" already has a window manager\n"
 | 
			
		||||
msgstr "Ekranas %d vaizduoklyje „%s“ jau turi langų valdyklę\n"
 | 
			
		||||
@@ -861,7 +840,7 @@ msgstr "Koordinačių išraiška neturi jokių operatorių ar operandų"
 | 
			
		||||
msgid "Theme contained an expression that resulted in an error: %s\n"
 | 
			
		||||
msgstr "Temoje esanti išraiška sukėlė klaidą: %s\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:4455
 | 
			
		||||
#: ../src/ui/theme.c:4467
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"<button function=\"%s\" state=\"%s\" draw_ops=\"whatever\"/> must be "
 | 
			
		||||
@@ -870,25 +849,25 @@ msgstr ""
 | 
			
		||||
"Šiam rėmelio stiliui turi būti nurodytas <button function=\"%s\" state=\"%s"
 | 
			
		||||
"\" draw_ops=\"kažkokswhatever\"/> požymis"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:4970 ../src/ui/theme.c:4995
 | 
			
		||||
#: ../src/ui/theme.c:4982 ../src/ui/theme.c:5007
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Missing <frame state=\"%s\" resize=\"%s\" focus=\"%s\" style=\"whatever\"/>"
 | 
			
		||||
msgstr ""
 | 
			
		||||
"Trūksta <frame state=\"%s\" resize=\"%s\" focus=\"%s\" style=\"kažkoks\"/>"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:5041
 | 
			
		||||
#: ../src/ui/theme.c:5053
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Failed to load theme \"%s\": %s\n"
 | 
			
		||||
msgstr "Nepavyko paleisti temos \"%s\": %s\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:5177 ../src/ui/theme.c:5184 ../src/ui/theme.c:5191
 | 
			
		||||
#: ../src/ui/theme.c:5198 ../src/ui/theme.c:5205
 | 
			
		||||
#: ../src/ui/theme.c:5189 ../src/ui/theme.c:5196 ../src/ui/theme.c:5203
 | 
			
		||||
#: ../src/ui/theme.c:5210 ../src/ui/theme.c:5217
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "No <%s> set for theme \"%s\""
 | 
			
		||||
msgstr "Temoje \"%2$s\" trūksta <%1$s> nustatymų"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:5213
 | 
			
		||||
#: ../src/ui/theme.c:5225
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"No frame style set for window type \"%s\" in theme \"%s\", add a <window "
 | 
			
		||||
@@ -897,7 +876,7 @@ msgstr ""
 | 
			
		||||
"Rėmelio stilius nenurodytas lango tipui \"%s\" temoje \"%s\", pridėkite "
 | 
			
		||||
"<window type=\"%s\" style_set=\"kažkoks\"/> elementą"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:5620 ../src/ui/theme.c:5682 ../src/ui/theme.c:5745
 | 
			
		||||
#: ../src/ui/theme.c:5632 ../src/ui/theme.c:5694 ../src/ui/theme.c:5757
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"User-defined constants must begin with a capital letter; \"%s\" does not"
 | 
			
		||||
@@ -905,7 +884,7 @@ msgstr ""
 | 
			
		||||
"Naudotojo nustatytos konstantos turi prasidėti didžiąja raide; „%s“ nėra "
 | 
			
		||||
"didžioji"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:5628 ../src/ui/theme.c:5690 ../src/ui/theme.c:5753
 | 
			
		||||
#: ../src/ui/theme.c:5640 ../src/ui/theme.c:5702 ../src/ui/theme.c:5765
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Constant \"%s\" has already been defined"
 | 
			
		||||
msgstr "Konstanta „%s“ jau aprašyta"
 | 
			
		||||
@@ -1302,7 +1281,7 @@ msgstr ""
 | 
			
		||||
"Šie langai nepalaiko "išsaugoti esamus nustatymus" komandos ir "
 | 
			
		||||
"turi būti paleisti rankiniu būdu, kai prisijungsite kitą kartą."
 | 
			
		||||
 | 
			
		||||
#: ../src/x11/window-props.c:515
 | 
			
		||||
#: ../src/x11/window-props.c:465
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "%s (on %s)"
 | 
			
		||||
msgstr "%s (kompiuteryje %s)"
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										11
									
								
								po/nb.po
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								po/nb.po
									
									
									
									
									
								
							@@ -6,7 +6,7 @@ msgid ""
 | 
			
		||||
msgstr ""
 | 
			
		||||
"Project-Id-Version: mutter 3.13.x\n"
 | 
			
		||||
"Report-Msgid-Bugs-To: \n"
 | 
			
		||||
"POT-Creation-Date: 2014-09-06 14:13+0200\n"
 | 
			
		||||
"POT-Creation-Date: 2014-08-23 13:36+0200\n"
 | 
			
		||||
"PO-Revision-Date: 2014-08-23 13:37+0200\n"
 | 
			
		||||
"Last-Translator: Kjartan Maraas <kmaraas@gnome.org>\n"
 | 
			
		||||
"Language-Team: Norwegian bokmål <i18n-no@lister.ping.uio.no>\n"
 | 
			
		||||
@@ -445,13 +445,17 @@ 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:443
 | 
			
		||||
#: ../src/compositor/compositor.c:441
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Another compositing manager is already running on screen %i on display \"%s"
 | 
			
		||||
"\"."
 | 
			
		||||
msgstr "En annen compositing manager kjører skjerm %i på display «%s»."
 | 
			
		||||
 | 
			
		||||
#: ../src/compositor/meta-background.c:1044
 | 
			
		||||
msgid "background texture could not be created from file"
 | 
			
		||||
msgstr "bakgrunnstekstur kunne ikke lages fra fil"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/bell.c:185
 | 
			
		||||
msgid "Bell event"
 | 
			
		||||
msgstr "Klokkehendelse"
 | 
			
		||||
@@ -1265,6 +1269,3 @@ msgstr ""
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "%s (on %s)"
 | 
			
		||||
msgstr "%s (på %s)"
 | 
			
		||||
 | 
			
		||||
#~ msgid "background texture could not be created from file"
 | 
			
		||||
#~ msgstr "bakgrunnstekstur kunne ikke lages fra fil"
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										1300
									
								
								po/sr@latin.po
									
									
									
									
									
								
							
							
						
						
									
										1300
									
								
								po/sr@latin.po
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										1240
									
								
								po/zh_CN.po
									
									
									
									
									
								
							
							
						
						
									
										1240
									
								
								po/zh_CN.po
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -1,51 +0,0 @@
 | 
			
		||||
# A framework for running scripted tests
 | 
			
		||||
 | 
			
		||||
if HAVE_WAYLAND
 | 
			
		||||
 | 
			
		||||
if BUILDOPT_INSTALL_TESTS
 | 
			
		||||
stackingdir = $(pkgdatadir)/tests/stacking
 | 
			
		||||
dist_stacking_DATA =				\
 | 
			
		||||
	tests/stacking/basic-x11.metatest	\
 | 
			
		||||
	tests/stacking/basic-wayland.metatest	\
 | 
			
		||||
	tests/stacking/minimized.metatest   	\
 | 
			
		||||
	tests/stacking/mixed-windows.metatest   \
 | 
			
		||||
	tests/stacking/override-redirect.metatest
 | 
			
		||||
 | 
			
		||||
mutter-all.test: tests/mutter-all.test.in
 | 
			
		||||
	$(AM_V_GEN) sed  -e "s|@libexecdir[@]|$(libexecdir)|g"  $< > $@.tmp && mv $@.tmp $@
 | 
			
		||||
 | 
			
		||||
installedtestsdir = $(datadir)/installed-tests/mutter
 | 
			
		||||
installedtests_DATA = mutter-all.test
 | 
			
		||||
 | 
			
		||||
installedtestsbindir = $(libexecdir)/installed-tests/mutter
 | 
			
		||||
installedtestsbin_PROGRAMS = mutter-test-client mutter-test-runner
 | 
			
		||||
else
 | 
			
		||||
noinst_PROGRAMS += mutter-test-client mutter-test-runner
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
EXTRA_DIST += tests/mutter-all.test.in
 | 
			
		||||
 | 
			
		||||
mutter_test_client_SOURCES = tests/test-client.c
 | 
			
		||||
mutter_test_client_LDADD = $(MUTTER_LIBS) libmutter.la
 | 
			
		||||
 | 
			
		||||
mutter_test_runner_SOURCES = tests/test-runner.c
 | 
			
		||||
mutter_test_runner_LDADD = $(MUTTER_LIBS) libmutter.la
 | 
			
		||||
 | 
			
		||||
.PHONY: run-tests
 | 
			
		||||
 | 
			
		||||
run-tests: mutter-test-client mutter-test-runner
 | 
			
		||||
	./mutter-test-runner $(dist_stacking_DATA)
 | 
			
		||||
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
# Some random test programs for bits of the code
 | 
			
		||||
 | 
			
		||||
testboxes_SOURCES = core/testboxes.c
 | 
			
		||||
testgradient_SOURCES = ui/testgradient.c
 | 
			
		||||
testasyncgetprop_SOURCES = x11/testasyncgetprop.c
 | 
			
		||||
 | 
			
		||||
noinst_PROGRAMS+=testboxes testgradient testasyncgetprop
 | 
			
		||||
 | 
			
		||||
testboxes_LDADD = $(MUTTER_LIBS) libmutter.la
 | 
			
		||||
testgradient_LDADD = $(MUTTER_LIBS) libmutter.la
 | 
			
		||||
testasyncgetprop_LDADD = $(MUTTER_LIBS) libmutter.la
 | 
			
		||||
@@ -5,8 +5,6 @@ lib_LTLIBRARIES = libmutter.la
 | 
			
		||||
 | 
			
		||||
SUBDIRS=compositor/plugins
 | 
			
		||||
 | 
			
		||||
EXTRA_DIST =
 | 
			
		||||
 | 
			
		||||
AM_CPPFLAGS = \
 | 
			
		||||
	-DCLUTTER_ENABLE_COMPOSITOR_API					\
 | 
			
		||||
	-DCLUTTER_ENABLE_EXPERIMENTAL_API				\
 | 
			
		||||
@@ -109,10 +107,6 @@ libmutter_la_SOURCES =				\
 | 
			
		||||
	compositor/meta-background-group.c	\
 | 
			
		||||
	compositor/meta-cullable.c		\
 | 
			
		||||
	compositor/meta-cullable.h		\
 | 
			
		||||
	compositor/meta-dnd-actor.c		\
 | 
			
		||||
	compositor/meta-dnd-actor-private.h	\
 | 
			
		||||
	compositor/meta-feedback-actor.c	\
 | 
			
		||||
	compositor/meta-feedback-actor-private.h	\
 | 
			
		||||
	compositor/meta-module.c		\
 | 
			
		||||
	compositor/meta-module.h		\
 | 
			
		||||
	compositor/meta-plugin.c		\
 | 
			
		||||
@@ -234,10 +228,6 @@ libmutter_la_SOURCES +=				\
 | 
			
		||||
	wayland/meta-xwayland.c			\
 | 
			
		||||
	wayland/meta-xwayland.h			\
 | 
			
		||||
	wayland/meta-xwayland-private.h		\
 | 
			
		||||
	wayland/meta-wayland-buffer.c      	\
 | 
			
		||||
	wayland/meta-wayland-buffer.h      	\
 | 
			
		||||
	wayland/meta-wayland-region.c      	\
 | 
			
		||||
	wayland/meta-wayland-region.h      	\
 | 
			
		||||
	wayland/meta-wayland-data-device.c      \
 | 
			
		||||
	wayland/meta-wayland-data-device.h      \
 | 
			
		||||
	wayland/meta-wayland-keyboard.c		\
 | 
			
		||||
@@ -335,7 +325,6 @@ nodist_libmutterinclude_HEADERS =		\
 | 
			
		||||
	$(libmutterinclude_built_headers)
 | 
			
		||||
 | 
			
		||||
bin_PROGRAMS=mutter
 | 
			
		||||
noinst_PROGRAMS=
 | 
			
		||||
 | 
			
		||||
mutter_SOURCES = core/mutter.c
 | 
			
		||||
mutter_LDADD = $(MUTTER_LIBS) libmutter.la
 | 
			
		||||
@@ -344,8 +333,6 @@ libexec_PROGRAMS = mutter-restart-helper
 | 
			
		||||
mutter_restart_helper_SOURCES = core/restart-helper.c
 | 
			
		||||
mutter_restart_helper_LDADD = $(MUTTER_LIBS)
 | 
			
		||||
 | 
			
		||||
include Makefile-tests.am
 | 
			
		||||
 | 
			
		||||
if HAVE_INTROSPECTION
 | 
			
		||||
include $(INTROSPECTION_MAKEFILE)
 | 
			
		||||
 | 
			
		||||
@@ -379,6 +366,16 @@ Meta-$(api_version).gir: libmutter.la
 | 
			
		||||
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
testboxes_SOURCES = core/testboxes.c
 | 
			
		||||
testgradient_SOURCES = ui/testgradient.c
 | 
			
		||||
testasyncgetprop_SOURCES = x11/testasyncgetprop.c
 | 
			
		||||
 | 
			
		||||
noinst_PROGRAMS=testboxes testgradient testasyncgetprop
 | 
			
		||||
 | 
			
		||||
testboxes_LDADD = $(MUTTER_LIBS) libmutter.la
 | 
			
		||||
testgradient_LDADD = $(MUTTER_LIBS) libmutter.la
 | 
			
		||||
testasyncgetprop_LDADD = $(MUTTER_LIBS) libmutter.la
 | 
			
		||||
 | 
			
		||||
dbus_idle_built_sources = meta-dbus-idle-monitor.c meta-dbus-idle-monitor.h
 | 
			
		||||
 | 
			
		||||
CLEANFILES =					\
 | 
			
		||||
@@ -392,7 +389,7 @@ DISTCLEANFILES = 				\
 | 
			
		||||
pkgconfigdir = $(libdir)/pkgconfig
 | 
			
		||||
pkgconfig_DATA = libmutter.pc
 | 
			
		||||
 | 
			
		||||
EXTRA_DIST +=				\
 | 
			
		||||
EXTRA_DIST =				\
 | 
			
		||||
	$(wayland_protocols)		\
 | 
			
		||||
	libmutter.pc.in \
 | 
			
		||||
	mutter-enum-types.h.in \
 | 
			
		||||
 
 | 
			
		||||
@@ -189,5 +189,7 @@ struct MonitorInfo
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
MonitorInfo *decode_edid (const uchar *data);
 | 
			
		||||
char *make_display_name (const MonitorInfo *info);
 | 
			
		||||
char *make_display_size_string (int width_mm, int height_mm);
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -97,62 +97,6 @@ on_monitors_changed (MetaMonitorManager *monitors,
 | 
			
		||||
  meta_backend_sync_screen_size (backend);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static MetaIdleMonitor *
 | 
			
		||||
meta_backend_create_idle_monitor (MetaBackend *backend,
 | 
			
		||||
                                  int          device_id)
 | 
			
		||||
{
 | 
			
		||||
  return META_BACKEND_GET_CLASS (backend)->create_idle_monitor (backend, device_id);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
create_device_monitor (MetaBackend *backend,
 | 
			
		||||
                       int          device_id)
 | 
			
		||||
{
 | 
			
		||||
  g_assert (backend->device_monitors[device_id] == NULL);
 | 
			
		||||
 | 
			
		||||
  backend->device_monitors[device_id] = meta_backend_create_idle_monitor (backend, device_id);
 | 
			
		||||
  backend->device_id_max = MAX (backend->device_id_max, device_id);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
destroy_device_monitor (MetaBackend *backend,
 | 
			
		||||
                        int          device_id)
 | 
			
		||||
{
 | 
			
		||||
  g_clear_object (&backend->device_monitors[device_id]);
 | 
			
		||||
 | 
			
		||||
  if (device_id == backend->device_id_max)
 | 
			
		||||
    {
 | 
			
		||||
      /* Reset the max device ID */
 | 
			
		||||
      int i, new_max = 0;
 | 
			
		||||
      for (i = 0; i < backend->device_id_max; i++)
 | 
			
		||||
        if (backend->device_monitors[i] != NULL)
 | 
			
		||||
          new_max = i;
 | 
			
		||||
      backend->device_id_max = new_max;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
on_device_added (ClutterDeviceManager *device_manager,
 | 
			
		||||
                 ClutterInputDevice   *device,
 | 
			
		||||
                 gpointer              user_data)
 | 
			
		||||
{
 | 
			
		||||
  MetaBackend *backend = META_BACKEND (user_data);
 | 
			
		||||
  int device_id = clutter_input_device_get_device_id (device);
 | 
			
		||||
 | 
			
		||||
  create_device_monitor (backend, device_id);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
on_device_removed (ClutterDeviceManager *device_manager,
 | 
			
		||||
                   ClutterInputDevice   *device,
 | 
			
		||||
                   gpointer              user_data)
 | 
			
		||||
{
 | 
			
		||||
  MetaBackend *backend = META_BACKEND (user_data);
 | 
			
		||||
  int device_id = clutter_input_device_get_device_id (device);
 | 
			
		||||
 | 
			
		||||
  destroy_device_monitor (backend, device_id);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_backend_real_post_init (MetaBackend *backend)
 | 
			
		||||
{
 | 
			
		||||
@@ -169,30 +113,6 @@ meta_backend_real_post_init (MetaBackend *backend)
 | 
			
		||||
  meta_backend_sync_screen_size (backend);
 | 
			
		||||
 | 
			
		||||
  priv->cursor_renderer = META_BACKEND_GET_CLASS (backend)->create_cursor_renderer (backend);
 | 
			
		||||
 | 
			
		||||
  {
 | 
			
		||||
    ClutterDeviceManager *manager;
 | 
			
		||||
    GSList *devices, *l;
 | 
			
		||||
 | 
			
		||||
    /* Create the core device monitor. */
 | 
			
		||||
    create_device_monitor (backend, 0);
 | 
			
		||||
 | 
			
		||||
    manager = clutter_device_manager_get_default ();
 | 
			
		||||
    g_signal_connect_object (manager, "device-added",
 | 
			
		||||
                             G_CALLBACK (on_device_added), backend, 0);
 | 
			
		||||
    g_signal_connect_object (manager, "device-removed",
 | 
			
		||||
                             G_CALLBACK (on_device_removed), backend, 0);
 | 
			
		||||
 | 
			
		||||
    devices = clutter_device_manager_list_devices (manager);
 | 
			
		||||
 | 
			
		||||
    for (l = devices; l != NULL; l = l->next)
 | 
			
		||||
      {
 | 
			
		||||
        ClutterInputDevice *device = l->data;
 | 
			
		||||
        on_device_added (manager, device, backend);
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
    g_slist_free (devices);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static MetaCursorRenderer *
 | 
			
		||||
@@ -254,12 +174,6 @@ meta_backend_class_init (MetaBackendClass *klass)
 | 
			
		||||
                0,
 | 
			
		||||
                NULL, NULL, NULL,
 | 
			
		||||
                G_TYPE_NONE, 0);
 | 
			
		||||
  g_signal_new ("keymap-layout-group-changed",
 | 
			
		||||
                G_TYPE_FROM_CLASS (object_class),
 | 
			
		||||
                G_SIGNAL_RUN_LAST,
 | 
			
		||||
                0,
 | 
			
		||||
                NULL, NULL, NULL,
 | 
			
		||||
                G_TYPE_NONE, 1, G_TYPE_UINT);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
@@ -268,6 +182,23 @@ meta_backend_init (MetaBackend *backend)
 | 
			
		||||
  _backend = backend;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* FIXME -- destroy device monitors at some point */
 | 
			
		||||
G_GNUC_UNUSED static void
 | 
			
		||||
destroy_device_monitor (MetaBackend *backend,
 | 
			
		||||
                        int          device_id)
 | 
			
		||||
{
 | 
			
		||||
  g_clear_object (&backend->device_monitors[device_id]);
 | 
			
		||||
  if (device_id == backend->device_id_max)
 | 
			
		||||
    backend->device_id_max--;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static MetaIdleMonitor *
 | 
			
		||||
meta_backend_create_idle_monitor (MetaBackend *backend,
 | 
			
		||||
                                  int          device_id)
 | 
			
		||||
{
 | 
			
		||||
  return META_BACKEND_GET_CLASS (backend)->create_idle_monitor (backend, device_id);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_backend_post_init (MetaBackend *backend)
 | 
			
		||||
{
 | 
			
		||||
@@ -283,6 +214,12 @@ meta_backend_get_idle_monitor (MetaBackend *backend,
 | 
			
		||||
{
 | 
			
		||||
  g_return_val_if_fail (device_id >= 0 && device_id < 256, NULL);
 | 
			
		||||
 | 
			
		||||
  if (!backend->device_monitors[device_id])
 | 
			
		||||
    {
 | 
			
		||||
      backend->device_monitors[device_id] = meta_backend_create_idle_monitor (backend, device_id);
 | 
			
		||||
      backend->device_id_max = MAX (backend->device_id_max, device_id);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  return backend->device_monitors[device_id];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -460,7 +397,6 @@ static GSourceFuncs event_funcs = {
 | 
			
		||||
void
 | 
			
		||||
meta_clutter_init (void)
 | 
			
		||||
{
 | 
			
		||||
  ClutterSettings *clutter_settings;
 | 
			
		||||
  GSource *source;
 | 
			
		||||
 | 
			
		||||
  meta_create_backend ();
 | 
			
		||||
@@ -468,13 +404,6 @@ meta_clutter_init (void)
 | 
			
		||||
  if (clutter_init (NULL, NULL) != CLUTTER_INIT_SUCCESS)
 | 
			
		||||
    g_error ("Unable to initialize Clutter.\n");
 | 
			
		||||
 | 
			
		||||
  /*
 | 
			
		||||
   * 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);
 | 
			
		||||
 | 
			
		||||
  source = g_source_new (&event_funcs, sizeof (GSource));
 | 
			
		||||
  g_source_attach (source, NULL);
 | 
			
		||||
  g_source_unref (source);
 | 
			
		||||
 
 | 
			
		||||
@@ -29,11 +29,8 @@
 | 
			
		||||
 | 
			
		||||
typedef struct {
 | 
			
		||||
  CoglTexture2D *texture;
 | 
			
		||||
  int hot_x, hot_y;
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_NATIVE_BACKEND
 | 
			
		||||
  struct gbm_bo *bo;
 | 
			
		||||
#endif
 | 
			
		||||
  int hot_x, hot_y;
 | 
			
		||||
} MetaCursorImage;
 | 
			
		||||
 | 
			
		||||
struct _MetaCursorReference {
 | 
			
		||||
@@ -47,10 +44,8 @@ CoglTexture *meta_cursor_reference_get_cogl_texture (MetaCursorReference *cursor
 | 
			
		||||
                                                     int                 *hot_x,
 | 
			
		||||
                                                     int                 *hot_y);
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_NATIVE_BACKEND
 | 
			
		||||
struct gbm_bo *meta_cursor_reference_get_gbm_bo (MetaCursorReference *cursor,
 | 
			
		||||
                                                 int                 *hot_x,
 | 
			
		||||
                                                 int                 *hot_y);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* META_CURSOR_PRIVATE_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -56,11 +56,8 @@ static void
 | 
			
		||||
meta_cursor_image_free (MetaCursorImage *image)
 | 
			
		||||
{
 | 
			
		||||
  cogl_object_unref (image->texture);
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_NATIVE_BACKEND
 | 
			
		||||
  if (image->bo)
 | 
			
		||||
    gbm_bo_destroy (image->bo);
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
@@ -142,90 +139,70 @@ load_cursor_on_client (MetaCursor cursor)
 | 
			
		||||
                                  meta_prefs_get_cursor_size ());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_NATIVE_BACKEND
 | 
			
		||||
static void
 | 
			
		||||
get_hardware_cursor_size (uint64_t *cursor_width, uint64_t *cursor_height)
 | 
			
		||||
{
 | 
			
		||||
  MetaBackend *meta_backend = meta_get_backend ();
 | 
			
		||||
  MetaCursorRenderer *renderer = meta_backend_get_cursor_renderer (meta_backend);
 | 
			
		||||
 | 
			
		||||
  if (META_IS_CURSOR_RENDERER_NATIVE (renderer))
 | 
			
		||||
    {
 | 
			
		||||
      meta_cursor_renderer_native_get_cursor_size (META_CURSOR_RENDERER_NATIVE (renderer), cursor_width, cursor_height);
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  g_assert_not_reached ();
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_NATIVE_BACKEND
 | 
			
		||||
static void
 | 
			
		||||
meta_cursor_image_load_gbm_buffer (struct gbm_device *gbm,
 | 
			
		||||
                                   MetaCursorImage   *image,
 | 
			
		||||
                                   uint8_t           *pixels,
 | 
			
		||||
                                   uint               width,
 | 
			
		||||
                                   uint               height,
 | 
			
		||||
                                   int                width,
 | 
			
		||||
                                   int                height,
 | 
			
		||||
                                   int                rowstride,
 | 
			
		||||
                                   uint32_t           gbm_format)
 | 
			
		||||
{
 | 
			
		||||
  uint64_t cursor_width, cursor_height;
 | 
			
		||||
  get_hardware_cursor_size (&cursor_width, &cursor_height);
 | 
			
		||||
 | 
			
		||||
  if (width > cursor_width || height > cursor_height)
 | 
			
		||||
  if (width > 64 || height > 64)
 | 
			
		||||
    {
 | 
			
		||||
      meta_warning ("Invalid theme cursor size (must be at most %ux%u)\n",
 | 
			
		||||
                    (unsigned int)cursor_width, (unsigned int)cursor_height);
 | 
			
		||||
      meta_warning ("Invalid theme cursor size (must be at most 64x64)\n");
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  if (gbm_device_is_format_supported (gbm, gbm_format,
 | 
			
		||||
                                      GBM_BO_USE_CURSOR | GBM_BO_USE_WRITE))
 | 
			
		||||
                                      GBM_BO_USE_CURSOR_64X64 | GBM_BO_USE_WRITE))
 | 
			
		||||
    {
 | 
			
		||||
      uint8_t buf[4 * cursor_width * cursor_height];
 | 
			
		||||
      uint i;
 | 
			
		||||
      uint8_t buf[4 * 64 * 64];
 | 
			
		||||
      int i;
 | 
			
		||||
 | 
			
		||||
      image->bo = gbm_bo_create (gbm, cursor_width, cursor_height,
 | 
			
		||||
                                 gbm_format, GBM_BO_USE_CURSOR | GBM_BO_USE_WRITE);
 | 
			
		||||
      image->bo = gbm_bo_create (gbm, 64, 64,
 | 
			
		||||
                                 gbm_format, GBM_BO_USE_CURSOR_64X64 | GBM_BO_USE_WRITE);
 | 
			
		||||
 | 
			
		||||
      memset (buf, 0, sizeof(buf));
 | 
			
		||||
      for (i = 0; i < height; i++)
 | 
			
		||||
        memcpy (buf + i * 4 * cursor_width, pixels + i * rowstride, width * 4);
 | 
			
		||||
        memcpy (buf + i * 4 * 64, pixels + i * rowstride, width * 4);
 | 
			
		||||
 | 
			
		||||
      gbm_bo_write (image->bo, buf, cursor_width * cursor_height * 4);
 | 
			
		||||
      gbm_bo_write (image->bo, buf, 64 * 64 * 4);
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    meta_warning ("HW cursor for format %d not supported\n", gbm_format);
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_NATIVE_BACKEND
 | 
			
		||||
static struct gbm_device *
 | 
			
		||||
get_gbm_device (void)
 | 
			
		||||
{
 | 
			
		||||
#ifdef HAVE_NATIVE_BACKEND
 | 
			
		||||
  MetaBackend *meta_backend = meta_get_backend ();
 | 
			
		||||
  MetaCursorRenderer *renderer = meta_backend_get_cursor_renderer (meta_backend);
 | 
			
		||||
 | 
			
		||||
  if (META_IS_CURSOR_RENDERER_NATIVE (renderer))
 | 
			
		||||
    return meta_cursor_renderer_native_get_gbm_device (META_CURSOR_RENDERER_NATIVE (renderer));
 | 
			
		||||
  else
 | 
			
		||||
    return NULL;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
  return NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_cursor_image_load_from_xcursor_image (MetaCursorImage   *image,
 | 
			
		||||
                                           XcursorImage      *xc_image)
 | 
			
		||||
{
 | 
			
		||||
  uint width, height, rowstride;
 | 
			
		||||
  int width, height, rowstride;
 | 
			
		||||
  CoglPixelFormat cogl_format;
 | 
			
		||||
  uint32_t gbm_format;
 | 
			
		||||
  ClutterBackend *clutter_backend;
 | 
			
		||||
  CoglContext *cogl_context;
 | 
			
		||||
  struct gbm_device *gbm;
 | 
			
		||||
 | 
			
		||||
  width           = xc_image->width;
 | 
			
		||||
  height          = xc_image->height;
 | 
			
		||||
  rowstride       = width * 4;
 | 
			
		||||
 | 
			
		||||
  gbm_format = GBM_FORMAT_ARGB8888;
 | 
			
		||||
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
 | 
			
		||||
  cogl_format = COGL_PIXEL_FORMAT_BGRA_8888;
 | 
			
		||||
#else
 | 
			
		||||
@@ -244,15 +221,13 @@ meta_cursor_image_load_from_xcursor_image (MetaCursorImage   *image,
 | 
			
		||||
                                                  (uint8_t *) xc_image->pixels,
 | 
			
		||||
                                                  NULL);
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_NATIVE_BACKEND
 | 
			
		||||
  struct gbm_device *gbm = get_gbm_device ();
 | 
			
		||||
  gbm = get_gbm_device ();
 | 
			
		||||
  if (gbm)
 | 
			
		||||
    meta_cursor_image_load_gbm_buffer (gbm,
 | 
			
		||||
                                       image,
 | 
			
		||||
                                       (uint8_t *) xc_image->pixels,
 | 
			
		||||
                                       width, height, rowstride,
 | 
			
		||||
                                       GBM_FORMAT_ARGB8888);
 | 
			
		||||
#endif
 | 
			
		||||
                                       gbm_format);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
MetaCursorReference *
 | 
			
		||||
@@ -281,8 +256,13 @@ meta_cursor_image_load_from_buffer (MetaCursorImage    *image,
 | 
			
		||||
                                    int                 hot_x,
 | 
			
		||||
                                    int                 hot_y)
 | 
			
		||||
{
 | 
			
		||||
  struct gbm_device *gbm = get_gbm_device ();
 | 
			
		||||
 | 
			
		||||
  ClutterBackend *backend;
 | 
			
		||||
  CoglContext *cogl_context;
 | 
			
		||||
  struct wl_shm_buffer *shm_buffer;
 | 
			
		||||
  uint32_t gbm_format;
 | 
			
		||||
  int width, height;
 | 
			
		||||
 | 
			
		||||
  image->hot_x = hot_x;
 | 
			
		||||
  image->hot_y = hot_y;
 | 
			
		||||
@@ -292,19 +272,13 @@ meta_cursor_image_load_from_buffer (MetaCursorImage    *image,
 | 
			
		||||
 | 
			
		||||
  image->texture = cogl_wayland_texture_2d_new_from_buffer (cogl_context, buffer, NULL);
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_NATIVE_BACKEND
 | 
			
		||||
  struct gbm_device *gbm = get_gbm_device ();
 | 
			
		||||
  if (gbm)
 | 
			
		||||
  width = cogl_texture_get_width (COGL_TEXTURE (image->texture));
 | 
			
		||||
  height = cogl_texture_get_height (COGL_TEXTURE (image->texture));
 | 
			
		||||
 | 
			
		||||
  shm_buffer = wl_shm_buffer_get (buffer);
 | 
			
		||||
  if (shm_buffer)
 | 
			
		||||
    {
 | 
			
		||||
      uint32_t gbm_format;
 | 
			
		||||
      uint64_t cursor_width, cursor_height;
 | 
			
		||||
      uint width, height;
 | 
			
		||||
 | 
			
		||||
      width = cogl_texture_get_width (COGL_TEXTURE (image->texture));
 | 
			
		||||
      height = cogl_texture_get_height (COGL_TEXTURE (image->texture));
 | 
			
		||||
 | 
			
		||||
      struct wl_shm_buffer *shm_buffer = wl_shm_buffer_get (buffer);
 | 
			
		||||
      if (shm_buffer)
 | 
			
		||||
      if (gbm)
 | 
			
		||||
        {
 | 
			
		||||
          int rowstride = wl_shm_buffer_get_stride (shm_buffer);
 | 
			
		||||
 | 
			
		||||
@@ -336,28 +310,29 @@ meta_cursor_image_load_from_buffer (MetaCursorImage    *image,
 | 
			
		||||
                                             width, height, rowstride,
 | 
			
		||||
                                             gbm_format);
 | 
			
		||||
        }
 | 
			
		||||
      else
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    {
 | 
			
		||||
      /* HW cursors must be 64x64, but 64x64 is huge, and no cursor theme actually uses
 | 
			
		||||
         that, so themed cursors must be padded with transparent pixels to fill the
 | 
			
		||||
         overlay. This is trivial if we have CPU access to the data, but it's not
 | 
			
		||||
         possible if the buffer is in GPU memory (and possibly tiled too), so if we
 | 
			
		||||
         don't get the right size, we fallback to GL.
 | 
			
		||||
      */
 | 
			
		||||
      if (width != 64 || height != 64)
 | 
			
		||||
        {
 | 
			
		||||
          /* HW cursors have a predefined size (at least 64x64), which usually is bigger than cursor theme
 | 
			
		||||
             size, so themed cursors must be padded with transparent pixels to fill the
 | 
			
		||||
             overlay. This is trivial if we have CPU access to the data, but it's not
 | 
			
		||||
             possible if the buffer is in GPU memory (and possibly tiled too), so if we
 | 
			
		||||
             don't get the right size, we fallback to GL.
 | 
			
		||||
          */
 | 
			
		||||
          get_hardware_cursor_size (&cursor_width, &cursor_height);
 | 
			
		||||
          meta_warning ("Invalid cursor size (must be 64x64), falling back to software (GL) cursors\n");
 | 
			
		||||
          return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
          if (width != cursor_width || height != cursor_height)
 | 
			
		||||
            {
 | 
			
		||||
              meta_warning ("Invalid cursor size (must be 64x64), falling back to software (GL) cursors\n");
 | 
			
		||||
              return;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
          image->bo = gbm_bo_import (gbm, GBM_BO_IMPORT_WL_BUFFER, buffer, GBM_BO_USE_CURSOR);
 | 
			
		||||
      if (gbm)
 | 
			
		||||
        {
 | 
			
		||||
          image->bo = gbm_bo_import (gbm, GBM_BO_IMPORT_WL_BUFFER,
 | 
			
		||||
                                     buffer, GBM_BO_USE_CURSOR_64X64);
 | 
			
		||||
          if (!image->bo)
 | 
			
		||||
            meta_warning ("Importing HW cursor from wl_buffer failed\n");
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
MetaCursorReference *
 | 
			
		||||
@@ -387,7 +362,6 @@ meta_cursor_reference_get_cogl_texture (MetaCursorReference *cursor,
 | 
			
		||||
  return COGL_TEXTURE (cursor->image.texture);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_NATIVE_BACKEND
 | 
			
		||||
struct gbm_bo *
 | 
			
		||||
meta_cursor_reference_get_gbm_bo (MetaCursorReference *cursor,
 | 
			
		||||
                                  int                 *hot_x,
 | 
			
		||||
@@ -399,7 +373,6 @@ meta_cursor_reference_get_gbm_bo (MetaCursorReference *cursor,
 | 
			
		||||
    *hot_y = cursor->image.hot_y;
 | 
			
		||||
  return cursor->image.bo;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
MetaCursor
 | 
			
		||||
meta_cursor_reference_get_meta_cursor (MetaCursorReference *cursor)
 | 
			
		||||
 
 | 
			
		||||
@@ -796,6 +796,27 @@ make_config_key (MetaConfiguration *key,
 | 
			
		||||
  key->n_outputs = o;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
gboolean
 | 
			
		||||
meta_monitor_config_match_current (MetaMonitorConfig  *self,
 | 
			
		||||
                                   MetaMonitorManager *manager)
 | 
			
		||||
{
 | 
			
		||||
  MetaOutput *outputs;
 | 
			
		||||
  unsigned n_outputs;
 | 
			
		||||
  MetaConfiguration key;
 | 
			
		||||
  gboolean ok;
 | 
			
		||||
 | 
			
		||||
  if (self->current == NULL)
 | 
			
		||||
    return FALSE;
 | 
			
		||||
 | 
			
		||||
  outputs = meta_monitor_manager_get_outputs (manager, &n_outputs);
 | 
			
		||||
 | 
			
		||||
  make_config_key (&key, outputs, n_outputs, -1);
 | 
			
		||||
  ok = config_equal (&key, self->current);
 | 
			
		||||
 | 
			
		||||
  config_clear (&key);
 | 
			
		||||
  return ok;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
gboolean
 | 
			
		||||
meta_monitor_manager_has_hotplug_mode_update (MetaMonitorManager *manager)
 | 
			
		||||
{
 | 
			
		||||
@@ -924,19 +945,6 @@ laptop_display_is_on (MetaConfiguration *config)
 | 
			
		||||
  return FALSE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static gboolean
 | 
			
		||||
multiple_outputs_are_enabled (MetaConfiguration *config)
 | 
			
		||||
{
 | 
			
		||||
  unsigned int i, enabled;
 | 
			
		||||
 | 
			
		||||
  enabled = 0;
 | 
			
		||||
  for (i = 0; i < config->n_outputs; i++)
 | 
			
		||||
    if (config->outputs[i].enabled)
 | 
			
		||||
      enabled++;
 | 
			
		||||
 | 
			
		||||
  return enabled > 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static MetaConfiguration *
 | 
			
		||||
make_laptop_lid_config (MetaConfiguration  *reference)
 | 
			
		||||
{
 | 
			
		||||
@@ -946,7 +954,7 @@ make_laptop_lid_config (MetaConfiguration  *reference)
 | 
			
		||||
  int x_after, y_after;
 | 
			
		||||
  int x_offset, y_offset;
 | 
			
		||||
 | 
			
		||||
  g_assert (multiple_outputs_are_enabled (reference));
 | 
			
		||||
  g_assert (reference->n_outputs > 1);
 | 
			
		||||
 | 
			
		||||
  new = g_slice_new0 (MetaConfiguration);
 | 
			
		||||
  new->n_outputs = reference->n_outputs;
 | 
			
		||||
@@ -1017,7 +1025,7 @@ meta_monitor_config_apply_stored (MetaMonitorConfig  *self,
 | 
			
		||||
  if (stored)
 | 
			
		||||
    {
 | 
			
		||||
      if (self->lid_is_closed &&
 | 
			
		||||
          multiple_outputs_are_enabled (stored) &&
 | 
			
		||||
          stored->n_outputs > 1 &&
 | 
			
		||||
          laptop_display_is_on (stored))
 | 
			
		||||
        {
 | 
			
		||||
          if (apply_configuration (self, make_laptop_lid_config (stored),
 | 
			
		||||
@@ -1279,7 +1287,7 @@ meta_monitor_config_make_default (MetaMonitorConfig  *self,
 | 
			
		||||
  if (default_config != NULL)
 | 
			
		||||
    {
 | 
			
		||||
      if (self->lid_is_closed &&
 | 
			
		||||
          multiple_outputs_are_enabled (default_config) &&
 | 
			
		||||
          default_config->n_outputs > 1 &&
 | 
			
		||||
          laptop_display_is_on (default_config))
 | 
			
		||||
        {
 | 
			
		||||
          ok = apply_configuration (self, make_laptop_lid_config (default_config),
 | 
			
		||||
@@ -1370,7 +1378,7 @@ turn_off_laptop_display (MetaMonitorConfig  *self,
 | 
			
		||||
{
 | 
			
		||||
  MetaConfiguration *new;
 | 
			
		||||
 | 
			
		||||
  if (!multiple_outputs_are_enabled (self->current))
 | 
			
		||||
  if (self->current->n_outputs == 1)
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  new = make_laptop_lid_config (self->current);
 | 
			
		||||
@@ -1781,6 +1789,7 @@ real_assign_crtcs (CrtcAssignment     *assignment,
 | 
			
		||||
                                output_config->transform,
 | 
			
		||||
                                pass);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
                  if (crtc_assignment_assign (assignment, crtc, &modes[j],
 | 
			
		||||
                                              output_config->rect.x, output_config->rect.y,
 | 
			
		||||
                                              output_config->transform,
 | 
			
		||||
 
 | 
			
		||||
@@ -36,6 +36,9 @@ GType meta_monitor_config_get_type (void) G_GNUC_CONST;
 | 
			
		||||
 | 
			
		||||
MetaMonitorConfig *meta_monitor_config_new (void);
 | 
			
		||||
 | 
			
		||||
gboolean           meta_monitor_config_match_current (MetaMonitorConfig  *config,
 | 
			
		||||
                                                      MetaMonitorManager *manager);
 | 
			
		||||
 | 
			
		||||
gboolean           meta_monitor_config_apply_stored (MetaMonitorConfig  *config,
 | 
			
		||||
                                                     MetaMonitorManager *manager);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -44,6 +44,12 @@ enum {
 | 
			
		||||
  SIGNALS_LAST
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
enum {
 | 
			
		||||
  PROP_0,
 | 
			
		||||
  PROP_POWER_SAVE_MODE,
 | 
			
		||||
  PROP_LAST
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static int signals[SIGNALS_LAST];
 | 
			
		||||
 | 
			
		||||
static void meta_monitor_manager_display_config_init (MetaDBusDisplayConfigIface *iface);
 | 
			
		||||
@@ -161,39 +167,11 @@ make_logical_config (MetaMonitorManager *manager)
 | 
			
		||||
  manager->monitor_infos = (void*)g_array_free (monitor_infos, FALSE);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
power_save_mode_changed (MetaMonitorManager *manager,
 | 
			
		||||
                         GParamSpec         *pspec,
 | 
			
		||||
                         gpointer            user_data)
 | 
			
		||||
{
 | 
			
		||||
  MetaMonitorManagerClass *klass;
 | 
			
		||||
  int mode = meta_dbus_display_config_get_power_save_mode (META_DBUS_DISPLAY_CONFIG (manager));
 | 
			
		||||
 | 
			
		||||
  if (mode == META_POWER_SAVE_UNSUPPORTED)
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  /* If DPMS is unsupported, force the property back. */
 | 
			
		||||
  if (manager->power_save_mode == META_POWER_SAVE_UNSUPPORTED)
 | 
			
		||||
    {
 | 
			
		||||
      meta_dbus_display_config_set_power_save_mode (META_DBUS_DISPLAY_CONFIG (manager), META_POWER_SAVE_UNSUPPORTED);
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  klass = META_MONITOR_MANAGER_GET_CLASS (manager);
 | 
			
		||||
  if (klass->set_power_save_mode)
 | 
			
		||||
    klass->set_power_save_mode (manager, mode);
 | 
			
		||||
 | 
			
		||||
  manager->power_save_mode = mode;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_monitor_manager_constructed (GObject *object)
 | 
			
		||||
{
 | 
			
		||||
  MetaMonitorManager *manager = META_MONITOR_MANAGER (object);
 | 
			
		||||
 | 
			
		||||
  g_signal_connect_object (manager, "notify::power-save-mode",
 | 
			
		||||
                           G_CALLBACK (power_save_mode_changed), manager, 0);
 | 
			
		||||
 | 
			
		||||
  manager->in_init = TRUE;
 | 
			
		||||
 | 
			
		||||
  manager->config = meta_monitor_config_new ();
 | 
			
		||||
@@ -236,6 +214,23 @@ meta_monitor_manager_constructed (GObject *object)
 | 
			
		||||
  manager->in_init = FALSE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_monitor_manager_set_power_save_mode (MetaMonitorManager *manager,
 | 
			
		||||
                                          MetaPowerSave       mode)
 | 
			
		||||
{
 | 
			
		||||
  MetaMonitorManagerClass *klass;
 | 
			
		||||
 | 
			
		||||
  if (manager->power_save_mode == META_POWER_SAVE_UNSUPPORTED ||
 | 
			
		||||
      mode == META_POWER_SAVE_UNSUPPORTED)
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  klass = META_MONITOR_MANAGER_GET_CLASS (manager);
 | 
			
		||||
  if (klass->set_power_save_mode)
 | 
			
		||||
    klass->set_power_save_mode (manager, mode);
 | 
			
		||||
 | 
			
		||||
  manager->power_save_mode = mode;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_monitor_manager_free_output_array (MetaOutput *old_outputs,
 | 
			
		||||
                                        int         n_old_outputs)
 | 
			
		||||
@@ -303,6 +298,44 @@ meta_monitor_manager_dispose (GObject *object)
 | 
			
		||||
  G_OBJECT_CLASS (meta_monitor_manager_parent_class)->dispose (object);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_monitor_manager_set_property (GObject      *object,
 | 
			
		||||
                                   guint         prop_id,
 | 
			
		||||
                                   const GValue *value,
 | 
			
		||||
                                   GParamSpec   *pspec)
 | 
			
		||||
{
 | 
			
		||||
  MetaMonitorManager *self = META_MONITOR_MANAGER (object);
 | 
			
		||||
 | 
			
		||||
  switch (prop_id)
 | 
			
		||||
    {
 | 
			
		||||
    case PROP_POWER_SAVE_MODE:
 | 
			
		||||
      meta_monitor_manager_set_power_save_mode (self, g_value_get_int (value));
 | 
			
		||||
      break;
 | 
			
		||||
    default:
 | 
			
		||||
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
 | 
			
		||||
      break;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_monitor_manager_get_property (GObject      *object,
 | 
			
		||||
                                   guint         prop_id,
 | 
			
		||||
                                   GValue       *value,
 | 
			
		||||
                                   GParamSpec   *pspec)
 | 
			
		||||
{
 | 
			
		||||
  MetaMonitorManager *self = META_MONITOR_MANAGER (object);
 | 
			
		||||
 | 
			
		||||
  switch (prop_id)
 | 
			
		||||
    {
 | 
			
		||||
    case PROP_POWER_SAVE_MODE:
 | 
			
		||||
      g_value_set_int (value, self->power_save_mode);
 | 
			
		||||
      break;
 | 
			
		||||
    default:
 | 
			
		||||
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
 | 
			
		||||
      break;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static GBytes *
 | 
			
		||||
meta_monitor_manager_real_read_edid (MetaMonitorManager *manager,
 | 
			
		||||
                                     MetaOutput         *output)
 | 
			
		||||
@@ -323,6 +356,8 @@ meta_monitor_manager_class_init (MetaMonitorManagerClass *klass)
 | 
			
		||||
  GObjectClass *object_class = G_OBJECT_CLASS (klass);
 | 
			
		||||
 | 
			
		||||
  object_class->constructed = meta_monitor_manager_constructed;
 | 
			
		||||
  object_class->get_property = meta_monitor_manager_get_property;
 | 
			
		||||
  object_class->set_property = meta_monitor_manager_set_property;
 | 
			
		||||
  object_class->dispose = meta_monitor_manager_dispose;
 | 
			
		||||
  object_class->finalize = meta_monitor_manager_finalize;
 | 
			
		||||
 | 
			
		||||
@@ -336,6 +371,8 @@ meta_monitor_manager_class_init (MetaMonitorManagerClass *klass)
 | 
			
		||||
		  0,
 | 
			
		||||
                  NULL, NULL, NULL,
 | 
			
		||||
		  G_TYPE_NONE, 0);
 | 
			
		||||
 | 
			
		||||
  g_object_class_override_property (object_class, PROP_POWER_SAVE_MODE, "power-save-mode");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static const double known_diagonals[] = {
 | 
			
		||||
 
 | 
			
		||||
@@ -36,24 +36,11 @@
 | 
			
		||||
struct _MetaBackendNativePrivate
 | 
			
		||||
{
 | 
			
		||||
  MetaLauncher *launcher;
 | 
			
		||||
 | 
			
		||||
  GSettings *keyboard_settings;
 | 
			
		||||
};
 | 
			
		||||
typedef struct _MetaBackendNativePrivate MetaBackendNativePrivate;
 | 
			
		||||
 | 
			
		||||
G_DEFINE_TYPE_WITH_PRIVATE (MetaBackendNative, meta_backend_native, META_TYPE_BACKEND);
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_backend_native_finalize (GObject *object)
 | 
			
		||||
{
 | 
			
		||||
  MetaBackendNative *native = META_BACKEND_NATIVE (object);
 | 
			
		||||
  MetaBackendNativePrivate *priv = meta_backend_native_get_instance_private (native);
 | 
			
		||||
 | 
			
		||||
  g_clear_object (&priv->keyboard_settings);
 | 
			
		||||
 | 
			
		||||
  G_OBJECT_CLASS (meta_backend_native_parent_class)->finalize (object);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * The pointer constrain code is mostly a rip-off of the XRandR code from Xorg.
 | 
			
		||||
 * (from xserver/randr/rrcrtc.c, RRConstrainCursorHarder)
 | 
			
		||||
@@ -155,46 +142,15 @@ pointer_constrain_callback (ClutterInputDevice *device,
 | 
			
		||||
  constrain_all_screen_monitors(device, monitors, n_monitors, new_x, new_y);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
set_keyboard_repeat (MetaBackendNative *native)
 | 
			
		||||
{
 | 
			
		||||
  MetaBackendNativePrivate *priv = meta_backend_native_get_instance_private (native);
 | 
			
		||||
  ClutterDeviceManager *manager = clutter_device_manager_get_default ();
 | 
			
		||||
  gboolean repeat;
 | 
			
		||||
  unsigned int delay, interval;
 | 
			
		||||
 | 
			
		||||
  repeat = g_settings_get_boolean (priv->keyboard_settings, "repeat");
 | 
			
		||||
  delay = g_settings_get_uint (priv->keyboard_settings, "delay");
 | 
			
		||||
  interval = g_settings_get_uint (priv->keyboard_settings, "repeat-interval");
 | 
			
		||||
 | 
			
		||||
  clutter_evdev_set_keyboard_repeat (manager, repeat, delay, interval);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
keyboard_settings_changed (GSettings           *settings,
 | 
			
		||||
                           const char          *key,
 | 
			
		||||
                           gpointer             data)
 | 
			
		||||
{
 | 
			
		||||
  MetaBackendNative *native = data;
 | 
			
		||||
  set_keyboard_repeat (native);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_backend_native_post_init (MetaBackend *backend)
 | 
			
		||||
{
 | 
			
		||||
  MetaBackendNative *native = META_BACKEND_NATIVE (backend);
 | 
			
		||||
  MetaBackendNativePrivate *priv = meta_backend_native_get_instance_private (native);
 | 
			
		||||
  ClutterDeviceManager *manager = clutter_device_manager_get_default ();
 | 
			
		||||
 | 
			
		||||
  META_BACKEND_CLASS (meta_backend_native_parent_class)->post_init (backend);
 | 
			
		||||
 | 
			
		||||
  clutter_evdev_set_pointer_constrain_callback (manager, pointer_constrain_callback,
 | 
			
		||||
                                                NULL, NULL);
 | 
			
		||||
 | 
			
		||||
  priv->keyboard_settings = g_settings_new ("org.gnome.settings-daemon.peripherals.keyboard");
 | 
			
		||||
  g_signal_connect (priv->keyboard_settings, "changed",
 | 
			
		||||
                    G_CALLBACK (keyboard_settings_changed), native);
 | 
			
		||||
  set_keyboard_repeat (native);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static MetaIdleMonitor *
 | 
			
		||||
@@ -273,16 +229,12 @@ meta_backend_native_lock_layout_group (MetaBackend *backend,
 | 
			
		||||
{
 | 
			
		||||
  ClutterDeviceManager *manager = clutter_device_manager_get_default ();
 | 
			
		||||
  clutter_evdev_set_keyboard_layout_index (manager, idx);
 | 
			
		||||
  g_signal_emit_by_name (backend, "keymap-layout-group-changed", idx, 0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_backend_native_class_init (MetaBackendNativeClass *klass)
 | 
			
		||||
{
 | 
			
		||||
  MetaBackendClass *backend_class = META_BACKEND_CLASS (klass);
 | 
			
		||||
  GObjectClass *object_class = G_OBJECT_CLASS (klass);
 | 
			
		||||
 | 
			
		||||
  object_class->finalize = meta_backend_native_finalize;
 | 
			
		||||
 | 
			
		||||
  backend_class->post_init = meta_backend_native_post_init;
 | 
			
		||||
  backend_class->create_idle_monitor = meta_backend_native_create_idle_monitor;
 | 
			
		||||
@@ -318,7 +270,7 @@ meta_activate_vt (int vt, GError **error)
 | 
			
		||||
 * meta_activate_session:
 | 
			
		||||
 *
 | 
			
		||||
 * Tells mutter to activate the session. When mutter is a
 | 
			
		||||
 * display server, this tells logind to switch over to
 | 
			
		||||
 * Wayland compositor, this tells logind to switch over to
 | 
			
		||||
 * the new session.
 | 
			
		||||
 */
 | 
			
		||||
gboolean
 | 
			
		||||
 
 | 
			
		||||
@@ -27,27 +27,16 @@
 | 
			
		||||
#include "meta-cursor-renderer-native.h"
 | 
			
		||||
 | 
			
		||||
#include <gbm.h>
 | 
			
		||||
#include <xf86drm.h>
 | 
			
		||||
 | 
			
		||||
#include "meta-cursor-private.h"
 | 
			
		||||
#include "meta-monitor-manager.h"
 | 
			
		||||
 | 
			
		||||
#ifndef DRM_CAP_CURSOR_WIDTH
 | 
			
		||||
#define DRM_CAP_CURSOR_WIDTH 0x8
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef DRM_CAP_CURSOR_HEIGHT
 | 
			
		||||
#define DRM_CAP_CURSOR_HEIGHT 0x9
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
struct _MetaCursorRendererNativePrivate
 | 
			
		||||
{
 | 
			
		||||
  gboolean has_hw_cursor;
 | 
			
		||||
 | 
			
		||||
  int drm_fd;
 | 
			
		||||
  struct gbm_device *gbm;
 | 
			
		||||
 | 
			
		||||
  uint64_t cursor_width;
 | 
			
		||||
  uint64_t cursor_height;
 | 
			
		||||
};
 | 
			
		||||
typedef struct _MetaCursorRendererNativePrivate MetaCursorRendererNativePrivate;
 | 
			
		||||
 | 
			
		||||
@@ -82,13 +71,17 @@ set_crtc_cursor (MetaCursorRendererNative *native,
 | 
			
		||||
    {
 | 
			
		||||
      struct gbm_bo *bo;
 | 
			
		||||
      union gbm_bo_handle handle;
 | 
			
		||||
      int width, height;
 | 
			
		||||
      int hot_x, hot_y;
 | 
			
		||||
 | 
			
		||||
      bo = meta_cursor_reference_get_gbm_bo (cursor, &hot_x, &hot_y);
 | 
			
		||||
 | 
			
		||||
      handle = gbm_bo_get_handle (bo);
 | 
			
		||||
      width = gbm_bo_get_width (bo);
 | 
			
		||||
      height = gbm_bo_get_height (bo);
 | 
			
		||||
 | 
			
		||||
      drmModeSetCursor2 (priv->drm_fd, crtc->crtc_id, handle.u32,
 | 
			
		||||
                         priv->cursor_width, priv->cursor_height, hot_x, hot_y);
 | 
			
		||||
                         width, height, hot_x, hot_y);
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    {
 | 
			
		||||
@@ -193,19 +186,6 @@ meta_cursor_renderer_native_init (MetaCursorRendererNative *native)
 | 
			
		||||
      CoglRenderer *cogl_renderer = cogl_display_get_renderer (cogl_context_get_display (ctx));
 | 
			
		||||
      priv->drm_fd = cogl_kms_renderer_get_kms_fd (cogl_renderer);
 | 
			
		||||
      priv->gbm = gbm_create_device (priv->drm_fd);
 | 
			
		||||
 | 
			
		||||
      uint64_t width, height;
 | 
			
		||||
      if (drmGetCap (priv->drm_fd, DRM_CAP_CURSOR_WIDTH, &width) == 0 &&
 | 
			
		||||
          drmGetCap (priv->drm_fd, DRM_CAP_CURSOR_HEIGHT, &height) == 0)
 | 
			
		||||
        {
 | 
			
		||||
          priv->cursor_width = width;
 | 
			
		||||
          priv->cursor_height = height;
 | 
			
		||||
        }
 | 
			
		||||
      else
 | 
			
		||||
        {
 | 
			
		||||
          priv->cursor_width = 64;
 | 
			
		||||
          priv->cursor_height = 64;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
@@ -218,16 +198,6 @@ meta_cursor_renderer_native_get_gbm_device (MetaCursorRendererNative *native)
 | 
			
		||||
  return priv->gbm;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_cursor_renderer_native_get_cursor_size (MetaCursorRendererNative *native,
 | 
			
		||||
                                             uint64_t *width, uint64_t *height)
 | 
			
		||||
{
 | 
			
		||||
  MetaCursorRendererNativePrivate *priv = meta_cursor_renderer_native_get_instance_private (native);
 | 
			
		||||
 | 
			
		||||
  *width = priv->cursor_width;
 | 
			
		||||
  *height = priv->cursor_height;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_cursor_renderer_native_force_update (MetaCursorRendererNative *native)
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
@@ -50,7 +50,6 @@ struct _MetaCursorRendererNativeClass
 | 
			
		||||
GType meta_cursor_renderer_native_get_type (void) G_GNUC_CONST;
 | 
			
		||||
 | 
			
		||||
struct gbm_device * meta_cursor_renderer_native_get_gbm_device (MetaCursorRendererNative *renderer);
 | 
			
		||||
void meta_cursor_renderer_native_get_cursor_size (MetaCursorRendererNative *native, uint64_t *width, uint64_t *height);
 | 
			
		||||
void meta_cursor_renderer_native_force_update (MetaCursorRendererNative *renderer);
 | 
			
		||||
 | 
			
		||||
#endif /* META_CURSOR_RENDERER_NATIVE_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -65,14 +65,9 @@ struct _MetaBackendX11Private
 | 
			
		||||
  uint8_t xkb_error_base;
 | 
			
		||||
 | 
			
		||||
  struct xkb_keymap *keymap;
 | 
			
		||||
  gchar *keymap_layouts;
 | 
			
		||||
  gchar *keymap_variants;
 | 
			
		||||
  gchar *keymap_options;
 | 
			
		||||
};
 | 
			
		||||
typedef struct _MetaBackendX11Private MetaBackendX11Private;
 | 
			
		||||
 | 
			
		||||
static void apply_keymap (MetaBackendX11 *x11);
 | 
			
		||||
 | 
			
		||||
G_DEFINE_TYPE_WITH_PRIVATE (MetaBackendX11, meta_backend_x11, META_TYPE_BACKEND);
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
@@ -331,17 +326,6 @@ take_touch_grab (MetaBackend *backend)
 | 
			
		||||
                    False, &mask, 1, &mods);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
on_device_added (ClutterDeviceManager *device_manager,
 | 
			
		||||
                 ClutterInputDevice   *device,
 | 
			
		||||
                 gpointer              user_data)
 | 
			
		||||
{
 | 
			
		||||
  MetaBackendX11 *x11 = META_BACKEND_X11 (user_data);
 | 
			
		||||
 | 
			
		||||
  if (clutter_input_device_get_device_type (device) == CLUTTER_KEYBOARD_DEVICE)
 | 
			
		||||
    apply_keymap (x11);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_backend_x11_post_init (MetaBackend *backend)
 | 
			
		||||
{
 | 
			
		||||
@@ -392,9 +376,6 @@ meta_backend_x11_post_init (MetaBackend *backend)
 | 
			
		||||
    meta_fatal ("X server doesn't have the XKB extension, version %d.%d or newer\n",
 | 
			
		||||
                XKB_X11_MIN_MAJOR_XKB_VERSION, XKB_X11_MIN_MINOR_XKB_VERSION);
 | 
			
		||||
 | 
			
		||||
  g_signal_connect_object (clutter_device_manager_get_default (), "device-added",
 | 
			
		||||
                           G_CALLBACK (on_device_added), backend, 0);
 | 
			
		||||
 | 
			
		||||
  META_BACKEND_CLASS (meta_backend_x11_parent_class)->post_init (backend);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -579,22 +560,21 @@ upload_xkb_description (Display              *xdisplay,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
apply_keymap (MetaBackendX11 *x11)
 | 
			
		||||
meta_backend_x11_set_keymap (MetaBackend *backend,
 | 
			
		||||
                             const char  *layouts,
 | 
			
		||||
                             const char  *variants,
 | 
			
		||||
                             const char  *options)
 | 
			
		||||
{
 | 
			
		||||
  MetaBackendX11 *x11 = META_BACKEND_X11 (backend);
 | 
			
		||||
  MetaBackendX11Private *priv = meta_backend_x11_get_instance_private (x11);
 | 
			
		||||
  XkbRF_RulesRec *xkb_rules;
 | 
			
		||||
  XkbRF_VarDefsRec xkb_var_defs = { 0 };
 | 
			
		||||
  gchar *rules_file_path;
 | 
			
		||||
 | 
			
		||||
  if (!priv->keymap_layouts ||
 | 
			
		||||
      !priv->keymap_variants ||
 | 
			
		||||
      !priv->keymap_options)
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  get_xkbrf_var_defs (priv->xdisplay,
 | 
			
		||||
                      priv->keymap_layouts,
 | 
			
		||||
                      priv->keymap_variants,
 | 
			
		||||
                      priv->keymap_options,
 | 
			
		||||
                      layouts,
 | 
			
		||||
                      variants,
 | 
			
		||||
                      options,
 | 
			
		||||
                      &rules_file_path,
 | 
			
		||||
                      &xkb_var_defs);
 | 
			
		||||
 | 
			
		||||
@@ -618,25 +598,6 @@ apply_keymap (MetaBackendX11 *x11)
 | 
			
		||||
  g_free (rules_file_path);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_backend_x11_set_keymap (MetaBackend *backend,
 | 
			
		||||
                             const char  *layouts,
 | 
			
		||||
                             const char  *variants,
 | 
			
		||||
                             const char  *options)
 | 
			
		||||
{
 | 
			
		||||
  MetaBackendX11 *x11 = META_BACKEND_X11 (backend);
 | 
			
		||||
  MetaBackendX11Private *priv = meta_backend_x11_get_instance_private (x11);
 | 
			
		||||
 | 
			
		||||
  g_free (priv->keymap_layouts);
 | 
			
		||||
  priv->keymap_layouts = g_strdup (layouts);
 | 
			
		||||
  g_free (priv->keymap_variants);
 | 
			
		||||
  priv->keymap_variants = g_strdup (variants);
 | 
			
		||||
  g_free (priv->keymap_options);
 | 
			
		||||
  priv->keymap_options = g_strdup (options);
 | 
			
		||||
 | 
			
		||||
  apply_keymap (x11);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static struct xkb_keymap *
 | 
			
		||||
meta_backend_x11_get_keymap (MetaBackend *backend)
 | 
			
		||||
{
 | 
			
		||||
@@ -670,20 +631,10 @@ static void
 | 
			
		||||
meta_backend_x11_update_screen_size (MetaBackend *backend,
 | 
			
		||||
                                     int width, int height)
 | 
			
		||||
{
 | 
			
		||||
  if (meta_is_wayland_compositor ())
 | 
			
		||||
    {
 | 
			
		||||
      /* For a nested wayland session, we want to go through Clutter to update the
 | 
			
		||||
       * toplevel window size, rather than doing it directly.
 | 
			
		||||
       */
 | 
			
		||||
      META_BACKEND_CLASS (meta_backend_x11_parent_class)->update_screen_size (backend, width, height);
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    {
 | 
			
		||||
      MetaBackendX11 *x11 = META_BACKEND_X11 (backend);
 | 
			
		||||
      MetaBackendX11Private *priv = meta_backend_x11_get_instance_private (x11);
 | 
			
		||||
      Window xwin = meta_backend_x11_get_xwindow (x11);
 | 
			
		||||
      XResizeWindow (priv->xdisplay, xwin, width, height);
 | 
			
		||||
    }
 | 
			
		||||
  MetaBackendX11 *x11 = META_BACKEND_X11 (backend);
 | 
			
		||||
  MetaBackendX11Private *priv = meta_backend_x11_get_instance_private (x11);
 | 
			
		||||
  Window xwin = meta_backend_x11_get_xwindow (x11);
 | 
			
		||||
  XResizeWindow (priv->xdisplay, xwin, width, height);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
 
 | 
			
		||||
@@ -140,35 +140,11 @@ meta_monitor_transform_from_xrandr_all (Rotation rotation)
 | 
			
		||||
  return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static gboolean
 | 
			
		||||
output_get_property_exists (MetaMonitorManagerXrandr *manager_xrandr,
 | 
			
		||||
                            MetaOutput *output, const char *propname)
 | 
			
		||||
{
 | 
			
		||||
  gboolean exists = FALSE;
 | 
			
		||||
  Atom atom, actual_type;
 | 
			
		||||
  int actual_format;
 | 
			
		||||
  unsigned long nitems, bytes_after;
 | 
			
		||||
  unsigned char *buffer;
 | 
			
		||||
 | 
			
		||||
  atom = XInternAtom (manager_xrandr->xdisplay, propname, False);
 | 
			
		||||
  XRRGetOutputProperty (manager_xrandr->xdisplay,
 | 
			
		||||
                        (XID)output->winsys_id,
 | 
			
		||||
                        atom,
 | 
			
		||||
                        0, G_MAXLONG, False, False, AnyPropertyType,
 | 
			
		||||
                        &actual_type, &actual_format,
 | 
			
		||||
                        &nitems, &bytes_after, &buffer);
 | 
			
		||||
 | 
			
		||||
  exists = (actual_type != None);
 | 
			
		||||
 | 
			
		||||
  XFree (buffer);
 | 
			
		||||
  return exists;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static gboolean
 | 
			
		||||
output_get_boolean_property (MetaMonitorManagerXrandr *manager_xrandr,
 | 
			
		||||
                             MetaOutput *output, const char *propname)
 | 
			
		||||
{
 | 
			
		||||
  gboolean value = FALSE;
 | 
			
		||||
  gboolean value;
 | 
			
		||||
  Atom atom, actual_type;
 | 
			
		||||
  int actual_format;
 | 
			
		||||
  unsigned long nitems, bytes_after;
 | 
			
		||||
@@ -182,12 +158,12 @@ output_get_boolean_property (MetaMonitorManagerXrandr *manager_xrandr,
 | 
			
		||||
                        &actual_type, &actual_format,
 | 
			
		||||
                        &nitems, &bytes_after, &buffer);
 | 
			
		||||
 | 
			
		||||
  if (actual_type != XA_CARDINAL || actual_format != 32 || nitems < 1)
 | 
			
		||||
    goto out;
 | 
			
		||||
  if (actual_type != XA_CARDINAL || actual_format != 32 ||
 | 
			
		||||
      nitems < 1)
 | 
			
		||||
    return FALSE;
 | 
			
		||||
 | 
			
		||||
  value = ((int*)buffer)[0];
 | 
			
		||||
 | 
			
		||||
 out:
 | 
			
		||||
  XFree (buffer);
 | 
			
		||||
  return value;
 | 
			
		||||
}
 | 
			
		||||
@@ -211,7 +187,7 @@ static int
 | 
			
		||||
output_get_backlight_xrandr (MetaMonitorManagerXrandr *manager_xrandr,
 | 
			
		||||
                             MetaOutput               *output)
 | 
			
		||||
{
 | 
			
		||||
  int value = -1;
 | 
			
		||||
  gboolean value;
 | 
			
		||||
  Atom atom, actual_type;
 | 
			
		||||
  int actual_format;
 | 
			
		||||
  unsigned long nitems, bytes_after;
 | 
			
		||||
@@ -225,17 +201,14 @@ output_get_backlight_xrandr (MetaMonitorManagerXrandr *manager_xrandr,
 | 
			
		||||
                        &actual_type, &actual_format,
 | 
			
		||||
                        &nitems, &bytes_after, &buffer);
 | 
			
		||||
 | 
			
		||||
  if (actual_type != XA_INTEGER || actual_format != 32 || nitems < 1)
 | 
			
		||||
    goto out;
 | 
			
		||||
  if (actual_type != XA_INTEGER || actual_format != 32 ||
 | 
			
		||||
      nitems < 1)
 | 
			
		||||
    return -1;
 | 
			
		||||
 | 
			
		||||
  value = ((int*)buffer)[0];
 | 
			
		||||
 | 
			
		||||
 out:
 | 
			
		||||
  XFree (buffer);
 | 
			
		||||
  if (value > 0)
 | 
			
		||||
    return normalize_backlight (output, value);
 | 
			
		||||
  else
 | 
			
		||||
    return -1;
 | 
			
		||||
  return normalize_backlight (output, value);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
@@ -354,7 +327,7 @@ static gboolean
 | 
			
		||||
output_get_hotplug_mode_update (MetaMonitorManagerXrandr *manager_xrandr,
 | 
			
		||||
                                MetaOutput               *output)
 | 
			
		||||
{
 | 
			
		||||
  return output_get_property_exists (manager_xrandr, output, "hotplug_mode_update");
 | 
			
		||||
  return output_get_boolean_property (manager_xrandr, output, "hotplug_mode_update");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static char *
 | 
			
		||||
@@ -1099,7 +1072,6 @@ meta_monitor_manager_xrandr_handle_xevent (MetaMonitorManagerXrandr *manager_xra
 | 
			
		||||
  MetaMonitorMode *old_modes;
 | 
			
		||||
  unsigned int n_old_outputs, n_old_modes;
 | 
			
		||||
  gboolean new_config;
 | 
			
		||||
  gboolean applied_config = FALSE;
 | 
			
		||||
 | 
			
		||||
  if ((event->type - manager_xrandr->rr_event_base) != RRScreenChangeNotify)
 | 
			
		||||
    return FALSE;
 | 
			
		||||
@@ -1116,32 +1088,39 @@ meta_monitor_manager_xrandr_handle_xevent (MetaMonitorManagerXrandr *manager_xra
 | 
			
		||||
  manager->serial++;
 | 
			
		||||
  meta_monitor_manager_xrandr_read_current (manager);
 | 
			
		||||
 | 
			
		||||
  new_config = manager_xrandr->resources->timestamp >= manager_xrandr->resources->configTimestamp;
 | 
			
		||||
  new_config = manager_xrandr->resources->timestamp >=
 | 
			
		||||
    manager_xrandr->resources->configTimestamp;
 | 
			
		||||
  if (meta_monitor_manager_has_hotplug_mode_update (manager))
 | 
			
		||||
 | 
			
		||||
  /* If this is the X server telling us we set a new configuration,
 | 
			
		||||
   * we can simply short-cut to rebuilding our logical configuration.
 | 
			
		||||
   */
 | 
			
		||||
  if (new_config)
 | 
			
		||||
    {
 | 
			
		||||
      meta_monitor_manager_xrandr_rebuild_derived (manager);
 | 
			
		||||
      goto out;
 | 
			
		||||
      /* Check if the current intended configuration is a result of an
 | 
			
		||||
         XRandR call.  Otherwise, hotplug_mode_update tells us to get
 | 
			
		||||
         a new preferred mode on hotplug events to handle dynamic
 | 
			
		||||
         guest resizing. */
 | 
			
		||||
      if (new_config)
 | 
			
		||||
        meta_monitor_manager_xrandr_rebuild_derived (manager);
 | 
			
		||||
      else
 | 
			
		||||
        meta_monitor_config_make_default (manager->config, manager);
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    {
 | 
			
		||||
      /* Check if the current intended configuration has the same outputs
 | 
			
		||||
         as the new real one, or if the event is a result of an XRandR call.
 | 
			
		||||
         If so, we can go straight to rebuild the logical config and tell
 | 
			
		||||
         the outside world.
 | 
			
		||||
         Otherwise, this event was caused by hotplug, so give a chance to
 | 
			
		||||
         MetaMonitorConfig.
 | 
			
		||||
 | 
			
		||||
         Note that we need to check both the timestamps and the list of
 | 
			
		||||
         outputs, because the X server might emit spurious events with new
 | 
			
		||||
         configTimestamps (bug 702804), and the driver may have changed
 | 
			
		||||
         the EDID for some other reason (old qxl and vbox drivers). */
 | 
			
		||||
      if (new_config || meta_monitor_config_match_current (manager->config, manager))
 | 
			
		||||
        meta_monitor_manager_xrandr_rebuild_derived (manager);
 | 
			
		||||
      else if (!meta_monitor_config_apply_stored (manager->config, manager))
 | 
			
		||||
        meta_monitor_config_make_default (manager->config, manager);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  /* If the monitor has hotplug_mode_update (which is used by VMs), don't bother
 | 
			
		||||
   * applying our stored configuration, because it's likely the user just resizing
 | 
			
		||||
   * the window.
 | 
			
		||||
   */
 | 
			
		||||
  if (!meta_monitor_manager_has_hotplug_mode_update (manager))
 | 
			
		||||
    {
 | 
			
		||||
      if (meta_monitor_config_apply_stored (manager->config, manager))
 | 
			
		||||
        applied_config = TRUE;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  /* If we haven't applied any configuration, apply the default configuration. */
 | 
			
		||||
  if (!applied_config)
 | 
			
		||||
    meta_monitor_config_make_default (manager->config, manager);
 | 
			
		||||
 | 
			
		||||
 out:
 | 
			
		||||
  meta_monitor_manager_free_output_array (old_outputs, n_old_outputs);
 | 
			
		||||
  meta_monitor_manager_free_mode_array (old_modes, n_old_modes);
 | 
			
		||||
  g_free (old_crtcs);
 | 
			
		||||
 
 | 
			
		||||
@@ -70,35 +70,10 @@ static gboolean is_pot(int x)
 | 
			
		||||
  return x > 0 && (x & (x - 1)) == 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * meta_create_texture:
 | 
			
		||||
 * @width: width of the texture to create
 | 
			
		||||
 * @height: height of the texture to create
 | 
			
		||||
 * @components; components to store in the texture (color or alpha)
 | 
			
		||||
 * @flags: flags that affect the allocation behavior
 | 
			
		||||
 *
 | 
			
		||||
 * Creates a texture of the given size with the specified components
 | 
			
		||||
 * for use as a frame buffer object.
 | 
			
		||||
 *
 | 
			
		||||
 * If non-power-of-two textures are not supported on the system, then
 | 
			
		||||
 * the texture will be created as a texture rectangle; in this case,
 | 
			
		||||
 * hardware repeating isn't possible, and texture coordinates are also
 | 
			
		||||
 * different, but Cogl hides these issues from the application, except from
 | 
			
		||||
 * GLSL shaders. Since GLSL is never (or at least almost never)
 | 
			
		||||
 * present on such a system, this is not typically an issue.
 | 
			
		||||
 *
 | 
			
		||||
 * If %META_TEXTURE_ALLOW_SLICING is present in @flags, and the texture
 | 
			
		||||
 * is larger than the texture size limits of the system, then the texture
 | 
			
		||||
 * will be created as a sliced texture. This also will cause problems
 | 
			
		||||
 * with using the texture with GLSL, and is more likely to be an issue
 | 
			
		||||
 * since all GL implementations have texture size limits, and they can
 | 
			
		||||
 * be as small as 2048x2048 on reasonably current systems.
 | 
			
		||||
 */
 | 
			
		||||
CoglTexture *
 | 
			
		||||
meta_create_texture (int                   width,
 | 
			
		||||
                     int                   height,
 | 
			
		||||
                     CoglTextureComponents components,
 | 
			
		||||
                     MetaTextureFlags      flags)
 | 
			
		||||
meta_create_large_texture (int                   width,
 | 
			
		||||
                           int                   height,
 | 
			
		||||
                           CoglTextureComponents components)
 | 
			
		||||
{
 | 
			
		||||
  ClutterBackend *backend = clutter_get_default_backend ();
 | 
			
		||||
  CoglContext *ctx = clutter_backend_get_cogl_context (backend);
 | 
			
		||||
@@ -111,31 +86,15 @@ meta_create_texture (int                   width,
 | 
			
		||||
    {
 | 
			
		||||
      if (cogl_has_feature (ctx, COGL_FEATURE_ID_TEXTURE_RECTANGLE))
 | 
			
		||||
        should_use_rectangle = TRUE;
 | 
			
		||||
      else
 | 
			
		||||
        g_error ("Cannot create texture. Support for GL_ARB_texture_non_power_of_two or "
 | 
			
		||||
                 "ARB_texture_rectangle is required");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  if (should_use_rectangle)
 | 
			
		||||
    texture = COGL_TEXTURE (cogl_texture_rectangle_new_with_size (ctx, width, height));
 | 
			
		||||
    texture = COGL_TEXTURE (cogl_texture_rectangle_new_with_size (ctx,
 | 
			
		||||
                                                                  width, height));
 | 
			
		||||
  else
 | 
			
		||||
    texture = COGL_TEXTURE (cogl_texture_2d_new_with_size (ctx, width, height));
 | 
			
		||||
    texture = COGL_TEXTURE (cogl_texture_2d_new_with_size (ctx,
 | 
			
		||||
                                                           width, height));
 | 
			
		||||
  cogl_texture_set_components (texture, components);
 | 
			
		||||
 | 
			
		||||
  if ((flags & META_TEXTURE_ALLOW_SLICING) != 0)
 | 
			
		||||
    {
 | 
			
		||||
      /* To find out if we need to slice the texture, we have to go ahead and force storage
 | 
			
		||||
       * to be allocated
 | 
			
		||||
       */
 | 
			
		||||
      CoglError *catch_error = NULL;
 | 
			
		||||
      if (!cogl_texture_allocate (texture, &catch_error))
 | 
			
		||||
        {
 | 
			
		||||
          cogl_error_free (catch_error);
 | 
			
		||||
          cogl_object_unref (texture);
 | 
			
		||||
          texture = COGL_TEXTURE (cogl_texture_2d_sliced_new_with_size (ctx, width, height, COGL_TEXTURE_MAX_WASTE));
 | 
			
		||||
          cogl_texture_set_components (texture, components);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  return texture;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -25,14 +25,8 @@
 | 
			
		||||
 | 
			
		||||
CoglPipeline * meta_create_texture_pipeline (CoglTexture *texture);
 | 
			
		||||
 | 
			
		||||
typedef enum {
 | 
			
		||||
  META_TEXTURE_FLAGS_NONE = 0,
 | 
			
		||||
  META_TEXTURE_ALLOW_SLICING = 1 << 1
 | 
			
		||||
} MetaTextureFlags;
 | 
			
		||||
 | 
			
		||||
CoglTexture *meta_create_texture (int                   width,
 | 
			
		||||
                                  int                   height,
 | 
			
		||||
                                  CoglTextureComponents components,
 | 
			
		||||
                                  MetaTextureFlags      flags);
 | 
			
		||||
CoglTexture *meta_create_large_texture (int                   width,
 | 
			
		||||
                                        int                   height,
 | 
			
		||||
                                        CoglTextureComponents components);
 | 
			
		||||
 | 
			
		||||
#endif /* __META_COGL_UTILS_H__ */
 | 
			
		||||
 
 | 
			
		||||
@@ -23,7 +23,7 @@ struct _MetaCompositor
 | 
			
		||||
  guint           server_time_is_monotonic_time : 1;
 | 
			
		||||
  guint           no_mipmaps  : 1;
 | 
			
		||||
 | 
			
		||||
  ClutterActor          *stage, *window_group, *top_window_group, *feedback_group;
 | 
			
		||||
  ClutterActor          *stage, *window_group, *top_window_group;
 | 
			
		||||
  ClutterActor          *background_actor;
 | 
			
		||||
  GList                 *windows;
 | 
			
		||||
  Window                 output;
 | 
			
		||||
 
 | 
			
		||||
@@ -185,19 +185,6 @@ meta_get_top_window_group_for_screen (MetaScreen *screen)
 | 
			
		||||
  return compositor->top_window_group;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * meta_get_feedback_group_for_screen:
 | 
			
		||||
 * @screen: a #MetaScreen
 | 
			
		||||
 *
 | 
			
		||||
 * Returns: (transfer none): The feedback group corresponding to @screen
 | 
			
		||||
 */
 | 
			
		||||
ClutterActor *
 | 
			
		||||
meta_get_feedback_group_for_screen (MetaScreen *screen)
 | 
			
		||||
{
 | 
			
		||||
  MetaCompositor *compositor = get_compositor_for_screen (screen);
 | 
			
		||||
  return compositor->feedback_group;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * meta_get_window_actors:
 | 
			
		||||
 * @screen: a #MetaScreen
 | 
			
		||||
@@ -491,11 +478,9 @@ meta_compositor_manage (MetaCompositor *compositor)
 | 
			
		||||
 | 
			
		||||
  compositor->window_group = meta_window_group_new (screen);
 | 
			
		||||
  compositor->top_window_group = meta_window_group_new (screen);
 | 
			
		||||
  compositor->feedback_group = meta_window_group_new (screen);
 | 
			
		||||
 | 
			
		||||
  clutter_actor_add_child (compositor->stage, compositor->window_group);
 | 
			
		||||
  clutter_actor_add_child (compositor->stage, compositor->top_window_group);
 | 
			
		||||
  clutter_actor_add_child (compositor->stage, compositor->feedback_group);
 | 
			
		||||
 | 
			
		||||
  if (meta_is_wayland_compositor ())
 | 
			
		||||
    {
 | 
			
		||||
@@ -935,7 +920,7 @@ meta_compositor_sync_stack (MetaCompositor  *compositor,
 | 
			
		||||
          old_actor = old_stack->data;
 | 
			
		||||
          old_window = meta_window_actor_get_meta_window (old_actor);
 | 
			
		||||
 | 
			
		||||
          if ((old_window->hidden || old_window->unmanaging) &&
 | 
			
		||||
          if (old_window->hidden &&
 | 
			
		||||
              !meta_window_actor_effect_in_progress (old_actor))
 | 
			
		||||
            {
 | 
			
		||||
              old_stack = g_list_delete_link (old_stack, old_stack);
 | 
			
		||||
@@ -969,7 +954,7 @@ meta_compositor_sync_stack (MetaCompositor  *compositor,
 | 
			
		||||
       * filtered out non-animating hidden windows above.
 | 
			
		||||
       */
 | 
			
		||||
      if (old_actor &&
 | 
			
		||||
          (!stack_actor || old_window->hidden || old_window->unmanaging))
 | 
			
		||||
          (!stack_actor || old_window->hidden))
 | 
			
		||||
        {
 | 
			
		||||
          actor = old_actor;
 | 
			
		||||
          window = old_window;
 | 
			
		||||
 
 | 
			
		||||
@@ -88,9 +88,6 @@ enum
 | 
			
		||||
  PROP_META_SCREEN = 1,
 | 
			
		||||
  PROP_MONITOR,
 | 
			
		||||
  PROP_BACKGROUND,
 | 
			
		||||
  PROP_VIGNETTE,
 | 
			
		||||
  PROP_VIGNETTE_SHARPNESS,
 | 
			
		||||
  PROP_BRIGHTNESS
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef enum {
 | 
			
		||||
@@ -133,8 +130,8 @@ struct _MetaBackgroundActorPrivate
 | 
			
		||||
  MetaBackground *background;
 | 
			
		||||
 | 
			
		||||
  gboolean vignette;
 | 
			
		||||
  double brightness;
 | 
			
		||||
  double vignette_sharpness;
 | 
			
		||||
  float brightness;
 | 
			
		||||
  float vignette_sharpness;
 | 
			
		||||
 | 
			
		||||
  ChangedFlags changed;
 | 
			
		||||
  CoglPipeline *pipeline;
 | 
			
		||||
@@ -245,20 +242,24 @@ make_pipeline (PipelineFlags pipeline_flags)
 | 
			
		||||
 | 
			
		||||
      if ((pipeline_flags & PIPELINE_VIGNETTE) != 0)
 | 
			
		||||
        {
 | 
			
		||||
          static CoglSnippet *vertex_snippet;
 | 
			
		||||
          static CoglSnippet *fragment_snippet;
 | 
			
		||||
          static CoglSnippet *snippet;
 | 
			
		||||
 | 
			
		||||
          if (!vertex_snippet)
 | 
			
		||||
            vertex_snippet = cogl_snippet_new (COGL_SNIPPET_HOOK_VERTEX,
 | 
			
		||||
                                               VERTEX_SHADER_DECLARATIONS, VERTEX_SHADER_CODE);
 | 
			
		||||
          if (!snippet)
 | 
			
		||||
            snippet = cogl_snippet_new (COGL_SNIPPET_HOOK_VERTEX,
 | 
			
		||||
                                        VERTEX_SHADER_DECLARATIONS, VERTEX_SHADER_CODE);
 | 
			
		||||
 | 
			
		||||
          cogl_pipeline_add_snippet (*templatep, vertex_snippet);
 | 
			
		||||
          cogl_pipeline_add_snippet (*templatep, snippet);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
          if (!fragment_snippet)
 | 
			
		||||
            fragment_snippet = cogl_snippet_new (COGL_SNIPPET_HOOK_FRAGMENT,
 | 
			
		||||
                                                 FRAGMENT_SHADER_DECLARATIONS, FRAGMENT_SHADER_CODE);
 | 
			
		||||
      if ((pipeline_flags & PIPELINE_VIGNETTE) != 0)
 | 
			
		||||
        {
 | 
			
		||||
          static CoglSnippet *snippet;
 | 
			
		||||
 | 
			
		||||
          cogl_pipeline_add_snippet (*templatep, fragment_snippet);
 | 
			
		||||
          if (!snippet)
 | 
			
		||||
            snippet = cogl_snippet_new (COGL_SNIPPET_HOOK_FRAGMENT,
 | 
			
		||||
                                        FRAGMENT_SHADER_DECLARATIONS, FRAGMENT_SHADER_CODE);
 | 
			
		||||
 | 
			
		||||
          cogl_pipeline_add_snippet (*templatep, snippet);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      if ((pipeline_flags & PIPELINE_BLEND) == 0)
 | 
			
		||||
@@ -322,18 +323,7 @@ setup_pipeline (MetaBackgroundActor   *self,
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  if (priv->vignette)
 | 
			
		||||
    {
 | 
			
		||||
      color_component = priv->brightness * opacity / 255.;
 | 
			
		||||
 | 
			
		||||
      if (!clutter_feature_available (CLUTTER_FEATURE_SHADERS_GLSL))
 | 
			
		||||
        {
 | 
			
		||||
          /* Darken everything to match the average brightness that would
 | 
			
		||||
           * be there if we were drawing the vignette, which is
 | 
			
		||||
           * (1 - (pi/12.) * vignette_sharpness) [exercise for the reader :]
 | 
			
		||||
           */
 | 
			
		||||
          color_component *= (1 - 0.74 * priv->vignette_sharpness);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    color_component = priv->brightness * opacity / 255.;
 | 
			
		||||
  else
 | 
			
		||||
    color_component = opacity / 255.;
 | 
			
		||||
 | 
			
		||||
@@ -379,37 +369,6 @@ set_glsl_parameters (MetaBackgroundActor   *self,
 | 
			
		||||
                                   2, 1, offset);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
paint_clipped_rectangle (CoglFramebuffer       *fb,
 | 
			
		||||
                         CoglPipeline          *pipeline,
 | 
			
		||||
                         cairo_rectangle_int_t *rect,
 | 
			
		||||
                         cairo_rectangle_int_t *texture_area)
 | 
			
		||||
{
 | 
			
		||||
  float x1, y1, x2, y2;
 | 
			
		||||
  float tx1, ty1, tx2, ty2;
 | 
			
		||||
 | 
			
		||||
  x1 = rect->x;
 | 
			
		||||
  y1 = rect->y;
 | 
			
		||||
  x2 = rect->x + rect->width;
 | 
			
		||||
  y2 = rect->y + rect->height;
 | 
			
		||||
 | 
			
		||||
  tx1 = (x1 - texture_area->x) / texture_area->width;
 | 
			
		||||
  ty1 = (y1 - texture_area->y) / texture_area->height;
 | 
			
		||||
  tx2 = (x2 - texture_area->x) / texture_area->width;
 | 
			
		||||
  ty2 = (y2 - texture_area->y) / texture_area->height;
 | 
			
		||||
 | 
			
		||||
  cogl_framebuffer_draw_textured_rectangle (fb, pipeline,
 | 
			
		||||
                                            x1, y1, x2, y2,
 | 
			
		||||
                                            tx1, ty1, tx2, ty2);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static gboolean
 | 
			
		||||
meta_background_actor_get_paint_volume (ClutterActor       *actor,
 | 
			
		||||
                                        ClutterPaintVolume *volume)
 | 
			
		||||
{
 | 
			
		||||
  return clutter_paint_volume_set_from_allocation (volume, actor);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_background_actor_paint (ClutterActor *actor)
 | 
			
		||||
{
 | 
			
		||||
@@ -417,7 +376,8 @@ meta_background_actor_paint (ClutterActor *actor)
 | 
			
		||||
  MetaBackgroundActorPrivate *priv = self->priv;
 | 
			
		||||
  ClutterActorBox actor_box;
 | 
			
		||||
  cairo_rectangle_int_t actor_pixel_rect;
 | 
			
		||||
  CoglFramebuffer *fb;
 | 
			
		||||
  cairo_region_t *paintable_region = NULL;
 | 
			
		||||
  int n_texture_subareas;
 | 
			
		||||
  int i;
 | 
			
		||||
 | 
			
		||||
  if ((priv->clip_region && cairo_region_is_empty (priv->clip_region)))
 | 
			
		||||
@@ -429,38 +389,43 @@ meta_background_actor_paint (ClutterActor *actor)
 | 
			
		||||
  actor_pixel_rect.width = actor_box.x2 - actor_box.x1;
 | 
			
		||||
  actor_pixel_rect.height = actor_box.y2 - actor_box.y1;
 | 
			
		||||
 | 
			
		||||
  /* Now figure out what to actually paint.
 | 
			
		||||
   */
 | 
			
		||||
  paintable_region = cairo_region_create_rectangle (&actor_pixel_rect);
 | 
			
		||||
  if (priv->clip_region != NULL)
 | 
			
		||||
    cairo_region_intersect (paintable_region, priv->clip_region);
 | 
			
		||||
 | 
			
		||||
  if (cairo_region_is_empty (paintable_region))
 | 
			
		||||
    goto out;
 | 
			
		||||
 | 
			
		||||
  setup_pipeline (self, &actor_pixel_rect);
 | 
			
		||||
  set_glsl_parameters (self, &actor_pixel_rect);
 | 
			
		||||
 | 
			
		||||
  /* Limit to how many separate rectangles we'll draw; beyond this just
 | 
			
		||||
   * fall back and draw the whole thing */
 | 
			
		||||
#define MAX_RECTS 64
 | 
			
		||||
 | 
			
		||||
  fb = cogl_get_draw_framebuffer ();
 | 
			
		||||
 | 
			
		||||
  /* Now figure out what to actually paint.
 | 
			
		||||
  /* Finally, split the paintable region up into distinct areas
 | 
			
		||||
   * and paint each area one by one
 | 
			
		||||
   */
 | 
			
		||||
  if (priv->clip_region != NULL)
 | 
			
		||||
  n_texture_subareas = cairo_region_num_rectangles (paintable_region);
 | 
			
		||||
  for (i = 0; i < n_texture_subareas; i++)
 | 
			
		||||
    {
 | 
			
		||||
      int n_rects = cairo_region_num_rectangles (priv->clip_region);
 | 
			
		||||
      if (n_rects <= MAX_RECTS)
 | 
			
		||||
        {
 | 
			
		||||
           for (i = 0; i < n_rects; i++)
 | 
			
		||||
             {
 | 
			
		||||
               cairo_rectangle_int_t rect;
 | 
			
		||||
               cairo_region_get_rectangle (priv->clip_region, i, &rect);
 | 
			
		||||
      cairo_rectangle_int_t rect;
 | 
			
		||||
      float tx1, tx2, ty1, ty2;
 | 
			
		||||
 | 
			
		||||
               if (!gdk_rectangle_intersect (&actor_pixel_rect, &rect, &rect))
 | 
			
		||||
                 continue;
 | 
			
		||||
      cairo_region_get_rectangle (paintable_region, i, &rect);
 | 
			
		||||
 | 
			
		||||
               paint_clipped_rectangle (fb, priv->pipeline, &rect, &priv->texture_area);
 | 
			
		||||
             }
 | 
			
		||||
      tx1 = (rect.x - actor_pixel_rect.x - priv->texture_area.x) / (float)priv->texture_area.width;
 | 
			
		||||
      ty1 = (rect.y - actor_pixel_rect.y - priv->texture_area.y) / (float)priv->texture_area.height;
 | 
			
		||||
      tx2 = (rect.x + rect.width - actor_pixel_rect.x - priv->texture_area.x) / (float)priv->texture_area.width;
 | 
			
		||||
      ty2 = (rect.y + rect.height - actor_pixel_rect.y - priv->texture_area.y) / (float)priv->texture_area.height;
 | 
			
		||||
 | 
			
		||||
           return;
 | 
			
		||||
        }
 | 
			
		||||
      cogl_framebuffer_draw_textured_rectangle (cogl_get_draw_framebuffer (),
 | 
			
		||||
                                                priv->pipeline,
 | 
			
		||||
                                                rect.x, rect.y,
 | 
			
		||||
                                                rect.x + rect.width, rect.y + rect.height,
 | 
			
		||||
                                                tx1, ty1, tx2, ty2);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  paint_clipped_rectangle (fb, priv->pipeline, &actor_pixel_rect, &priv->texture_area);
 | 
			
		||||
 out:
 | 
			
		||||
  cairo_region_destroy (paintable_region);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
@@ -483,24 +448,6 @@ meta_background_actor_set_property (GObject      *object,
 | 
			
		||||
    case PROP_BACKGROUND:
 | 
			
		||||
      meta_background_actor_set_background (self, g_value_get_object (value));
 | 
			
		||||
      break;
 | 
			
		||||
    case PROP_VIGNETTE:
 | 
			
		||||
      meta_background_actor_set_vignette (self,
 | 
			
		||||
                                          g_value_get_boolean (value),
 | 
			
		||||
                                          priv->brightness,
 | 
			
		||||
                                          priv->vignette_sharpness);
 | 
			
		||||
      break;
 | 
			
		||||
    case PROP_VIGNETTE_SHARPNESS:
 | 
			
		||||
      meta_background_actor_set_vignette (self,
 | 
			
		||||
                                          priv->vignette,
 | 
			
		||||
                                          priv->brightness,
 | 
			
		||||
                                          g_value_get_double (value));
 | 
			
		||||
      break;
 | 
			
		||||
    case PROP_BRIGHTNESS:
 | 
			
		||||
      meta_background_actor_set_vignette (self,
 | 
			
		||||
                                          priv->vignette,
 | 
			
		||||
                                          g_value_get_double (value),
 | 
			
		||||
                                          priv->vignette_sharpness);
 | 
			
		||||
      break;
 | 
			
		||||
    default:
 | 
			
		||||
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
 | 
			
		||||
      break;
 | 
			
		||||
@@ -526,15 +473,6 @@ meta_background_actor_get_property (GObject      *object,
 | 
			
		||||
    case PROP_BACKGROUND:
 | 
			
		||||
      g_value_set_object (value, priv->background);
 | 
			
		||||
      break;
 | 
			
		||||
    case PROP_VIGNETTE:
 | 
			
		||||
      g_value_set_boolean (value, priv->vignette);
 | 
			
		||||
      break;
 | 
			
		||||
    case PROP_BRIGHTNESS:
 | 
			
		||||
      g_value_set_double (value, priv->brightness);
 | 
			
		||||
      break;
 | 
			
		||||
    case PROP_VIGNETTE_SHARPNESS:
 | 
			
		||||
      g_value_set_double (value, priv->vignette_sharpness);
 | 
			
		||||
      break;
 | 
			
		||||
    default:
 | 
			
		||||
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
 | 
			
		||||
      break;
 | 
			
		||||
@@ -556,7 +494,6 @@ meta_background_actor_class_init (MetaBackgroundActorClass *klass)
 | 
			
		||||
 | 
			
		||||
  actor_class->get_preferred_width = meta_background_actor_get_preferred_width;
 | 
			
		||||
  actor_class->get_preferred_height = meta_background_actor_get_preferred_height;
 | 
			
		||||
  actor_class->get_paint_volume = meta_background_actor_get_paint_volume;
 | 
			
		||||
  actor_class->paint = meta_background_actor_paint;
 | 
			
		||||
 | 
			
		||||
  param_spec = g_param_spec_object ("meta-screen",
 | 
			
		||||
@@ -588,50 +525,14 @@ meta_background_actor_class_init (MetaBackgroundActorClass *klass)
 | 
			
		||||
  g_object_class_install_property (object_class,
 | 
			
		||||
                                   PROP_BACKGROUND,
 | 
			
		||||
                                   param_spec);
 | 
			
		||||
 | 
			
		||||
  param_spec = g_param_spec_boolean ("vignette",
 | 
			
		||||
                                     "Vignette",
 | 
			
		||||
                                     "Whether vignette effect is enabled",
 | 
			
		||||
                                     FALSE,
 | 
			
		||||
                                     G_PARAM_READWRITE);
 | 
			
		||||
 | 
			
		||||
  g_object_class_install_property (object_class,
 | 
			
		||||
                                   PROP_VIGNETTE,
 | 
			
		||||
                                   param_spec);
 | 
			
		||||
 | 
			
		||||
  param_spec = g_param_spec_double ("brightness",
 | 
			
		||||
                                    "Brightness",
 | 
			
		||||
                                    "Brightness of vignette effect",
 | 
			
		||||
                                    0.0, 1.0, 1.0,
 | 
			
		||||
                                    G_PARAM_READWRITE);
 | 
			
		||||
 | 
			
		||||
  g_object_class_install_property (object_class,
 | 
			
		||||
                                   PROP_BRIGHTNESS,
 | 
			
		||||
                                   param_spec);
 | 
			
		||||
 | 
			
		||||
  param_spec = g_param_spec_double ("vignette-sharpness",
 | 
			
		||||
                                    "Vignette Sharpness",
 | 
			
		||||
                                    "Sharpness of vignette effect",
 | 
			
		||||
                                    0.0, G_MAXDOUBLE, 0.0,
 | 
			
		||||
                                    G_PARAM_READWRITE);
 | 
			
		||||
 | 
			
		||||
  g_object_class_install_property (object_class,
 | 
			
		||||
                                   PROP_VIGNETTE_SHARPNESS,
 | 
			
		||||
                                   param_spec);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_background_actor_init (MetaBackgroundActor *self)
 | 
			
		||||
{
 | 
			
		||||
  MetaBackgroundActorPrivate *priv;
 | 
			
		||||
 | 
			
		||||
  priv = self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
 | 
			
		||||
                                                   META_TYPE_BACKGROUND_ACTOR,
 | 
			
		||||
                                                   MetaBackgroundActorPrivate);
 | 
			
		||||
 | 
			
		||||
  priv->vignette = FALSE;
 | 
			
		||||
  priv->brightness = 1.0;
 | 
			
		||||
  priv->vignette_sharpness = 0.0;
 | 
			
		||||
  self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
 | 
			
		||||
                                            META_TYPE_BACKGROUND_ACTOR,
 | 
			
		||||
                                            MetaBackgroundActorPrivate);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
@@ -708,7 +609,6 @@ on_background_changed (MetaBackground      *background,
 | 
			
		||||
                       MetaBackgroundActor *self)
 | 
			
		||||
{
 | 
			
		||||
  invalidate_pipeline (self, CHANGED_BACKGROUND);
 | 
			
		||||
  clutter_actor_queue_redraw (CLUTTER_ACTOR (self));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
@@ -746,13 +646,11 @@ meta_background_actor_set_background (MetaBackgroundActor *self,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_background_actor_set_vignette (MetaBackgroundActor *self,
 | 
			
		||||
                                    gboolean             enabled,
 | 
			
		||||
meta_background_actor_add_vignette (MetaBackgroundActor *self,
 | 
			
		||||
                                    double               brightness,
 | 
			
		||||
                                    double               sharpness)
 | 
			
		||||
{
 | 
			
		||||
  MetaBackgroundActorPrivate *priv;
 | 
			
		||||
  gboolean changed = FALSE;
 | 
			
		||||
 | 
			
		||||
  g_return_if_fail (META_IS_BACKGROUND_ACTOR (self));
 | 
			
		||||
  g_return_if_fail (brightness >= 0. && brightness <= 1.);
 | 
			
		||||
@@ -760,23 +658,31 @@ meta_background_actor_set_vignette (MetaBackgroundActor *self,
 | 
			
		||||
 | 
			
		||||
  priv = self->priv;
 | 
			
		||||
 | 
			
		||||
  enabled = enabled != FALSE;
 | 
			
		||||
  if (!priv->vignette)
 | 
			
		||||
    invalidate_pipeline (self, CHANGED_EFFECTS);
 | 
			
		||||
 | 
			
		||||
  if (enabled != priv->vignette)
 | 
			
		||||
    {
 | 
			
		||||
      priv->vignette = enabled;
 | 
			
		||||
      invalidate_pipeline (self, CHANGED_EFFECTS);
 | 
			
		||||
      changed = TRUE;
 | 
			
		||||
    }
 | 
			
		||||
  priv->vignette = TRUE;
 | 
			
		||||
  priv->brightness = brightness;
 | 
			
		||||
  priv->vignette_sharpness = sharpness;
 | 
			
		||||
  invalidate_pipeline (self, CHANGED_VIGNETTE_PARAMETERS);
 | 
			
		||||
 | 
			
		||||
  if (brightness != priv->brightness || sharpness != priv->vignette_sharpness)
 | 
			
		||||
    {
 | 
			
		||||
      priv->brightness = brightness;
 | 
			
		||||
      priv->vignette_sharpness = sharpness;
 | 
			
		||||
      invalidate_pipeline (self, CHANGED_VIGNETTE_PARAMETERS);
 | 
			
		||||
      changed = TRUE;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  if (changed)
 | 
			
		||||
    clutter_actor_queue_redraw (CLUTTER_ACTOR (self));
 | 
			
		||||
  clutter_actor_queue_redraw (CLUTTER_ACTOR (self));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_background_actor_remove_vignette (MetaBackgroundActor *self)
 | 
			
		||||
{
 | 
			
		||||
  MetaBackgroundActorPrivate *priv;
 | 
			
		||||
  priv = self->priv;
 | 
			
		||||
 | 
			
		||||
  g_return_if_fail (META_IS_BACKGROUND_ACTOR (self));
 | 
			
		||||
 | 
			
		||||
  if (!priv->vignette)
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  priv->vignette = FALSE;
 | 
			
		||||
 | 
			
		||||
  invalidate_pipeline (self, CHANGED_EFFECTS);
 | 
			
		||||
  clutter_actor_queue_redraw (CLUTTER_ACTOR (self));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -168,10 +168,8 @@ file_loaded (GObject      *source_object,
 | 
			
		||||
  pixels = gdk_pixbuf_get_pixels (pixbuf);
 | 
			
		||||
  has_alpha = gdk_pixbuf_get_has_alpha (pixbuf);
 | 
			
		||||
 | 
			
		||||
  texture = meta_create_texture (width, height,
 | 
			
		||||
                                 has_alpha ? COGL_TEXTURE_COMPONENTS_RGBA : COGL_TEXTURE_COMPONENTS_RGB,
 | 
			
		||||
                                 META_TEXTURE_ALLOW_SLICING);
 | 
			
		||||
 | 
			
		||||
  texture = meta_create_large_texture (width, height,
 | 
			
		||||
                                       has_alpha ? COGL_TEXTURE_COMPONENTS_RGBA : COGL_TEXTURE_COMPONENTS_RGB);
 | 
			
		||||
  if (!cogl_texture_set_data (texture,
 | 
			
		||||
                              has_alpha ? COGL_PIXEL_FORMAT_RGBA_8888 : COGL_PIXEL_FORMAT_RGB_888,
 | 
			
		||||
                              row_stride,
 | 
			
		||||
@@ -185,9 +183,6 @@ file_loaded (GObject      *source_object,
 | 
			
		||||
  image->texture = texture;
 | 
			
		||||
 | 
			
		||||
out:
 | 
			
		||||
  if (pixbuf != NULL)
 | 
			
		||||
    g_object_unref (pixbuf);
 | 
			
		||||
 | 
			
		||||
  image->loaded = TRUE;
 | 
			
		||||
  g_signal_emit (image, signals[LOADED], 0);
 | 
			
		||||
}
 | 
			
		||||
@@ -249,8 +244,8 @@ meta_background_image_cache_purge (MetaBackgroundImageCache *cache,
 | 
			
		||||
{
 | 
			
		||||
  MetaBackgroundImage *image;
 | 
			
		||||
 | 
			
		||||
  g_return_if_fail (META_IS_BACKGROUND_IMAGE_CACHE (cache));
 | 
			
		||||
  g_return_if_fail (filename != NULL);
 | 
			
		||||
  g_return_val_if_fail (META_IS_BACKGROUND_IMAGE_CACHE (cache), NULL);
 | 
			
		||||
  g_return_val_if_fail (filename != NULL, NULL);
 | 
			
		||||
 | 
			
		||||
  image = g_hash_table_lookup (cache->images, filename);
 | 
			
		||||
  if (image == NULL)
 | 
			
		||||
@@ -318,7 +313,7 @@ meta_background_image_is_loaded (MetaBackgroundImage *image)
 | 
			
		||||
 * @image: a #MetaBackgroundImage
 | 
			
		||||
 *
 | 
			
		||||
 * This function is a convenience function for checking for success,
 | 
			
		||||
 * without having to call meta_background_image_get_texture() and
 | 
			
		||||
 * without having to call meta_background_image_get_success() and
 | 
			
		||||
 * handle the return of a Cogl type.
 | 
			
		||||
 *
 | 
			
		||||
 * Return value: %TRUE if loading completed successfully, otherwise %FALSE
 | 
			
		||||
 
 | 
			
		||||
@@ -59,8 +59,6 @@ struct _MetaBackgroundPrivate
 | 
			
		||||
  CoglTexture *wallpaper_texture;
 | 
			
		||||
 | 
			
		||||
  float blend_factor;
 | 
			
		||||
 | 
			
		||||
  guint wallpaper_allocation_failed : 1;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
enum
 | 
			
		||||
@@ -116,8 +114,6 @@ free_wallpaper_texture (MetaBackground *self)
 | 
			
		||||
      cogl_object_unref (priv->wallpaper_texture);
 | 
			
		||||
      priv->wallpaper_texture = NULL;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  priv->wallpaper_allocation_failed = FALSE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
@@ -133,13 +129,8 @@ on_monitors_changed (MetaScreen     *screen,
 | 
			
		||||
 | 
			
		||||
  if (priv->screen)
 | 
			
		||||
    {
 | 
			
		||||
      int i;
 | 
			
		||||
 | 
			
		||||
      priv->n_monitors = meta_screen_get_n_monitors (screen);
 | 
			
		||||
      priv->monitors = g_new0 (MetaBackgroundMonitor, priv->n_monitors);
 | 
			
		||||
 | 
			
		||||
      for (i = 0; i < priv->n_monitors; i++)
 | 
			
		||||
        priv->monitors[i].dirty = TRUE;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -335,16 +326,6 @@ meta_background_init (MetaBackground *self)
 | 
			
		||||
                                            MetaBackgroundPrivate);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
set_texture_area_from_monitor_area (cairo_rectangle_int_t *monitor_area,
 | 
			
		||||
                                    cairo_rectangle_int_t *texture_area)
 | 
			
		||||
{
 | 
			
		||||
  texture_area->x = 0;
 | 
			
		||||
  texture_area->y = 0;
 | 
			
		||||
  texture_area->width = monitor_area->width;
 | 
			
		||||
  texture_area->height = monitor_area->height;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
get_texture_area (MetaBackground          *self,
 | 
			
		||||
                  cairo_rectangle_int_t   *monitor_rect,
 | 
			
		||||
@@ -367,7 +348,7 @@ get_texture_area (MetaBackground          *self,
 | 
			
		||||
      /* paint region is whole actor, and the texture
 | 
			
		||||
       * is scaled disproportionately to fit the actor
 | 
			
		||||
       */
 | 
			
		||||
      set_texture_area_from_monitor_area (monitor_rect, texture_area);
 | 
			
		||||
      *texture_area = *monitor_rect;
 | 
			
		||||
      break;
 | 
			
		||||
    case G_DESKTOP_BACKGROUND_STYLE_WALLPAPER:
 | 
			
		||||
      meta_screen_get_size (priv->screen, &screen_width, &screen_height);
 | 
			
		||||
@@ -391,8 +372,8 @@ get_texture_area (MetaBackground          *self,
 | 
			
		||||
       * and the texture is scaled to the original image size */
 | 
			
		||||
      image_area.width = texture_width;
 | 
			
		||||
      image_area.height = texture_height;
 | 
			
		||||
      image_area.x = monitor_rect->width / 2 - image_area.width / 2;
 | 
			
		||||
      image_area.y = monitor_rect->height / 2 - image_area.height / 2;
 | 
			
		||||
      image_area.x = monitor_rect->x + monitor_rect->width / 2 - image_area.width / 2;
 | 
			
		||||
      image_area.y = monitor_rect->y + monitor_rect->height / 2 - image_area.height / 2;
 | 
			
		||||
 | 
			
		||||
      *texture_area = image_area;
 | 
			
		||||
      break;
 | 
			
		||||
@@ -417,8 +398,8 @@ get_texture_area (MetaBackground          *self,
 | 
			
		||||
          image_area.height = texture_height * monitor_x_scale;
 | 
			
		||||
 | 
			
		||||
          /* Position image centered vertically in actor */
 | 
			
		||||
          image_area.x = 0;
 | 
			
		||||
          image_area.y = monitor_rect->height / 2 - image_area.height / 2;
 | 
			
		||||
          image_area.x = monitor_rect->x;
 | 
			
		||||
          image_area.y = monitor_rect->y + monitor_rect->height / 2 - image_area.height / 2;
 | 
			
		||||
        }
 | 
			
		||||
      else
 | 
			
		||||
        {
 | 
			
		||||
@@ -427,8 +408,8 @@ get_texture_area (MetaBackground          *self,
 | 
			
		||||
          image_area.height = monitor_rect->height;
 | 
			
		||||
 | 
			
		||||
          /* Position image centered horizontally in actor */
 | 
			
		||||
          image_area.x = monitor_rect->width / 2 - image_area.width / 2;
 | 
			
		||||
          image_area.y = 0;
 | 
			
		||||
          image_area.x = monitor_rect->x + monitor_rect->width / 2 - image_area.width / 2;
 | 
			
		||||
          image_area.y = monitor_rect->y;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      *texture_area = image_area;
 | 
			
		||||
@@ -510,7 +491,7 @@ ensure_color_texture (MetaBackground *self)
 | 
			
		||||
    {
 | 
			
		||||
      ClutterBackend *backend = clutter_get_default_backend ();
 | 
			
		||||
      CoglContext *ctx = clutter_backend_get_cogl_context (backend);
 | 
			
		||||
      uint8_t pixels[6];
 | 
			
		||||
      uint8_t pixels[8];
 | 
			
		||||
      int width, height;
 | 
			
		||||
 | 
			
		||||
      if (priv->shading_direction == G_DESKTOP_BACKGROUND_SHADING_SOLID)
 | 
			
		||||
@@ -521,6 +502,7 @@ ensure_color_texture (MetaBackground *self)
 | 
			
		||||
          pixels[0] = priv->color.red;
 | 
			
		||||
          pixels[1] = priv->color.green;
 | 
			
		||||
          pixels[2] = priv->color.blue;
 | 
			
		||||
          pixels[3] = 0xFF;
 | 
			
		||||
        }
 | 
			
		||||
      else
 | 
			
		||||
        {
 | 
			
		||||
@@ -541,14 +523,16 @@ ensure_color_texture (MetaBackground *self)
 | 
			
		||||
          pixels[0] = priv->color.red;
 | 
			
		||||
          pixels[1] = priv->color.green;
 | 
			
		||||
          pixels[2] = priv->color.blue;
 | 
			
		||||
          pixels[3] = priv->second_color.red;
 | 
			
		||||
          pixels[4] = priv->second_color.green;
 | 
			
		||||
          pixels[5] = priv->second_color.blue;
 | 
			
		||||
          pixels[3] = 0xFF;
 | 
			
		||||
          pixels[4] = priv->second_color.red;
 | 
			
		||||
          pixels[5] = priv->second_color.green;
 | 
			
		||||
          pixels[6] = priv->second_color.blue;
 | 
			
		||||
          pixels[7] = 0xFF;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      priv->color_texture = COGL_TEXTURE (cogl_texture_2d_new_from_data (ctx, width, height,
 | 
			
		||||
                                                                         COGL_PIXEL_FORMAT_RGB_888,
 | 
			
		||||
                                                                         width * 3,
 | 
			
		||||
                                                                         4,
 | 
			
		||||
                                                                         pixels,
 | 
			
		||||
                                                                         NULL));
 | 
			
		||||
    }
 | 
			
		||||
@@ -599,13 +583,13 @@ texture_has_alpha (CoglTexture *texture)
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static gboolean
 | 
			
		||||
static void
 | 
			
		||||
ensure_wallpaper_texture (MetaBackground *self,
 | 
			
		||||
                          CoglTexture    *texture)
 | 
			
		||||
{
 | 
			
		||||
  MetaBackgroundPrivate *priv = self->priv;
 | 
			
		||||
 | 
			
		||||
  if (priv->wallpaper_texture == NULL && !priv->wallpaper_allocation_failed)
 | 
			
		||||
  if (priv->wallpaper_texture == NULL)
 | 
			
		||||
    {
 | 
			
		||||
      int width = cogl_texture_get_width (texture);
 | 
			
		||||
      int height = cogl_texture_get_height (texture);
 | 
			
		||||
@@ -613,25 +597,14 @@ ensure_wallpaper_texture (MetaBackground *self,
 | 
			
		||||
      CoglError *catch_error = NULL;
 | 
			
		||||
      CoglPipeline *pipeline;
 | 
			
		||||
 | 
			
		||||
      priv->wallpaper_texture = meta_create_texture (width, height,
 | 
			
		||||
                                                     COGL_TEXTURE_COMPONENTS_RGBA,
 | 
			
		||||
                                                     META_TEXTURE_FLAGS_NONE);
 | 
			
		||||
      priv->wallpaper_texture = meta_create_large_texture (width, height,
 | 
			
		||||
                                                           COGL_TEXTURE_COMPONENTS_RGBA);
 | 
			
		||||
      fbo = cogl_offscreen_new_with_texture (priv->wallpaper_texture);
 | 
			
		||||
 | 
			
		||||
      if (!cogl_framebuffer_allocate (fbo, &catch_error))
 | 
			
		||||
        {
 | 
			
		||||
          /* This probably means that the size of the wallpapered texture is larger
 | 
			
		||||
           * than the maximum texture size; we treat it as permanent until the
 | 
			
		||||
           * background is changed again.
 | 
			
		||||
           */
 | 
			
		||||
          cogl_error_free (catch_error);
 | 
			
		||||
 | 
			
		||||
          cogl_object_unref (priv->wallpaper_texture);
 | 
			
		||||
          priv->wallpaper_texture = NULL;
 | 
			
		||||
          cogl_object_unref (fbo);
 | 
			
		||||
 | 
			
		||||
          priv->wallpaper_allocation_failed = TRUE;
 | 
			
		||||
          return FALSE;
 | 
			
		||||
          return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      cogl_framebuffer_orthographic (fbo, 0, 0,
 | 
			
		||||
@@ -655,8 +628,6 @@ ensure_wallpaper_texture (MetaBackground *self,
 | 
			
		||||
 | 
			
		||||
      cogl_object_unref (fbo);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  return priv->wallpaper_texture != NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static CoglPipelineWrapMode
 | 
			
		||||
@@ -689,9 +660,9 @@ meta_background_get_texture (MetaBackground         *self,
 | 
			
		||||
  cairo_rectangle_int_t monitor_area;
 | 
			
		||||
  CoglTexture *texture1, *texture2;
 | 
			
		||||
 | 
			
		||||
  g_return_val_if_fail (META_IS_BACKGROUND (self), NULL);
 | 
			
		||||
  g_return_if_fail (META_IS_BACKGROUND (self));
 | 
			
		||||
  priv = self->priv;
 | 
			
		||||
  g_return_val_if_fail (monitor_index >= 0 && monitor_index < priv->n_monitors, NULL);
 | 
			
		||||
  g_return_if_fail (monitor_index <= 0 && monitor_index < priv->n_monitors);
 | 
			
		||||
 | 
			
		||||
  monitor = &priv->monitors[monitor_index];
 | 
			
		||||
 | 
			
		||||
@@ -708,16 +679,16 @@ meta_background_get_texture (MetaBackground         *self,
 | 
			
		||||
    {
 | 
			
		||||
      ensure_color_texture (self);
 | 
			
		||||
      if (texture_area)
 | 
			
		||||
        set_texture_area_from_monitor_area (&monitor_area, texture_area);
 | 
			
		||||
        *texture_area = monitor_area;
 | 
			
		||||
      if (wrap_mode)
 | 
			
		||||
        *wrap_mode = COGL_PIPELINE_WRAP_MODE_CLAMP_TO_EDGE;
 | 
			
		||||
      return priv->color_texture;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  if (texture2 == NULL && priv->style == G_DESKTOP_BACKGROUND_STYLE_WALLPAPER &&
 | 
			
		||||
      priv->shading_direction == G_DESKTOP_BACKGROUND_SHADING_SOLID &&
 | 
			
		||||
      ensure_wallpaper_texture (self, texture1))
 | 
			
		||||
      priv->shading_direction == G_DESKTOP_BACKGROUND_SHADING_SOLID)
 | 
			
		||||
    {
 | 
			
		||||
      ensure_wallpaper_texture (self, texture1);
 | 
			
		||||
      if (texture_area)
 | 
			
		||||
        get_texture_area (self, &monitor_area, priv->wallpaper_texture,
 | 
			
		||||
                          texture_area);
 | 
			
		||||
@@ -732,23 +703,13 @@ meta_background_get_texture (MetaBackground         *self,
 | 
			
		||||
 | 
			
		||||
      if (monitor->texture == NULL)
 | 
			
		||||
        {
 | 
			
		||||
          monitor->texture = meta_create_texture (monitor_area.width, monitor_area.height,
 | 
			
		||||
                                                  COGL_TEXTURE_COMPONENTS_RGBA,
 | 
			
		||||
                                                  META_TEXTURE_FLAGS_NONE);
 | 
			
		||||
          monitor->texture = meta_create_large_texture (monitor_area.width, monitor_area.height,
 | 
			
		||||
                                                        COGL_TEXTURE_COMPONENTS_RGBA);
 | 
			
		||||
          monitor->fbo = cogl_offscreen_new_with_texture (monitor->texture);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      if (!cogl_framebuffer_allocate (monitor->fbo, &catch_error))
 | 
			
		||||
        {
 | 
			
		||||
          /* Texture or framebuffer allocation failed; it's unclear why this happened;
 | 
			
		||||
           * we'll try again the next time this is called. (MetaBackgroundActor
 | 
			
		||||
           * caches the result, so user might be left without a background.)
 | 
			
		||||
           */
 | 
			
		||||
          cogl_object_unref (monitor->texture);
 | 
			
		||||
          monitor->texture = NULL;
 | 
			
		||||
          cogl_object_unref (monitor->fbo);
 | 
			
		||||
          monitor->fbo = NULL;
 | 
			
		||||
 | 
			
		||||
          cogl_error_free (catch_error);
 | 
			
		||||
          return NULL;
 | 
			
		||||
        }
 | 
			
		||||
@@ -814,8 +775,7 @@ meta_background_get_texture (MetaBackground         *self,
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  if (texture_area)
 | 
			
		||||
    set_texture_area_from_monitor_area (&monitor_area, texture_area);
 | 
			
		||||
 | 
			
		||||
    *texture_area = monitor_area;
 | 
			
		||||
  if (wrap_mode)
 | 
			
		||||
    *wrap_mode = COGL_PIPELINE_WRAP_MODE_CLAMP_TO_EDGE;
 | 
			
		||||
  return monitor->texture;
 | 
			
		||||
@@ -825,7 +785,7 @@ MetaBackground *
 | 
			
		||||
meta_background_new  (MetaScreen *screen)
 | 
			
		||||
{
 | 
			
		||||
  return g_object_new (META_TYPE_BACKGROUND,
 | 
			
		||||
                       "meta-screen", screen,
 | 
			
		||||
                       "screen", screen,
 | 
			
		||||
                       NULL);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,64 +0,0 @@
 | 
			
		||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
 | 
			
		||||
/*
 | 
			
		||||
 * meta-dnd-actor-private.h: Actor for painting the DnD surface
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright 2014 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/>.
 | 
			
		||||
 *
 | 
			
		||||
 * Author: Carlos Garnacho <carlosg@gnome.org>
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef META_DND_ACTOR_PRIVATE_H
 | 
			
		||||
#define META_DND_ACTOR_PRIVATE_H
 | 
			
		||||
 | 
			
		||||
#include "meta-feedback-actor-private.h"
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * MetaDnDActor:
 | 
			
		||||
 *
 | 
			
		||||
 * This class handles the rendering of the DnD surface
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define META_TYPE_DND_ACTOR            (meta_dnd_actor_get_type ())
 | 
			
		||||
#define META_DND_ACTOR(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_DND_ACTOR, MetaDnDActor))
 | 
			
		||||
#define META_DND_ACTOR_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_DND_ACTOR, MetaDnDActorClass))
 | 
			
		||||
#define META_IS_DND_ACTOR(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_DND_ACTOR))
 | 
			
		||||
#define META_IS_DND_ACTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_DND_ACTOR))
 | 
			
		||||
#define META_DND_ACTOR_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_DND_ACTOR, MetaDnDActorClass))
 | 
			
		||||
 | 
			
		||||
typedef struct _MetaDnDActor        MetaDnDActor;
 | 
			
		||||
typedef struct _MetaDnDActorClass   MetaDnDActorClass;
 | 
			
		||||
 | 
			
		||||
struct _MetaDnDActorClass
 | 
			
		||||
{
 | 
			
		||||
  /*< private >*/
 | 
			
		||||
  MetaFeedbackActorClass parent_class;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct _MetaDnDActor
 | 
			
		||||
{
 | 
			
		||||
  MetaFeedbackActor parent;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
GType         meta_dnd_actor_get_type (void);
 | 
			
		||||
 | 
			
		||||
ClutterActor *meta_dnd_actor_new (ClutterActor *drag_origin,
 | 
			
		||||
                                  int           start_x,
 | 
			
		||||
                                  int           start_y);
 | 
			
		||||
 | 
			
		||||
void          meta_dnd_actor_drag_finish (MetaDnDActor *self,
 | 
			
		||||
                                          gboolean      success);
 | 
			
		||||
 | 
			
		||||
#endif /* META_DND_ACTOR_PRIVATE_H */
 | 
			
		||||
@@ -1,231 +0,0 @@
 | 
			
		||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright 2014 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/>.
 | 
			
		||||
 *
 | 
			
		||||
 * Author: Carlos Garnacho <carlosg@gnome.org>
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * SECTION:meta-dnd-actor
 | 
			
		||||
 * @title: MetaDnDActor
 | 
			
		||||
 * @short_description: Actor for painting the drag and drop surface
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <config.h>
 | 
			
		||||
 | 
			
		||||
#include <clutter/clutter.h>
 | 
			
		||||
 | 
			
		||||
#include "meta-dnd-actor-private.h"
 | 
			
		||||
 | 
			
		||||
#define DRAG_FAILED_DURATION 500
 | 
			
		||||
 | 
			
		||||
enum {
 | 
			
		||||
  PROP_DRAG_ORIGIN = 1,
 | 
			
		||||
  PROP_DRAG_START_X,
 | 
			
		||||
  PROP_DRAG_START_Y
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef struct _MetaDnDActorPrivate MetaDnDActorPrivate;
 | 
			
		||||
 | 
			
		||||
struct _MetaDnDActorPrivate
 | 
			
		||||
{
 | 
			
		||||
  ClutterActor *drag_origin;
 | 
			
		||||
  int drag_start_x;
 | 
			
		||||
  int drag_start_y;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
G_DEFINE_TYPE_WITH_PRIVATE (MetaDnDActor, meta_dnd_actor, META_TYPE_FEEDBACK_ACTOR)
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_dnd_actor_set_property (GObject      *object,
 | 
			
		||||
                             guint         prop_id,
 | 
			
		||||
                             const GValue *value,
 | 
			
		||||
                             GParamSpec   *pspec)
 | 
			
		||||
{
 | 
			
		||||
  MetaDnDActor *self = META_DND_ACTOR (object);
 | 
			
		||||
  MetaDnDActorPrivate *priv = meta_dnd_actor_get_instance_private (self);
 | 
			
		||||
 | 
			
		||||
  switch (prop_id)
 | 
			
		||||
    {
 | 
			
		||||
    case PROP_DRAG_ORIGIN:
 | 
			
		||||
      priv->drag_origin = g_value_get_object (value);
 | 
			
		||||
      break;
 | 
			
		||||
    case PROP_DRAG_START_X:
 | 
			
		||||
      priv->drag_start_x = g_value_get_int (value);
 | 
			
		||||
      break;
 | 
			
		||||
    case PROP_DRAG_START_Y:
 | 
			
		||||
      priv->drag_start_y = g_value_get_int (value);
 | 
			
		||||
      break;
 | 
			
		||||
    default:
 | 
			
		||||
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
 | 
			
		||||
      break;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_dnd_actor_get_property (GObject      *object,
 | 
			
		||||
                             guint         prop_id,
 | 
			
		||||
                             GValue       *value,
 | 
			
		||||
                             GParamSpec   *pspec)
 | 
			
		||||
{
 | 
			
		||||
  MetaDnDActor *self = META_DND_ACTOR (object);
 | 
			
		||||
  MetaDnDActorPrivate *priv = meta_dnd_actor_get_instance_private (self);
 | 
			
		||||
 | 
			
		||||
  switch (prop_id)
 | 
			
		||||
    {
 | 
			
		||||
    case PROP_DRAG_ORIGIN:
 | 
			
		||||
      g_value_set_object (value, priv->drag_origin);
 | 
			
		||||
      break;
 | 
			
		||||
    case PROP_DRAG_START_X:
 | 
			
		||||
      g_value_set_int (value, priv->drag_start_x);
 | 
			
		||||
      break;
 | 
			
		||||
    case PROP_DRAG_START_Y:
 | 
			
		||||
      g_value_set_int (value, priv->drag_start_y);
 | 
			
		||||
      break;
 | 
			
		||||
    default:
 | 
			
		||||
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
 | 
			
		||||
      break;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_dnd_actor_class_init (MetaDnDActorClass *klass)
 | 
			
		||||
{
 | 
			
		||||
  GObjectClass *object_class = G_OBJECT_CLASS (klass);
 | 
			
		||||
  GParamSpec *pspec;
 | 
			
		||||
 | 
			
		||||
  object_class->set_property = meta_dnd_actor_set_property;
 | 
			
		||||
  object_class->get_property = meta_dnd_actor_get_property;
 | 
			
		||||
 | 
			
		||||
  pspec = g_param_spec_object ("drag-origin",
 | 
			
		||||
                               "Drag origin",
 | 
			
		||||
                               "The origin of the DnD operation",
 | 
			
		||||
                               CLUTTER_TYPE_ACTOR,
 | 
			
		||||
                               G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
 | 
			
		||||
 | 
			
		||||
  g_object_class_install_property (object_class,
 | 
			
		||||
                                   PROP_DRAG_ORIGIN,
 | 
			
		||||
                                   pspec);
 | 
			
		||||
 | 
			
		||||
  pspec = g_param_spec_int ("drag-start-x",
 | 
			
		||||
                            "Drag start X",
 | 
			
		||||
                            "The X axis of the drag start point",
 | 
			
		||||
                            0, G_MAXINT, 0,
 | 
			
		||||
                            G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
 | 
			
		||||
 | 
			
		||||
  g_object_class_install_property (object_class,
 | 
			
		||||
                                   PROP_DRAG_START_X,
 | 
			
		||||
                                   pspec);
 | 
			
		||||
 | 
			
		||||
  pspec = g_param_spec_int ("drag-start-y",
 | 
			
		||||
                            "Drag start Y",
 | 
			
		||||
                            "The Y axis of the drag start point",
 | 
			
		||||
                            0, G_MAXINT, 0,
 | 
			
		||||
                            G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
 | 
			
		||||
 | 
			
		||||
  g_object_class_install_property (object_class,
 | 
			
		||||
                                   PROP_DRAG_START_Y,
 | 
			
		||||
                                   pspec);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_dnd_actor_init (MetaDnDActor *self)
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * meta_dnd_actor_new:
 | 
			
		||||
 *
 | 
			
		||||
 * Creates a new actor to draw the current drag and drop surface.
 | 
			
		||||
 *
 | 
			
		||||
 * Return value: the newly created background actor
 | 
			
		||||
 */
 | 
			
		||||
ClutterActor *
 | 
			
		||||
meta_dnd_actor_new (ClutterActor *drag_origin,
 | 
			
		||||
                    int           drag_start_x,
 | 
			
		||||
                    int           drag_start_y)
 | 
			
		||||
{
 | 
			
		||||
  MetaDnDActor *self;
 | 
			
		||||
 | 
			
		||||
  self = g_object_new (META_TYPE_DND_ACTOR,
 | 
			
		||||
                       "drag-origin", drag_origin,
 | 
			
		||||
                       "drag-start-x", drag_start_x,
 | 
			
		||||
                       "drag-start-y", drag_start_y,
 | 
			
		||||
                       NULL);
 | 
			
		||||
 | 
			
		||||
  return CLUTTER_ACTOR (self);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
drag_failed_complete (ClutterTimeline *timeline,
 | 
			
		||||
                      gboolean         is_finished,
 | 
			
		||||
                      gpointer         user_data)
 | 
			
		||||
{
 | 
			
		||||
  ClutterActor *self = user_data;
 | 
			
		||||
 | 
			
		||||
  clutter_actor_remove_all_children (self);
 | 
			
		||||
  clutter_actor_destroy (self);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_dnd_actor_drag_finish (MetaDnDActor *self,
 | 
			
		||||
                            gboolean      success)
 | 
			
		||||
{
 | 
			
		||||
  MetaDnDActorPrivate *priv;
 | 
			
		||||
  ClutterActor *actor;
 | 
			
		||||
 | 
			
		||||
  g_return_if_fail (META_IS_DND_ACTOR (self));
 | 
			
		||||
 | 
			
		||||
  actor = CLUTTER_ACTOR (self);
 | 
			
		||||
  priv = meta_dnd_actor_get_instance_private (self);
 | 
			
		||||
 | 
			
		||||
  if (success)
 | 
			
		||||
    {
 | 
			
		||||
      clutter_actor_remove_all_children (CLUTTER_ACTOR (self));
 | 
			
		||||
      clutter_actor_destroy (CLUTTER_ACTOR (self));
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    {
 | 
			
		||||
      ClutterTransition *transition;
 | 
			
		||||
 | 
			
		||||
      clutter_actor_save_easing_state (actor);
 | 
			
		||||
      clutter_actor_set_easing_mode (actor, CLUTTER_EASE_OUT_CUBIC);
 | 
			
		||||
      clutter_actor_set_easing_duration (actor, DRAG_FAILED_DURATION);
 | 
			
		||||
      clutter_actor_set_opacity (actor, 0);
 | 
			
		||||
 | 
			
		||||
      if (CLUTTER_ACTOR_IS_VISIBLE (priv->drag_origin))
 | 
			
		||||
        {
 | 
			
		||||
          int anchor_x, anchor_y;
 | 
			
		||||
          ClutterPoint dest;
 | 
			
		||||
 | 
			
		||||
          clutter_actor_get_transformed_position (priv->drag_origin,
 | 
			
		||||
                                                  &dest.x, &dest.y);
 | 
			
		||||
          meta_feedback_actor_get_anchor (META_FEEDBACK_ACTOR (self),
 | 
			
		||||
                                          &anchor_x, &anchor_y);
 | 
			
		||||
 | 
			
		||||
          dest.x += priv->drag_start_x - anchor_x;
 | 
			
		||||
          dest.y += priv->drag_start_y - anchor_y;
 | 
			
		||||
          clutter_actor_set_position (actor, dest.x, dest.y);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      transition = clutter_actor_get_transition (actor, "opacity");
 | 
			
		||||
      g_signal_connect (transition, "stopped",
 | 
			
		||||
                        G_CALLBACK (drag_failed_complete), self);
 | 
			
		||||
 | 
			
		||||
      clutter_actor_restore_easing_state (actor);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,74 +0,0 @@
 | 
			
		||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
 | 
			
		||||
/*
 | 
			
		||||
 * meta-feedback-actor-private.h: Actor for painting user interaction feedback
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright 2014 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/>.
 | 
			
		||||
 *
 | 
			
		||||
 * Author: Carlos Garnacho <carlosg@gnome.org>
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef META_FEEDBACK_ACTOR_PRIVATE_H
 | 
			
		||||
#define META_FEEDBACK_ACTOR_PRIVATE_H
 | 
			
		||||
 | 
			
		||||
#include <clutter/clutter.h>
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * MetaFeedbackActor:
 | 
			
		||||
 *
 | 
			
		||||
 * This class handles the rendering of user interaction feedback
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define META_TYPE_FEEDBACK_ACTOR            (meta_feedback_actor_get_type ())
 | 
			
		||||
#define META_FEEDBACK_ACTOR(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_FEEDBACK_ACTOR, MetaFeedbackActor))
 | 
			
		||||
#define META_FEEDBACK_ACTOR_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_FEEDBACK_ACTOR, MetaFeedbackActorClass))
 | 
			
		||||
#define META_IS_FEEDBACK_ACTOR(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_FEEDBACK_ACTOR))
 | 
			
		||||
#define META_IS_FEEDBACK_ACTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_FEEDBACK_ACTOR))
 | 
			
		||||
#define META_FEEDBACK_ACTOR_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_FEEDBACK_ACTOR, MetaFeedbackActorClass))
 | 
			
		||||
 | 
			
		||||
typedef struct _MetaFeedbackActor        MetaFeedbackActor;
 | 
			
		||||
typedef struct _MetaFeedbackActorClass   MetaFeedbackActorClass;
 | 
			
		||||
 | 
			
		||||
struct _MetaFeedbackActorClass
 | 
			
		||||
{
 | 
			
		||||
  /*< private >*/
 | 
			
		||||
  ClutterActorClass parent_class;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct _MetaFeedbackActor
 | 
			
		||||
{
 | 
			
		||||
  ClutterActor parent;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
GType meta_feedback_actor_get_type (void);
 | 
			
		||||
 | 
			
		||||
ClutterActor *meta_feedback_actor_new (int anchor_x,
 | 
			
		||||
                                       int anchor_y);
 | 
			
		||||
 | 
			
		||||
void meta_feedback_actor_set_anchor (MetaFeedbackActor *actor,
 | 
			
		||||
                                     int                anchor_x,
 | 
			
		||||
                                     int                anchor_y);
 | 
			
		||||
void meta_feedback_actor_get_anchor (MetaFeedbackActor *actor,
 | 
			
		||||
                                     int               *anchor_x,
 | 
			
		||||
                                     int               *anchor_y);
 | 
			
		||||
 | 
			
		||||
void meta_feedback_actor_set_position (MetaFeedbackActor  *self,
 | 
			
		||||
                                       int                 x,
 | 
			
		||||
                                       int                 y);
 | 
			
		||||
 | 
			
		||||
void meta_feedback_actor_update (MetaFeedbackActor  *self,
 | 
			
		||||
                                 const ClutterEvent *event);
 | 
			
		||||
 | 
			
		||||
#endif /* META_FEEDBACK_ACTOR_PRIVATE_H */
 | 
			
		||||
@@ -1,249 +0,0 @@
 | 
			
		||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright 2014 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/>.
 | 
			
		||||
 *
 | 
			
		||||
 * Author: Carlos Garnacho <carlosg@gnome.org>
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * SECTION:meta-feedback-actor
 | 
			
		||||
 * @title: MetaFeedbackActor
 | 
			
		||||
 * @short_description: Actor for painting user interaction feedback
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <config.h>
 | 
			
		||||
 | 
			
		||||
#include "display-private.h"
 | 
			
		||||
#include "compositor-private.h"
 | 
			
		||||
#include "meta-feedback-actor-private.h"
 | 
			
		||||
 | 
			
		||||
enum {
 | 
			
		||||
  PROP_ANCHOR_X = 1,
 | 
			
		||||
  PROP_ANCHOR_Y
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef struct _MetaFeedbackActorPrivate MetaFeedbackActorPrivate;
 | 
			
		||||
 | 
			
		||||
struct _MetaFeedbackActorPrivate
 | 
			
		||||
{
 | 
			
		||||
  int anchor_x;
 | 
			
		||||
  int anchor_y;
 | 
			
		||||
  int pos_x;
 | 
			
		||||
  int pos_y;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
G_DEFINE_TYPE_WITH_PRIVATE (MetaFeedbackActor, meta_feedback_actor, CLUTTER_TYPE_ACTOR)
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_feedback_actor_constructed (GObject *object)
 | 
			
		||||
{
 | 
			
		||||
  MetaDisplay *display;
 | 
			
		||||
 | 
			
		||||
  display = meta_get_display ();
 | 
			
		||||
  clutter_actor_add_child (display->compositor->feedback_group,
 | 
			
		||||
                           CLUTTER_ACTOR (object));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_feedback_actor_update_position (MetaFeedbackActor *self)
 | 
			
		||||
{
 | 
			
		||||
  MetaFeedbackActorPrivate *priv = meta_feedback_actor_get_instance_private (self);
 | 
			
		||||
 | 
			
		||||
  clutter_actor_set_position (CLUTTER_ACTOR (self),
 | 
			
		||||
                              priv->pos_x - priv->anchor_x,
 | 
			
		||||
                              priv->pos_y - priv->anchor_y);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_feedback_actor_set_property (GObject      *object,
 | 
			
		||||
                                  guint         prop_id,
 | 
			
		||||
                                  const GValue *value,
 | 
			
		||||
                                  GParamSpec   *pspec)
 | 
			
		||||
{
 | 
			
		||||
  MetaFeedbackActor *self = META_FEEDBACK_ACTOR (object);
 | 
			
		||||
  MetaFeedbackActorPrivate *priv = meta_feedback_actor_get_instance_private (self);
 | 
			
		||||
 | 
			
		||||
  switch (prop_id)
 | 
			
		||||
    {
 | 
			
		||||
    case PROP_ANCHOR_X:
 | 
			
		||||
      priv->anchor_x = g_value_get_int (value);
 | 
			
		||||
      meta_feedback_actor_update_position (self);
 | 
			
		||||
      break;
 | 
			
		||||
    case PROP_ANCHOR_Y:
 | 
			
		||||
      priv->anchor_y = g_value_get_int (value);
 | 
			
		||||
      meta_feedback_actor_update_position (self);
 | 
			
		||||
      break;
 | 
			
		||||
    default:
 | 
			
		||||
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
 | 
			
		||||
      break;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_feedback_actor_get_property (GObject      *object,
 | 
			
		||||
                                  guint         prop_id,
 | 
			
		||||
                                  GValue       *value,
 | 
			
		||||
                                  GParamSpec   *pspec)
 | 
			
		||||
{
 | 
			
		||||
  MetaFeedbackActor *self = META_FEEDBACK_ACTOR (object);
 | 
			
		||||
  MetaFeedbackActorPrivate *priv = meta_feedback_actor_get_instance_private (self);
 | 
			
		||||
 | 
			
		||||
  switch (prop_id)
 | 
			
		||||
    {
 | 
			
		||||
    case PROP_ANCHOR_X:
 | 
			
		||||
      g_value_set_int (value, priv->anchor_x);
 | 
			
		||||
      break;
 | 
			
		||||
    case PROP_ANCHOR_Y:
 | 
			
		||||
      g_value_set_int (value, priv->anchor_y);
 | 
			
		||||
      break;
 | 
			
		||||
    default:
 | 
			
		||||
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
 | 
			
		||||
      break;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_feedback_actor_class_init (MetaFeedbackActorClass *klass)
 | 
			
		||||
{
 | 
			
		||||
  GObjectClass *object_class = G_OBJECT_CLASS (klass);
 | 
			
		||||
  GParamSpec *pspec;
 | 
			
		||||
 | 
			
		||||
  object_class->constructed = meta_feedback_actor_constructed;
 | 
			
		||||
  object_class->set_property = meta_feedback_actor_set_property;
 | 
			
		||||
  object_class->get_property = meta_feedback_actor_get_property;
 | 
			
		||||
 | 
			
		||||
  pspec = g_param_spec_int ("anchor-x",
 | 
			
		||||
                            "Anchor X",
 | 
			
		||||
                            "The X axis of the anchor point",
 | 
			
		||||
                            0, G_MAXINT, 0,
 | 
			
		||||
                            G_PARAM_READWRITE);
 | 
			
		||||
 | 
			
		||||
  g_object_class_install_property (object_class,
 | 
			
		||||
                                   PROP_ANCHOR_X,
 | 
			
		||||
                                   pspec);
 | 
			
		||||
 | 
			
		||||
  pspec = g_param_spec_int ("anchor-y",
 | 
			
		||||
                            "Anchor Y",
 | 
			
		||||
                            "The Y axis of the anchor point",
 | 
			
		||||
                            0, G_MAXINT, 0,
 | 
			
		||||
                            G_PARAM_READWRITE);
 | 
			
		||||
 | 
			
		||||
  g_object_class_install_property (object_class,
 | 
			
		||||
                                   PROP_ANCHOR_Y,
 | 
			
		||||
                                   pspec);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_feedback_actor_init (MetaFeedbackActor *self)
 | 
			
		||||
{
 | 
			
		||||
  clutter_actor_set_reactive (CLUTTER_ACTOR (self), FALSE);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * meta_feedback_actor_new:
 | 
			
		||||
 *
 | 
			
		||||
 * Creates a new actor to draw the current drag and drop surface.
 | 
			
		||||
 *
 | 
			
		||||
 * Return value: the newly created background actor
 | 
			
		||||
 */
 | 
			
		||||
ClutterActor *
 | 
			
		||||
meta_feedback_actor_new (int anchor_x,
 | 
			
		||||
                         int anchor_y)
 | 
			
		||||
{
 | 
			
		||||
  MetaFeedbackActor *self;
 | 
			
		||||
 | 
			
		||||
  self = g_object_new (META_TYPE_FEEDBACK_ACTOR,
 | 
			
		||||
                       "anchor-x", anchor_x,
 | 
			
		||||
                       "anchor-y", anchor_y,
 | 
			
		||||
                       NULL);
 | 
			
		||||
 | 
			
		||||
  return CLUTTER_ACTOR (self);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_feedback_actor_set_anchor (MetaFeedbackActor *self,
 | 
			
		||||
                                int                anchor_x,
 | 
			
		||||
                                int                anchor_y)
 | 
			
		||||
{
 | 
			
		||||
  MetaFeedbackActorPrivate *priv;
 | 
			
		||||
 | 
			
		||||
  g_return_if_fail (META_IS_FEEDBACK_ACTOR (self));
 | 
			
		||||
 | 
			
		||||
  priv = meta_feedback_actor_get_instance_private (self);
 | 
			
		||||
 | 
			
		||||
  if (priv->anchor_x == anchor_x && priv->anchor_y == anchor_y)
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  if (priv->anchor_x != anchor_y)
 | 
			
		||||
    {
 | 
			
		||||
      priv->anchor_x = anchor_x;
 | 
			
		||||
      g_object_notify (G_OBJECT (self), "anchor-x");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  if (priv->anchor_y != anchor_y)
 | 
			
		||||
    {
 | 
			
		||||
      priv->anchor_y = anchor_y;
 | 
			
		||||
      g_object_notify (G_OBJECT (self), "anchor-y");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  meta_feedback_actor_update_position (self);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_feedback_actor_get_anchor (MetaFeedbackActor *self,
 | 
			
		||||
                                int               *anchor_x,
 | 
			
		||||
                                int               *anchor_y)
 | 
			
		||||
{
 | 
			
		||||
  MetaFeedbackActorPrivate *priv;
 | 
			
		||||
 | 
			
		||||
  g_return_if_fail (META_IS_FEEDBACK_ACTOR (self));
 | 
			
		||||
 | 
			
		||||
  priv = meta_feedback_actor_get_instance_private (self);
 | 
			
		||||
 | 
			
		||||
  if (anchor_x)
 | 
			
		||||
    *anchor_x = priv->anchor_x;
 | 
			
		||||
  if (anchor_y)
 | 
			
		||||
    *anchor_y = priv->anchor_y;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_feedback_actor_set_position (MetaFeedbackActor  *self,
 | 
			
		||||
                                  int                 x,
 | 
			
		||||
                                  int                 y)
 | 
			
		||||
{
 | 
			
		||||
  MetaFeedbackActorPrivate *priv;
 | 
			
		||||
 | 
			
		||||
  g_return_if_fail (META_IS_FEEDBACK_ACTOR (self));
 | 
			
		||||
 | 
			
		||||
  priv = meta_feedback_actor_get_instance_private (self);
 | 
			
		||||
  priv->pos_x = x;
 | 
			
		||||
  priv->pos_y = y;
 | 
			
		||||
 | 
			
		||||
  meta_feedback_actor_update_position (self);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_feedback_actor_update (MetaFeedbackActor  *self,
 | 
			
		||||
                            const ClutterEvent *event)
 | 
			
		||||
{
 | 
			
		||||
  ClutterPoint point;
 | 
			
		||||
 | 
			
		||||
  g_return_if_fail (META_IS_FEEDBACK_ACTOR (self));
 | 
			
		||||
  g_return_if_fail (event != NULL);
 | 
			
		||||
 | 
			
		||||
  clutter_event_get_position (event, &point);
 | 
			
		||||
  meta_feedback_actor_set_position (self, point.x, point.y);
 | 
			
		||||
}
 | 
			
		||||
@@ -193,8 +193,8 @@ meta_surface_actor_x11_process_damage (MetaSurfaceActor *actor,
 | 
			
		||||
      MetaRectangle window_rect;
 | 
			
		||||
      meta_window_get_frame_rect (priv->window, &window_rect);
 | 
			
		||||
 | 
			
		||||
      if (x == 0 &&
 | 
			
		||||
          y == 0 &&
 | 
			
		||||
      if (window_rect.x == x &&
 | 
			
		||||
          window_rect.y == y &&
 | 
			
		||||
          window_rect.width == width &&
 | 
			
		||||
          window_rect.height == height)
 | 
			
		||||
        priv->full_damage_frames_count++;
 | 
			
		||||
@@ -383,7 +383,6 @@ window_decorated_notify (MetaWindow *window,
 | 
			
		||||
{
 | 
			
		||||
  MetaSurfaceActorX11 *self = META_SURFACE_ACTOR_X11 (user_data);
 | 
			
		||||
 | 
			
		||||
  detach_pixmap (self);
 | 
			
		||||
  free_damage (self);
 | 
			
		||||
  create_damage (self);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -406,12 +406,9 @@ meta_window_actor_update_surface (MetaWindowActor *self)
 | 
			
		||||
  MetaWindow *window = priv->window;
 | 
			
		||||
  MetaSurfaceActor *surface_actor;
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_WAYLAND
 | 
			
		||||
  if (window->surface)
 | 
			
		||||
    surface_actor = window->surface->surface_actor;
 | 
			
		||||
  else
 | 
			
		||||
#endif
 | 
			
		||||
  if (!meta_is_wayland_compositor ())
 | 
			
		||||
  else if (!meta_is_wayland_compositor ())
 | 
			
		||||
    surface_actor = meta_surface_actor_x11_new (window);
 | 
			
		||||
  else
 | 
			
		||||
    surface_actor = NULL;
 | 
			
		||||
@@ -865,7 +862,7 @@ meta_window_actor_get_surface (MetaWindowActor *self)
 | 
			
		||||
gboolean
 | 
			
		||||
meta_window_actor_is_destroyed (MetaWindowActor *self)
 | 
			
		||||
{
 | 
			
		||||
  return self->priv->disposed || self->priv->needs_destroy;
 | 
			
		||||
  return self->priv->disposed;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static gboolean
 | 
			
		||||
@@ -927,12 +924,7 @@ meta_window_actor_queue_frame_drawn (MetaWindowActor *self,
 | 
			
		||||
                                     gboolean         no_delay_frame)
 | 
			
		||||
{
 | 
			
		||||
  MetaWindowActorPrivate *priv = self->priv;
 | 
			
		||||
  FrameData *frame;
 | 
			
		||||
 | 
			
		||||
  if (meta_window_actor_is_destroyed (self))
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  frame = g_slice_new0 (FrameData);
 | 
			
		||||
  FrameData *frame = g_slice_new0 (FrameData);
 | 
			
		||||
 | 
			
		||||
  priv->needs_frame_drawn = TRUE;
 | 
			
		||||
 | 
			
		||||
@@ -1176,6 +1168,7 @@ meta_window_actor_destroy (MetaWindowActor *self)
 | 
			
		||||
{
 | 
			
		||||
  MetaWindowActorPrivate *priv = self->priv;
 | 
			
		||||
  MetaWindow *window = priv->window;
 | 
			
		||||
  MetaCompositor *compositor = priv->compositor;
 | 
			
		||||
  MetaWindowType window_type = meta_window_get_window_type (window);
 | 
			
		||||
 | 
			
		||||
  meta_window_set_compositor_private (window, NULL);
 | 
			
		||||
@@ -1186,6 +1179,12 @@ meta_window_actor_destroy (MetaWindowActor *self)
 | 
			
		||||
      priv->send_frame_messages_timer = 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  /*
 | 
			
		||||
   * We remove the window from internal lookup hashes and thus any other
 | 
			
		||||
   * unmap events etc fail
 | 
			
		||||
   */
 | 
			
		||||
  compositor->windows = g_list_remove (compositor->windows, (gconstpointer) self);
 | 
			
		||||
 | 
			
		||||
  if (window_type == META_WINDOW_DROPDOWN_MENU ||
 | 
			
		||||
      window_type == META_WINDOW_POPUP_MENU ||
 | 
			
		||||
      window_type == META_WINDOW_TOOLTIP ||
 | 
			
		||||
@@ -1908,9 +1907,6 @@ meta_window_actor_pre_paint (MetaWindowActor *self)
 | 
			
		||||
  MetaWindowActorPrivate *priv = self->priv;
 | 
			
		||||
  GList *l;
 | 
			
		||||
 | 
			
		||||
  if (meta_window_actor_is_destroyed (self))
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  meta_window_actor_handle_updates (self);
 | 
			
		||||
 | 
			
		||||
  for (l = priv->frames; l != NULL; l = l->next)
 | 
			
		||||
@@ -1960,9 +1956,6 @@ meta_window_actor_post_paint (MetaWindowActor *self)
 | 
			
		||||
 | 
			
		||||
  priv->repaint_scheduled = FALSE;
 | 
			
		||||
 | 
			
		||||
  if (meta_window_actor_is_destroyed (self))
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
 /* This window had damage, but wasn't actually redrawn because
 | 
			
		||||
  * it is obscured. So we should wait until timer expiration
 | 
			
		||||
  * before sending _NET_WM_FRAME_* messages.
 | 
			
		||||
@@ -2050,9 +2043,6 @@ meta_window_actor_frame_complete (MetaWindowActor *self,
 | 
			
		||||
  MetaWindowActorPrivate *priv = self->priv;
 | 
			
		||||
  GList *l;
 | 
			
		||||
 | 
			
		||||
  if (meta_window_actor_is_destroyed (self))
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  for (l = priv->frames; l;)
 | 
			
		||||
    {
 | 
			
		||||
      GList *l_next = l->next;
 | 
			
		||||
 
 | 
			
		||||
@@ -295,7 +295,7 @@ on_monitors_changed (MetaScreen *screen,
 | 
			
		||||
{
 | 
			
		||||
  MetaDefaultPlugin *self = META_DEFAULT_PLUGIN (plugin);
 | 
			
		||||
  int i, n;
 | 
			
		||||
  GRand *rand = g_rand_new_with_seed (123456);
 | 
			
		||||
  GRand *rand = g_rand_new_with_seed (12345);
 | 
			
		||||
 | 
			
		||||
  clutter_actor_destroy_all_children (self->priv->background_group);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -612,14 +612,9 @@ update_onscreen_requirements (MetaWindow     *window,
 | 
			
		||||
   */
 | 
			
		||||
  if (window->frame && window->decorated)
 | 
			
		||||
    {
 | 
			
		||||
      MetaRectangle titlebar_rect, frame_rect;
 | 
			
		||||
      MetaRectangle titlebar_rect;
 | 
			
		||||
 | 
			
		||||
      meta_window_get_titlebar_rect (window, &titlebar_rect);
 | 
			
		||||
      meta_window_get_frame_rect (window, &frame_rect);
 | 
			
		||||
 | 
			
		||||
      /* translate into screen coordinates */
 | 
			
		||||
      titlebar_rect.x = frame_rect.x;
 | 
			
		||||
      titlebar_rect.y = frame_rect.y;
 | 
			
		||||
 | 
			
		||||
      old = window->require_titlebar_visible;
 | 
			
		||||
      window->require_titlebar_visible =
 | 
			
		||||
 
 | 
			
		||||
@@ -57,7 +57,6 @@ typedef struct MetaEdgeResistanceData MetaEdgeResistanceData;
 | 
			
		||||
typedef enum {
 | 
			
		||||
  META_LIST_DEFAULT                   = 0,      /* normal windows */
 | 
			
		||||
  META_LIST_INCLUDE_OVERRIDE_REDIRECT = 1 << 0, /* normal and O-R */
 | 
			
		||||
  META_LIST_SORTED                    = 1 << 1, /* sort list by mru */
 | 
			
		||||
} MetaListWindowsFlags;
 | 
			
		||||
 | 
			
		||||
#define _NET_WM_STATE_REMOVE        0    /* remove/unset property */
 | 
			
		||||
@@ -98,10 +97,6 @@ typedef enum {
 | 
			
		||||
  META_EVENT_ROUTE_WINDOW_OP,
 | 
			
		||||
} MetaEventRoute;
 | 
			
		||||
 | 
			
		||||
typedef gboolean (*MetaAlarmFilter) (MetaDisplay           *display,
 | 
			
		||||
                                     XSyncAlarmNotifyEvent *event,
 | 
			
		||||
                                     gpointer               data);
 | 
			
		||||
 | 
			
		||||
struct _MetaDisplay
 | 
			
		||||
{
 | 
			
		||||
  GObject parent_instance;
 | 
			
		||||
@@ -167,7 +162,6 @@ struct _MetaDisplay
 | 
			
		||||
  /*< private-ish >*/
 | 
			
		||||
  MetaScreen *screen;
 | 
			
		||||
  GHashTable *xids;
 | 
			
		||||
  GHashTable *stamps;
 | 
			
		||||
  GHashTable *wayland_windows;
 | 
			
		||||
 | 
			
		||||
  /* serials of leave/unmap events that may
 | 
			
		||||
@@ -262,9 +256,6 @@ struct _MetaDisplay
 | 
			
		||||
  MetaGestureTracker *gesture_tracker;
 | 
			
		||||
  ClutterEventSequence *pointer_emulating_sequence;
 | 
			
		||||
 | 
			
		||||
  MetaAlarmFilter alarm_filter;
 | 
			
		||||
  gpointer alarm_filter_data;
 | 
			
		||||
 | 
			
		||||
  int composite_event_base;
 | 
			
		||||
  int composite_error_base;
 | 
			
		||||
  int composite_major_version;
 | 
			
		||||
@@ -343,29 +334,6 @@ void        meta_display_register_x_window   (MetaDisplay *display,
 | 
			
		||||
void        meta_display_unregister_x_window (MetaDisplay *display,
 | 
			
		||||
                                              Window       xwindow);
 | 
			
		||||
 | 
			
		||||
/* Each MetaWindow is uniquely identified by a 64-bit "stamp"; unlike a
 | 
			
		||||
 * a MetaWindow *, a stamp will never be recycled
 | 
			
		||||
 */
 | 
			
		||||
MetaWindow* meta_display_lookup_stamp     (MetaDisplay *display,
 | 
			
		||||
                                           guint64      stamp);
 | 
			
		||||
void        meta_display_register_stamp   (MetaDisplay *display,
 | 
			
		||||
                                           guint64     *stampp,
 | 
			
		||||
                                           MetaWindow  *window);
 | 
			
		||||
void        meta_display_unregister_stamp (MetaDisplay *display,
 | 
			
		||||
                                           guint64      stamp);
 | 
			
		||||
 | 
			
		||||
/* A "stack id" is a XID or a stamp */
 | 
			
		||||
 | 
			
		||||
#define META_STACK_ID_IS_X11(id) ((id) < G_GUINT64_CONSTANT(0x100000000))
 | 
			
		||||
MetaWindow* meta_display_lookup_stack_id   (MetaDisplay *display,
 | 
			
		||||
                                            guint64      stack_id);
 | 
			
		||||
 | 
			
		||||
/* for debug logging only; returns a human-description of the stack
 | 
			
		||||
 * ID - a small number of buffers are recycled, so the result must
 | 
			
		||||
 * be used immediately or copied */
 | 
			
		||||
const char *meta_display_describe_stack_id (MetaDisplay *display,
 | 
			
		||||
                                            guint64      stack_id);
 | 
			
		||||
 | 
			
		||||
void        meta_display_register_wayland_window   (MetaDisplay *display,
 | 
			
		||||
                                                    MetaWindow  *window);
 | 
			
		||||
void        meta_display_unregister_wayland_window (MetaDisplay *display,
 | 
			
		||||
@@ -485,8 +453,4 @@ void meta_display_cancel_touch (MetaDisplay *display);
 | 
			
		||||
 | 
			
		||||
gboolean meta_display_windows_are_interactable (MetaDisplay *display);
 | 
			
		||||
 | 
			
		||||
void meta_display_set_alarm_filter (MetaDisplay    *display,
 | 
			
		||||
                                    MetaAlarmFilter filter,
 | 
			
		||||
                                    gpointer        data);
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -150,9 +150,6 @@ static void update_cursor_theme (void);
 | 
			
		||||
static void    prefs_changed_callback    (MetaPreference pref,
 | 
			
		||||
                                          void          *data);
 | 
			
		||||
 | 
			
		||||
static int mru_cmp (gconstpointer a,
 | 
			
		||||
                    gconstpointer b);
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_display_get_property(GObject         *object,
 | 
			
		||||
                          guint            prop_id,
 | 
			
		||||
@@ -630,8 +627,6 @@ meta_display_open (void)
 | 
			
		||||
 | 
			
		||||
  display->xids = g_hash_table_new (meta_unsigned_long_hash,
 | 
			
		||||
                                        meta_unsigned_long_equal);
 | 
			
		||||
  display->stamps = g_hash_table_new (g_int64_hash,
 | 
			
		||||
                                      g_int64_equal);
 | 
			
		||||
  display->wayland_windows = g_hash_table_new (NULL, NULL);
 | 
			
		||||
 | 
			
		||||
  i = 0;
 | 
			
		||||
@@ -1007,7 +1002,7 @@ meta_display_list_windows (MetaDisplay          *display,
 | 
			
		||||
    {
 | 
			
		||||
      MetaWindow *window = value;
 | 
			
		||||
 | 
			
		||||
      if (!META_IS_WINDOW (window) || window->unmanaging)
 | 
			
		||||
      if (!META_IS_WINDOW (window))
 | 
			
		||||
        continue;
 | 
			
		||||
 | 
			
		||||
      if (!window->override_redirect ||
 | 
			
		||||
@@ -1020,7 +1015,7 @@ meta_display_list_windows (MetaDisplay          *display,
 | 
			
		||||
    {
 | 
			
		||||
      MetaWindow *window = value;
 | 
			
		||||
 | 
			
		||||
      if (!META_IS_WINDOW (window) || window->unmanaging)
 | 
			
		||||
      if (!META_IS_WINDOW (window))
 | 
			
		||||
        continue;
 | 
			
		||||
 | 
			
		||||
      if (!window->override_redirect ||
 | 
			
		||||
@@ -1064,9 +1059,6 @@ meta_display_list_windows (MetaDisplay          *display,
 | 
			
		||||
      tmp = next;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  if (flags & META_LIST_SORTED)
 | 
			
		||||
    winlist = g_slist_sort (winlist, mru_cmp);
 | 
			
		||||
 | 
			
		||||
  return winlist;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -1589,68 +1581,6 @@ meta_display_unregister_wayland_window (MetaDisplay *display,
 | 
			
		||||
  g_hash_table_remove (display->wayland_windows, window);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
MetaWindow*
 | 
			
		||||
meta_display_lookup_stamp (MetaDisplay *display,
 | 
			
		||||
                           guint64       stamp)
 | 
			
		||||
{
 | 
			
		||||
  return g_hash_table_lookup (display->stamps, &stamp);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_display_register_stamp (MetaDisplay *display,
 | 
			
		||||
                             guint64     *stampp,
 | 
			
		||||
                             MetaWindow  *window)
 | 
			
		||||
{
 | 
			
		||||
  g_return_if_fail (g_hash_table_lookup (display->stamps, stampp) == NULL);
 | 
			
		||||
 | 
			
		||||
  g_hash_table_insert (display->stamps, stampp, window);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_display_unregister_stamp (MetaDisplay *display,
 | 
			
		||||
                               guint64      stamp)
 | 
			
		||||
{
 | 
			
		||||
  g_return_if_fail (g_hash_table_lookup (display->stamps, &stamp) != NULL);
 | 
			
		||||
 | 
			
		||||
  g_hash_table_remove (display->stamps, &stamp);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
MetaWindow*
 | 
			
		||||
meta_display_lookup_stack_id (MetaDisplay *display,
 | 
			
		||||
                              guint64      stack_id)
 | 
			
		||||
{
 | 
			
		||||
  if (META_STACK_ID_IS_X11 (stack_id))
 | 
			
		||||
    return meta_display_lookup_x_window (display, (Window)stack_id);
 | 
			
		||||
  else
 | 
			
		||||
    return meta_display_lookup_stamp (display, stack_id);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* We return a pointer into a ring of static buffers. This is to make
 | 
			
		||||
 * using this function for debug-logging convenient and avoid tempory
 | 
			
		||||
 * strings that must be freed. */
 | 
			
		||||
const char *
 | 
			
		||||
meta_display_describe_stack_id (MetaDisplay *display,
 | 
			
		||||
                                guint64      stack_id)
 | 
			
		||||
{
 | 
			
		||||
  /* 0x<64-bit: 16 characters> (<10 characters of title>)\0' */
 | 
			
		||||
  static char buffer[5][32];
 | 
			
		||||
  MetaWindow *window;
 | 
			
		||||
  static int pos = 0;
 | 
			
		||||
  char *result;
 | 
			
		||||
 | 
			
		||||
  result = buffer[pos];
 | 
			
		||||
  pos = (pos + 1) % 5;
 | 
			
		||||
 | 
			
		||||
  window = meta_display_lookup_stack_id (display, stack_id);
 | 
			
		||||
 | 
			
		||||
  if (window && window->title)
 | 
			
		||||
    snprintf (result, sizeof(buffer[0]), "%#" G_GINT64_MODIFIER "x (%.10s)", stack_id, window->title);
 | 
			
		||||
  else
 | 
			
		||||
    snprintf (result, sizeof(buffer[0]), "%#" G_GINT64_MODIFIER "x", stack_id);
 | 
			
		||||
 | 
			
		||||
  return result;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* We store sync alarms in the window ID hash table, because they are
 | 
			
		||||
 * just more types of XIDs in the same global space, but we have
 | 
			
		||||
 * typesafe functions to register/unregister for readability.
 | 
			
		||||
@@ -1965,7 +1895,7 @@ meta_display_end_grab_op (MetaDisplay *display,
 | 
			
		||||
       * beginning of the grab_op.
 | 
			
		||||
       */
 | 
			
		||||
      if (!meta_prefs_get_raise_on_click () &&
 | 
			
		||||
          !display->grab_threshold_movement_reached)
 | 
			
		||||
          display->grab_threshold_movement_reached)
 | 
			
		||||
        meta_window_raise (display->grab_window);
 | 
			
		||||
 | 
			
		||||
      meta_window_grab_op_ended (grab_window, grab_op);
 | 
			
		||||
@@ -2440,22 +2370,13 @@ meta_display_get_tab_list (MetaDisplay   *display,
 | 
			
		||||
 | 
			
		||||
  mru_list = workspace ? workspace->mru_list : global_mru_list;
 | 
			
		||||
 | 
			
		||||
  /* Windows sellout mode - MRU order. Collect unminimized windows
 | 
			
		||||
   * then minimized so minimized windows aren't in the way so much.
 | 
			
		||||
  /* Windows sellout mode - MRU order.
 | 
			
		||||
   */
 | 
			
		||||
  for (tmp = mru_list; tmp; tmp = tmp->next)
 | 
			
		||||
    {
 | 
			
		||||
      MetaWindow *window = tmp->data;
 | 
			
		||||
 | 
			
		||||
      if (!window->minimized && IN_TAB_CHAIN (window, type))
 | 
			
		||||
        tab_list = g_list_prepend (tab_list, window);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  for (tmp = mru_list; tmp; tmp = tmp->next)
 | 
			
		||||
    {
 | 
			
		||||
      MetaWindow *window = tmp->data;
 | 
			
		||||
 | 
			
		||||
      if (window->minimized && IN_TAB_CHAIN (window, type))
 | 
			
		||||
      if (IN_TAB_CHAIN (window, type))
 | 
			
		||||
        tab_list = g_list_prepend (tab_list, window);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -3033,14 +2954,3 @@ meta_display_is_pointer_emulating_sequence (MetaDisplay          *display,
 | 
			
		||||
 | 
			
		||||
  return display->pointer_emulating_sequence == sequence;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_display_set_alarm_filter (MetaDisplay    *display,
 | 
			
		||||
                               MetaAlarmFilter filter,
 | 
			
		||||
                               gpointer        data)
 | 
			
		||||
{
 | 
			
		||||
  g_return_if_fail (filter == NULL || display->alarm_filter == NULL);
 | 
			
		||||
 | 
			
		||||
  display->alarm_filter = filter;
 | 
			
		||||
  display->alarm_filter_data = data;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -28,7 +28,6 @@
 | 
			
		||||
#include "display-private.h"
 | 
			
		||||
#include "window-private.h"
 | 
			
		||||
#include "backends/x11/meta-backend-x11.h"
 | 
			
		||||
#include "backends/meta-cursor-tracker-private.h"
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_NATIVE_BACKEND
 | 
			
		||||
#include "backends/native/meta-backend-native.h"
 | 
			
		||||
@@ -36,6 +35,7 @@
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_WAYLAND
 | 
			
		||||
#include "backends/meta-cursor-tracker-private.h"
 | 
			
		||||
#include "wayland/meta-wayland-private.h"
 | 
			
		||||
#endif
 | 
			
		||||
#include "meta-surface-actor.h"
 | 
			
		||||
@@ -188,11 +188,13 @@ meta_display_handle_event (MetaDisplay        *display,
 | 
			
		||||
    }
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_WAYLAND
 | 
			
		||||
  if (meta_is_wayland_compositor () && event->type == CLUTTER_MOTION)
 | 
			
		||||
    {
 | 
			
		||||
      MetaCursorTracker *tracker = meta_cursor_tracker_get_for_screen (NULL);
 | 
			
		||||
      meta_cursor_tracker_update_position (tracker, event->motion.x, event->motion.y);
 | 
			
		||||
    }
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
  handle_idletime_for_event (event);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -39,6 +39,7 @@ meta_window_ensure_frame (MetaWindow *window)
 | 
			
		||||
  XSetWindowAttributes attrs;
 | 
			
		||||
  Visual *visual;
 | 
			
		||||
  gulong create_serial;
 | 
			
		||||
  MetaStackWindow stack_window;
 | 
			
		||||
 | 
			
		||||
  if (window->frame)
 | 
			
		||||
    return;
 | 
			
		||||
@@ -94,8 +95,10 @@ meta_window_ensure_frame (MetaWindow *window)
 | 
			
		||||
						frame->rect.height,
 | 
			
		||||
						frame->window->screen->number,
 | 
			
		||||
                                                &create_serial);
 | 
			
		||||
  stack_window.any.type = META_WINDOW_CLIENT_TYPE_X11;
 | 
			
		||||
  stack_window.x11.xwindow = frame->xwindow;
 | 
			
		||||
  meta_stack_tracker_record_add (window->screen->stack_tracker,
 | 
			
		||||
                                 frame->xwindow,
 | 
			
		||||
                                 &stack_window,
 | 
			
		||||
                                 create_serial);
 | 
			
		||||
 | 
			
		||||
  meta_verbose ("Frame for %s is 0x%lx\n", frame->window->desc, frame->xwindow);
 | 
			
		||||
@@ -129,8 +132,9 @@ meta_window_ensure_frame (MetaWindow *window)
 | 
			
		||||
      window->unmaps_pending += 1;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  stack_window.x11.xwindow = window->xwindow;
 | 
			
		||||
  meta_stack_tracker_record_remove (window->screen->stack_tracker,
 | 
			
		||||
                                    window->xwindow,
 | 
			
		||||
                                    &stack_window,
 | 
			
		||||
                                    XNextRequest (window->display->xdisplay));
 | 
			
		||||
  XReparentWindow (window->display->xdisplay,
 | 
			
		||||
                   window->xwindow,
 | 
			
		||||
@@ -175,6 +179,7 @@ meta_window_destroy_frame (MetaWindow *window)
 | 
			
		||||
{
 | 
			
		||||
  MetaFrame *frame;
 | 
			
		||||
  MetaFrameBorders borders;
 | 
			
		||||
  MetaStackWindow stack_window;
 | 
			
		||||
 | 
			
		||||
  if (window->frame == NULL)
 | 
			
		||||
    return;
 | 
			
		||||
@@ -201,8 +206,10 @@ meta_window_destroy_frame (MetaWindow *window)
 | 
			
		||||
                  "Incrementing unmaps_pending on %s for reparent back to root\n", window->desc);
 | 
			
		||||
      window->unmaps_pending += 1;
 | 
			
		||||
    }
 | 
			
		||||
  stack_window.any.type = META_WINDOW_CLIENT_TYPE_X11;
 | 
			
		||||
  stack_window.x11.xwindow = window->xwindow;
 | 
			
		||||
  meta_stack_tracker_record_add (window->screen->stack_tracker,
 | 
			
		||||
                                 window->xwindow,
 | 
			
		||||
                                 &stack_window,
 | 
			
		||||
                                 XNextRequest (window->display->xdisplay));
 | 
			
		||||
  XReparentWindow (window->display->xdisplay,
 | 
			
		||||
                   window->xwindow,
 | 
			
		||||
 
 | 
			
		||||
@@ -101,8 +101,6 @@ typedef struct
 | 
			
		||||
  MetaKeyCombo *iso_next_group_combos;
 | 
			
		||||
  int n_iso_next_group_combos;
 | 
			
		||||
 | 
			
		||||
  xkb_level_index_t keymap_num_levels;
 | 
			
		||||
 | 
			
		||||
  /* Alt+click button grabs */
 | 
			
		||||
  ClutterModifierType window_grab_modifiers;
 | 
			
		||||
} MetaKeyBindingManager;
 | 
			
		||||
 
 | 
			
		||||
@@ -40,11 +40,7 @@
 | 
			
		||||
#include <meta/prefs.h>
 | 
			
		||||
#include "meta-accel-parse.h"
 | 
			
		||||
 | 
			
		||||
#ifdef __linux__
 | 
			
		||||
#include <linux/input.h>
 | 
			
		||||
#elif !defined KEY_GRAVE
 | 
			
		||||
#define KEY_GRAVE 0x29 /* assume the use of xf86-input-keyboard */
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include "backends/x11/meta-backend-x11.h"
 | 
			
		||||
#include "x11/window-x11.h"
 | 
			
		||||
@@ -240,19 +236,29 @@ reload_modmap (MetaKeyBindingManager *keys)
 | 
			
		||||
 | 
			
		||||
static gboolean
 | 
			
		||||
is_keycode_for_keysym (struct xkb_keymap *keymap,
 | 
			
		||||
                       xkb_layout_index_t layout,
 | 
			
		||||
                       xkb_level_index_t  level,
 | 
			
		||||
                       xkb_keycode_t      keycode,
 | 
			
		||||
                       xkb_keysym_t       keysym)
 | 
			
		||||
{
 | 
			
		||||
  const xkb_keysym_t *syms;
 | 
			
		||||
  int num_syms, k;
 | 
			
		||||
  xkb_layout_index_t num_layouts, i;
 | 
			
		||||
 | 
			
		||||
  num_syms = xkb_keymap_key_get_syms_by_level (keymap, keycode, layout, level, &syms);
 | 
			
		||||
  for (k = 0; k < num_syms; k++)
 | 
			
		||||
  num_layouts = xkb_keymap_num_layouts_for_key (keymap, keycode);
 | 
			
		||||
  for (i = 0; i < num_layouts; i++)
 | 
			
		||||
    {
 | 
			
		||||
      if (syms[k] == keysym)
 | 
			
		||||
        return TRUE;
 | 
			
		||||
      xkb_level_index_t num_levels, j;
 | 
			
		||||
 | 
			
		||||
      num_levels = xkb_keymap_num_levels_for_key (keymap, keycode, i);
 | 
			
		||||
      for (j = 0; j < num_levels; j++)
 | 
			
		||||
        {
 | 
			
		||||
          const xkb_keysym_t *syms;
 | 
			
		||||
          int num_syms, k;
 | 
			
		||||
 | 
			
		||||
          num_syms = xkb_keymap_key_get_syms_by_level (keymap, keycode, i, j, &syms);
 | 
			
		||||
          for (k = 0; k < num_syms; k++)
 | 
			
		||||
            {
 | 
			
		||||
              if (syms[k] == keysym)
 | 
			
		||||
                return TRUE;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  return FALSE;
 | 
			
		||||
@@ -262,8 +268,6 @@ typedef struct
 | 
			
		||||
{
 | 
			
		||||
  GArray *keycodes;
 | 
			
		||||
  xkb_keysym_t keysym;
 | 
			
		||||
  xkb_layout_index_t layout;
 | 
			
		||||
  xkb_level_index_t level;
 | 
			
		||||
} FindKeysymData;
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
@@ -274,10 +278,8 @@ get_keycodes_for_keysym_iter (struct xkb_keymap *keymap,
 | 
			
		||||
  FindKeysymData *search_data = data;
 | 
			
		||||
  GArray *keycodes = search_data->keycodes;
 | 
			
		||||
  xkb_keysym_t keysym = search_data->keysym;
 | 
			
		||||
  xkb_layout_index_t layout = search_data->layout;
 | 
			
		||||
  xkb_level_index_t level = search_data->level;
 | 
			
		||||
 | 
			
		||||
  if (is_keycode_for_keysym (keymap, layout, level, keycode, keysym))
 | 
			
		||||
  if (is_keycode_for_keysym (keymap, keycode, keysym))
 | 
			
		||||
    g_array_append_val (keycodes, keycode);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -305,15 +307,8 @@ get_keycodes_for_keysym (MetaKeyBindingManager  *keys,
 | 
			
		||||
  {
 | 
			
		||||
    MetaBackend *backend = meta_get_backend ();
 | 
			
		||||
    struct xkb_keymap *keymap = meta_backend_get_keymap (backend);
 | 
			
		||||
    xkb_layout_index_t i;
 | 
			
		||||
    xkb_level_index_t j;
 | 
			
		||||
 | 
			
		||||
    for (i = 0; i < xkb_keymap_num_layouts (keymap); i++)
 | 
			
		||||
      for (j = 0; j < keys->keymap_num_levels; j++)
 | 
			
		||||
        {
 | 
			
		||||
          FindKeysymData search_data = { retval, keysym, i, j };
 | 
			
		||||
          xkb_keymap_key_for_each (keymap, get_keycodes_for_keysym_iter, &search_data);
 | 
			
		||||
        }
 | 
			
		||||
    FindKeysymData search_data = { retval, keysym };
 | 
			
		||||
    xkb_keymap_key_for_each (keymap, get_keycodes_for_keysym_iter, &search_data);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 out:
 | 
			
		||||
@@ -324,7 +319,7 @@ get_keycodes_for_keysym (MetaKeyBindingManager  *keys,
 | 
			
		||||
 | 
			
		||||
static guint
 | 
			
		||||
get_first_keycode_for_keysym (MetaKeyBindingManager *keys,
 | 
			
		||||
                              guint                  keysym)
 | 
			
		||||
                              guint                   keysym)
 | 
			
		||||
{
 | 
			
		||||
  int *keycodes;
 | 
			
		||||
  int n_keycodes;
 | 
			
		||||
@@ -341,32 +336,6 @@ get_first_keycode_for_keysym (MetaKeyBindingManager *keys,
 | 
			
		||||
  return keycode;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
determine_keymap_num_levels_iter (struct xkb_keymap *keymap,
 | 
			
		||||
                                  xkb_keycode_t      keycode,
 | 
			
		||||
                                  void              *data)
 | 
			
		||||
{
 | 
			
		||||
  xkb_level_index_t *num_levels = data;
 | 
			
		||||
  xkb_layout_index_t i;
 | 
			
		||||
 | 
			
		||||
  for (i = 0; i < xkb_keymap_num_layouts_for_key (keymap, keycode); i++)
 | 
			
		||||
    {
 | 
			
		||||
      xkb_level_index_t level = xkb_keymap_num_levels_for_key (keymap, keycode, i);
 | 
			
		||||
      if (level > *num_levels)
 | 
			
		||||
        *num_levels = level;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
determine_keymap_num_levels (MetaKeyBindingManager *keys)
 | 
			
		||||
{
 | 
			
		||||
  MetaBackend *backend = meta_get_backend ();
 | 
			
		||||
  struct xkb_keymap *keymap = meta_backend_get_keymap (backend);
 | 
			
		||||
 | 
			
		||||
  keys->keymap_num_levels = 0;
 | 
			
		||||
  xkb_keymap_key_for_each (keymap, determine_keymap_num_levels_iter, &keys->keymap_num_levels);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
reload_iso_next_group_combos (MetaKeyBindingManager *keys)
 | 
			
		||||
{
 | 
			
		||||
@@ -515,8 +484,6 @@ reload_keycodes (MetaKeyBindingManager *keys)
 | 
			
		||||
  meta_topic (META_DEBUG_KEYBINDINGS,
 | 
			
		||||
              "Reloading keycodes for binding tables\n");
 | 
			
		||||
 | 
			
		||||
  determine_keymap_num_levels (keys);
 | 
			
		||||
 | 
			
		||||
  if (keys->overlay_key_combo.keysym != 0)
 | 
			
		||||
    {
 | 
			
		||||
      keys->overlay_key_combo.keycode =
 | 
			
		||||
@@ -1662,22 +1629,12 @@ meta_window_ungrab_all_keys (MetaWindow *window, guint32 timestamp)
 | 
			
		||||
void
 | 
			
		||||
meta_display_freeze_keyboard (MetaDisplay *display, Window window, guint32 timestamp)
 | 
			
		||||
{
 | 
			
		||||
  MetaBackend *backend = meta_get_backend ();
 | 
			
		||||
 | 
			
		||||
  if (!META_IS_BACKEND_X11 (backend))
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  grab_keyboard (window, timestamp, XIGrabModeSync);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_display_ungrab_keyboard (MetaDisplay *display, guint32 timestamp)
 | 
			
		||||
{
 | 
			
		||||
  MetaBackend *backend = meta_get_backend ();
 | 
			
		||||
 | 
			
		||||
  if (!META_IS_BACKEND_X11 (backend))
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  ungrab_keyboard (timestamp);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -1920,8 +1877,6 @@ process_iso_next_group (MetaDisplay *display,
 | 
			
		||||
{
 | 
			
		||||
  MetaKeyBindingManager *keys = &display->key_binding_manager;
 | 
			
		||||
  gboolean activate;
 | 
			
		||||
  guint32 keycode;
 | 
			
		||||
  guint32 modifiers;
 | 
			
		||||
  int i;
 | 
			
		||||
 | 
			
		||||
  if (event->type == CLUTTER_KEY_RELEASE)
 | 
			
		||||
@@ -1929,13 +1884,10 @@ process_iso_next_group (MetaDisplay *display,
 | 
			
		||||
 | 
			
		||||
  activate = FALSE;
 | 
			
		||||
 | 
			
		||||
  keycode = event->hardware_keycode;
 | 
			
		||||
  modifiers = event->modifier_state & 0xff & ~keys->ignored_modifier_mask;
 | 
			
		||||
 | 
			
		||||
  for (i = 0; i < keys->n_iso_next_group_combos; ++i)
 | 
			
		||||
    {
 | 
			
		||||
      if (keycode == keys->iso_next_group_combos[i].keycode &&
 | 
			
		||||
          modifiers == keys->iso_next_group_combos[i].modifiers)
 | 
			
		||||
      if (event->hardware_keycode == keys->iso_next_group_combos[i].keycode &&
 | 
			
		||||
          event->modifier_state == (unsigned int)keys->iso_next_group_combos[i].modifiers)
 | 
			
		||||
        {
 | 
			
		||||
          /* If the signal handler returns TRUE the keyboard will
 | 
			
		||||
             remain frozen. It's the signal handler's responsibility
 | 
			
		||||
@@ -2955,6 +2907,10 @@ do_choose_window (MetaDisplay     *display,
 | 
			
		||||
  meta_topic (META_DEBUG_KEYBINDINGS,
 | 
			
		||||
              "Tab list = %u\n", type);
 | 
			
		||||
 | 
			
		||||
  /* reverse direction if shift is down */
 | 
			
		||||
  if (event->modifier_state & CLUTTER_SHIFT_MASK)
 | 
			
		||||
    backward = !backward;
 | 
			
		||||
 | 
			
		||||
  window = meta_display_get_tab_next (display,
 | 
			
		||||
                                      type,
 | 
			
		||||
                                      screen->active_workspace,
 | 
			
		||||
 
 | 
			
		||||
@@ -302,6 +302,7 @@ meta_init (void)
 | 
			
		||||
{
 | 
			
		||||
  struct sigaction act;
 | 
			
		||||
  sigset_t empty_mask;
 | 
			
		||||
  ClutterSettings *clutter_settings;
 | 
			
		||||
 | 
			
		||||
  sigemptyset (&empty_mask);
 | 
			
		||||
  act.sa_handler = SIG_IGN;
 | 
			
		||||
@@ -376,6 +377,13 @@ meta_init (void)
 | 
			
		||||
  meta_ui_init ();
 | 
			
		||||
 | 
			
		||||
  meta_restart_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);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										125
									
								
								src/core/prefs.c
									
									
									
									
									
								
							
							
						
						
									
										125
									
								
								src/core/prefs.c
									
									
									
									
									
								
							@@ -52,7 +52,9 @@
 | 
			
		||||
#define KEY_GNOME_ACCESSIBILITY "toolkit-accessibility"
 | 
			
		||||
#define KEY_GNOME_ANIMATIONS "enable-animations"
 | 
			
		||||
#define KEY_GNOME_CURSOR_THEME "cursor-theme"
 | 
			
		||||
#define KEY_GNOME_CURSOR_SIZE "cursor-size"
 | 
			
		||||
#define KEY_XKB_OPTIONS "xkb-options"
 | 
			
		||||
#define KEY_XSETTINGS_OVERRIDES "overrides"
 | 
			
		||||
 | 
			
		||||
#define KEY_OVERLAY_KEY "overlay-key"
 | 
			
		||||
#define KEY_WORKSPACES_ONLY_ON_PRIMARY "workspaces-only-on-primary"
 | 
			
		||||
@@ -131,13 +133,9 @@ static void bindings_changed (GSettings      *settings,
 | 
			
		||||
                              gchar          *key,
 | 
			
		||||
                              gpointer        data);
 | 
			
		||||
 | 
			
		||||
static void shell_shows_app_menu_changed (GtkSettings *settings,
 | 
			
		||||
                                          GParamSpec  *pspec,
 | 
			
		||||
                                          gpointer     data);
 | 
			
		||||
 | 
			
		||||
static void update_cursor_size (GtkSettings *settings,
 | 
			
		||||
                                GParamSpec *pspec,
 | 
			
		||||
                                gpointer data);
 | 
			
		||||
static void xsettings_overrides_changed (GSettings  *settings,
 | 
			
		||||
                                         gchar      *key,
 | 
			
		||||
                                         gpointer    data);
 | 
			
		||||
 | 
			
		||||
static void queue_changed (MetaPreference  pref);
 | 
			
		||||
 | 
			
		||||
@@ -481,6 +479,13 @@ static MetaIntPreference preferences_int[] =
 | 
			
		||||
      },
 | 
			
		||||
      &auto_raise_delay
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      { "cursor-size",
 | 
			
		||||
        SCHEMA_INTERFACE,
 | 
			
		||||
        META_PREF_CURSOR_SIZE,
 | 
			
		||||
      },
 | 
			
		||||
      &cursor_size
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      { "draggable-border-width",
 | 
			
		||||
        SCHEMA_MUTTER,
 | 
			
		||||
@@ -946,6 +951,24 @@ queue_changed (MetaPreference pref)
 | 
			
		||||
/* Initialisation.                                                          */
 | 
			
		||||
/****************************************************************************/
 | 
			
		||||
 | 
			
		||||
static GSettings *
 | 
			
		||||
get_xsettings_settings (void)
 | 
			
		||||
{
 | 
			
		||||
  GSettings *settings = NULL;
 | 
			
		||||
  GSettingsSchema *schema;
 | 
			
		||||
 | 
			
		||||
  schema = g_settings_schema_source_lookup (g_settings_schema_source_get_default (),
 | 
			
		||||
                                            SCHEMA_XSETTINGS, FALSE);
 | 
			
		||||
 | 
			
		||||
  if (schema)
 | 
			
		||||
    {
 | 
			
		||||
      settings = g_settings_new_full (schema, NULL, NULL);
 | 
			
		||||
      g_settings_schema_unref (schema);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  return settings;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_prefs_init (void)
 | 
			
		||||
{
 | 
			
		||||
@@ -975,14 +998,19 @@ meta_prefs_init (void)
 | 
			
		||||
                    G_CALLBACK (settings_changed), NULL);
 | 
			
		||||
  g_signal_connect (settings, "changed::" KEY_GNOME_CURSOR_THEME,
 | 
			
		||||
                    G_CALLBACK (settings_changed), NULL);
 | 
			
		||||
  g_signal_connect (settings, "changed::" KEY_GNOME_CURSOR_SIZE,
 | 
			
		||||
                    G_CALLBACK (settings_changed), NULL);
 | 
			
		||||
  g_hash_table_insert (settings_schemas, g_strdup (SCHEMA_INTERFACE), settings);
 | 
			
		||||
 | 
			
		||||
  g_signal_connect (gtk_settings_get_default (),
 | 
			
		||||
                    "notify::gtk-shell-shows-app-menu",
 | 
			
		||||
                    G_CALLBACK (shell_shows_app_menu_changed), NULL);
 | 
			
		||||
  settings = get_xsettings_settings ();
 | 
			
		||||
  if (settings)
 | 
			
		||||
    {
 | 
			
		||||
      g_signal_connect (settings, "changed::" KEY_XSETTINGS_OVERRIDES,
 | 
			
		||||
                        G_CALLBACK (xsettings_overrides_changed), NULL);
 | 
			
		||||
      g_hash_table_insert (settings_schemas, g_strdup (SCHEMA_XSETTINGS), settings);
 | 
			
		||||
 | 
			
		||||
  g_signal_connect (gtk_settings_get_default (), "notify::gtk-cursor-theme-size",
 | 
			
		||||
                    G_CALLBACK (update_cursor_size), NULL);
 | 
			
		||||
      xsettings_overrides_changed (settings, KEY_XSETTINGS_OVERRIDES, NULL);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  settings = g_settings_new (SCHEMA_INPUT_SOURCES);
 | 
			
		||||
  g_signal_connect (settings, "changed::" KEY_XKB_OPTIONS,
 | 
			
		||||
@@ -1004,9 +1032,6 @@ meta_prefs_init (void)
 | 
			
		||||
  handle_preference_init_string_array ();
 | 
			
		||||
  handle_preference_init_int ();
 | 
			
		||||
 | 
			
		||||
  update_cursor_size (gtk_settings_get_default (), NULL, NULL);
 | 
			
		||||
  shell_shows_app_menu_changed (gtk_settings_get_default (), NULL, NULL);
 | 
			
		||||
 | 
			
		||||
  init_bindings ();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -1187,6 +1212,7 @@ settings_changed (GSettings *settings,
 | 
			
		||||
    {
 | 
			
		||||
      /* Unknown preference type. This quite likely simply isn't
 | 
			
		||||
       * a preference we track changes to. */
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  g_variant_unref (value);
 | 
			
		||||
@@ -1206,49 +1232,44 @@ bindings_changed (GSettings *settings,
 | 
			
		||||
  g_strfreev (strokes);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* The fallback app menu should be enabled if either we are not
 | 
			
		||||
 * showing the app menu (e.g. when using the default plugin) or
 | 
			
		||||
 * with a corresponding XSettings override; we ignore the former
 | 
			
		||||
 * and assume that we always show the app menu, not least
 | 
			
		||||
 * because we rely on the compositor implementation to display
 | 
			
		||||
 * the fallback ...
 | 
			
		||||
 */
 | 
			
		||||
static void
 | 
			
		||||
shell_shows_app_menu_changed (GtkSettings *settings,
 | 
			
		||||
                              GParamSpec *pspec,
 | 
			
		||||
                              gpointer data)
 | 
			
		||||
xsettings_overrides_changed (GSettings  *settings,
 | 
			
		||||
                             gchar      *key,
 | 
			
		||||
                             gpointer    data)
 | 
			
		||||
{
 | 
			
		||||
  GVariant *value;
 | 
			
		||||
  GVariantDict overrides;
 | 
			
		||||
  int shell_shows_app_menu = 1;
 | 
			
		||||
  gboolean changed = FALSE;
 | 
			
		||||
 | 
			
		||||
  g_object_get (settings,
 | 
			
		||||
                "gtk-shell-shows-app-menu", &shell_shows_app_menu,
 | 
			
		||||
                NULL);
 | 
			
		||||
  if (!g_settings_get_boolean (settings, "active"))
 | 
			
		||||
    goto out;
 | 
			
		||||
 | 
			
		||||
  value = g_settings_get_value (settings, KEY_XSETTINGS_OVERRIDES);
 | 
			
		||||
 | 
			
		||||
  g_variant_dict_init (&overrides, value);
 | 
			
		||||
  g_variant_unref (value);
 | 
			
		||||
 | 
			
		||||
  g_variant_dict_lookup (&overrides,
 | 
			
		||||
                         "Gtk/ShellShowsAppMenu", "i", &shell_shows_app_menu);
 | 
			
		||||
  g_variant_dict_clear (&overrides);
 | 
			
		||||
 | 
			
		||||
  changed = (show_fallback_app_menu == !!shell_shows_app_menu);
 | 
			
		||||
 | 
			
		||||
out:
 | 
			
		||||
  show_fallback_app_menu = !shell_shows_app_menu;
 | 
			
		||||
 | 
			
		||||
  if (changed)
 | 
			
		||||
    queue_changed (META_PREF_BUTTON_LAYOUT);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
update_cursor_size (GtkSettings *settings,
 | 
			
		||||
                    GParamSpec *pspec,
 | 
			
		||||
                    gpointer data)
 | 
			
		||||
{
 | 
			
		||||
  GdkScreen *screen = gdk_screen_get_default ();
 | 
			
		||||
  GValue value = G_VALUE_INIT;
 | 
			
		||||
  int xsettings_cursor_size = 24;
 | 
			
		||||
 | 
			
		||||
  g_value_init (&value, G_TYPE_INT);
 | 
			
		||||
  if (gdk_screen_get_setting (screen, "gtk-cursor-theme-size", &value))
 | 
			
		||||
    {
 | 
			
		||||
      xsettings_cursor_size = g_value_get_int (&value);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  if (xsettings_cursor_size != cursor_size)
 | 
			
		||||
    {
 | 
			
		||||
      cursor_size = xsettings_cursor_size;
 | 
			
		||||
      queue_changed (META_PREF_CURSOR_SIZE);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * maybe_give_disable_workaround_warning:
 | 
			
		||||
 *
 | 
			
		||||
@@ -1326,10 +1347,26 @@ meta_prefs_get_cursor_theme (void)
 | 
			
		||||
  return cursor_theme;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int
 | 
			
		||||
get_scale_factor (void)
 | 
			
		||||
{
 | 
			
		||||
  GdkScreen *screen;
 | 
			
		||||
  GValue value = G_VALUE_INIT;
 | 
			
		||||
 | 
			
		||||
  g_value_init (&value, G_TYPE_INT);
 | 
			
		||||
 | 
			
		||||
  /* XXX: Should this be in ui/ ? Or MetaMonitorManager? */
 | 
			
		||||
  screen = gdk_screen_get_default ();
 | 
			
		||||
  if (gdk_screen_get_setting (screen, "gdk-window-scaling-factor", &value))
 | 
			
		||||
    return g_value_get_int (&value);
 | 
			
		||||
  else
 | 
			
		||||
    return 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
meta_prefs_get_cursor_size (void)
 | 
			
		||||
{
 | 
			
		||||
  return cursor_size;
 | 
			
		||||
  return cursor_size * get_scale_factor ();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -441,6 +441,7 @@ create_guard_window (Display *xdisplay, MetaScreen *screen)
 | 
			
		||||
  XSetWindowAttributes attributes;
 | 
			
		||||
  Window guard_window;
 | 
			
		||||
  gulong create_serial;
 | 
			
		||||
  MetaStackWindow stack_window;
 | 
			
		||||
 | 
			
		||||
  attributes.event_mask = NoEventMask;
 | 
			
		||||
  attributes.override_redirect = True;
 | 
			
		||||
@@ -486,12 +487,16 @@ create_guard_window (Display *xdisplay, MetaScreen *screen)
 | 
			
		||||
      }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  stack_window.any.type = META_WINDOW_CLIENT_TYPE_X11;
 | 
			
		||||
  stack_window.x11.xwindow = guard_window;
 | 
			
		||||
  meta_stack_tracker_record_add (screen->stack_tracker,
 | 
			
		||||
                                 guard_window,
 | 
			
		||||
                                 &stack_window,
 | 
			
		||||
                                 create_serial);
 | 
			
		||||
 | 
			
		||||
  meta_stack_tracker_lower (screen->stack_tracker,
 | 
			
		||||
                            guard_window);
 | 
			
		||||
  meta_stack_tracker_record_lower (screen->stack_tracker,
 | 
			
		||||
                                   &stack_window,
 | 
			
		||||
                                   XNextRequest (xdisplay));
 | 
			
		||||
  XLowerWindow (xdisplay, guard_window);
 | 
			
		||||
  XMapWindow (xdisplay, guard_window);
 | 
			
		||||
  return guard_window;
 | 
			
		||||
}
 | 
			
		||||
@@ -879,20 +884,19 @@ meta_screen_create_guard_window (MetaScreen *screen)
 | 
			
		||||
void
 | 
			
		||||
meta_screen_manage_all_windows (MetaScreen *screen)
 | 
			
		||||
{
 | 
			
		||||
  guint64 *_children;
 | 
			
		||||
  guint64 *children;
 | 
			
		||||
  MetaStackWindow *_children;
 | 
			
		||||
  MetaStackWindow *children;
 | 
			
		||||
  int n_children, i;
 | 
			
		||||
 | 
			
		||||
  meta_stack_freeze (screen->stack);
 | 
			
		||||
  meta_stack_tracker_get_stack (screen->stack_tracker, &_children, &n_children);
 | 
			
		||||
 | 
			
		||||
  /* Copy the stack as it will be modified as part of the loop */
 | 
			
		||||
  children = g_memdup (_children, sizeof (guint64) * n_children);
 | 
			
		||||
  children = g_memdup (_children, sizeof (MetaStackWindow) * n_children);
 | 
			
		||||
 | 
			
		||||
  for (i = 0; i < n_children; ++i)
 | 
			
		||||
    {
 | 
			
		||||
      g_assert (META_STACK_ID_IS_X11 (children[i]));
 | 
			
		||||
      meta_window_x11_new (screen->display, children[i], TRUE,
 | 
			
		||||
      meta_window_x11_new (screen->display, children[i].x11.xwindow, TRUE,
 | 
			
		||||
                           META_COMP_EFFECT_NONE);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -3021,32 +3025,38 @@ static gboolean
 | 
			
		||||
check_fullscreen_func (gpointer data)
 | 
			
		||||
{
 | 
			
		||||
  MetaScreen *screen = data;
 | 
			
		||||
  MetaWindow *window;
 | 
			
		||||
  GSList *windows;
 | 
			
		||||
  GSList *tmp;
 | 
			
		||||
  GSList *fullscreen_monitors = NULL;
 | 
			
		||||
  GSList *obscured_monitors = NULL;
 | 
			
		||||
  gboolean in_fullscreen_changed = FALSE;
 | 
			
		||||
  int i;
 | 
			
		||||
 | 
			
		||||
  screen->check_fullscreen_later = 0;
 | 
			
		||||
 | 
			
		||||
  /* We consider a monitor in fullscreen if it contains a fullscreen window;
 | 
			
		||||
   * however we make an exception for maximized windows above the fullscreen
 | 
			
		||||
   * one, as in that case window+chrome fully obscure the fullscreen window.
 | 
			
		||||
   */
 | 
			
		||||
  for (window = meta_stack_get_top (screen->stack);
 | 
			
		||||
       window;
 | 
			
		||||
       window = meta_stack_get_below (screen->stack, window, FALSE))
 | 
			
		||||
  windows = meta_display_list_windows (screen->display,
 | 
			
		||||
                                       META_LIST_INCLUDE_OVERRIDE_REDIRECT);
 | 
			
		||||
 | 
			
		||||
  for (tmp = windows; tmp != NULL; tmp = tmp->next)
 | 
			
		||||
    {
 | 
			
		||||
      MetaWindow *window = tmp->data;
 | 
			
		||||
      gboolean covers_monitors = FALSE;
 | 
			
		||||
 | 
			
		||||
      if (window->screen != screen || window->hidden)
 | 
			
		||||
        continue;
 | 
			
		||||
 | 
			
		||||
      if (window->fullscreen)
 | 
			
		||||
        {
 | 
			
		||||
          covers_monitors = TRUE;
 | 
			
		||||
        }
 | 
			
		||||
      else if (window->override_redirect)
 | 
			
		||||
        /* The checks for determining a fullscreen window's layer are quite
 | 
			
		||||
         * elaborate, and we do a poor job at keeping it dynamically up-to-date.
 | 
			
		||||
         * (It depends, for example, on whether the focus window is on the
 | 
			
		||||
         * same monitor as the fullscreen window.) But because we minimize
 | 
			
		||||
         * fullscreen windows not in LAYER_FULLSCREEN (see below), if the
 | 
			
		||||
         * layer is stale here, it's really bad, so just force recomputation for
 | 
			
		||||
         * here. This is expensive, but hopefully this function won't be
 | 
			
		||||
         * called too often.
 | 
			
		||||
         */
 | 
			
		||||
        meta_window_update_layer (window);
 | 
			
		||||
 | 
			
		||||
      if (window->override_redirect)
 | 
			
		||||
        {
 | 
			
		||||
          /* We want to handle the case where an application is creating an
 | 
			
		||||
           * override-redirect window the size of the screen (monitor) and treat
 | 
			
		||||
@@ -3056,14 +3066,10 @@ check_fullscreen_func (gpointer data)
 | 
			
		||||
          if (meta_window_is_monitor_sized (window))
 | 
			
		||||
            covers_monitors = TRUE;
 | 
			
		||||
        }
 | 
			
		||||
      else if (window->maximized_horizontally &&
 | 
			
		||||
               window->maximized_vertically)
 | 
			
		||||
      else
 | 
			
		||||
        {
 | 
			
		||||
          int monitor_index = meta_window_get_monitor (window);
 | 
			
		||||
          /* + 1 to avoid NULL */
 | 
			
		||||
          gpointer monitor_p = GINT_TO_POINTER(monitor_index + 1);
 | 
			
		||||
          if (!g_slist_find (obscured_monitors, monitor_p))
 | 
			
		||||
            obscured_monitors = g_slist_prepend (obscured_monitors, monitor_p);
 | 
			
		||||
          if (window->layer == META_LAYER_FULLSCREEN)
 | 
			
		||||
            covers_monitors = TRUE;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      if (covers_monitors)
 | 
			
		||||
@@ -3077,16 +3083,30 @@ check_fullscreen_func (gpointer data)
 | 
			
		||||
            {
 | 
			
		||||
              /* + 1 to avoid NULL */
 | 
			
		||||
              gpointer monitor_p = GINT_TO_POINTER(monitors[j] + 1);
 | 
			
		||||
              if (!g_slist_find (fullscreen_monitors, monitor_p) &&
 | 
			
		||||
                  !g_slist_find (obscured_monitors, monitor_p))
 | 
			
		||||
              if (!g_slist_find (fullscreen_monitors, monitor_p))
 | 
			
		||||
                fullscreen_monitors = g_slist_prepend (fullscreen_monitors, monitor_p);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
          g_free (monitors);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      /* If we find a window that is fullscreen but not in the FULLSCREEN
 | 
			
		||||
       * layer, it means that we've kicked it out of the layer because
 | 
			
		||||
       * we've focused another window on the same monitor. In this case
 | 
			
		||||
       * it would be confusing to keep the window fullscreen and visible,
 | 
			
		||||
       * so minimize it. We can't do the same thing for override-redirect
 | 
			
		||||
       * windows, so we just hope the application does the right thing.
 | 
			
		||||
       */
 | 
			
		||||
      if (!covers_monitors && window->fullscreen)
 | 
			
		||||
        {
 | 
			
		||||
          meta_window_minimize (window);
 | 
			
		||||
          meta_topic (META_DEBUG_WINDOW_OPS,
 | 
			
		||||
                      "Minimizing %s: was fullscreen but in a lower layer\n",
 | 
			
		||||
                      window->desc);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  g_slist_free (obscured_monitors);
 | 
			
		||||
  g_slist_free (windows);
 | 
			
		||||
 | 
			
		||||
  for (i = 0; i < screen->n_monitor_infos; i++)
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -39,30 +39,51 @@
 | 
			
		||||
 | 
			
		||||
typedef struct _MetaStackTracker MetaStackTracker;
 | 
			
		||||
 | 
			
		||||
typedef union _MetaStackWindow
 | 
			
		||||
{
 | 
			
		||||
  struct {
 | 
			
		||||
    MetaWindowClientType type;
 | 
			
		||||
  } any;
 | 
			
		||||
  struct {
 | 
			
		||||
    MetaWindowClientType type;
 | 
			
		||||
    Window xwindow;
 | 
			
		||||
  } x11;
 | 
			
		||||
  struct {
 | 
			
		||||
    MetaWindowClientType type;
 | 
			
		||||
    MetaWindow *meta_window;
 | 
			
		||||
  } wayland;
 | 
			
		||||
} MetaStackWindow;
 | 
			
		||||
 | 
			
		||||
gboolean meta_stack_window_equal (const MetaStackWindow *a,
 | 
			
		||||
                                  const MetaStackWindow *b);
 | 
			
		||||
 | 
			
		||||
MetaStackTracker *meta_stack_tracker_new  (MetaScreen       *screen);
 | 
			
		||||
void              meta_stack_tracker_free (MetaStackTracker *tracker);
 | 
			
		||||
 | 
			
		||||
/* These functions are called when we make an X call that changes the
 | 
			
		||||
 * stacking order; this allows MetaStackTracker to predict stacking
 | 
			
		||||
 * order before it receives events back from the X server */
 | 
			
		||||
void meta_stack_tracker_record_add             (MetaStackTracker *tracker,
 | 
			
		||||
                                                guint64           window,
 | 
			
		||||
                                                gulong            serial);
 | 
			
		||||
void meta_stack_tracker_record_remove          (MetaStackTracker *tracker,
 | 
			
		||||
                                                guint64           window,
 | 
			
		||||
                                                gulong            serial);
 | 
			
		||||
 | 
			
		||||
/* We also have functions that also go ahead and do the work
 | 
			
		||||
 */
 | 
			
		||||
void meta_stack_tracker_lower           (MetaStackTracker *tracker,
 | 
			
		||||
                                         guint64           window);
 | 
			
		||||
 | 
			
		||||
void meta_stack_tracker_restack_managed (MetaStackTracker *tracker,
 | 
			
		||||
                                         const guint64    *windows,
 | 
			
		||||
                                         int               n_windows);
 | 
			
		||||
void meta_stack_tracker_restack_at_bottom (MetaStackTracker *tracker,
 | 
			
		||||
                                           const guint64    *new_order,
 | 
			
		||||
                                           int               n_new_order);
 | 
			
		||||
void meta_stack_tracker_record_add             (MetaStackTracker      *tracker,
 | 
			
		||||
                                                const MetaStackWindow *window,
 | 
			
		||||
                                                gulong                 serial);
 | 
			
		||||
void meta_stack_tracker_record_remove          (MetaStackTracker      *tracker,
 | 
			
		||||
                                                const MetaStackWindow *window,
 | 
			
		||||
                                                gulong                 serial);
 | 
			
		||||
void meta_stack_tracker_record_restack_windows (MetaStackTracker      *tracker,
 | 
			
		||||
                                                const MetaStackWindow *windows,
 | 
			
		||||
						int                    n_windows,
 | 
			
		||||
                                                gulong                 serial);
 | 
			
		||||
void meta_stack_tracker_record_raise_above     (MetaStackTracker      *tracker,
 | 
			
		||||
                                                const MetaStackWindow *window,
 | 
			
		||||
                                                const MetaStackWindow *sibling,
 | 
			
		||||
                                                gulong                 serial);
 | 
			
		||||
void meta_stack_tracker_record_lower_below    (MetaStackTracker       *tracker,
 | 
			
		||||
                                               const MetaStackWindow  *window,
 | 
			
		||||
                                               const MetaStackWindow  *sibling,
 | 
			
		||||
                                               gulong                  serial);
 | 
			
		||||
void meta_stack_tracker_record_lower           (MetaStackTracker      *tracker,
 | 
			
		||||
                                                const MetaStackWindow *window,
 | 
			
		||||
                                                gulong                 serial);
 | 
			
		||||
 | 
			
		||||
/* These functions are used to update the stack when we get events
 | 
			
		||||
 * reflecting changes to the stacking order */
 | 
			
		||||
@@ -75,9 +96,9 @@ void meta_stack_tracker_reparent_event  (MetaStackTracker    *tracker,
 | 
			
		||||
void meta_stack_tracker_configure_event (MetaStackTracker    *tracker,
 | 
			
		||||
					 XConfigureEvent     *event);
 | 
			
		||||
 | 
			
		||||
void meta_stack_tracker_get_stack  (MetaStackTracker *tracker,
 | 
			
		||||
                                    guint64         **windows,
 | 
			
		||||
                                    int              *n_entries);
 | 
			
		||||
void meta_stack_tracker_get_stack  (MetaStackTracker      *tracker,
 | 
			
		||||
                                    MetaStackWindow      **windows,
 | 
			
		||||
                                    int                   *n_entries);
 | 
			
		||||
 | 
			
		||||
void meta_stack_tracker_sync_stack       (MetaStackTracker *tracker);
 | 
			
		||||
void meta_stack_tracker_queue_sync_stack (MetaStackTracker *tracker);
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										510
									
								
								src/core/stack.c
									
									
									
									
									
								
							
							
						
						
									
										510
									
								
								src/core/stack.c
									
									
									
									
									
								
							@@ -76,6 +76,8 @@ meta_stack_new (MetaScreen *screen)
 | 
			
		||||
  stack->removed = NULL;
 | 
			
		||||
 | 
			
		||||
  stack->freeze_count = 0;
 | 
			
		||||
  stack->last_all_root_children_stacked = NULL;
 | 
			
		||||
 | 
			
		||||
  stack->n_positions = 0;
 | 
			
		||||
 | 
			
		||||
  stack->need_resort = FALSE;
 | 
			
		||||
@@ -85,6 +87,13 @@ meta_stack_new (MetaScreen *screen)
 | 
			
		||||
  return stack;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
free_last_all_root_children_stacked_cache (MetaStack *stack)
 | 
			
		||||
{
 | 
			
		||||
  g_array_free (stack->last_all_root_children_stacked, TRUE);
 | 
			
		||||
  stack->last_all_root_children_stacked = NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_stack_free (MetaStack *stack)
 | 
			
		||||
{
 | 
			
		||||
@@ -94,6 +103,9 @@ meta_stack_free (MetaStack *stack)
 | 
			
		||||
  g_list_free (stack->added);
 | 
			
		||||
  g_list_free (stack->removed);
 | 
			
		||||
 | 
			
		||||
  if (stack->last_all_root_children_stacked)
 | 
			
		||||
    free_last_all_root_children_stacked_cache (stack);
 | 
			
		||||
 | 
			
		||||
  g_free (stack);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -101,8 +113,6 @@ void
 | 
			
		||||
meta_stack_add (MetaStack  *stack,
 | 
			
		||||
                MetaWindow *window)
 | 
			
		||||
{
 | 
			
		||||
  g_return_if_fail (!window->override_redirect);
 | 
			
		||||
 | 
			
		||||
  meta_topic (META_DEBUG_STACK, "Adding window %s to the stack\n", window->desc);
 | 
			
		||||
 | 
			
		||||
  if (window->stack_position >= 0)
 | 
			
		||||
@@ -1020,6 +1030,194 @@ stack_ensure_sorted (MetaStack *stack)
 | 
			
		||||
  stack_do_resort (stack);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static MetaStackWindow *
 | 
			
		||||
find_top_most_managed_window (MetaScreen *screen,
 | 
			
		||||
                              const MetaStackWindow *ignore)
 | 
			
		||||
{
 | 
			
		||||
  MetaStackTracker *stack_tracker = screen->stack_tracker;
 | 
			
		||||
  MetaStackWindow *windows;
 | 
			
		||||
  int n_windows;
 | 
			
		||||
  int i;
 | 
			
		||||
 | 
			
		||||
  meta_stack_tracker_get_stack (stack_tracker,
 | 
			
		||||
                                &windows, &n_windows);
 | 
			
		||||
 | 
			
		||||
  /* Children are in order from bottom to top. We want to
 | 
			
		||||
   * find the topmost managed child, then configure
 | 
			
		||||
   * our window to be above it.
 | 
			
		||||
   */
 | 
			
		||||
  for (i = n_windows -1; i >= 0; i--)
 | 
			
		||||
    {
 | 
			
		||||
      MetaStackWindow *other_window = &windows[i];
 | 
			
		||||
 | 
			
		||||
      if (other_window->any.type == ignore->any.type &&
 | 
			
		||||
          ((other_window->any.type == META_WINDOW_CLIENT_TYPE_X11 &&
 | 
			
		||||
            other_window->x11.xwindow == ignore->x11.xwindow) ||
 | 
			
		||||
           other_window->wayland.meta_window == ignore->wayland.meta_window))
 | 
			
		||||
        {
 | 
			
		||||
          /* Do nothing. This means we're already the topmost managed
 | 
			
		||||
           * window, but it DOES NOT mean we are already just above
 | 
			
		||||
           * the topmost managed window. This is important because if
 | 
			
		||||
           * an override redirect window is up, and we map a new
 | 
			
		||||
           * managed window, the new window is probably above the old
 | 
			
		||||
           * popup by default, and we want to push it below that
 | 
			
		||||
           * popup. So keep looking for a sibling managed window
 | 
			
		||||
           * to be moved below.
 | 
			
		||||
           */
 | 
			
		||||
        }
 | 
			
		||||
      else
 | 
			
		||||
        {
 | 
			
		||||
          if (other_window->any.type == META_WINDOW_CLIENT_TYPE_X11)
 | 
			
		||||
            {
 | 
			
		||||
              MetaWindow *other = meta_display_lookup_x_window (screen->display,
 | 
			
		||||
                                                                other_window->x11.xwindow);
 | 
			
		||||
 | 
			
		||||
              if (other != NULL && !other->override_redirect)
 | 
			
		||||
                return other_window;
 | 
			
		||||
            }
 | 
			
		||||
          else
 | 
			
		||||
            {
 | 
			
		||||
              /* All wayland windows are currently considered "managed"
 | 
			
		||||
               * TODO: consider wayland pop-up windows like override
 | 
			
		||||
               * redirect windows here. */
 | 
			
		||||
              return other_window;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  return NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* When moving an X window we sometimes need an X based sibling.
 | 
			
		||||
 *
 | 
			
		||||
 * If the given sibling is X based this function returns it back
 | 
			
		||||
 * otherwise it searches downwards looking for the nearest X window.
 | 
			
		||||
 *
 | 
			
		||||
 * If no X based sibling could be found return NULL. */
 | 
			
		||||
static MetaStackWindow *
 | 
			
		||||
find_x11_sibling_downwards (MetaScreen *screen,
 | 
			
		||||
                            MetaStackWindow *sibling)
 | 
			
		||||
{
 | 
			
		||||
  MetaStackTracker *stack_tracker = screen->stack_tracker;
 | 
			
		||||
  MetaStackWindow *windows;
 | 
			
		||||
  int n_windows;
 | 
			
		||||
  int i;
 | 
			
		||||
 | 
			
		||||
  if (sibling->any.type == META_WINDOW_CLIENT_TYPE_X11)
 | 
			
		||||
    return sibling;
 | 
			
		||||
 | 
			
		||||
  meta_stack_tracker_get_stack (stack_tracker,
 | 
			
		||||
                                &windows, &n_windows);
 | 
			
		||||
 | 
			
		||||
  /* NB: Children are in order from bottom to top and we
 | 
			
		||||
   * want to search downwards for the nearest X window.
 | 
			
		||||
   */
 | 
			
		||||
 | 
			
		||||
  for (i = n_windows - 1; i >= 0; i--)
 | 
			
		||||
    if (meta_stack_window_equal (&windows[i], sibling))
 | 
			
		||||
      break;
 | 
			
		||||
 | 
			
		||||
  for (; i >= 0; i--)
 | 
			
		||||
    {
 | 
			
		||||
      if (windows[i].any.type == META_WINDOW_CLIENT_TYPE_X11)
 | 
			
		||||
        return &windows[i];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  return NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * raise_window_relative_to_managed_windows:
 | 
			
		||||
 *
 | 
			
		||||
 * This function is used to avoid raising a window above popup
 | 
			
		||||
 * menus and other such things.
 | 
			
		||||
 *
 | 
			
		||||
 * The key to the operation of this function is that we are expecting
 | 
			
		||||
 * at most one window to be added at a time. If xwindow is newly added,
 | 
			
		||||
 * then its own stack position will be too high (the frame window
 | 
			
		||||
 * is created at the top of the stack), but if we ignore xwindow,
 | 
			
		||||
 * then the *next* managed window in the stack will be a window that
 | 
			
		||||
 * we've already stacked.
 | 
			
		||||
 *
 | 
			
		||||
 * We could generalize this and remove the assumption that windows
 | 
			
		||||
 * are added one at a time by keeping an explicit ->stacked flag in
 | 
			
		||||
 * MetaWindow.
 | 
			
		||||
 *
 | 
			
		||||
 * An alternate approach would be to reverse the stacking algorithm to
 | 
			
		||||
 * work by placing each window above the others, and start by lowering
 | 
			
		||||
 * a window to the bottom (instead of the current way, which works by
 | 
			
		||||
 * placing each window below another and starting with a raise)
 | 
			
		||||
 */
 | 
			
		||||
static void
 | 
			
		||||
raise_window_relative_to_managed_windows (MetaScreen *screen,
 | 
			
		||||
                                          const MetaStackWindow *window)
 | 
			
		||||
{
 | 
			
		||||
  gulong serial = 0;
 | 
			
		||||
  MetaStackWindow *sibling;
 | 
			
		||||
 | 
			
		||||
  sibling = find_top_most_managed_window (screen, window);
 | 
			
		||||
  if (!sibling)
 | 
			
		||||
    {
 | 
			
		||||
      if (window->any.type == META_WINDOW_CLIENT_TYPE_X11)
 | 
			
		||||
        {
 | 
			
		||||
          serial = XNextRequest (screen->display->xdisplay);
 | 
			
		||||
          meta_error_trap_push (screen->display);
 | 
			
		||||
          XLowerWindow (screen->display->xdisplay,
 | 
			
		||||
                        window->x11.xwindow);
 | 
			
		||||
          meta_error_trap_pop (screen->display);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      /* No sibling to use, just lower ourselves to the bottom
 | 
			
		||||
       * to be sure we're below any override redirect windows.
 | 
			
		||||
       */
 | 
			
		||||
      meta_stack_tracker_record_lower (screen->stack_tracker,
 | 
			
		||||
                                       window,
 | 
			
		||||
                                       serial);
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  /* window is the topmost managed child */
 | 
			
		||||
  meta_topic (META_DEBUG_STACK,
 | 
			
		||||
              "Moving 0x%lx above topmost managed child window 0x%lx\n",
 | 
			
		||||
              window->any.type == META_WINDOW_CLIENT_TYPE_X11 ? window->x11.xwindow: 0,
 | 
			
		||||
              sibling->any.type == META_WINDOW_CLIENT_TYPE_X11 ? sibling->x11.xwindow: 0);
 | 
			
		||||
 | 
			
		||||
  if (window->any.type == META_WINDOW_CLIENT_TYPE_X11)
 | 
			
		||||
    {
 | 
			
		||||
      XWindowChanges changes;
 | 
			
		||||
      MetaStackWindow *x11_sibling = find_x11_sibling_downwards (screen, sibling);
 | 
			
		||||
      serial = XNextRequest (screen->display->xdisplay);
 | 
			
		||||
 | 
			
		||||
      if (x11_sibling)
 | 
			
		||||
        {
 | 
			
		||||
          changes.sibling = x11_sibling->x11.xwindow;
 | 
			
		||||
          changes.stack_mode = Above;
 | 
			
		||||
 | 
			
		||||
          meta_error_trap_push (screen->display);
 | 
			
		||||
          XConfigureWindow (screen->display->xdisplay,
 | 
			
		||||
                            window->x11.xwindow,
 | 
			
		||||
                            CWSibling | CWStackMode,
 | 
			
		||||
                            &changes);
 | 
			
		||||
          meta_error_trap_pop (screen->display);
 | 
			
		||||
        }
 | 
			
		||||
      else
 | 
			
		||||
        {
 | 
			
		||||
          /* No sibling to use, just lower ourselves to the bottom
 | 
			
		||||
           * to be sure we're below any override redirect windows.
 | 
			
		||||
           */
 | 
			
		||||
          meta_error_trap_push (screen->display);
 | 
			
		||||
          XLowerWindow (screen->display->xdisplay,
 | 
			
		||||
                        window->x11.xwindow);
 | 
			
		||||
          meta_error_trap_pop (screen->display);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  meta_stack_tracker_record_raise_above (screen->stack_tracker,
 | 
			
		||||
                                         window,
 | 
			
		||||
                                         sibling,
 | 
			
		||||
                                         serial);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * stack_sync_to_server:
 | 
			
		||||
 *
 | 
			
		||||
@@ -1037,9 +1235,13 @@ static void
 | 
			
		||||
stack_sync_to_xserver (MetaStack *stack)
 | 
			
		||||
{
 | 
			
		||||
  GArray *x11_stacked;
 | 
			
		||||
  GArray *x11_root_children_stacked;
 | 
			
		||||
  GArray *all_root_children_stacked; /* wayland OR x11 */
 | 
			
		||||
  GList *tmp;
 | 
			
		||||
  GArray *x11_hidden_stack_ids;
 | 
			
		||||
  GArray *x11_hidden;
 | 
			
		||||
  GArray *x11_hidden_stack_windows;
 | 
			
		||||
  int n_override_redirect = 0;
 | 
			
		||||
  MetaStackWindow guard_stack_window;
 | 
			
		||||
 | 
			
		||||
  /* Bail out if frozen */
 | 
			
		||||
  if (stack->freeze_count > 0)
 | 
			
		||||
@@ -1049,29 +1251,42 @@ stack_sync_to_xserver (MetaStack *stack)
 | 
			
		||||
 | 
			
		||||
  stack_ensure_sorted (stack);
 | 
			
		||||
 | 
			
		||||
  /* Create stacked xwindow arrays, in bottom-to-top order
 | 
			
		||||
  /* Create stacked xwindow arrays.
 | 
			
		||||
   * Painfully, "stacked" is in bottom-to-top order for the
 | 
			
		||||
   * _NET hints, and "root_children_stacked" is in top-to-bottom
 | 
			
		||||
   * order for XRestackWindows()
 | 
			
		||||
   */
 | 
			
		||||
  x11_stacked = g_array_new (FALSE, FALSE, sizeof (Window));
 | 
			
		||||
 | 
			
		||||
  all_root_children_stacked = g_array_new (FALSE, FALSE, sizeof (guint64));
 | 
			
		||||
  x11_hidden_stack_ids = g_array_new (FALSE, FALSE, sizeof (guint64));
 | 
			
		||||
  all_root_children_stacked = g_array_new (FALSE, FALSE, sizeof (MetaStackWindow));
 | 
			
		||||
  x11_root_children_stacked = g_array_new (FALSE, FALSE, sizeof (Window));
 | 
			
		||||
 | 
			
		||||
  x11_hidden_stack_windows = g_array_new (FALSE, FALSE, sizeof (MetaStackWindow));
 | 
			
		||||
  x11_hidden = g_array_new (FALSE, FALSE, sizeof (Window));
 | 
			
		||||
 | 
			
		||||
  /* The screen guard window sits above all hidden windows and acts as
 | 
			
		||||
   * a barrier to input reaching these windows. */
 | 
			
		||||
  g_array_append_val (x11_hidden, stack->screen->guard_window);
 | 
			
		||||
 | 
			
		||||
  meta_topic (META_DEBUG_STACK, "Top to bottom: ");
 | 
			
		||||
  meta_push_no_msg_prefix ();
 | 
			
		||||
 | 
			
		||||
  for (tmp = g_list_last(stack->sorted); tmp != NULL; tmp = tmp->prev)
 | 
			
		||||
  for (tmp = stack->sorted; tmp != NULL; tmp = tmp->next)
 | 
			
		||||
    {
 | 
			
		||||
      MetaWindow *w = tmp->data;
 | 
			
		||||
      Window top_level_window;
 | 
			
		||||
      guint64 stack_id;
 | 
			
		||||
      MetaStackWindow stack_window;
 | 
			
		||||
 | 
			
		||||
      if (w->unmanaging)
 | 
			
		||||
        continue;
 | 
			
		||||
      stack_window.any.type = w->client_type;
 | 
			
		||||
 | 
			
		||||
      meta_topic (META_DEBUG_STACK, "%u:%d - %s ",
 | 
			
		||||
		  w->layer, w->stack_position, w->desc);
 | 
			
		||||
 | 
			
		||||
      g_array_append_val (x11_stacked, w->xwindow);
 | 
			
		||||
      /* remember, stacked is in reverse order (bottom to top) */
 | 
			
		||||
      if (w->override_redirect)
 | 
			
		||||
	n_override_redirect++;
 | 
			
		||||
      else
 | 
			
		||||
	g_array_prepend_val (x11_stacked, w->xwindow);
 | 
			
		||||
 | 
			
		||||
      if (w->frame)
 | 
			
		||||
	top_level_window = w->frame->xwindow;
 | 
			
		||||
@@ -1079,9 +1294,9 @@ stack_sync_to_xserver (MetaStack *stack)
 | 
			
		||||
	top_level_window = w->xwindow;
 | 
			
		||||
 | 
			
		||||
      if (w->client_type == META_WINDOW_CLIENT_TYPE_X11)
 | 
			
		||||
        stack_id = top_level_window;
 | 
			
		||||
        stack_window.x11.xwindow = top_level_window;
 | 
			
		||||
      else
 | 
			
		||||
        stack_id = w->stamp;
 | 
			
		||||
        stack_window.wayland.meta_window = w;
 | 
			
		||||
 | 
			
		||||
      /* We don't restack hidden windows along with the rest, though they are
 | 
			
		||||
       * reflected in the _NET hints. Hidden windows all get pushed below
 | 
			
		||||
@@ -1090,34 +1305,267 @@ stack_sync_to_xserver (MetaStack *stack)
 | 
			
		||||
	{
 | 
			
		||||
          if (w->client_type == META_WINDOW_CLIENT_TYPE_X11)
 | 
			
		||||
            {
 | 
			
		||||
              guint64 stack_id = top_level_window;
 | 
			
		||||
              MetaStackWindow stack_window;
 | 
			
		||||
 | 
			
		||||
              g_array_append_val (x11_hidden_stack_ids, stack_id);
 | 
			
		||||
              stack_window.any.type = META_WINDOW_CLIENT_TYPE_X11;
 | 
			
		||||
              stack_window.x11.xwindow = top_level_window;
 | 
			
		||||
 | 
			
		||||
              g_array_append_val (x11_hidden_stack_windows, stack_window);
 | 
			
		||||
              g_array_append_val (x11_hidden, top_level_window);
 | 
			
		||||
            }
 | 
			
		||||
	  continue;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
      g_array_append_val (all_root_children_stacked, stack_id);
 | 
			
		||||
      g_array_append_val (all_root_children_stacked, stack_window);
 | 
			
		||||
 | 
			
		||||
      /* build XRestackWindows() array from top to bottom */
 | 
			
		||||
      if (w->client_type == META_WINDOW_CLIENT_TYPE_X11)
 | 
			
		||||
        g_array_append_val (x11_root_children_stacked, top_level_window);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  meta_topic (META_DEBUG_STACK, "\n");
 | 
			
		||||
  meta_pop_no_msg_prefix ();
 | 
			
		||||
 | 
			
		||||
  /* The screen guard window sits above all hidden windows and acts as
 | 
			
		||||
   * a barrier to input reaching these windows. */
 | 
			
		||||
  g_array_append_val (x11_hidden_stack_ids, stack->screen->guard_window);
 | 
			
		||||
  /* All X windows should be in some stacking order */
 | 
			
		||||
  if (x11_stacked->len != stack->xwindows->len - n_override_redirect)
 | 
			
		||||
    meta_bug ("%u windows stacked, %u windows exist in stack\n",
 | 
			
		||||
              x11_stacked->len, stack->xwindows->len);
 | 
			
		||||
 | 
			
		||||
  /* Sync to server */
 | 
			
		||||
 | 
			
		||||
  meta_topic (META_DEBUG_STACK, "Restacking %u windows\n",
 | 
			
		||||
              all_root_children_stacked->len);
 | 
			
		||||
 | 
			
		||||
  meta_stack_tracker_restack_managed (stack->screen->stack_tracker,
 | 
			
		||||
                                      (guint64 *)all_root_children_stacked->data,
 | 
			
		||||
                                      all_root_children_stacked->len);
 | 
			
		||||
  meta_stack_tracker_restack_at_bottom (stack->screen->stack_tracker,
 | 
			
		||||
                                        (guint64 *)x11_hidden_stack_ids->data,
 | 
			
		||||
                                        x11_hidden_stack_ids->len);
 | 
			
		||||
  meta_error_trap_push (stack->screen->display);
 | 
			
		||||
 | 
			
		||||
  if (stack->last_all_root_children_stacked == NULL)
 | 
			
		||||
    {
 | 
			
		||||
      /* Just impose our stack, we don't know the previous state.
 | 
			
		||||
       * This involves a ton of circulate requests and may flicker.
 | 
			
		||||
       */
 | 
			
		||||
      meta_topic (META_DEBUG_STACK, "Don't know last stack state, restacking everything\n");
 | 
			
		||||
 | 
			
		||||
      if (all_root_children_stacked->len > 1)
 | 
			
		||||
        {
 | 
			
		||||
          gulong serial = 0;
 | 
			
		||||
          if (x11_root_children_stacked->len > 1)
 | 
			
		||||
            {
 | 
			
		||||
              serial = XNextRequest (stack->screen->display->xdisplay);
 | 
			
		||||
              XRestackWindows (stack->screen->display->xdisplay,
 | 
			
		||||
                               (Window *) x11_root_children_stacked->data,
 | 
			
		||||
                               x11_root_children_stacked->len);
 | 
			
		||||
            }
 | 
			
		||||
          meta_stack_tracker_record_restack_windows (stack->screen->stack_tracker,
 | 
			
		||||
                                                     (MetaStackWindow *) all_root_children_stacked->data,
 | 
			
		||||
                                                     all_root_children_stacked->len,
 | 
			
		||||
                                                     serial);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
  else if (all_root_children_stacked->len > 0)
 | 
			
		||||
    {
 | 
			
		||||
      /* Try to do minimal window moves to get the stack in order */
 | 
			
		||||
      /* A point of note: these arrays include frames not client windows,
 | 
			
		||||
       * so if a client window has changed frame since last_root_children_stacked
 | 
			
		||||
       * was saved, then we may have inefficiency, but I don't think things
 | 
			
		||||
       * break...
 | 
			
		||||
       */
 | 
			
		||||
      const MetaStackWindow *old_stack = (MetaStackWindow *) stack->last_all_root_children_stacked->data;
 | 
			
		||||
      const MetaStackWindow *new_stack = (MetaStackWindow *) all_root_children_stacked->data;
 | 
			
		||||
      const int old_len = stack->last_all_root_children_stacked->len;
 | 
			
		||||
      const int new_len = all_root_children_stacked->len;
 | 
			
		||||
      const MetaStackWindow *oldp = old_stack;
 | 
			
		||||
      const MetaStackWindow *newp = new_stack;
 | 
			
		||||
      const MetaStackWindow *old_end = old_stack + old_len;
 | 
			
		||||
      const MetaStackWindow *new_end = new_stack + new_len;
 | 
			
		||||
      Window last_xwindow = None;
 | 
			
		||||
      const MetaStackWindow *last_window = NULL;
 | 
			
		||||
 | 
			
		||||
      while (oldp != old_end &&
 | 
			
		||||
             newp != new_end)
 | 
			
		||||
        {
 | 
			
		||||
          if (meta_stack_window_equal (oldp, newp))
 | 
			
		||||
            {
 | 
			
		||||
              /* Stacks are the same here, move on */
 | 
			
		||||
              ++oldp;
 | 
			
		||||
              if (newp->any.type == META_WINDOW_CLIENT_TYPE_X11)
 | 
			
		||||
                last_xwindow = newp->x11.xwindow;
 | 
			
		||||
              last_window = newp;
 | 
			
		||||
              ++newp;
 | 
			
		||||
            }
 | 
			
		||||
          else if ((oldp->any.type == META_WINDOW_CLIENT_TYPE_X11 &&
 | 
			
		||||
                    meta_display_lookup_x_window (stack->screen->display,
 | 
			
		||||
                                                  oldp->x11.xwindow) == NULL) ||
 | 
			
		||||
                   (oldp->any.type == META_WINDOW_CLIENT_TYPE_WAYLAND &&
 | 
			
		||||
                    oldp->wayland.meta_window == NULL))
 | 
			
		||||
            {
 | 
			
		||||
              /* *oldp is no longer known to us (probably destroyed),
 | 
			
		||||
               * so we can just skip it
 | 
			
		||||
               */
 | 
			
		||||
              ++oldp;
 | 
			
		||||
            }
 | 
			
		||||
          else
 | 
			
		||||
            {
 | 
			
		||||
              /* Move *newp below the last_window */
 | 
			
		||||
              if (!last_window)
 | 
			
		||||
                {
 | 
			
		||||
                  meta_topic (META_DEBUG_STACK, "Using window 0x%lx as topmost (but leaving it in-place)\n",
 | 
			
		||||
                              newp->x11.xwindow);
 | 
			
		||||
 | 
			
		||||
                  raise_window_relative_to_managed_windows (stack->screen, newp);
 | 
			
		||||
                }
 | 
			
		||||
              else if (newp->any.type == META_WINDOW_CLIENT_TYPE_X11 &&
 | 
			
		||||
                       last_xwindow == None)
 | 
			
		||||
                {
 | 
			
		||||
                  /* In this case we have an X window that we need to
 | 
			
		||||
                   * put below a wayland window and this is the
 | 
			
		||||
                   * topmost X window. */
 | 
			
		||||
 | 
			
		||||
                  /* In X terms (because this is the topmost X window)
 | 
			
		||||
                   * we want to
 | 
			
		||||
                   * raise_window_relative_to_managed_windows() to
 | 
			
		||||
                   * ensure the X window is below override-redirect
 | 
			
		||||
                   * pop-up windows.
 | 
			
		||||
                   *
 | 
			
		||||
                   * In Wayland terms we just want to ensure
 | 
			
		||||
                   * newp is lowered below last_window (which
 | 
			
		||||
                   * notably doesn't require an X request because we
 | 
			
		||||
                   * know last_window isn't an X window).
 | 
			
		||||
                   */
 | 
			
		||||
 | 
			
		||||
                  raise_window_relative_to_managed_windows (stack->screen, newp);
 | 
			
		||||
 | 
			
		||||
                  meta_stack_tracker_record_lower_below (stack->screen->stack_tracker,
 | 
			
		||||
                                                         newp, last_window,
 | 
			
		||||
                                                         0); /* no x request serial */
 | 
			
		||||
                }
 | 
			
		||||
              else
 | 
			
		||||
                {
 | 
			
		||||
                  gulong serial = 0;
 | 
			
		||||
 | 
			
		||||
                  /* This means that if last_xwindow is dead, but not
 | 
			
		||||
                   * *newp, then we fail to restack *newp; but on
 | 
			
		||||
                   * unmanaging last_xwindow, we'll fix it up.
 | 
			
		||||
                   */
 | 
			
		||||
 | 
			
		||||
                  meta_topic (META_DEBUG_STACK, "Placing window 0x%lx below 0x%lx\n",
 | 
			
		||||
                              newp->any.type == META_WINDOW_CLIENT_TYPE_X11 ? newp->x11.xwindow : 0,
 | 
			
		||||
                              last_xwindow);
 | 
			
		||||
 | 
			
		||||
                  if (newp->any.type == META_WINDOW_CLIENT_TYPE_X11)
 | 
			
		||||
                    {
 | 
			
		||||
                      XWindowChanges changes;
 | 
			
		||||
                      serial = XNextRequest (stack->screen->display->xdisplay);
 | 
			
		||||
 | 
			
		||||
                      changes.sibling = last_xwindow;
 | 
			
		||||
                      changes.stack_mode = Below;
 | 
			
		||||
 | 
			
		||||
                      XConfigureWindow (stack->screen->display->xdisplay,
 | 
			
		||||
                                        newp->x11.xwindow,
 | 
			
		||||
                                        CWSibling | CWStackMode,
 | 
			
		||||
                                        &changes);
 | 
			
		||||
                    }
 | 
			
		||||
 | 
			
		||||
                  meta_stack_tracker_record_lower_below (stack->screen->stack_tracker,
 | 
			
		||||
                                                         newp, last_window,
 | 
			
		||||
                                                         serial);
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
              if (newp->any.type == META_WINDOW_CLIENT_TYPE_X11)
 | 
			
		||||
                last_xwindow = newp->x11.xwindow;
 | 
			
		||||
              last_window = newp;
 | 
			
		||||
              ++newp;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      if (newp != new_end)
 | 
			
		||||
        {
 | 
			
		||||
          const MetaStackWindow *x_ref;
 | 
			
		||||
          unsigned long serial = 0;
 | 
			
		||||
 | 
			
		||||
          /* Restack remaining windows */
 | 
			
		||||
          meta_topic (META_DEBUG_STACK, "Restacking remaining %d windows\n",
 | 
			
		||||
                      (int) (new_end - newp));
 | 
			
		||||
 | 
			
		||||
          /* rewind until we find the last stacked X window that we can use
 | 
			
		||||
           * as a reference point for re-stacking remaining X windows */
 | 
			
		||||
          if (newp != new_stack)
 | 
			
		||||
            for (x_ref = newp - 1;
 | 
			
		||||
                 x_ref->any.type != META_WINDOW_CLIENT_TYPE_X11 && x_ref > new_stack;
 | 
			
		||||
                 x_ref--)
 | 
			
		||||
              ;
 | 
			
		||||
          else
 | 
			
		||||
            x_ref = new_stack;
 | 
			
		||||
 | 
			
		||||
          /* If we didn't find an X window looking backwards then walk forwards
 | 
			
		||||
           * through the remaining windows to find the first remaining X window
 | 
			
		||||
           * instead. */
 | 
			
		||||
          if (x_ref->any.type != META_WINDOW_CLIENT_TYPE_X11)
 | 
			
		||||
            {
 | 
			
		||||
              for (x_ref = newp;
 | 
			
		||||
                   x_ref->any.type != META_WINDOW_CLIENT_TYPE_X11 && x_ref < new_end;
 | 
			
		||||
                   x_ref++)
 | 
			
		||||
                ;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
          /* If there are any X windows remaining unstacked then restack them */
 | 
			
		||||
          if (x_ref->any.type == META_WINDOW_CLIENT_TYPE_X11)
 | 
			
		||||
            {
 | 
			
		||||
              int i;
 | 
			
		||||
 | 
			
		||||
              for (i = x11_root_children_stacked->len - 1; i; i--)
 | 
			
		||||
                {
 | 
			
		||||
                  Window *reference = &g_array_index (x11_root_children_stacked, Window, i);
 | 
			
		||||
 | 
			
		||||
                  if (*reference == x_ref->x11.xwindow)
 | 
			
		||||
                    {
 | 
			
		||||
                      int n = x11_root_children_stacked->len - i;
 | 
			
		||||
 | 
			
		||||
                      /* There's no point restacking if there's only one X window */
 | 
			
		||||
                      if (n == 1)
 | 
			
		||||
                        break;
 | 
			
		||||
 | 
			
		||||
                      serial = XNextRequest (stack->screen->display->xdisplay);
 | 
			
		||||
                      XRestackWindows (stack->screen->display->xdisplay,
 | 
			
		||||
                                       reference, n);
 | 
			
		||||
                      break;
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
          /* We need to include an already-stacked window
 | 
			
		||||
           * in the restack call, so we get in the proper position
 | 
			
		||||
           * with respect to it.
 | 
			
		||||
           */
 | 
			
		||||
          if (newp != new_stack)
 | 
			
		||||
            newp = MIN (newp - 1, x_ref);
 | 
			
		||||
          meta_stack_tracker_record_restack_windows (stack->screen->stack_tracker,
 | 
			
		||||
                                                     newp, new_end - newp,
 | 
			
		||||
                                                     serial);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  /* Push hidden X windows to the bottom of the stack under the guard window */
 | 
			
		||||
  guard_stack_window.any.type = META_WINDOW_CLIENT_TYPE_X11;
 | 
			
		||||
  guard_stack_window.x11.xwindow = stack->screen->guard_window;
 | 
			
		||||
  meta_stack_tracker_record_lower (stack->screen->stack_tracker,
 | 
			
		||||
                                   &guard_stack_window,
 | 
			
		||||
                                   XNextRequest (stack->screen->display->xdisplay));
 | 
			
		||||
  XLowerWindow (stack->screen->display->xdisplay, stack->screen->guard_window);
 | 
			
		||||
  meta_stack_tracker_record_restack_windows (stack->screen->stack_tracker,
 | 
			
		||||
                                             (MetaStackWindow *)x11_hidden_stack_windows->data,
 | 
			
		||||
                                             x11_hidden_stack_windows->len,
 | 
			
		||||
                                             XNextRequest (stack->screen->display->xdisplay));
 | 
			
		||||
  XRestackWindows (stack->screen->display->xdisplay,
 | 
			
		||||
		   (Window *)x11_hidden->data,
 | 
			
		||||
		   x11_hidden->len);
 | 
			
		||||
  g_array_free (x11_hidden, TRUE);
 | 
			
		||||
  g_array_free (x11_hidden_stack_windows, TRUE);
 | 
			
		||||
 | 
			
		||||
  meta_error_trap_pop (stack->screen->display);
 | 
			
		||||
  /* on error, a window was destroyed; it should eventually
 | 
			
		||||
   * get removed from the stacking list when we unmanage it
 | 
			
		||||
   * and we'll fix stacking at that time.
 | 
			
		||||
   */
 | 
			
		||||
 | 
			
		||||
  /* Sync _NET_CLIENT_LIST and _NET_CLIENT_LIST_STACKING */
 | 
			
		||||
 | 
			
		||||
@@ -1137,7 +1585,14 @@ stack_sync_to_xserver (MetaStack *stack)
 | 
			
		||||
                   x11_stacked->len);
 | 
			
		||||
 | 
			
		||||
  g_array_free (x11_stacked, TRUE);
 | 
			
		||||
  g_array_free (all_root_children_stacked, TRUE);
 | 
			
		||||
 | 
			
		||||
  if (stack->last_all_root_children_stacked)
 | 
			
		||||
    free_last_all_root_children_stacked_cache (stack);
 | 
			
		||||
  stack->last_all_root_children_stacked = all_root_children_stacked;
 | 
			
		||||
 | 
			
		||||
  g_array_free (x11_root_children_stacked, TRUE);
 | 
			
		||||
 | 
			
		||||
  /* That was scary... */
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
MetaWindow*
 | 
			
		||||
@@ -1275,9 +1730,6 @@ get_default_focus_window (MetaStack     *stack,
 | 
			
		||||
      if (window->minimized)
 | 
			
		||||
        continue;
 | 
			
		||||
 | 
			
		||||
      if (window->unmanaging)
 | 
			
		||||
        continue;
 | 
			
		||||
 | 
			
		||||
      if (!(window->input || window->take_focus))
 | 
			
		||||
        continue;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -92,7 +92,6 @@ struct _MetaWindow
 | 
			
		||||
 | 
			
		||||
  MetaDisplay *display;
 | 
			
		||||
  MetaScreen *screen;
 | 
			
		||||
  guint64 stamp;
 | 
			
		||||
  const MetaMonitorInfo *monitor;
 | 
			
		||||
  MetaWorkspace *workspace;
 | 
			
		||||
  MetaWindowClientType client_type;
 | 
			
		||||
@@ -519,6 +518,7 @@ MetaWindow * _meta_window_shared_new       (MetaDisplay         *display,
 | 
			
		||||
 | 
			
		||||
void        meta_window_unmanage           (MetaWindow  *window,
 | 
			
		||||
                                            guint32      timestamp);
 | 
			
		||||
void        meta_window_calc_showing       (MetaWindow  *window);
 | 
			
		||||
void        meta_window_queue              (MetaWindow  *window,
 | 
			
		||||
                                            guint queuebits);
 | 
			
		||||
void        meta_window_tile               (MetaWindow        *window);
 | 
			
		||||
@@ -653,6 +653,9 @@ void meta_window_set_transient_for        (MetaWindow *window,
 | 
			
		||||
void meta_window_set_opacity              (MetaWindow *window,
 | 
			
		||||
                                           guint8      opacity);
 | 
			
		||||
 | 
			
		||||
void meta_window_set_custom_frame_extents (MetaWindow *window,
 | 
			
		||||
                                           GtkBorder  *extents);
 | 
			
		||||
 | 
			
		||||
void meta_window_handle_enter (MetaWindow  *window,
 | 
			
		||||
                               guint32      timestamp,
 | 
			
		||||
                               guint        root_x,
 | 
			
		||||
 
 | 
			
		||||
@@ -71,10 +71,6 @@
 | 
			
		||||
 | 
			
		||||
static int destroying_windows_disallowed = 0;
 | 
			
		||||
 | 
			
		||||
// Each window has a "stamp" which is a non-recycled 64-bit ID. They
 | 
			
		||||
// start after the end of the XID space so that, for stacking
 | 
			
		||||
// we can keep a guint64 that represents one or the other
 | 
			
		||||
static guint64 next_window_stamp = G_GUINT64_CONSTANT(0x100000000);
 | 
			
		||||
 | 
			
		||||
static void     invalidate_work_areas     (MetaWindow     *window);
 | 
			
		||||
static void     set_wm_state              (MetaWindow     *window);
 | 
			
		||||
@@ -646,7 +642,6 @@ meta_window_class_init (MetaWindowClass *klass)
 | 
			
		||||
static void
 | 
			
		||||
meta_window_init (MetaWindow *self)
 | 
			
		||||
{
 | 
			
		||||
  self->stamp = next_window_stamp++;
 | 
			
		||||
  meta_prefs_add_listener (prefs_changed_callback, self);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -808,8 +803,6 @@ _meta_window_shared_new (MetaDisplay         *display,
 | 
			
		||||
   * type
 | 
			
		||||
   */
 | 
			
		||||
  window->display = display;
 | 
			
		||||
  meta_display_register_stamp (window->display, &window->stamp, window);
 | 
			
		||||
 | 
			
		||||
  window->workspace = NULL;
 | 
			
		||||
 | 
			
		||||
  window->sync_request_counter = None;
 | 
			
		||||
@@ -1062,8 +1055,8 @@ _meta_window_shared_new (MetaDisplay         *display,
 | 
			
		||||
 | 
			
		||||
  if (window->initial_workspace_set)
 | 
			
		||||
    {
 | 
			
		||||
      gboolean on_all_workspaces = window->on_all_workspaces;
 | 
			
		||||
      MetaWorkspace *workspace = NULL;
 | 
			
		||||
      gboolean on_all_workspaces;
 | 
			
		||||
      MetaWorkspace *workspace;
 | 
			
		||||
 | 
			
		||||
      if (window->initial_workspace == (int) 0xFFFFFFFF)
 | 
			
		||||
        {
 | 
			
		||||
@@ -1077,13 +1070,15 @@ _meta_window_shared_new (MetaDisplay         *display,
 | 
			
		||||
          window->on_all_workspaces_requested = TRUE;
 | 
			
		||||
 | 
			
		||||
          on_all_workspaces = TRUE;
 | 
			
		||||
          workspace = NULL;
 | 
			
		||||
        }
 | 
			
		||||
      else if (!on_all_workspaces)
 | 
			
		||||
      else
 | 
			
		||||
        {
 | 
			
		||||
          meta_topic (META_DEBUG_PLACEMENT,
 | 
			
		||||
                      "Window %s is initially on space %d\n",
 | 
			
		||||
                      window->desc, window->initial_workspace);
 | 
			
		||||
 | 
			
		||||
          on_all_workspaces = FALSE;
 | 
			
		||||
          workspace = meta_screen_get_workspace_by_index (window->screen,
 | 
			
		||||
                                                          window->initial_workspace);
 | 
			
		||||
        }
 | 
			
		||||
@@ -1097,9 +1092,9 @@ _meta_window_shared_new (MetaDisplay         *display,
 | 
			
		||||
   * but appear on other workspaces. override-redirect windows are part
 | 
			
		||||
   * of no workspace.
 | 
			
		||||
   */
 | 
			
		||||
  if (!window->override_redirect && window->workspace == NULL)
 | 
			
		||||
  if (!window->override_redirect)
 | 
			
		||||
    {
 | 
			
		||||
      if (window->transient_for != NULL)
 | 
			
		||||
      if (window->workspace == NULL && window->transient_for != NULL)
 | 
			
		||||
        {
 | 
			
		||||
          meta_topic (META_DEBUG_PLACEMENT,
 | 
			
		||||
                      "Putting window %s on same workspace as parent %s\n",
 | 
			
		||||
@@ -1110,15 +1105,7 @@ _meta_window_shared_new (MetaDisplay         *display,
 | 
			
		||||
                               window->transient_for->workspace);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      if (window->on_all_workspaces)
 | 
			
		||||
        {
 | 
			
		||||
          meta_topic (META_DEBUG_PLACEMENT,
 | 
			
		||||
                      "Putting window %s on all workspaces\n",
 | 
			
		||||
                      window->desc);
 | 
			
		||||
 | 
			
		||||
          set_workspace_state (window, TRUE, NULL);
 | 
			
		||||
        }
 | 
			
		||||
      else
 | 
			
		||||
      if (window->workspace == NULL)
 | 
			
		||||
        {
 | 
			
		||||
          meta_topic (META_DEBUG_PLACEMENT,
 | 
			
		||||
                      "Putting window %s on active workspace\n",
 | 
			
		||||
@@ -1170,6 +1157,9 @@ _meta_window_shared_new (MetaDisplay         *display,
 | 
			
		||||
  /* disable show desktop mode unless we're a desktop component */
 | 
			
		||||
  maybe_leave_show_desktop_mode (window);
 | 
			
		||||
 | 
			
		||||
  if (!window->override_redirect)
 | 
			
		||||
    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.
 | 
			
		||||
@@ -1252,8 +1242,6 @@ meta_window_unmanage (MetaWindow  *window,
 | 
			
		||||
    meta_bug ("Tried to destroy window %s while destruction was not allowed\n",
 | 
			
		||||
              window->desc);
 | 
			
		||||
 | 
			
		||||
  meta_display_unregister_stamp (window->display, window->stamp);
 | 
			
		||||
 | 
			
		||||
  window->unmanaging = TRUE;
 | 
			
		||||
 | 
			
		||||
  if (meta_prefs_get_attach_modal_dialogs ())
 | 
			
		||||
@@ -1311,7 +1299,9 @@ meta_window_unmanage (MetaWindow  *window,
 | 
			
		||||
      meta_topic (META_DEBUG_FOCUS,
 | 
			
		||||
                  "Focusing default window since we're unmanaging %s\n",
 | 
			
		||||
                  window->desc);
 | 
			
		||||
      meta_workspace_focus_default_window (window->screen->active_workspace, NULL, timestamp);
 | 
			
		||||
      meta_workspace_focus_default_window (window->screen->active_workspace,
 | 
			
		||||
                                           window,
 | 
			
		||||
                                           timestamp);
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    {
 | 
			
		||||
@@ -1533,6 +1523,9 @@ implement_showing (MetaWindow *window,
 | 
			
		||||
  meta_verbose ("Implement showing = %d for window %s\n",
 | 
			
		||||
                showing, window->desc);
 | 
			
		||||
 | 
			
		||||
  if (!window->override_redirect)
 | 
			
		||||
    sync_client_window_mapped (window);
 | 
			
		||||
 | 
			
		||||
  if (!showing)
 | 
			
		||||
    {
 | 
			
		||||
      /* When we manage a new window, we normally delay placing it
 | 
			
		||||
@@ -1548,12 +1541,9 @@ implement_showing (MetaWindow *window,
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    meta_window_show (window);
 | 
			
		||||
 | 
			
		||||
  if (!window->override_redirect)
 | 
			
		||||
    sync_client_window_mapped (window);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
void
 | 
			
		||||
meta_window_calc_showing (MetaWindow  *window)
 | 
			
		||||
{
 | 
			
		||||
  implement_showing (window, meta_window_should_be_showing (window));
 | 
			
		||||
@@ -2095,7 +2085,7 @@ windows_overlap (const MetaWindow *w1, const MetaWindow *w2)
 | 
			
		||||
static gboolean
 | 
			
		||||
window_would_be_covered (const MetaWindow *newbie)
 | 
			
		||||
{
 | 
			
		||||
  MetaWorkspace *workspace = meta_window_get_workspace ((MetaWindow *)newbie);
 | 
			
		||||
  MetaWorkspace *workspace = newbie->workspace;
 | 
			
		||||
  GList *tmp, *windows;
 | 
			
		||||
 | 
			
		||||
  windows = meta_workspace_list_windows (workspace);
 | 
			
		||||
@@ -2622,9 +2612,6 @@ meta_window_maximize_internal (MetaWindow        *window,
 | 
			
		||||
  meta_window_recalc_features (window);
 | 
			
		||||
  set_net_wm_state (window);
 | 
			
		||||
 | 
			
		||||
  if (window->monitor->in_fullscreen)
 | 
			
		||||
    meta_screen_queue_check_fullscreen (window->screen);
 | 
			
		||||
 | 
			
		||||
  g_object_freeze_notify (G_OBJECT (window));
 | 
			
		||||
  g_object_notify_by_pspec (G_OBJECT (window), obj_props[PROP_MAXIMIZED_HORIZONTALLY]);
 | 
			
		||||
  g_object_notify_by_pspec (G_OBJECT (window), obj_props[PROP_MAXIMIZED_VERTICALLY]);
 | 
			
		||||
@@ -3069,8 +3056,6 @@ meta_window_unmaximize_internal (MetaWindow        *window,
 | 
			
		||||
 | 
			
		||||
      meta_window_recalc_features (window);
 | 
			
		||||
      set_net_wm_state (window);
 | 
			
		||||
      if (!window->monitor->in_fullscreen)
 | 
			
		||||
        meta_screen_queue_check_fullscreen (window->screen);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  g_object_freeze_notify (G_OBJECT (window));
 | 
			
		||||
@@ -4302,7 +4287,7 @@ meta_window_focus (MetaWindow  *window,
 | 
			
		||||
 *  - workspace->windows is a list of windows that is located on
 | 
			
		||||
 *    that workspace.
 | 
			
		||||
 *
 | 
			
		||||
 *  - If the window is on_all_workspaces, then
 | 
			
		||||
 *  - If the window is on_all_workspaces, then then
 | 
			
		||||
 *    window->workspace == NULL, but workspace->windows contains
 | 
			
		||||
 *    the window.
 | 
			
		||||
 */
 | 
			
		||||
@@ -4324,8 +4309,7 @@ set_workspace_state (MetaWindow    *window,
 | 
			
		||||
    g_return_if_fail ((window->constructing && on_all_workspaces) || window->unmanaging);
 | 
			
		||||
 | 
			
		||||
  if (on_all_workspaces == window->on_all_workspaces &&
 | 
			
		||||
      workspace == window->workspace &&
 | 
			
		||||
      !window->constructing)
 | 
			
		||||
      workspace == window->workspace)
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  if (window->workspace)
 | 
			
		||||
@@ -4657,32 +4641,6 @@ meta_window_appears_focused_changed (MetaWindow *window)
 | 
			
		||||
    meta_frame_queue_draw (window->frame);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static gboolean
 | 
			
		||||
should_propagate_focus_appearance (MetaWindow *window)
 | 
			
		||||
{
 | 
			
		||||
  /* Parents of attached modal dialogs should appear focused. */
 | 
			
		||||
  if (meta_window_is_attached_dialog (window))
 | 
			
		||||
    return TRUE;
 | 
			
		||||
 | 
			
		||||
  /* Parents of these sorts of override-redirect windows should
 | 
			
		||||
   * appear focused. */
 | 
			
		||||
  switch (window->type)
 | 
			
		||||
    {
 | 
			
		||||
    case META_WINDOW_DROPDOWN_MENU:
 | 
			
		||||
    case META_WINDOW_POPUP_MENU:
 | 
			
		||||
    case META_WINDOW_COMBO:
 | 
			
		||||
    case META_WINDOW_TOOLTIP:
 | 
			
		||||
    case META_WINDOW_NOTIFICATION:
 | 
			
		||||
    case META_WINDOW_DND:
 | 
			
		||||
    case META_WINDOW_OVERRIDE_OTHER:
 | 
			
		||||
      return TRUE;
 | 
			
		||||
    default:
 | 
			
		||||
      break;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  return FALSE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * meta_window_propagate_focus_appearance:
 | 
			
		||||
 * @window: the window to start propagating from
 | 
			
		||||
@@ -4706,7 +4664,7 @@ meta_window_propagate_focus_appearance (MetaWindow *window,
 | 
			
		||||
 | 
			
		||||
  child = window;
 | 
			
		||||
  parent = meta_window_get_transient_for (child);
 | 
			
		||||
  while (parent && (!focused || should_propagate_focus_appearance (child)))
 | 
			
		||||
  while (parent && (!focused || meta_window_is_attached_dialog (child)))
 | 
			
		||||
    {
 | 
			
		||||
      gboolean child_focus_state_changed;
 | 
			
		||||
 | 
			
		||||
@@ -5423,7 +5381,7 @@ meta_window_shove_titlebar_onscreen (MetaWindow *window)
 | 
			
		||||
gboolean
 | 
			
		||||
meta_window_titlebar_is_onscreen (MetaWindow *window)
 | 
			
		||||
{
 | 
			
		||||
  MetaRectangle  titlebar_rect, frame_rect;
 | 
			
		||||
  MetaRectangle  titlebar_rect;
 | 
			
		||||
  GList         *onscreen_region;
 | 
			
		||||
  gboolean       is_onscreen;
 | 
			
		||||
 | 
			
		||||
@@ -5438,11 +5396,6 @@ meta_window_titlebar_is_onscreen (MetaWindow *window)
 | 
			
		||||
  /* Get the rectangle corresponding to the titlebar */
 | 
			
		||||
  meta_window_get_titlebar_rect (window, &titlebar_rect);
 | 
			
		||||
 | 
			
		||||
  /* Translate into screen coordinates */
 | 
			
		||||
  meta_window_get_frame_rect (window, &frame_rect);
 | 
			
		||||
  titlebar_rect.x = frame_rect.x;
 | 
			
		||||
  titlebar_rect.y = frame_rect.y;
 | 
			
		||||
 | 
			
		||||
  /* Run through the spanning rectangles for the screen and see if one of
 | 
			
		||||
   * them overlaps with the titlebar sufficiently to consider it onscreen.
 | 
			
		||||
   */
 | 
			
		||||
@@ -6762,7 +6715,7 @@ meta_window_set_demands_attention (MetaWindow *window)
 | 
			
		||||
          other_window = stack->data;
 | 
			
		||||
          stack = stack->next;
 | 
			
		||||
 | 
			
		||||
          if (meta_window_located_on_workspace (other_window, workspace))
 | 
			
		||||
          if (meta_window_located_on_workspace (other_window, window->workspace))
 | 
			
		||||
            {
 | 
			
		||||
              meta_window_get_frame_rect (other_window, &other_rect);
 | 
			
		||||
 | 
			
		||||
@@ -7930,6 +7883,24 @@ meta_window_handle_ungrabbed_event (MetaWindow         *window,
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_window_set_custom_frame_extents (MetaWindow *window,
 | 
			
		||||
                                      GtkBorder  *extents)
 | 
			
		||||
{
 | 
			
		||||
  if (extents)
 | 
			
		||||
    {
 | 
			
		||||
      window->has_custom_frame_extents = TRUE;
 | 
			
		||||
      window->custom_frame_extents = *extents;
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    {
 | 
			
		||||
      window->has_custom_frame_extents = FALSE;
 | 
			
		||||
      memset (&window->custom_frame_extents, 0, sizeof (window->custom_frame_extents));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  meta_window_queue (window, META_QUEUE_MOVE_RESIZE);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
gboolean
 | 
			
		||||
meta_window_can_maximize (MetaWindow *window)
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
@@ -170,7 +170,6 @@ MetaWorkspace*
 | 
			
		||||
meta_workspace_new (MetaScreen *screen)
 | 
			
		||||
{
 | 
			
		||||
  MetaWorkspace *workspace;
 | 
			
		||||
  GSList *windows, *l;
 | 
			
		||||
 | 
			
		||||
  workspace = g_object_new (META_TYPE_WORKSPACE, NULL);
 | 
			
		||||
 | 
			
		||||
@@ -198,13 +197,6 @@ meta_workspace_new (MetaScreen *screen)
 | 
			
		||||
 | 
			
		||||
  workspace->showing_desktop = FALSE;
 | 
			
		||||
 | 
			
		||||
  /* make sure sticky windows are in our mru_list */
 | 
			
		||||
  windows = meta_display_list_windows (screen->display, META_LIST_SORTED);
 | 
			
		||||
  for (l = windows; l; l = l->next)
 | 
			
		||||
    if (meta_window_located_on_workspace (l->data, workspace))
 | 
			
		||||
      meta_workspace_add_window (workspace, l->data);
 | 
			
		||||
  g_slist_free (windows);
 | 
			
		||||
 | 
			
		||||
  return workspace;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -366,7 +358,7 @@ meta_workspace_relocate_windows (MetaWorkspace *workspace,
 | 
			
		||||
    {
 | 
			
		||||
      MetaWindow *window = l->data;
 | 
			
		||||
 | 
			
		||||
      if (!window->on_all_workspaces)
 | 
			
		||||
      if (!window->override_redirect)
 | 
			
		||||
        meta_window_change_workspace (window, new_home);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -1167,8 +1159,11 @@ meta_workspace_focus_default_window (MetaWorkspace *workspace,
 | 
			
		||||
                                     guint32        timestamp)
 | 
			
		||||
{
 | 
			
		||||
  if (timestamp == CurrentTime)
 | 
			
		||||
    meta_warning ("CurrentTime used to choose focus window; "
 | 
			
		||||
                  "focus window may not be correct.\n");
 | 
			
		||||
    {
 | 
			
		||||
      meta_warning ("CurrentTime used to choose focus window; "
 | 
			
		||||
                    "focus window may not be correct.\n");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  if (meta_prefs_get_focus_mode () == G_DESKTOP_FOCUS_MODE_CLICK ||
 | 
			
		||||
      !workspace->screen->display->mouse_mode)
 | 
			
		||||
 
 | 
			
		||||
@@ -37,7 +37,6 @@ Window        meta_get_overlay_window           (MetaScreen *screen);
 | 
			
		||||
GList        *meta_get_window_actors            (MetaScreen *screen);
 | 
			
		||||
ClutterActor *meta_get_window_group_for_screen  (MetaScreen *screen);
 | 
			
		||||
ClutterActor *meta_get_top_window_group_for_screen (MetaScreen *screen);
 | 
			
		||||
ClutterActor *meta_get_feedback_group_for_screen (MetaScreen *screen);
 | 
			
		||||
 | 
			
		||||
void        meta_disable_unredirect_for_screen  (MetaScreen *screen);
 | 
			
		||||
void        meta_enable_unredirect_for_screen   (MetaScreen *screen);
 | 
			
		||||
 
 | 
			
		||||
@@ -67,9 +67,9 @@ ClutterActor *meta_background_actor_new    (MetaScreen *screen,
 | 
			
		||||
void meta_background_actor_set_background  (MetaBackgroundActor *self,
 | 
			
		||||
                                            MetaBackground      *background);
 | 
			
		||||
 | 
			
		||||
void meta_background_actor_set_vignette (MetaBackgroundActor *self,
 | 
			
		||||
                                         gboolean             enabled,
 | 
			
		||||
                                         double               brightness,
 | 
			
		||||
                                         double               sharpness);
 | 
			
		||||
void meta_background_actor_add_vignette    (MetaBackgroundActor *self,
 | 
			
		||||
                                            double               brightness,
 | 
			
		||||
                                            double               sharpness);
 | 
			
		||||
void meta_background_actor_remove_vignette (MetaBackgroundActor *self);
 | 
			
		||||
 | 
			
		||||
#endif /* META_BACKGROUND_ACTOR_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -28,7 +28,7 @@
 | 
			
		||||
#define META_TYPE_WORKSPACE            (meta_workspace_get_type ())
 | 
			
		||||
#define META_WORKSPACE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_WORKSPACE, MetaWorkspace))
 | 
			
		||||
#define META_WORKSPACE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  META_TYPE_WORKSPACE, MetaWorkspaceClass))
 | 
			
		||||
#define META_IS_WORKSPACE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_WORKSPACE))
 | 
			
		||||
#define META_IS_WORKSPACE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_WORKSPACE_TYPE))
 | 
			
		||||
#define META_IS_WORKSPACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  META_TYPE_WORKSPACE))
 | 
			
		||||
#define META_WORKSPACE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  META_TYPE_WORKSPACE, MetaWorkspaceClass))
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,94 +0,0 @@
 | 
			
		||||
This directory implements a framework for automated tests of Mutter. The basic
 | 
			
		||||
idea is that mutter-test-runner acts as the window manager and compositor, and
 | 
			
		||||
forks off instances of mutter-test-client to act as clients.
 | 
			
		||||
 | 
			
		||||
There's a simple scripting language for tests. A very small test would look like:
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
# Start up a new X11 client with the client id 1 (doesn't have to be an integer)
 | 
			
		||||
# Windows for this client will be referred to as 1/<window-id>
 | 
			
		||||
new_client 1 x11
 | 
			
		||||
 | 
			
		||||
# Create and show two windows - again the IDs don't have to be integers
 | 
			
		||||
create 1/1
 | 
			
		||||
show 1/1
 | 
			
		||||
create 1/2
 | 
			
		||||
show 1/2
 | 
			
		||||
 | 
			
		||||
# Wait for the commands we've executed in the clients to reach Mutter
 | 
			
		||||
wait
 | 
			
		||||
 | 
			
		||||
# Check that the windows are in the order we expect
 | 
			
		||||
assert_stacking 1/1 1/2
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
Running
 | 
			
		||||
=======
 | 
			
		||||
 | 
			
		||||
The tests are installed according to:
 | 
			
		||||
 | 
			
		||||
https://wiki.gnome.org/Initiatives/GnomeGoals/InstalledTests
 | 
			
		||||
 | 
			
		||||
if --enable-installed-tests is passed to configure. You can run them
 | 
			
		||||
uninstalled with:
 | 
			
		||||
 | 
			
		||||
 cd src && make run-tests
 | 
			
		||||
 | 
			
		||||
Command reference
 | 
			
		||||
=================
 | 
			
		||||
 | 
			
		||||
The following commands are supported. Quoting and comments follow shell rules.
 | 
			
		||||
 | 
			
		||||
new_client <client-id> [wayland|x11]
 | 
			
		||||
 Starts a client, connecting by either Wayland or X11. The client
 | 
			
		||||
 will subsequently be known with the given client-id (an arbitrary
 | 
			
		||||
 string)
 | 
			
		||||
 | 
			
		||||
quit_client <client-id>
 | 
			
		||||
 Destroys all windows for the client, waits for that to be processed,
 | 
			
		||||
 then instructs the client to exit.
 | 
			
		||||
 | 
			
		||||
create <client-id>/<window-id> [override|csd]
 | 
			
		||||
 Creates a new window. For the X11 backend, the keyword 'override'
 | 
			
		||||
 can be given to create an override-redirect and the keyword 'csd'
 | 
			
		||||
 can be given to create a client-side decorated window.
 | 
			
		||||
 | 
			
		||||
show <client-id>/<window-id>
 | 
			
		||||
hide <client-id>/<window-id>
 | 
			
		||||
 Ask the client to show (map) or hide (unmap) the given window
 | 
			
		||||
 | 
			
		||||
activate <client-id>/<window-id>
 | 
			
		||||
 Ask the client to raise and focus the given window. This is currently a no-op
 | 
			
		||||
 for Wayland, where this capability is not supported in the protocol.
 | 
			
		||||
 | 
			
		||||
local_activate <client-id>-<window-id>
 | 
			
		||||
  The same as 'activate', but the operation is done directly inside Mutter
 | 
			
		||||
  and works for both backends
 | 
			
		||||
 | 
			
		||||
raise <client-id>/<window-id>
 | 
			
		||||
lower <client-id>/<window-id>
 | 
			
		||||
  Ask the client to raise or lower the given window ID. This is a no-op
 | 
			
		||||
  for Wayland clients. (It's also considered discouraged, but supported, for
 | 
			
		||||
  non-override-redirect X11 clients.)
 | 
			
		||||
 | 
			
		||||
minimize <client-id>/<window-id>
 | 
			
		||||
unminimize <client-id>/<window-id>
 | 
			
		||||
  Ask the client to minimize or unminimize the given window ID. This older
 | 
			
		||||
  term for this operation is "iconify".
 | 
			
		||||
 | 
			
		||||
destroy <client-id>/<window-id>
 | 
			
		||||
  Destroy the given window
 | 
			
		||||
 | 
			
		||||
wait
 | 
			
		||||
  Wait until all requests sent by Mutter to clients have been received by Mutter,
 | 
			
		||||
  and then wait until all requests by Mutter have been processed by the X server.
 | 
			
		||||
 | 
			
		||||
assert_stacking <client-id>/<window-id> <client-id>/<window-id> ...
 | 
			
		||||
  Assert that the list of client windows known to Mutter is as given and in
 | 
			
		||||
  the given order, bottom to top. The character '|' can be present in the
 | 
			
		||||
  list of windows to indicate the guard window that separates hidden and
 | 
			
		||||
  visible windows. If '|' isn't present, the guard window is asserted to
 | 
			
		||||
  be below all client windows.
 | 
			
		||||
 | 
			
		||||
  This function also queries the X server stack and verifies that Mutter's
 | 
			
		||||
  expectation of the X server stack matches reality.
 | 
			
		||||
@@ -1,5 +0,0 @@
 | 
			
		||||
[Test]
 | 
			
		||||
Description=All Mutter tests
 | 
			
		||||
Exec=@libexecdir@/installed-tests/mutter/mutter-test-runner --all
 | 
			
		||||
Type=session
 | 
			
		||||
Output=TAP
 | 
			
		||||
@@ -1,22 +0,0 @@
 | 
			
		||||
new_client 1 wayland
 | 
			
		||||
create 1/1
 | 
			
		||||
show 1/1
 | 
			
		||||
create 1/2
 | 
			
		||||
show 1/2
 | 
			
		||||
wait
 | 
			
		||||
assert_stacking 1/1 1/2
 | 
			
		||||
 | 
			
		||||
# Currently Wayland clients have no wait to bring themselves to the user's
 | 
			
		||||
# attention; gtk_window_present() is a no-op with the X11 backend of GTK+
 | 
			
		||||
 | 
			
		||||
# activate 1/1
 | 
			
		||||
# wait
 | 
			
		||||
# assert_stacking 1/2 1/1
 | 
			
		||||
# activate 1/2
 | 
			
		||||
# wait
 | 
			
		||||
# assert_stacking 1/1 1/2
 | 
			
		||||
 | 
			
		||||
local_activate 1/1
 | 
			
		||||
assert_stacking 1/2 1/1
 | 
			
		||||
local_activate 1/2
 | 
			
		||||
assert_stacking 1/1 1/2
 | 
			
		||||
@@ -1,19 +0,0 @@
 | 
			
		||||
new_client 1 x11
 | 
			
		||||
create 1/1
 | 
			
		||||
show 1/1
 | 
			
		||||
create 1/2
 | 
			
		||||
show 1/2
 | 
			
		||||
wait
 | 
			
		||||
assert_stacking 1/1 1/2
 | 
			
		||||
 | 
			
		||||
activate 1/1
 | 
			
		||||
wait
 | 
			
		||||
assert_stacking 1/2 1/1
 | 
			
		||||
activate 1/2
 | 
			
		||||
wait
 | 
			
		||||
assert_stacking 1/1 1/2
 | 
			
		||||
 | 
			
		||||
local_activate 1/1
 | 
			
		||||
assert_stacking 1/2 1/1
 | 
			
		||||
local_activate 1/2
 | 
			
		||||
assert_stacking 1/1 1/2
 | 
			
		||||
@@ -1,22 +0,0 @@
 | 
			
		||||
new_client 1 x11
 | 
			
		||||
create 1/1
 | 
			
		||||
show 1/1
 | 
			
		||||
create 1/2 csd
 | 
			
		||||
show 1/2
 | 
			
		||||
wait
 | 
			
		||||
assert_stacking 1/1 1/2
 | 
			
		||||
 | 
			
		||||
destroy 1/2
 | 
			
		||||
wait
 | 
			
		||||
assert_stacking 1/1
 | 
			
		||||
 | 
			
		||||
create 1/2 csd
 | 
			
		||||
show 1/2
 | 
			
		||||
create 1/3 csd
 | 
			
		||||
show 1/3
 | 
			
		||||
wait
 | 
			
		||||
assert_stacking 1/1 1/2 1/3
 | 
			
		||||
 | 
			
		||||
destroy 1/2
 | 
			
		||||
wait
 | 
			
		||||
assert_stacking 1/1 1/3
 | 
			
		||||
@@ -1,18 +0,0 @@
 | 
			
		||||
new_client 1 x11
 | 
			
		||||
create 1/1
 | 
			
		||||
show 1/1
 | 
			
		||||
create 1/2
 | 
			
		||||
show 1/2
 | 
			
		||||
wait
 | 
			
		||||
assert_stacking 1/1 1/2
 | 
			
		||||
 | 
			
		||||
minimize 1/2
 | 
			
		||||
wait
 | 
			
		||||
assert_stacking 1/2 | 1/1
 | 
			
		||||
 | 
			
		||||
# unminimize doesn't work for GTK+ currently, because GTK+ expects
 | 
			
		||||
# to be able to de-iconify with MapWindow, but the window is already
 | 
			
		||||
# mapped.
 | 
			
		||||
activate 1/2
 | 
			
		||||
wait
 | 
			
		||||
assert_stacking 1/1 1/2
 | 
			
		||||
@@ -1,26 +0,0 @@
 | 
			
		||||
new_client w wayland
 | 
			
		||||
new_client x x11
 | 
			
		||||
 | 
			
		||||
create w/1
 | 
			
		||||
show w/1
 | 
			
		||||
create w/2
 | 
			
		||||
show w/2
 | 
			
		||||
wait
 | 
			
		||||
 | 
			
		||||
create x/1
 | 
			
		||||
show x/1
 | 
			
		||||
create x/2
 | 
			
		||||
show x/2
 | 
			
		||||
wait
 | 
			
		||||
 | 
			
		||||
assert_stacking w/1 w/2 x/1 x/2
 | 
			
		||||
 | 
			
		||||
local_activate w/1
 | 
			
		||||
assert_stacking w/2 x/1 x/2 w/1
 | 
			
		||||
 | 
			
		||||
local_activate x/1
 | 
			
		||||
assert_stacking w/2 x/2 w/1 x/1
 | 
			
		||||
 | 
			
		||||
lower x/1
 | 
			
		||||
wait
 | 
			
		||||
assert_stacking x/1 w/2 x/2 w/1
 | 
			
		||||
@@ -1,19 +0,0 @@
 | 
			
		||||
new_client 1 x11
 | 
			
		||||
create 1/1
 | 
			
		||||
show 1/1
 | 
			
		||||
create 1/2 override
 | 
			
		||||
show 1/2
 | 
			
		||||
wait
 | 
			
		||||
assert_stacking 1/1 1/2
 | 
			
		||||
 | 
			
		||||
activate 1/1
 | 
			
		||||
wait
 | 
			
		||||
assert_stacking 1/1 1/2
 | 
			
		||||
 | 
			
		||||
lower 1/2
 | 
			
		||||
wait
 | 
			
		||||
assert_stacking 1/2 | 1/1
 | 
			
		||||
 | 
			
		||||
raise 1/2
 | 
			
		||||
wait
 | 
			
		||||
assert_stacking 1/1 1/2
 | 
			
		||||
@@ -1,385 +0,0 @@
 | 
			
		||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (C) 2014 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 <gio/gunixinputstream.h>
 | 
			
		||||
#include <gtk/gtk.h>
 | 
			
		||||
#include <gdk/gdkx.h>
 | 
			
		||||
#include <stdarg.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include <X11/extensions/sync.h>
 | 
			
		||||
 | 
			
		||||
char *client_id = "0";
 | 
			
		||||
static gboolean wayland;
 | 
			
		||||
GHashTable *windows;
 | 
			
		||||
 | 
			
		||||
static void read_next_line (GDataInputStream *in);
 | 
			
		||||
 | 
			
		||||
static GtkWidget *
 | 
			
		||||
lookup_window (const char *window_id)
 | 
			
		||||
{
 | 
			
		||||
  GtkWidget *window = g_hash_table_lookup (windows, window_id);
 | 
			
		||||
  if (!window)
 | 
			
		||||
    g_print ("Window %s doesn't exist", window_id);
 | 
			
		||||
 | 
			
		||||
  return window;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
process_line (const char *line)
 | 
			
		||||
{
 | 
			
		||||
  GError *error = NULL;
 | 
			
		||||
  int argc;
 | 
			
		||||
  char **argv;
 | 
			
		||||
 | 
			
		||||
  if (!g_shell_parse_argv (line, &argc, &argv, &error))
 | 
			
		||||
    {
 | 
			
		||||
      g_print ("error parsing command: %s", error->message);
 | 
			
		||||
      g_error_free (error);
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  if (argc < 1)
 | 
			
		||||
    {
 | 
			
		||||
      g_print ("Empty command");
 | 
			
		||||
      goto out;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  if (strcmp (argv[0], "create") == 0)
 | 
			
		||||
    {
 | 
			
		||||
      int i;
 | 
			
		||||
 | 
			
		||||
      if (argc  < 2)
 | 
			
		||||
        {
 | 
			
		||||
          g_print ("usage: create <id> [override|csd]");
 | 
			
		||||
          goto out;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      if (g_hash_table_lookup (windows, argv[1]))
 | 
			
		||||
        {
 | 
			
		||||
          g_print ("window %s already exists", argv[1]);
 | 
			
		||||
          goto out;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      gboolean override = FALSE;
 | 
			
		||||
      gboolean csd = FALSE;
 | 
			
		||||
      for (i = 2; i < argc; i++)
 | 
			
		||||
        {
 | 
			
		||||
          if (strcmp (argv[i], "override") == 0)
 | 
			
		||||
            override = TRUE;
 | 
			
		||||
          if (strcmp (argv[i], "csd") == 0)
 | 
			
		||||
            csd = TRUE;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      if (override && csd)
 | 
			
		||||
        {
 | 
			
		||||
          g_print ("override and csd keywords are exclusie");
 | 
			
		||||
          goto out;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      GtkWidget *window = gtk_window_new (override ? GTK_WINDOW_POPUP : GTK_WINDOW_TOPLEVEL);
 | 
			
		||||
      g_hash_table_insert (windows, g_strdup (argv[1]), window);
 | 
			
		||||
 | 
			
		||||
      if (csd)
 | 
			
		||||
        {
 | 
			
		||||
          GtkWidget *headerbar = gtk_header_bar_new ();
 | 
			
		||||
          gtk_window_set_titlebar (GTK_WINDOW (window), headerbar);
 | 
			
		||||
          gtk_widget_show (headerbar);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      gtk_window_set_default_size (GTK_WINDOW (window), 100, 100);
 | 
			
		||||
 | 
			
		||||
      gchar *title = g_strdup_printf ("test/%s/%s", client_id, argv[1]);
 | 
			
		||||
      gtk_window_set_title (GTK_WINDOW (window), title);
 | 
			
		||||
      g_free (title);
 | 
			
		||||
 | 
			
		||||
      gtk_widget_realize (window);
 | 
			
		||||
 | 
			
		||||
      if (!wayland)
 | 
			
		||||
        {
 | 
			
		||||
          /* The cairo xlib backend creates a window when initialized, which
 | 
			
		||||
           * confuses our testing if it happens asynchronously the first
 | 
			
		||||
           * time a window is painted. By creating an Xlib surface and
 | 
			
		||||
           * destroying it, we force initialization at a more predictable time.
 | 
			
		||||
           */
 | 
			
		||||
          GdkWindow *window_gdk = gtk_widget_get_window (window);
 | 
			
		||||
          cairo_surface_t *surface = gdk_window_create_similar_surface (window_gdk,
 | 
			
		||||
                                                                        CAIRO_CONTENT_COLOR,
 | 
			
		||||
                                                                        1, 1);
 | 
			
		||||
          cairo_surface_destroy (surface);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
  else if (strcmp (argv[0], "show") == 0)
 | 
			
		||||
    {
 | 
			
		||||
      if (argc != 2)
 | 
			
		||||
        {
 | 
			
		||||
          g_print ("usage: show <id>");
 | 
			
		||||
          goto out;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      GtkWidget *window = lookup_window (argv[1]);
 | 
			
		||||
      if (!window)
 | 
			
		||||
        goto out;
 | 
			
		||||
 | 
			
		||||
      gtk_widget_show (window);
 | 
			
		||||
    }
 | 
			
		||||
  else if (strcmp (argv[0], "hide") == 0)
 | 
			
		||||
    {
 | 
			
		||||
      if (argc != 2)
 | 
			
		||||
        {
 | 
			
		||||
          g_print ("usage: hide <id>");
 | 
			
		||||
          goto out;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      GtkWidget *window = lookup_window (argv[1]);
 | 
			
		||||
      if (!window)
 | 
			
		||||
        goto out;
 | 
			
		||||
 | 
			
		||||
      gtk_widget_hide (window);
 | 
			
		||||
    }
 | 
			
		||||
  else if (strcmp (argv[0], "activate") == 0)
 | 
			
		||||
    {
 | 
			
		||||
      if (argc != 2)
 | 
			
		||||
        {
 | 
			
		||||
          g_print ("usage: activate <id>");
 | 
			
		||||
          goto out;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      GtkWidget *window = lookup_window (argv[1]);
 | 
			
		||||
      if (!window)
 | 
			
		||||
        goto out;
 | 
			
		||||
 | 
			
		||||
      gtk_window_present (GTK_WINDOW (window));
 | 
			
		||||
    }
 | 
			
		||||
  else if (strcmp (argv[0], "raise") == 0)
 | 
			
		||||
    {
 | 
			
		||||
      if (argc != 2)
 | 
			
		||||
        {
 | 
			
		||||
          g_print ("usage: raise <id>");
 | 
			
		||||
          goto out;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      GtkWidget *window = lookup_window (argv[1]);
 | 
			
		||||
      if (!window)
 | 
			
		||||
        goto out;
 | 
			
		||||
 | 
			
		||||
      gdk_window_raise (gtk_widget_get_window (window));
 | 
			
		||||
    }
 | 
			
		||||
  else if (strcmp (argv[0], "lower") == 0)
 | 
			
		||||
    {
 | 
			
		||||
      if (argc != 2)
 | 
			
		||||
        {
 | 
			
		||||
          g_print ("usage: lower <id>");
 | 
			
		||||
          goto out;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      GtkWidget *window = lookup_window (argv[1]);
 | 
			
		||||
      if (!window)
 | 
			
		||||
        goto out;
 | 
			
		||||
 | 
			
		||||
      gdk_window_lower (gtk_widget_get_window (window));
 | 
			
		||||
    }
 | 
			
		||||
  else if (strcmp (argv[0], "destroy") == 0)
 | 
			
		||||
    {
 | 
			
		||||
      if (argc != 2)
 | 
			
		||||
        {
 | 
			
		||||
          g_print ("usage: destroy <id>");
 | 
			
		||||
          goto out;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      GtkWidget *window = lookup_window (argv[1]);
 | 
			
		||||
      if (!window)
 | 
			
		||||
        goto out;
 | 
			
		||||
 | 
			
		||||
      g_hash_table_remove (windows, argv[1]);
 | 
			
		||||
      gtk_widget_destroy (window);
 | 
			
		||||
    }
 | 
			
		||||
  else if (strcmp (argv[0], "destroy_all") == 0)
 | 
			
		||||
    {
 | 
			
		||||
      if (argc != 1)
 | 
			
		||||
        {
 | 
			
		||||
          g_print ("usage: destroy_all");
 | 
			
		||||
          goto out;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      GHashTableIter iter;
 | 
			
		||||
      gpointer key, value;
 | 
			
		||||
 | 
			
		||||
      g_hash_table_iter_init (&iter, windows);
 | 
			
		||||
      while (g_hash_table_iter_next (&iter, &key, &value))
 | 
			
		||||
        gtk_widget_destroy (value);
 | 
			
		||||
 | 
			
		||||
      g_hash_table_remove_all (windows);
 | 
			
		||||
    }
 | 
			
		||||
  else if (strcmp (argv[0], "sync") == 0)
 | 
			
		||||
    {
 | 
			
		||||
      if (argc != 1)
 | 
			
		||||
        {
 | 
			
		||||
          g_print ("usage: sync");
 | 
			
		||||
          goto out;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      gdk_display_sync (gdk_display_get_default ());
 | 
			
		||||
    }
 | 
			
		||||
  else if (strcmp (argv[0], "set_counter") == 0)
 | 
			
		||||
    {
 | 
			
		||||
      XSyncCounter counter;
 | 
			
		||||
      int value;
 | 
			
		||||
 | 
			
		||||
      if (argc != 3)
 | 
			
		||||
        {
 | 
			
		||||
          g_print ("usage: set_counter <counter> <value>");
 | 
			
		||||
          goto out;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      if (wayland)
 | 
			
		||||
        {
 | 
			
		||||
          g_print ("usage: set_counter can only be used for X11");
 | 
			
		||||
          goto out;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      counter = strtoul(argv[1], NULL, 10);
 | 
			
		||||
      value = atoi(argv[2]);
 | 
			
		||||
      XSyncValue sync_value;
 | 
			
		||||
      XSyncIntToValue (&sync_value, value);
 | 
			
		||||
 | 
			
		||||
      XSyncSetCounter (gdk_x11_display_get_xdisplay (gdk_display_get_default ()),
 | 
			
		||||
                       counter, sync_value);
 | 
			
		||||
    }
 | 
			
		||||
  else if (strcmp (argv[0], "minimize") == 0)
 | 
			
		||||
    {
 | 
			
		||||
      if (argc != 2)
 | 
			
		||||
        {
 | 
			
		||||
          g_print ("usage: minimize <id>");
 | 
			
		||||
          goto out;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      GtkWidget *window = lookup_window (argv[1]);
 | 
			
		||||
      if (!window)
 | 
			
		||||
        goto out;
 | 
			
		||||
 | 
			
		||||
      gtk_window_iconify (GTK_WINDOW (window));
 | 
			
		||||
    }
 | 
			
		||||
  else if (strcmp (argv[0], "unminimize") == 0)
 | 
			
		||||
    {
 | 
			
		||||
      if (argc != 2)
 | 
			
		||||
        {
 | 
			
		||||
          g_print ("usage: unminimize <id>");
 | 
			
		||||
          goto out;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      GtkWidget *window = lookup_window (argv[1]);
 | 
			
		||||
      if (!window)
 | 
			
		||||
        goto out;
 | 
			
		||||
 | 
			
		||||
      gtk_window_deiconify (GTK_WINDOW (window));
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    {
 | 
			
		||||
      g_print ("Unknown command %s", argv[0]);
 | 
			
		||||
      goto out;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  g_print ("OK\n");
 | 
			
		||||
 | 
			
		||||
 out:
 | 
			
		||||
  g_strfreev (argv);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
on_line_received (GObject      *source,
 | 
			
		||||
                  GAsyncResult *result,
 | 
			
		||||
                  gpointer      user_data)
 | 
			
		||||
{
 | 
			
		||||
  GDataInputStream *in = G_DATA_INPUT_STREAM (source);
 | 
			
		||||
  GError *error = NULL;
 | 
			
		||||
  gsize length;
 | 
			
		||||
  char *line = g_data_input_stream_read_line_finish_utf8 (in, result, &length, &error);
 | 
			
		||||
 | 
			
		||||
  if (line == NULL)
 | 
			
		||||
    {
 | 
			
		||||
      if (error != NULL)
 | 
			
		||||
        g_printerr ("Error reading from stdin: %s\n", error->message);
 | 
			
		||||
      gtk_main_quit ();
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  process_line (line);
 | 
			
		||||
  g_free (line);
 | 
			
		||||
  read_next_line (in);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
read_next_line (GDataInputStream *in)
 | 
			
		||||
{
 | 
			
		||||
  g_data_input_stream_read_line_async (in, G_PRIORITY_DEFAULT, NULL,
 | 
			
		||||
                                       on_line_received, NULL);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const GOptionEntry options[] = {
 | 
			
		||||
  {
 | 
			
		||||
    "wayland", 0, 0, G_OPTION_ARG_NONE,
 | 
			
		||||
    &wayland,
 | 
			
		||||
    "Create a wayland client, not an X11 one",
 | 
			
		||||
    NULL
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    "client-id", 0, 0, G_OPTION_ARG_STRING,
 | 
			
		||||
    &client_id,
 | 
			
		||||
    "Identifier used in Window titles for this client",
 | 
			
		||||
    "CLIENT_ID",
 | 
			
		||||
  },
 | 
			
		||||
  { NULL }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
main(int argc, char **argv)
 | 
			
		||||
{
 | 
			
		||||
  GOptionContext *context = g_option_context_new (NULL);
 | 
			
		||||
  GError *error = NULL;
 | 
			
		||||
 | 
			
		||||
  g_option_context_add_main_entries (context, options, NULL);
 | 
			
		||||
 | 
			
		||||
  if (!g_option_context_parse (context,
 | 
			
		||||
                               &argc, &argv, &error))
 | 
			
		||||
    {
 | 
			
		||||
      g_printerr ("%s", error->message);
 | 
			
		||||
      return 1;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  if (wayland)
 | 
			
		||||
    gdk_set_allowed_backends ("wayland");
 | 
			
		||||
  else
 | 
			
		||||
    gdk_set_allowed_backends ("x11");
 | 
			
		||||
 | 
			
		||||
  gtk_init (NULL, NULL);
 | 
			
		||||
 | 
			
		||||
  windows = g_hash_table_new_full (g_str_hash, g_str_equal,
 | 
			
		||||
                                   g_free, NULL);
 | 
			
		||||
 | 
			
		||||
  GInputStream *raw_in = g_unix_input_stream_new (0, FALSE);
 | 
			
		||||
  GDataInputStream *in = g_data_input_stream_new (raw_in);
 | 
			
		||||
 | 
			
		||||
  read_next_line (in);
 | 
			
		||||
 | 
			
		||||
  gtk_main ();
 | 
			
		||||
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -573,7 +573,6 @@ meta_frames_manage_window (MetaFrames *frames,
 | 
			
		||||
  frame->title = NULL;
 | 
			
		||||
  frame->shape_applied = FALSE;
 | 
			
		||||
  frame->prelit_control = META_FRAME_CONTROL_NONE;
 | 
			
		||||
  frame->button_state = META_BUTTON_STATE_NORMAL;
 | 
			
		||||
 | 
			
		||||
  meta_core_grab_buttons (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), frame->xwindow);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -653,11 +653,3 @@ meta_ui_window_is_widget (MetaUI *ui,
 | 
			
		||||
  else
 | 
			
		||||
    return FALSE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
gboolean
 | 
			
		||||
meta_ui_window_is_dummy (MetaUI *ui,
 | 
			
		||||
                         Window  xwindow)
 | 
			
		||||
{
 | 
			
		||||
  GdkWindow *frames_window = gtk_widget_get_window (GTK_WIDGET (ui->frames));
 | 
			
		||||
  return xwindow == gdk_x11_window_get_xid (frames_window);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -116,7 +116,5 @@ gboolean meta_ui_have_a_theme      (void);
 | 
			
		||||
 | 
			
		||||
gboolean meta_ui_window_is_widget (MetaUI *ui,
 | 
			
		||||
                                   Window  xwindow);
 | 
			
		||||
gboolean meta_ui_window_is_dummy  (MetaUI *ui,
 | 
			
		||||
                                   Window  xwindow);
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -1,137 +0,0 @@
 | 
			
		||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (C) 2014 Endless Mobile
 | 
			
		||||
 *
 | 
			
		||||
 * 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.
 | 
			
		||||
 *
 | 
			
		||||
 * Written by:
 | 
			
		||||
 *     Jasper St. Pierre <jstpierre@mecheye.net>
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "config.h"
 | 
			
		||||
 | 
			
		||||
#include "meta-wayland-buffer.h"
 | 
			
		||||
 | 
			
		||||
#include <clutter/clutter.h>
 | 
			
		||||
#include <cogl/cogl-wayland-server.h>
 | 
			
		||||
#include <meta/util.h>
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_wayland_buffer_destroy_handler (struct wl_listener *listener,
 | 
			
		||||
                                     void *data)
 | 
			
		||||
{
 | 
			
		||||
  MetaWaylandBuffer *buffer =
 | 
			
		||||
    wl_container_of (listener, buffer, destroy_listener);
 | 
			
		||||
 | 
			
		||||
  wl_signal_emit (&buffer->destroy_signal, buffer);
 | 
			
		||||
  g_slice_free (MetaWaylandBuffer, buffer);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_wayland_buffer_ref (MetaWaylandBuffer *buffer)
 | 
			
		||||
{
 | 
			
		||||
  buffer->ref_count++;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_wayland_buffer_unref (MetaWaylandBuffer *buffer)
 | 
			
		||||
{
 | 
			
		||||
  buffer->ref_count--;
 | 
			
		||||
  if (buffer->ref_count == 0)
 | 
			
		||||
    {
 | 
			
		||||
      g_clear_pointer (&buffer->texture, cogl_object_unref);
 | 
			
		||||
      wl_resource_queue_event (buffer->resource, WL_BUFFER_RELEASE);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
MetaWaylandBuffer *
 | 
			
		||||
meta_wayland_buffer_from_resource (struct wl_resource *resource)
 | 
			
		||||
{
 | 
			
		||||
  MetaWaylandBuffer *buffer;
 | 
			
		||||
  struct wl_listener *listener;
 | 
			
		||||
 | 
			
		||||
  listener =
 | 
			
		||||
    wl_resource_get_destroy_listener (resource,
 | 
			
		||||
                                      meta_wayland_buffer_destroy_handler);
 | 
			
		||||
 | 
			
		||||
  if (listener)
 | 
			
		||||
    {
 | 
			
		||||
      buffer = wl_container_of (listener, buffer, destroy_listener);
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    {
 | 
			
		||||
      buffer = g_slice_new0 (MetaWaylandBuffer);
 | 
			
		||||
 | 
			
		||||
      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);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  return buffer;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
CoglTexture *
 | 
			
		||||
meta_wayland_buffer_ensure_texture (MetaWaylandBuffer *buffer)
 | 
			
		||||
{
 | 
			
		||||
  CoglContext *ctx = clutter_backend_get_cogl_context (clutter_get_default_backend ());
 | 
			
		||||
  CoglError *catch_error = NULL;
 | 
			
		||||
  CoglTexture *texture;
 | 
			
		||||
 | 
			
		||||
  if (buffer->texture)
 | 
			
		||||
    goto out;
 | 
			
		||||
 | 
			
		||||
  texture = COGL_TEXTURE (cogl_wayland_texture_2d_new_from_buffer (ctx,
 | 
			
		||||
                                                                   buffer->resource,
 | 
			
		||||
                                                                   &catch_error));
 | 
			
		||||
  if (!texture)
 | 
			
		||||
    {
 | 
			
		||||
      cogl_error_free (catch_error);
 | 
			
		||||
      meta_fatal ("Could not import pending buffer, ignoring commit\n");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  buffer->texture = texture;
 | 
			
		||||
 | 
			
		||||
 out:
 | 
			
		||||
  return buffer->texture;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_wayland_buffer_process_damage (MetaWaylandBuffer *buffer,
 | 
			
		||||
                                    cairo_region_t    *region)
 | 
			
		||||
{
 | 
			
		||||
  struct wl_shm_buffer *shm_buffer;
 | 
			
		||||
 | 
			
		||||
  shm_buffer = wl_shm_buffer_get (buffer->resource);
 | 
			
		||||
 | 
			
		||||
  if (shm_buffer)
 | 
			
		||||
    {
 | 
			
		||||
      int i, n_rectangles;
 | 
			
		||||
 | 
			
		||||
      n_rectangles = cairo_region_num_rectangles (region);
 | 
			
		||||
 | 
			
		||||
      for (i = 0; i < n_rectangles; i++)
 | 
			
		||||
        {
 | 
			
		||||
          cairo_rectangle_int_t rect;
 | 
			
		||||
          cairo_region_get_rectangle (region, i, &rect);
 | 
			
		||||
          cogl_wayland_texture_set_region_from_shm_buffer (buffer->texture,
 | 
			
		||||
                                                           rect.x, rect.y, rect.width, rect.height,
 | 
			
		||||
                                                           shm_buffer,
 | 
			
		||||
                                                           rect.x, rect.y, 0, NULL);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,51 +0,0 @@
 | 
			
		||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (C) 2014 Endless Mobile
 | 
			
		||||
 *
 | 
			
		||||
 * 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.
 | 
			
		||||
 *
 | 
			
		||||
 * Written by:
 | 
			
		||||
 *     Jasper St. Pierre <jstpierre@mecheye.net>
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef META_WAYLAND_BUFFER_H
 | 
			
		||||
#define META_WAYLAND_BUFFER_H
 | 
			
		||||
 | 
			
		||||
#include <cogl/cogl.h>
 | 
			
		||||
#include <cairo.h>
 | 
			
		||||
#include <wayland-server.h>
 | 
			
		||||
 | 
			
		||||
#include "meta-wayland-types.h"
 | 
			
		||||
 | 
			
		||||
struct _MetaWaylandBuffer
 | 
			
		||||
{
 | 
			
		||||
  struct wl_resource *resource;
 | 
			
		||||
  struct wl_signal destroy_signal;
 | 
			
		||||
  struct wl_listener destroy_listener;
 | 
			
		||||
 | 
			
		||||
  CoglTexture *texture;
 | 
			
		||||
  uint32_t ref_count;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
MetaWaylandBuffer *     meta_wayland_buffer_from_resource       (struct wl_resource    *resource);
 | 
			
		||||
void                    meta_wayland_buffer_ref                 (MetaWaylandBuffer     *buffer);
 | 
			
		||||
void                    meta_wayland_buffer_unref               (MetaWaylandBuffer     *buffer);
 | 
			
		||||
CoglTexture *           meta_wayland_buffer_ensure_texture      (MetaWaylandBuffer     *buffer);
 | 
			
		||||
void                    meta_wayland_buffer_process_damage      (MetaWaylandBuffer     *buffer,
 | 
			
		||||
                                                                 cairo_region_t        *region);
 | 
			
		||||
 | 
			
		||||
#endif /* META_WAYLAND_BUFFER_H */
 | 
			
		||||
@@ -34,7 +34,6 @@
 | 
			
		||||
#include "meta-wayland-seat.h"
 | 
			
		||||
#include "meta-wayland-pointer.h"
 | 
			
		||||
#include "meta-wayland-private.h"
 | 
			
		||||
#include "meta-dnd-actor-private.h"
 | 
			
		||||
 | 
			
		||||
typedef struct
 | 
			
		||||
{
 | 
			
		||||
@@ -47,7 +46,6 @@ struct _MetaWaylandDataSource
 | 
			
		||||
{
 | 
			
		||||
  struct wl_resource *resource;
 | 
			
		||||
  struct wl_array mime_types;
 | 
			
		||||
  gboolean has_target;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
@@ -69,10 +67,7 @@ data_offer_accept (struct wl_client *client,
 | 
			
		||||
   * this be a wl_data_device request? */
 | 
			
		||||
 | 
			
		||||
  if (offer->source)
 | 
			
		||||
    {
 | 
			
		||||
      wl_data_source_send_target (offer->source->resource, mime_type);
 | 
			
		||||
      offer->source->has_target = mime_type != NULL;
 | 
			
		||||
    }
 | 
			
		||||
    wl_data_source_send_target (offer->source->resource, mime_type);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
@@ -167,7 +162,7 @@ static struct wl_data_source_interface data_source_interface = {
 | 
			
		||||
  data_source_destroy
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct _MetaWaylandDragGrab {
 | 
			
		||||
typedef struct {
 | 
			
		||||
  MetaWaylandPointerGrab  generic;
 | 
			
		||||
 | 
			
		||||
  MetaWaylandSeat        *seat;
 | 
			
		||||
@@ -182,14 +177,7 @@ struct _MetaWaylandDragGrab {
 | 
			
		||||
 | 
			
		||||
  MetaWaylandDataSource  *drag_data_source;
 | 
			
		||||
  struct wl_listener      drag_data_source_listener;
 | 
			
		||||
 | 
			
		||||
  ClutterActor           *feedback_actor;
 | 
			
		||||
 | 
			
		||||
  MetaWaylandSurface     *drag_origin;
 | 
			
		||||
  struct wl_listener      drag_origin_listener;
 | 
			
		||||
 | 
			
		||||
  int                     drag_start_x, drag_start_y;
 | 
			
		||||
};
 | 
			
		||||
} MetaWaylandDragGrab;
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
destroy_drag_focus (struct wl_listener *listener, void *data)
 | 
			
		||||
@@ -269,21 +257,11 @@ drag_grab_motion (MetaWaylandPointerGrab *grab,
 | 
			
		||||
				  clutter_event_get_time (event),
 | 
			
		||||
				  sx, sy);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  if (drag_grab->drag_surface)
 | 
			
		||||
    meta_feedback_actor_update (META_FEEDBACK_ACTOR (drag_grab->feedback_actor),
 | 
			
		||||
                                event);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
data_device_end_drag_grab (MetaWaylandDragGrab *drag_grab)
 | 
			
		||||
{
 | 
			
		||||
  if (drag_grab->drag_origin)
 | 
			
		||||
    {
 | 
			
		||||
      drag_grab->drag_origin = NULL;
 | 
			
		||||
      wl_list_remove (&drag_grab->drag_origin_listener.link);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  if (drag_grab->drag_surface)
 | 
			
		||||
    {
 | 
			
		||||
      drag_grab->drag_surface = NULL;
 | 
			
		||||
@@ -291,18 +269,7 @@ data_device_end_drag_grab (MetaWaylandDragGrab *drag_grab)
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  if (drag_grab->drag_data_source)
 | 
			
		||||
    {
 | 
			
		||||
      drag_grab->drag_data_source->has_target = FALSE;
 | 
			
		||||
      wl_list_remove (&drag_grab->drag_data_source_listener.link);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  if (drag_grab->feedback_actor)
 | 
			
		||||
    {
 | 
			
		||||
      clutter_actor_remove_all_children (drag_grab->feedback_actor);
 | 
			
		||||
      clutter_actor_destroy (drag_grab->feedback_actor);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  drag_grab->seat->data_device.current_grab = NULL;
 | 
			
		||||
    wl_list_remove (&drag_grab->drag_data_source_listener.link);
 | 
			
		||||
 | 
			
		||||
  drag_grab_focus (&drag_grab->generic, NULL);
 | 
			
		||||
 | 
			
		||||
@@ -318,23 +285,10 @@ drag_grab_button (MetaWaylandPointerGrab *grab,
 | 
			
		||||
  MetaWaylandSeat *seat = drag_grab->seat;
 | 
			
		||||
  ClutterEventType event_type = clutter_event_type (event);
 | 
			
		||||
 | 
			
		||||
  if (drag_grab->generic.pointer->grab_button == clutter_event_get_button (event) &&
 | 
			
		||||
  if (drag_grab->drag_focus_data_device &&
 | 
			
		||||
      drag_grab->generic.pointer->grab_button == clutter_event_get_button (event) &&
 | 
			
		||||
      event_type == CLUTTER_BUTTON_RELEASE)
 | 
			
		||||
    {
 | 
			
		||||
      gboolean success = FALSE;
 | 
			
		||||
 | 
			
		||||
      if (drag_grab->drag_focus_data_device &&
 | 
			
		||||
          drag_grab->drag_data_source->has_target)
 | 
			
		||||
        {
 | 
			
		||||
          wl_data_device_send_drop (drag_grab->drag_focus_data_device);
 | 
			
		||||
          success = TRUE;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      /* Finish drag and let actor self-destruct */
 | 
			
		||||
      meta_dnd_actor_drag_finish (META_DND_ACTOR (drag_grab->feedback_actor),
 | 
			
		||||
                                  success);
 | 
			
		||||
      drag_grab->feedback_actor = NULL;
 | 
			
		||||
    }
 | 
			
		||||
    wl_data_device_send_drop (drag_grab->drag_focus_data_device);
 | 
			
		||||
 | 
			
		||||
  if (seat->pointer.button_count == 0 &&
 | 
			
		||||
      event_type == CLUTTER_BUTTON_RELEASE)
 | 
			
		||||
@@ -347,16 +301,6 @@ static const MetaWaylandPointerGrabInterface drag_grab_interface = {
 | 
			
		||||
  drag_grab_button,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
destroy_data_device_origin (struct wl_listener *listener, void *data)
 | 
			
		||||
{
 | 
			
		||||
  MetaWaylandDragGrab *drag_grab =
 | 
			
		||||
    wl_container_of (listener, drag_grab, drag_origin_listener);
 | 
			
		||||
 | 
			
		||||
  drag_grab->drag_origin = NULL;
 | 
			
		||||
  data_device_end_drag_grab (drag_grab);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
destroy_data_device_source (struct wl_listener *listener, void *data)
 | 
			
		||||
{
 | 
			
		||||
@@ -374,9 +318,6 @@ destroy_data_device_icon (struct wl_listener *listener, void *data)
 | 
			
		||||
    wl_container_of (listener, drag_grab, drag_data_source_listener);
 | 
			
		||||
 | 
			
		||||
  drag_grab->drag_surface = NULL;
 | 
			
		||||
 | 
			
		||||
  if (drag_grab->feedback_actor)
 | 
			
		||||
    clutter_actor_remove_all_children (drag_grab->feedback_actor);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
@@ -388,29 +329,20 @@ data_device_start_drag (struct wl_client *client,
 | 
			
		||||
{
 | 
			
		||||
  MetaWaylandDataDevice *data_device = wl_resource_get_user_data (resource);
 | 
			
		||||
  MetaWaylandSeat *seat = wl_container_of (data_device, seat, data_device);
 | 
			
		||||
  MetaWaylandSurface *surface = NULL;
 | 
			
		||||
  MetaWaylandDragGrab *drag_grab;
 | 
			
		||||
  ClutterPoint pos;
 | 
			
		||||
 | 
			
		||||
  if (origin_resource)
 | 
			
		||||
    surface = wl_resource_get_user_data (origin_resource);
 | 
			
		||||
 | 
			
		||||
  if (!surface)
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  if (seat->pointer.button_count == 0 ||
 | 
			
		||||
      seat->pointer.grab_serial != serial ||
 | 
			
		||||
      !seat->pointer.focus_surface ||
 | 
			
		||||
      seat->pointer.focus_surface != surface)
 | 
			
		||||
  if ((seat->pointer.button_count == 0 ||
 | 
			
		||||
       seat->pointer.grab_serial != serial ||
 | 
			
		||||
       !seat->pointer.focus_surface ||
 | 
			
		||||
       seat->pointer.focus_surface != wl_resource_get_user_data (origin_resource)))
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  /* FIXME: Check that the data source type array isn't empty. */
 | 
			
		||||
 | 
			
		||||
  if (data_device->current_grab ||
 | 
			
		||||
      seat->pointer.grab != &seat->pointer.default_grab)
 | 
			
		||||
  if (seat->pointer.grab != &seat->pointer.default_grab)
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  data_device->current_grab = drag_grab = g_slice_new0 (MetaWaylandDragGrab);
 | 
			
		||||
  drag_grab = g_slice_new0 (MetaWaylandDragGrab);
 | 
			
		||||
 | 
			
		||||
  drag_grab->generic.interface = &drag_grab_interface;
 | 
			
		||||
  drag_grab->generic.pointer = &seat->pointer;
 | 
			
		||||
@@ -418,17 +350,6 @@ data_device_start_drag (struct wl_client *client,
 | 
			
		||||
  drag_grab->drag_client = client;
 | 
			
		||||
  drag_grab->seat = seat;
 | 
			
		||||
 | 
			
		||||
  drag_grab->drag_origin = surface;
 | 
			
		||||
  drag_grab->drag_origin_listener.notify = destroy_data_device_origin;
 | 
			
		||||
  wl_resource_add_destroy_listener (origin_resource,
 | 
			
		||||
                                    &drag_grab->drag_origin_listener);
 | 
			
		||||
 | 
			
		||||
  clutter_input_device_get_coords (seat->pointer.device, NULL, &pos);
 | 
			
		||||
  clutter_actor_transform_stage_point (CLUTTER_ACTOR (meta_surface_actor_get_texture (surface->surface_actor)),
 | 
			
		||||
                                       pos.x, pos.y, &pos.x, &pos.y);
 | 
			
		||||
  drag_grab->drag_start_x = pos.x;
 | 
			
		||||
  drag_grab->drag_start_y = pos.y;
 | 
			
		||||
 | 
			
		||||
  if (source_resource)
 | 
			
		||||
    {
 | 
			
		||||
      drag_grab->drag_data_source = wl_resource_get_user_data (source_resource);
 | 
			
		||||
@@ -443,19 +364,6 @@ data_device_start_drag (struct wl_client *client,
 | 
			
		||||
      drag_grab->drag_icon_listener.notify = destroy_data_device_icon;
 | 
			
		||||
      wl_resource_add_destroy_listener (icon_resource,
 | 
			
		||||
                                        &drag_grab->drag_icon_listener);
 | 
			
		||||
 | 
			
		||||
      drag_grab->feedback_actor = meta_dnd_actor_new (CLUTTER_ACTOR (drag_grab->drag_origin->surface_actor),
 | 
			
		||||
                                                      drag_grab->drag_start_x,
 | 
			
		||||
                                                      drag_grab->drag_start_y);
 | 
			
		||||
      meta_feedback_actor_set_anchor (META_FEEDBACK_ACTOR (drag_grab->feedback_actor),
 | 
			
		||||
                                      -drag_grab->drag_surface->offset_x,
 | 
			
		||||
                                      -drag_grab->drag_surface->offset_y);
 | 
			
		||||
      clutter_actor_add_child (drag_grab->feedback_actor,
 | 
			
		||||
                               CLUTTER_ACTOR (drag_grab->drag_surface->surface_actor));
 | 
			
		||||
 | 
			
		||||
      clutter_input_device_get_coords (seat->pointer.device, NULL, &pos);
 | 
			
		||||
      meta_feedback_actor_set_position (META_FEEDBACK_ACTOR (drag_grab->feedback_actor),
 | 
			
		||||
                                        pos.x, pos.y);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  meta_wayland_pointer_set_focus (&seat->pointer, NULL);
 | 
			
		||||
@@ -643,29 +551,3 @@ meta_wayland_data_device_set_keyboard_focus (MetaWaylandDataDevice *data_device)
 | 
			
		||||
      wl_data_device_send_selection (data_device_resource, offer);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
gboolean
 | 
			
		||||
meta_wayland_data_device_is_dnd_surface (MetaWaylandDataDevice *data_device,
 | 
			
		||||
                                         MetaWaylandSurface    *surface)
 | 
			
		||||
{
 | 
			
		||||
  return data_device->current_grab &&
 | 
			
		||||
    data_device->current_grab->drag_surface == surface;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_wayland_data_device_update_dnd_surface (MetaWaylandDataDevice *data_device)
 | 
			
		||||
{
 | 
			
		||||
  MetaWaylandDragGrab *drag_grab;
 | 
			
		||||
 | 
			
		||||
  if (!data_device->current_grab)
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  drag_grab = data_device->current_grab;
 | 
			
		||||
 | 
			
		||||
  if (!drag_grab->feedback_actor || !drag_grab->drag_surface)
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  meta_feedback_actor_set_anchor (META_FEEDBACK_ACTOR (drag_grab->feedback_actor),
 | 
			
		||||
                                  -drag_grab->drag_surface->offset_x,
 | 
			
		||||
                                  -drag_grab->drag_surface->offset_y);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user