Compare commits
	
		
			368 Commits
		
	
	
		
			3.9.90
			...
			3.11.3-way
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					732c059235 | ||
| 
						 | 
					ef2b6e7d00 | ||
| 
						 | 
					9c1b972ca1 | ||
| 
						 | 
					cb33e1942a | ||
| 
						 | 
					7009d1e470 | ||
| 
						 | 
					c54a19825b | ||
| 
						 | 
					8131f34eb6 | ||
| 
						 | 
					f29241d90e | ||
| 
						 | 
					bad48ea815 | ||
| 
						 | 
					66af41f4a9 | ||
| 
						 | 
					e30be380dd | ||
| 
						 | 
					65f2e29375 | ||
| 
						 | 
					98dbba1e17 | ||
| 
						 | 
					422648e2eb | ||
| 
						 | 
					f0fa4d831a | ||
| 
						 | 
					1b600f5867 | ||
| 
						 | 
					fd8cc9b7a8 | ||
| 
						 | 
					ca5b5e6bc4 | ||
| 
						 | 
					ee683ff187 | ||
| 
						 | 
					57602adfe7 | ||
| 
						 | 
					1481836ed6 | ||
| 
						 | 
					309f78ff52 | ||
| 
						 | 
					6436459381 | ||
| 
						 | 
					65b39212d5 | ||
| 
						 | 
					283649b8d7 | ||
| 
						 | 
					fa65c380db | ||
| 
						 | 
					58b39233f5 | ||
| 
						 | 
					82066e02c5 | ||
| 
						 | 
					c36aa5e696 | ||
| 
						 | 
					29197d40c6 | ||
| 
						 | 
					8d5ab6b5b3 | ||
| 
						 | 
					a796938b39 | ||
| 
						 | 
					3813113f1a | ||
| 
						 | 
					1be117e430 | ||
| 
						 | 
					622c7a021b | ||
| 
						 | 
					4d2d2f285b | ||
| 
						 | 
					0924c7d61b | ||
| 
						 | 
					2746608eb2 | ||
| 
						 | 
					fe26cb5989 | ||
| 
						 | 
					602307e694 | ||
| 
						 | 
					b2c18c4a78 | ||
| 
						 | 
					1e211722c7 | ||
| 
						 | 
					461f74ef18 | ||
| 
						 | 
					3f022ca963 | ||
| 
						 | 
					20e92c5a72 | ||
| 
						 | 
					0850da44d7 | ||
| 
						 | 
					37ba264190 | ||
| 
						 | 
					6c12c928df | ||
| 
						 | 
					9c5733caf0 | ||
| 
						 | 
					21d8b8310a | ||
| 
						 | 
					c46af91d54 | ||
| 
						 | 
					d44574f738 | ||
| 
						 | 
					a9424255a5 | ||
| 
						 | 
					5089a63d76 | ||
| 
						 | 
					f9a2c64460 | ||
| 
						 | 
					7841042a85 | ||
| 
						 | 
					ea1b8cdc22 | ||
| 
						 | 
					52b48cfbef | ||
| 
						 | 
					644f3e1275 | ||
| 
						 | 
					304005e04f | ||
| 
						 | 
					025ab35af7 | ||
| 
						 | 
					a27744503b | ||
| 
						 | 
					1011331caf | ||
| 
						 | 
					0ccef81789 | ||
| 
						 | 
					4780f74a40 | ||
| 
						 | 
					57866fb267 | ||
| 
						 | 
					d3bc7570d0 | ||
| 
						 | 
					74e43a4702 | ||
| 
						 | 
					0764b2058a | ||
| 
						 | 
					7a787d7946 | ||
| 
						 | 
					eec0f5df47 | ||
| 
						 | 
					ba3968a822 | ||
| 
						 | 
					762fa0e116 | ||
| 
						 | 
					0be57b621b | ||
| 
						 | 
					7d88b3593b | ||
| 
						 | 
					858db7081a | ||
| 
						 | 
					5af7f619c8 | ||
| 
						 | 
					e5e35e5a7f | ||
| 
						 | 
					6d639ac528 | ||
| 
						 | 
					aa3643cdde | ||
| 
						 | 
					8a3501ffe1 | ||
| 
						 | 
					5ea443eb4b | ||
| 
						 | 
					a37a8c6497 | ||
| 
						 | 
					ebf6862a10 | ||
| 
						 | 
					6c0e16c482 | ||
| 
						 | 
					40b1e7312d | ||
| 
						 | 
					1c0e6f26e2 | ||
| 
						 | 
					f4fc498e65 | ||
| 
						 | 
					a8632c2546 | ||
| 
						 | 
					600a0f836f | ||
| 
						 | 
					0ac142d39e | ||
| 
						 | 
					abd368be00 | ||
| 
						 | 
					a8ac2cc275 | ||
| 
						 | 
					2f14b5cc3f | ||
| 
						 | 
					2930612e64 | ||
| 
						 | 
					2952d3671d | ||
| 
						 | 
					1b5ace8256 | ||
| 
						 | 
					2ebecc5370 | ||
| 
						 | 
					02144d17e9 | ||
| 
						 | 
					71496c8909 | ||
| 
						 | 
					594b15abf1 | ||
| 
						 | 
					bbe3641844 | ||
| 
						 | 
					0cc5cf940b | ||
| 
						 | 
					153d8efcf5 | ||
| 
						 | 
					be744775c1 | ||
| 
						 | 
					5959457c73 | ||
| 
						 | 
					0824eb7c96 | ||
| 
						 | 
					d945501be6 | ||
| 
						 | 
					ca342c4573 | ||
| 
						 | 
					4326d0bf3a | ||
| 
						 | 
					a6ebc70170 | ||
| 
						 | 
					3025cb7c48 | ||
| 
						 | 
					17f48baf3a | ||
| 
						 | 
					333661a9d8 | ||
| 
						 | 
					b9da43b753 | ||
| 
						 | 
					097ee776c7 | ||
| 
						 | 
					a4a8f1f863 | ||
| 
						 | 
					f36a627330 | ||
| 
						 | 
					a1087c3f30 | ||
| 
						 | 
					aad275b9a2 | ||
| 
						 | 
					f0397eab94 | ||
| 
						 | 
					392e224831 | ||
| 
						 | 
					6867d44573 | ||
| 
						 | 
					a841fff2ac | ||
| 
						 | 
					26aa10a974 | ||
| 
						 | 
					f6144082b1 | ||
| 
						 | 
					957513242c | ||
| 
						 | 
					17fd25e216 | ||
| 
						 | 
					e91268a250 | ||
| 
						 | 
					82cb4e8267 | ||
| 
						 | 
					68eb87cc58 | ||
| 
						 | 
					f3e52d5b18 | ||
| 
						 | 
					2b2b2d3191 | ||
| 
						 | 
					9461c612de | ||
| 
						 | 
					f0280a8868 | ||
| 
						 | 
					c749f7b6fb | ||
| 
						 | 
					74462133ca | ||
| 
						 | 
					7c45d6594c | ||
| 
						 | 
					ea916b6c49 | ||
| 
						 | 
					a02d734243 | ||
| 
						 | 
					735b736110 | ||
| 
						 | 
					bbbb9ac53c | ||
| 
						 | 
					8dd97b4998 | ||
| 
						 | 
					73a9082062 | ||
| 
						 | 
					4091f5493d | ||
| 
						 | 
					d96b053c9d | ||
| 
						 | 
					1f569bef76 | ||
| 
						 | 
					1a88176cc0 | ||
| 
						 | 
					662c9729bc | ||
| 
						 | 
					56a0dd6b2c | ||
| 
						 | 
					9dc6028b3d | ||
| 
						 | 
					932e913d88 | ||
| 
						 | 
					b72315e27a | ||
| 
						 | 
					3c7cd1f38c | ||
| 
						 | 
					1946c548bf | ||
| 
						 | 
					cf181fe109 | ||
| 
						 | 
					63b9110f93 | ||
| 
						 | 
					ae44bff0b1 | ||
| 
						 | 
					23ba3e527f | ||
| 
						 | 
					08df9bf559 | ||
| 
						 | 
					648639fffe | ||
| 
						 | 
					6cc014a941 | ||
| 
						 | 
					b7b95123ed | ||
| 
						 | 
					153463790a | ||
| 
						 | 
					875bbec949 | ||
| 
						 | 
					666e5f1f98 | ||
| 
						 | 
					e6790038dd | ||
| 
						 | 
					e86c53230f | ||
| 
						 | 
					4ea4658abf | ||
| 
						 | 
					58f6ab0a27 | ||
| 
						 | 
					9c0cc664d1 | ||
| 
						 | 
					84d26e31f1 | ||
| 
						 | 
					64a848fcb7 | ||
| 
						 | 
					429583ae8b | ||
| 
						 | 
					93ae868987 | ||
| 
						 | 
					72a900787f | ||
| 
						 | 
					7186841db0 | ||
| 
						 | 
					ab080e3e6b | ||
| 
						 | 
					ad84aef766 | ||
| 
						 | 
					7908eca579 | ||
| 
						 | 
					237d990dea | ||
| 
						 | 
					78fcfec5c1 | ||
| 
						 | 
					1bd3a162f8 | ||
| 
						 | 
					918cfdcbda | ||
| 
						 | 
					cd76313297 | ||
| 
						 | 
					dc8231c2cf | ||
| 
						 | 
					4d01eb3a23 | ||
| 
						 | 
					35f47b211d | ||
| 
						 | 
					77046edf21 | ||
| 
						 | 
					488df061c7 | ||
| 
						 | 
					21d511e50f | ||
| 
						 | 
					15e83f0c2f | ||
| 
						 | 
					a23830fd13 | ||
| 
						 | 
					c8bf8c17be | ||
| 
						 | 
					d82e24981b | ||
| 
						 | 
					01b8ffac5d | ||
| 
						 | 
					1fa56bd7e0 | ||
| 
						 | 
					c3f28b9cdb | ||
| 
						 | 
					dc4e1d4cd1 | ||
| 
						 | 
					d69553e8f5 | ||
| 
						 | 
					0ead0d945a | ||
| 
						 | 
					c24d9bf142 | ||
| 
						 | 
					a6bf340ff8 | ||
| 
						 | 
					35ef7c95b2 | ||
| 
						 | 
					348f3007d9 | ||
| 
						 | 
					52e2a1226e | ||
| 
						 | 
					58622c0515 | ||
| 
						 | 
					cb5e1e2776 | ||
| 
						 | 
					e965cf32d4 | ||
| 
						 | 
					ce5e0b20b5 | ||
| 
						 | 
					90854a0f80 | ||
| 
						 | 
					2d9dc143fc | ||
| 
						 | 
					1e52d2aa9c | ||
| 
						 | 
					2734c8547f | ||
| 
						 | 
					cc0b093f7a | ||
| 
						 | 
					d25275fa8d | ||
| 
						 | 
					389e04c715 | ||
| 
						 | 
					24074a81d0 | ||
| 
						 | 
					c0e7f6d9bf | ||
| 
						 | 
					9a13b857f4 | ||
| 
						 | 
					776a86a65f | ||
| 
						 | 
					76e2455d1b | ||
| 
						 | 
					81d9797544 | ||
| 
						 | 
					12d6c70000 | ||
| 
						 | 
					a7eaf43e18 | ||
| 
						 | 
					514fec7275 | ||
| 
						 | 
					42a5f4f479 | ||
| 
						 | 
					6c1feedbdf | ||
| 
						 | 
					2d21fbbd35 | ||
| 
						 | 
					7baf687499 | ||
| 
						 | 
					a3e44d13d1 | ||
| 
						 | 
					65db8efbe8 | ||
| 
						 | 
					e48a5cd5f2 | ||
| 
						 | 
					698bb24848 | ||
| 
						 | 
					67fff237e6 | ||
| 
						 | 
					b9247b4b2f | ||
| 
						 | 
					0394b4a82b | ||
| 
						 | 
					ff7c85c599 | ||
| 
						 | 
					c316ad17a4 | ||
| 
						 | 
					fc108d5052 | ||
| 
						 | 
					8c0d38a1a1 | ||
| 
						 | 
					2f9c6c4146 | ||
| 
						 | 
					72ca2b218d | ||
| 
						 | 
					7360aece74 | ||
| 
						 | 
					b5f3238f6f | ||
| 
						 | 
					227fb56103 | ||
| 
						 | 
					5ae52473c9 | ||
| 
						 | 
					7b537d6b8f | ||
| 
						 | 
					4494888b82 | ||
| 
						 | 
					004ee2d3b5 | ||
| 
						 | 
					168ea64a45 | ||
| 
						 | 
					73ee491281 | ||
| 
						 | 
					95a9655412 | ||
| 
						 | 
					72b6699efb | ||
| 
						 | 
					3e341e83d9 | ||
| 
						 | 
					5b3340e585 | ||
| 
						 | 
					6f4f611ba8 | ||
| 
						 | 
					450afbaf51 | ||
| 
						 | 
					28708e4317 | ||
| 
						 | 
					9f64f2cf4f | ||
| 
						 | 
					2b1eb206d3 | ||
| 
						 | 
					a6dc454c49 | ||
| 
						 | 
					c2bf44fa19 | ||
| 
						 | 
					2d67b01c3a | ||
| 
						 | 
					6014d31dea | ||
| 
						 | 
					bf78f067a2 | ||
| 
						 | 
					ddb9929dad | ||
| 
						 | 
					2098ec2d16 | ||
| 
						 | 
					97eece6607 | ||
| 
						 | 
					7ac9a6e241 | ||
| 
						 | 
					b53bf0e8c2 | ||
| 
						 | 
					a26ded47d9 | ||
| 
						 | 
					cad9e14463 | ||
| 
						 | 
					806d5939e3 | ||
| 
						 | 
					0f0c23fbab | ||
| 
						 | 
					5d1fcc26c0 | ||
| 
						 | 
					cbe5b6b3bc | ||
| 
						 | 
					590cf4e832 | ||
| 
						 | 
					22ca820c44 | ||
| 
						 | 
					b1206ceb66 | ||
| 
						 | 
					ad4053ab84 | ||
| 
						 | 
					7bd4e6ecb0 | ||
| 
						 | 
					deeb1db1ac | ||
| 
						 | 
					7eb4bfbea3 | ||
| 
						 | 
					59b274f12f | ||
| 
						 | 
					e311cef013 | ||
| 
						 | 
					e72f81c24f | ||
| 
						 | 
					96fa518576 | ||
| 
						 | 
					e263b3624c | ||
| 
						 | 
					1c34f0b342 | ||
| 
						 | 
					2d27873f98 | ||
| 
						 | 
					fd40a12213 | ||
| 
						 | 
					57406e0a9e | ||
| 
						 | 
					1987cbb764 | ||
| 
						 | 
					705978405b | ||
| 
						 | 
					daba05f6a7 | ||
| 
						 | 
					1a7984be43 | ||
| 
						 | 
					1b3c77d53a | ||
| 
						 | 
					5b0f0d9e5b | ||
| 
						 | 
					9816659fa9 | ||
| 
						 | 
					3b1b611634 | ||
| 
						 | 
					f08921bd0c | ||
| 
						 | 
					0089b5769c | ||
| 
						 | 
					452be05ea0 | ||
| 
						 | 
					69f038f7c7 | ||
| 
						 | 
					2d35e07fae | ||
| 
						 | 
					95e2d26d03 | ||
| 
						 | 
					f506e090ea | ||
| 
						 | 
					0697b53826 | ||
| 
						 | 
					7d9141c56f | ||
| 
						 | 
					519a06b93d | ||
| 
						 | 
					0cceddab75 | ||
| 
						 | 
					c9830c13b4 | ||
| 
						 | 
					9a4783e364 | ||
| 
						 | 
					aa15c09d54 | ||
| 
						 | 
					62d908be42 | ||
| 
						 | 
					6526e9882b | ||
| 
						 | 
					ab72352c47 | ||
| 
						 | 
					f09b9573f0 | ||
| 
						 | 
					3d3ae40f79 | ||
| 
						 | 
					ea3d2b4759 | ||
| 
						 | 
					542a0886cf | ||
| 
						 | 
					bd3d5df9ce | ||
| 
						 | 
					91cdfab495 | ||
| 
						 | 
					1617323dca | ||
| 
						 | 
					bbf9358eba | ||
| 
						 | 
					9682a2aea4 | ||
| 
						 | 
					c9fbb51775 | ||
| 
						 | 
					aa6d887214 | ||
| 
						 | 
					13312527de | ||
| 
						 | 
					9bd366f2a6 | ||
| 
						 | 
					5de346bfef | ||
| 
						 | 
					2af20b77b6 | ||
| 
						 | 
					9affbf10a6 | ||
| 
						 | 
					c0acf3ae6d | ||
| 
						 | 
					2c1b20e15f | ||
| 
						 | 
					77290b6736 | ||
| 
						 | 
					876f81db12 | ||
| 
						 | 
					75f3ae14b5 | ||
| 
						 | 
					d26f248b0f | ||
| 
						 | 
					eeb3dfc991 | ||
| 
						 | 
					e66db2eab3 | ||
| 
						 | 
					2ae7454f36 | ||
| 
						 | 
					4fd3c63da9 | ||
| 
						 | 
					bfc87d13cb | ||
| 
						 | 
					24564c77d6 | ||
| 
						 | 
					18a21b67c2 | ||
| 
						 | 
					3803fd9511 | ||
| 
						 | 
					152d896f75 | ||
| 
						 | 
					2f3a5f2001 | ||
| 
						 | 
					0e098249b1 | ||
| 
						 | 
					9a5f243f73 | ||
| 
						 | 
					03f55b9485 | ||
| 
						 | 
					ef9ef87d91 | ||
| 
						 | 
					0ee2c21da7 | ||
| 
						 | 
					9b966561c4 | ||
| 
						 | 
					8c0779a9db | ||
| 
						 | 
					2c901cc015 | ||
| 
						 | 
					85e66f69fa | ||
| 
						 | 
					a5585327dc | ||
| 
						 | 
					268ebb1b18 | ||
| 
						 | 
					40e820f551 | ||
| 
						 | 
					f9a11b3b18 | ||
| 
						 | 
					bd3c357212 | ||
| 
						 | 
					b4d108dac6 | ||
| 
						 | 
					6585a5760b | ||
| 
						 | 
					531be6c413 | ||
| 
						 | 
					f0c503b5a9 | 
							
								
								
									
										22
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										22
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -23,7 +23,7 @@ src/50-mutter-navigation.xml
 | 
			
		||||
src/50-mutter-system.xml
 | 
			
		||||
src/50-mutter-windows.xml
 | 
			
		||||
src/mutter-wm.desktop
 | 
			
		||||
src/mutter.desktop
 | 
			
		||||
src/mutter-wayland.desktop
 | 
			
		||||
*.o
 | 
			
		||||
*.a
 | 
			
		||||
*.lo
 | 
			
		||||
@@ -46,12 +46,13 @@ POTFILES
 | 
			
		||||
po/*.pot
 | 
			
		||||
50-metacity-desktop-key.xml
 | 
			
		||||
50-metacity-key.xml
 | 
			
		||||
libmutter.pc
 | 
			
		||||
mutter
 | 
			
		||||
mutter-theme-viewer
 | 
			
		||||
mutter.desktop
 | 
			
		||||
libmutter-wayland.pc
 | 
			
		||||
mutter-wayland
 | 
			
		||||
mutter-launch
 | 
			
		||||
org.gnome.mutter.gschema.valid
 | 
			
		||||
org.gnome.mutter.gschema.xml
 | 
			
		||||
org.gnome.mutter.wayland.gschema.valid
 | 
			
		||||
org.gnome.mutter.wayland.gschema.xml
 | 
			
		||||
testasyncgetprop
 | 
			
		||||
testboxes
 | 
			
		||||
testgradient
 | 
			
		||||
@@ -74,7 +75,18 @@ src/mutter-enum-types.[ch]
 | 
			
		||||
src/stamp-mutter-enum-types.h
 | 
			
		||||
src/mutter-marshal.[ch]
 | 
			
		||||
src/stamp-mutter-marshal.h
 | 
			
		||||
src/meta-dbus-xrandr.[ch]
 | 
			
		||||
src/meta-dbus-idle-monitor.[ch]
 | 
			
		||||
src/mutter-plugins.pc
 | 
			
		||||
src/wayland/gtk-shell-protocol.c
 | 
			
		||||
src/wayland/gtk-shell-client-protocol.h
 | 
			
		||||
src/wayland/gtk-shell-server-protocol.h
 | 
			
		||||
src/wayland/xdg-shell-protocol.c
 | 
			
		||||
src/wayland/xdg-shell-client-protocol.h
 | 
			
		||||
src/wayland/xdg-shell-server-protocol.h
 | 
			
		||||
src/wayland/xserver-protocol.c
 | 
			
		||||
src/wayland/xserver-client-protocol.h
 | 
			
		||||
src/wayland/xserver-server-protocol.h
 | 
			
		||||
doc/reference/*.args
 | 
			
		||||
doc/reference/*.bak
 | 
			
		||||
doc/reference/*.hierarchy
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,10 @@
 | 
			
		||||
 | 
			
		||||
SUBDIRS=src po doc
 | 
			
		||||
SUBDIRS=src protocol po doc
 | 
			
		||||
 | 
			
		||||
EXTRA_DIST = HACKING MAINTAINERS rationales.txt
 | 
			
		||||
 | 
			
		||||
DISTCLEANFILES = intltool-extract intltool-merge intltool-update po/stamp-it po/.intltool-merge-cache
 | 
			
		||||
 | 
			
		||||
DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
 | 
			
		||||
 | 
			
		||||
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										159
									
								
								NEWS
									
									
									
									
									
								
							
							
						
						
									
										159
									
								
								NEWS
									
									
									
									
									
								
							@@ -1,3 +1,162 @@
 | 
			
		||||
3.11.3
 | 
			
		||||
======
 | 
			
		||||
* Fix focus issues with external OSKs[Jasper; #715030]
 | 
			
		||||
* Add a MetaCullable interface [Jasper; #714706]
 | 
			
		||||
* Fix window keybindings [Rui; #719724]
 | 
			
		||||
* Fix settings keyboard/pointer focus for new clients [Rui; #719725]
 | 
			
		||||
* Fix window group paint volume [Owen; #719669]
 | 
			
		||||
* Fix frame extents problems [Owen; #714707]
 | 
			
		||||
* Add shortcut to move windows between monitors [Florian; #671054]
 | 
			
		||||
* Fix problems with focus tracking [Owen; #720558]
 | 
			
		||||
* Misc. bug fixes and cleanups: [Rui, Colin, Lionel, Jasper, Owen; #712833,
 | 
			
		||||
  #719557, #719695, #719833, #678989, #720417, #720630]
 | 
			
		||||
 | 
			
		||||
Contributors:
 | 
			
		||||
  Lionel Landwerlin, Rui Matos, Alberto Milone, Florian Müllner,
 | 
			
		||||
  Jasper St. Pierre, Rico Tzschichholz, Owen W. Taylor, Colin Walters
 | 
			
		||||
 | 
			
		||||
3.11.2
 | 
			
		||||
======
 | 
			
		||||
* Support setting a NULL opaque region [Andreas; #711518]
 | 
			
		||||
* Sync keymap from X to wayland [Giovanni; #707446]
 | 
			
		||||
* Implement support for subsurfaces [Jonas; #705502]
 | 
			
		||||
* Don't focus the no-focus-window for globally active windows [Jasper; #710296]
 | 
			
		||||
* Support "hotplug_mode_update" property [Marc-André; #711216]
 | 
			
		||||
* Fix resize operations using mouse-button-modifier [Lionel; #710251]
 | 
			
		||||
* Fix position of attached modals for CSD windows [Giovanni, Owen; #707194]
 | 
			
		||||
* Misc. bug fixes [Rui, Jasper, Neil, Florian; #712247, #711731]
 | 
			
		||||
 | 
			
		||||
Contributors:
 | 
			
		||||
  Giovanni Campagna, Andreas Heider, Lionel Landwerlin, Marc-André Lureau,
 | 
			
		||||
  Rui Matos, Florian Müllner, Neil Roberts, Sindhu S, Jasper St. Pierre,
 | 
			
		||||
  Rico Tzschichholz, Owen W. Taylor, Jonas Ådahl
 | 
			
		||||
 | 
			
		||||
3.11.1
 | 
			
		||||
======
 | 
			
		||||
* Fix tile previews getting stuck on right click during drags [Lionel; #704759]
 | 
			
		||||
* Use new UPower API [Bastien]
 | 
			
		||||
* Set hot spot when cursor set from wl_buffer [Jonas; #709593]
 | 
			
		||||
* Expose min-backlight-step [Asad; #710380]
 | 
			
		||||
* Misc. bug fixes and cleanups [Jasper, Olav, Magdalen; #709776]
 | 
			
		||||
 | 
			
		||||
Contributors:
 | 
			
		||||
  Magdalen Berns, Lionel Landwerlin, Asad Mehmood, Bastien Nocera,
 | 
			
		||||
  Jasper St. Pierre, Olav Vitters, Jonas Ådahl
 | 
			
		||||
 | 
			
		||||
3.10.1
 | 
			
		||||
======
 | 
			
		||||
* Don't apply fullscreen workarounds to CSD windows [Giovanni; #708718]
 | 
			
		||||
* Fix hangs during DND operations [Adel; #709340]
 | 
			
		||||
* Misc bug fixes [Dan, Giovanni, Jasper; #708813, #708420]
 | 
			
		||||
 | 
			
		||||
Contributors:
 | 
			
		||||
  Giovanni Campagna, Adel Gadllah, Dan Horák, Hans Petter Jansson,
 | 
			
		||||
  Jasper St. Pierre
 | 
			
		||||
 | 
			
		||||
3.10.0.1
 | 
			
		||||
========
 | 
			
		||||
* Fix bug when a window changed size twice in a single frame - this
 | 
			
		||||
  can happen with GTK+ client-side decorations [Giovanni, Owen; #708367]
 | 
			
		||||
 | 
			
		||||
Contributors:
 | 
			
		||||
  Giovanni Campagna, Owen Taylor
 | 
			
		||||
 | 
			
		||||
3.10.0
 | 
			
		||||
======
 | 
			
		||||
* Update dependencies [Giovanni; #708210]
 | 
			
		||||
 | 
			
		||||
3.9.92
 | 
			
		||||
======
 | 
			
		||||
* Constrain the pointer position onto visible monitors [Giovanni; #706655]
 | 
			
		||||
* Fix keyboard state handling in face of event compression [Giovanni; #706963]
 | 
			
		||||
* Extend the MetaCursorTracker API with query pointer and cursor visibility [Giovanni; #707474]
 | 
			
		||||
* Be stricter in checking and exposing the wayland protocol version [#707851]
 | 
			
		||||
* Don't require plugins to pass event to Clutter [Giovanni; #707482]
 | 
			
		||||
* Move the --wayland option from the binary to the library [Giovanni; #707897]
 | 
			
		||||
* Implement running from gnome-session (environment variable setting, process group
 | 
			
		||||
  handling, Clutter backend variables) [Giovanni; #706421]
 | 
			
		||||
* Add support for more cursor types [Giovanni; #707919]
 | 
			
		||||
* Drop man pages for removed utilities [Kalev; #706579]
 | 
			
		||||
* Implement monitor configuration on KMS [Giovanni; #706308]
 | 
			
		||||
* Implement HW cursors [Giovanni; #707573]
 | 
			
		||||
* Implement minimal support for resizing and maximizing wayland clients [Giovanni; #707401]
 | 
			
		||||
* Implement transient hints for wayland clients [Giovanni; #707401]
 | 
			
		||||
* Implement popup menu surfaces and grabs [Giovanni; #707863]
 | 
			
		||||
* Immediately fire idle watches that are already expired [Giovanni; #707302]
 | 
			
		||||
* Remove holes generated by disabling the laptop lid [Giovanni; #707473]
 | 
			
		||||
* Misc bug fixes [Giovanni, Pavel, Adel; #707649, #706124, #707584, #707851, #707929,
 | 
			
		||||
  #708070]
 | 
			
		||||
 | 
			
		||||
Contributors:
 | 
			
		||||
  Adel Gadllah, Giovanni Campagna, Kalev Lember, Pavel Vasin
 | 
			
		||||
 | 
			
		||||
Translations:
 | 
			
		||||
  Мирослав Николић po/sr, sr@latin.po, Мирослав Николић [sr, sr@latin],
 | 
			
		||||
  Chao-Hsiung Liao [zh_HK, zh_TW], Yuri Myasoedov [ru],
 | 
			
		||||
  Ville-Pekka Vainio [fi], Changwoo Ryu [ko], A S Alam [pa],
 | 
			
		||||
  Mattias Põldaru [et], Rūdolfs Mazurs [lv], Ihar Hrachyshka [be],
 | 
			
		||||
  Nilamdyuti Goswami [as], Andika Triwidada [id], Baurzhan Muftakhidinov [kk],
 | 
			
		||||
  Benjamin Steinwender [de]
 | 
			
		||||
 | 
			
		||||
3.9.91
 | 
			
		||||
======
 | 
			
		||||
* Drop man pages for removed utilities [Kalev; #706579]
 | 
			
		||||
* Add support for idle tracking [Giovanni, Cosimo; #706005, #707250]
 | 
			
		||||
* Skip CRTC reconfigurations that have no effect [Giovanni; #706672]
 | 
			
		||||
* Ignore skip-taskbar hints on parentless dialogs [Giovanni; #673399]
 | 
			
		||||
* Don't save pixbuf data in user data [Tim; #706777]
 | 
			
		||||
* Don't queue redraws for obscured regions [Adel; #703332]
 | 
			
		||||
* Suppor the opaque region hints for wayland clients [Jasper; #707019]
 | 
			
		||||
* Turn blending off when drawing entirely opaque regions [Jasper; #707019]
 | 
			
		||||
* Check event timestamps before reconfiguring [Giovanni; #706735]
 | 
			
		||||
* Merge the DBus API for display configuration in the wayland branch [Giovanni]
 | 
			
		||||
* Install an X IO error handler for XWayland [Giovanni; #706962]
 | 
			
		||||
* Use the clutter xkbcommon integration for the wayland keyboard [Giovanni; #705862]
 | 
			
		||||
* Add a setuid helper for running on KMS+evdev [Giovanni, Colin; #705861]
 | 
			
		||||
* Add keybindings for switching VT [Giovanni; #705861]
 | 
			
		||||
* Implement plugin modality when running as a wayland compositor [Giovanni; #705917]
 | 
			
		||||
* Add support for the application menu for wayland clients [Giovanni; #707128]
 | 
			
		||||
* Several Coverity spotted fixes [Jasper]
 | 
			
		||||
* Don't create a dummy texture for the texture template [Neil; #707458]
 | 
			
		||||
* Use a more conservative paint volume for obscured windows [Adel]
 | 
			
		||||
* Misc bug fixes [Giovanni, Colin, Seán, Jasper, Cosimo; #706582, #706598,
 | 
			
		||||
  #706787, #706729, #706825, #707081, #707090, #707267, #706982, #706289]
 | 
			
		||||
 | 
			
		||||
Contributors:
 | 
			
		||||
  Giovanni Campagna, Cosimo Cecchi, Adel Gadllah, Colin Guthrie, Kalev Lember,
 | 
			
		||||
  Tim Lunn, Jasper St. Pierre, Neil Roberts, Rico Tzschichholz, Seán de Búrca
 | 
			
		||||
 | 
			
		||||
Translations:
 | 
			
		||||
  Piotr Drąg [pl], Alexandre Franke [fr], Kjartan Maraas [nb],
 | 
			
		||||
  Milo Casagrande [it], Balázs Úr [hu], Seán de Búrca [ga], Fran Diéguez [gl],
 | 
			
		||||
  Daniel Mustieles [es], Aurimas Černius [lt], Gil Forcada [ca]
 | 
			
		||||
 | 
			
		||||
3.9.90
 | 
			
		||||
======
 | 
			
		||||
* First release from the wayland branch, includes basic support for running
 | 
			
		||||
  as a wayland compositor [Robert, Neil, Giovanni]
 | 
			
		||||
* Add support for _GTK_FRAME_EXTENTS [Jasper; #705766]
 | 
			
		||||
* Fix quick consecutive <super> presses breaking keyboard input [Alban; #666101]
 | 
			
		||||
* Work towards running as wayland compositor [Giovanni]
 | 
			
		||||
 - Add DBus API for display configuration
 | 
			
		||||
   [#705670, #706231, #706233, #706322, #706382]
 | 
			
		||||
 - Add abstraction layer for cursor tracking [#705911]
 | 
			
		||||
 - Add support for plugin modality under wayland [#705917]
 | 
			
		||||
* Disable GTK+ scaling [Alexander; #706388]
 | 
			
		||||
* Disable blending while updating tower [Robert]
 | 
			
		||||
* Misc bug fixes and cleanups [Adel, Jasper, Giovanni, Colin, Rico, Florian;
 | 
			
		||||
  #703332, #704437, #706207]
 | 
			
		||||
 | 
			
		||||
Contributors:
 | 
			
		||||
  Robert Bragg, Giovanni Campagna, Alban Crequy, Adel Gadllah,
 | 
			
		||||
  Alexander Larsson, Florian Müllner, Jasper St. Pierre, Neil Roberts,
 | 
			
		||||
  Rico Tzschichholz, Colin Walters
 | 
			
		||||
 | 
			
		||||
Translations:
 | 
			
		||||
  Jiro Matsuzawa [ja], Kjartan Maraas [nb], Matej Urbančič [sl],
 | 
			
		||||
  Marek Černocký [cs], Daniel Mustieles [es], Rafael Ferreira [pt_BR],
 | 
			
		||||
  Yaron Shahrabani [he], Ján Kyselica [sk]
 | 
			
		||||
 | 
			
		||||
3.9.5
 | 
			
		||||
=====
 | 
			
		||||
* Don't select for touch events on the stage [Jasper; #697192]
 | 
			
		||||
 
 | 
			
		||||
@@ -5,7 +5,7 @@ srcdir=`dirname $0`
 | 
			
		||||
test -z "$srcdir" && srcdir=.
 | 
			
		||||
 | 
			
		||||
PKG_NAME="mutter"
 | 
			
		||||
REQUIRED_AUTOMAKE_VERSION=1.10
 | 
			
		||||
REQUIRED_AUTOMAKE_VERSION=1.13
 | 
			
		||||
 | 
			
		||||
(test -f $srcdir/configure.ac \
 | 
			
		||||
  && test -d $srcdir/src) || {
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										66
									
								
								configure.ac
									
									
									
									
									
								
							
							
						
						
									
										66
									
								
								configure.ac
									
									
									
									
									
								
							@@ -1,8 +1,9 @@
 | 
			
		||||
AC_PREREQ(2.50)
 | 
			
		||||
AC_CONFIG_MACRO_DIR([m4])
 | 
			
		||||
 | 
			
		||||
m4_define([mutter_major_version], [3])
 | 
			
		||||
m4_define([mutter_minor_version], [9])
 | 
			
		||||
m4_define([mutter_micro_version], [5])
 | 
			
		||||
m4_define([mutter_minor_version], [11])
 | 
			
		||||
m4_define([mutter_micro_version], [3])
 | 
			
		||||
 | 
			
		||||
m4_define([mutter_version],
 | 
			
		||||
          [mutter_major_version.mutter_minor_version.mutter_micro_version])
 | 
			
		||||
@@ -15,10 +16,14 @@ AC_INIT([mutter], [mutter_version],
 | 
			
		||||
AC_CONFIG_SRCDIR(src/core/display.c)
 | 
			
		||||
AC_CONFIG_HEADERS(config.h)
 | 
			
		||||
 | 
			
		||||
AM_INIT_AUTOMAKE([1.11 no-dist-gzip dist-xz tar-ustar])
 | 
			
		||||
AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz tar-ustar])
 | 
			
		||||
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],)
 | 
			
		||||
AM_MAINTAINER_MODE([enable])
 | 
			
		||||
 | 
			
		||||
# Change pkglibdir and pkgdatadir to mutter-wayland instead of mutter
 | 
			
		||||
PACKAGE="mutter-wayland"
 | 
			
		||||
AC_SUBST([PACKAGE], [$PACKAGE])
 | 
			
		||||
 | 
			
		||||
MUTTER_MAJOR_VERSION=mutter_major_version
 | 
			
		||||
MUTTER_MINOR_VERSION=mutter_minor_version
 | 
			
		||||
MUTTER_MICRO_VERSION=mutter_micro_version
 | 
			
		||||
@@ -34,7 +39,7 @@ AC_SUBST(MUTTER_PLUGIN_DIR)
 | 
			
		||||
# Honor aclocal flags
 | 
			
		||||
AC_SUBST(ACLOCAL_AMFLAGS, "\${ACLOCAL_FLAGS}")
 | 
			
		||||
 | 
			
		||||
GETTEXT_PACKAGE=mutter
 | 
			
		||||
GETTEXT_PACKAGE=mutter-wayland
 | 
			
		||||
AC_SUBST(GETTEXT_PACKAGE)
 | 
			
		||||
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Name of default gettext domain])
 | 
			
		||||
 | 
			
		||||
@@ -73,9 +78,9 @@ MUTTER_PC_MODULES="
 | 
			
		||||
   cairo >= 1.10.0
 | 
			
		||||
   gsettings-desktop-schemas >= 3.7.3
 | 
			
		||||
   xcomposite >= 0.2 xfixes xrender xdamage xi >= 1.6.0
 | 
			
		||||
   $CLUTTER_PACKAGE >= 1.14.3
 | 
			
		||||
   $CLUTTER_PACKAGE >= 1.17.1
 | 
			
		||||
   cogl-1.0 >= 1.13.3
 | 
			
		||||
   upower-glib > 0.9.11
 | 
			
		||||
   upower-glib >= 0.99.0
 | 
			
		||||
   gnome-desktop-3.0
 | 
			
		||||
"
 | 
			
		||||
 | 
			
		||||
@@ -115,11 +120,32 @@ AC_ARG_ENABLE(shape,
 | 
			
		||||
                 [disable mutter's use of the shaped window extension]),,
 | 
			
		||||
  enable_shape=auto)
 | 
			
		||||
 | 
			
		||||
## Wayland support requires the xserver.xml protocol extension found in the weston
 | 
			
		||||
## repository but since there aren't currently established conventions for
 | 
			
		||||
## installing and discovering these we simply require a location to be given
 | 
			
		||||
## explicitly...
 | 
			
		||||
AC_ARG_WITH([wayland-protocols],
 | 
			
		||||
            [AS_HELP_STRING([--with-wayland-protocols], [Location for wayland extension protocol specs])],
 | 
			
		||||
            [
 | 
			
		||||
            ],
 | 
			
		||||
            [])
 | 
			
		||||
 | 
			
		||||
AC_ARG_WITH([xwayland-path],
 | 
			
		||||
            [AS_HELP_STRING([--with-xwayland-path], [Absolute path for an X Wayland server])],
 | 
			
		||||
            [XWAYLAND_PATH="$withval"],
 | 
			
		||||
            [XWAYLAND_PATH="$bindir/Xorg"])
 | 
			
		||||
 | 
			
		||||
AM_GLIB_GNU_GETTEXT
 | 
			
		||||
 | 
			
		||||
## here we get the flags we'll actually use
 | 
			
		||||
# GRegex requires Glib-2.14.0
 | 
			
		||||
PKG_CHECK_MODULES(ALL, glib-2.0 >= 2.14.0)
 | 
			
		||||
PKG_CHECK_MODULES(MUTTER_LAUNCH, libdrm libsystemd-login)
 | 
			
		||||
 | 
			
		||||
saved_LIBS="$LIBS"
 | 
			
		||||
LIBS="$LIBS $MUTTER_LAUNCH"
 | 
			
		||||
AC_CHECK_FUNCS([sd_session_get_vt])
 | 
			
		||||
LIBS="$saved_LIBS"
 | 
			
		||||
 | 
			
		||||
# Unconditionally use this dir to avoid a circular dep with gnomecc
 | 
			
		||||
GNOME_KEYBINDINGS_KEYSDIR="${datadir}/gnome-control-center/keybindings"
 | 
			
		||||
@@ -184,20 +210,18 @@ if test x$found_introspection != xno; then
 | 
			
		||||
  AC_SUBST(META_GIR)
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
AC_MSG_CHECKING([Xcursor])
 | 
			
		||||
if $PKG_CONFIG xcursor; then
 | 
			
		||||
     have_xcursor=yes
 | 
			
		||||
  else
 | 
			
		||||
     have_xcursor=no
 | 
			
		||||
  fi
 | 
			
		||||
  AC_MSG_RESULT($have_xcursor)
 | 
			
		||||
MUTTER_PC_MODULES="$MUTTER_PC_MODULES xcursor"
 | 
			
		||||
 | 
			
		||||
if test x$have_xcursor = xyes; then
 | 
			
		||||
  echo "Building with Xcursor"
 | 
			
		||||
  MUTTER_PC_MODULES="$MUTTER_PC_MODULES xcursor"
 | 
			
		||||
  AC_DEFINE(HAVE_XCURSOR, , [Building with Xcursor support])
 | 
			
		||||
fi
 | 
			
		||||
# We always build with wayland enabled
 | 
			
		||||
AC_DEFINE(HAVE_WAYLAND, , [Building with Wayland support])
 | 
			
		||||
 | 
			
		||||
AC_PATH_PROG([WAYLAND_SCANNER],[wayland-scanner],[no])
 | 
			
		||||
AS_IF([test "x$WAYLAND_SCANNER" = "xno"],
 | 
			
		||||
  AC_MSG_ERROR([Could not find wayland-scanner in your PATH, required for parsing wayland extension protocols]))
 | 
			
		||||
AC_SUBST([WAYLAND_SCANNER])
 | 
			
		||||
AC_SUBST(XWAYLAND_PATH)
 | 
			
		||||
 | 
			
		||||
MUTTER_PC_MODULES="$MUTTER_PC_MODULES clutter-wayland-1.0 clutter-wayland-compositor-1.0 clutter-egl-1.0 wayland-server libdrm"
 | 
			
		||||
PKG_CHECK_MODULES(MUTTER, $MUTTER_PC_MODULES)
 | 
			
		||||
 | 
			
		||||
PKG_CHECK_EXISTS([xi >= 1.6.99.1],
 | 
			
		||||
@@ -435,9 +459,9 @@ doc/man/Makefile
 | 
			
		||||
doc/reference/Makefile
 | 
			
		||||
doc/reference/meta-docs.sgml
 | 
			
		||||
src/Makefile
 | 
			
		||||
src/libmutter.pc
 | 
			
		||||
src/mutter-plugins.pc
 | 
			
		||||
src/libmutter-wayland.pc
 | 
			
		||||
src/compositor/plugins/Makefile
 | 
			
		||||
protocol/Makefile
 | 
			
		||||
po/Makefile.in
 | 
			
		||||
])
 | 
			
		||||
 | 
			
		||||
@@ -453,7 +477,7 @@ fi
 | 
			
		||||
 | 
			
		||||
dnl ==========================================================================
 | 
			
		||||
echo "
 | 
			
		||||
mutter-$VERSION
 | 
			
		||||
mutter-wayland-$VERSION
 | 
			
		||||
 | 
			
		||||
	prefix:                   ${prefix}
 | 
			
		||||
	source code location:	  ${srcdir}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,3 @@
 | 
			
		||||
man_MANS = mutter.1 mutter-theme-viewer.1 \
 | 
			
		||||
	   mutter-window-demo.1 mutter-message.1
 | 
			
		||||
man_MANS = mutter.1
 | 
			
		||||
 | 
			
		||||
EXTRA_DIST = $(man_MANS)
 | 
			
		||||
 
 | 
			
		||||
@@ -1,60 +0,0 @@
 | 
			
		||||
.\"                                      Hey, EMACS: -*- nroff -*-
 | 
			
		||||
.\" First parameter, NAME, should be all caps
 | 
			
		||||
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
 | 
			
		||||
.\" other parameters are allowed: see man(7), man(1)
 | 
			
		||||
.\" -----
 | 
			
		||||
.\" This file was confirmed to be licenced under the GPL
 | 
			
		||||
.\" by its author and copyright holder, Akira TAGOH, on June 1st 2008:
 | 
			
		||||
.\"
 | 
			
		||||
.\" > I'm comfortable with DFSG-free. that sounds great if you think it's
 | 
			
		||||
.\" > useful and worth containing it in upstream.
 | 
			
		||||
.\" ...
 | 
			
		||||
.\" > Right I know. any licenses that is DFSG-free, I'm ok with whatever,
 | 
			
		||||
.\" > since I have contributed that for Debian. so GPL is no problem for me.
 | 
			
		||||
.\" -----
 | 
			
		||||
.TH MUTTER\-MESSAGE 1 "28 August 2002"
 | 
			
		||||
.\" Please adjust this date whenever revising the manpage.
 | 
			
		||||
.\"
 | 
			
		||||
.\" Some roff macros, for reference:
 | 
			
		||||
.\" .nh        disable hyphenation
 | 
			
		||||
.\" .hy        enable hyphenation
 | 
			
		||||
.\" .ad l      left justify
 | 
			
		||||
.\" .ad b      justify to both left and right margins
 | 
			
		||||
.\" .nf        disable filling
 | 
			
		||||
.\" .fi        enable filling
 | 
			
		||||
.\" .br        insert line break
 | 
			
		||||
.\" .sp <n>    insert n+1 empty lines
 | 
			
		||||
.\" for manpage-specific macros, see man(7)
 | 
			
		||||
.SH NAME
 | 
			
		||||
MUTTER\-MESSAGE \- a command to send a message to Mutter
 | 
			
		||||
.SH SYNOPSIS
 | 
			
		||||
.B MUTTER\-MESSAGE
 | 
			
		||||
[restart|reload\-theme|enable\-keybindings|disable\-keybindings]
 | 
			
		||||
.SH DESCRIPTION
 | 
			
		||||
This manual page documents briefly the
 | 
			
		||||
.B mutter\-message\fP.
 | 
			
		||||
This manual page was written for the Debian distribution
 | 
			
		||||
because the original program does not have a manual page.
 | 
			
		||||
.PP
 | 
			
		||||
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
 | 
			
		||||
.\" \fI<whatever>\fP escape sequences to invode bold face and italics, 
 | 
			
		||||
.\" respectively.
 | 
			
		||||
\fBmutter\-message\fP send a specified message to \fBmutter\fP(1).
 | 
			
		||||
.SH OPTIONS
 | 
			
		||||
.TP
 | 
			
		||||
.B restart
 | 
			
		||||
Restart \fBmutter\fP(1) which is running.
 | 
			
		||||
.TP
 | 
			
		||||
.B reload-theme
 | 
			
		||||
Reload a theme which is specified on gsettings database.
 | 
			
		||||
.TP
 | 
			
		||||
.B enable-keybindings
 | 
			
		||||
Enable all of keybindings which is specified on gsettings database.
 | 
			
		||||
.TP
 | 
			
		||||
.B disable-keybindings
 | 
			
		||||
Disable all of keybindings which is specified on gsettings database.
 | 
			
		||||
.SH SEE ALSO
 | 
			
		||||
.BR mutter (1)
 | 
			
		||||
.SH AUTHOR
 | 
			
		||||
This manual page was written by Akira TAGOH <tagoh@debian.org>,
 | 
			
		||||
for the Debian GNU/Linux system (but may be used by others).
 | 
			
		||||
@@ -1,43 +0,0 @@
 | 
			
		||||
.\" In .TH, FOO should be all caps, SECTION should be 1-8, maybe w/ subsection
 | 
			
		||||
.\" other parms are allowed: see man(7), man(1)
 | 
			
		||||
.\"
 | 
			
		||||
.\" Based on template provided by Tom Christiansen <tchrist@jhereg.perl.com>.
 | 
			
		||||
.\" 
 | 
			
		||||
.TH MUTTER-THEME-VIEWER 1 "1 June 2004" 
 | 
			
		||||
.SH NAME
 | 
			
		||||
mutter-theme-viewer \- view mutter themes
 | 
			
		||||
.SH SYNOPSIS
 | 
			
		||||
.B mutter-theme-viewer
 | 
			
		||||
[
 | 
			
		||||
.I THEMENAME
 | 
			
		||||
]
 | 
			
		||||
.SH DESCRIPTION
 | 
			
		||||
.\" Putting a newline after each sentence can generate better output.
 | 
			
		||||
.B mutter-theme-viewer
 | 
			
		||||
allows you to preview any installed Mutter theme.
 | 
			
		||||
.PP
 | 
			
		||||
When designing a new Mutter theme, you can use
 | 
			
		||||
.B mutter-theme-viewer
 | 
			
		||||
to measure the performance of a window frame option, and to preview
 | 
			
		||||
the option.
 | 
			
		||||
.SH OPTIONS
 | 
			
		||||
.TP
 | 
			
		||||
.I THEMENAME
 | 
			
		||||
Name of the theme to be shown (\fIAtlanta\fR by default).
 | 
			
		||||
It is case-sensitive.
 | 
			
		||||
.SH FILES
 | 
			
		||||
.br
 | 
			
		||||
.nf
 | 
			
		||||
.TP
 | 
			
		||||
.I /usr/share/themes
 | 
			
		||||
system themes directory
 | 
			
		||||
.TP
 | 
			
		||||
.I /usr/share/themes/*/mutter-1/mutter-theme-1.xml
 | 
			
		||||
theme specification file
 | 
			
		||||
.SH AUTHOR
 | 
			
		||||
This manual page was written by Jose M. Moya <josem@die.upm.es>, for
 | 
			
		||||
the Debian  GNU/Linux system (but may be used by others).
 | 
			
		||||
.SH "SEE ALSO"
 | 
			
		||||
.\" Always quote multiple words for .SH
 | 
			
		||||
.BR mutter (1),
 | 
			
		||||
.BR mutter-window-demo (1).
 | 
			
		||||
@@ -1,25 +0,0 @@
 | 
			
		||||
.\" In .TH, FOO should be all caps, SECTION should be 1-8, maybe w/ subsection
 | 
			
		||||
.\" other parms are allowed: see man(7), man(1)
 | 
			
		||||
.\"
 | 
			
		||||
.\" Based on template provided by Tom Christiansen <tchrist@jhereg.perl.com>.
 | 
			
		||||
.\" 
 | 
			
		||||
.TH MUTTER-WINDOW-DEMO 1 "1 June 2004" 
 | 
			
		||||
.SH NAME
 | 
			
		||||
mutter-window-demo \- demo of window features
 | 
			
		||||
.SH SYNOPSIS
 | 
			
		||||
.B mutter-window-demo
 | 
			
		||||
.SH DESCRIPTION
 | 
			
		||||
.\" Putting a newline after each sentence can generate better output.
 | 
			
		||||
This program demonstrates various kinds of windows that window
 | 
			
		||||
managers and window manager themes should handle.
 | 
			
		||||
.PP
 | 
			
		||||
Be sure to tear off the menu and toolbar, those are also a special
 | 
			
		||||
kind of window.
 | 
			
		||||
.SH AUTHOR
 | 
			
		||||
This manual page was written by Jose M. Moya <josem@die.upm.es>, for
 | 
			
		||||
the Debian  GNU/Linux system (but may be used by others).
 | 
			
		||||
.SH "SEE ALSO"
 | 
			
		||||
.\" Always quote multiple words for .SH
 | 
			
		||||
.BR x-window-manager (1),
 | 
			
		||||
.BR mutter (1),
 | 
			
		||||
.BR mutter-theme-viewer (1).
 | 
			
		||||
@@ -49,8 +49,8 @@ FIXXREF_OPTIONS=
 | 
			
		||||
# Used for dependencies. The docs will be rebuilt if any of these change.
 | 
			
		||||
# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h
 | 
			
		||||
# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c
 | 
			
		||||
HFILE_GLOB=$(top_srcdir)/src/*.h
 | 
			
		||||
CFILE_GLOB=$(top_srcdir)/src/*.c
 | 
			
		||||
HFILE_GLOB=$(top_srcdir)/src/*/*.h
 | 
			
		||||
CFILE_GLOB=$(top_srcdir)/src/*/*.c
 | 
			
		||||
 | 
			
		||||
# Extra header to include when scanning, which are not under DOC_SOURCE_DIR
 | 
			
		||||
# e.g. EXTRA_HFILES=$(top_srcdir}/contrib/extra.h
 | 
			
		||||
@@ -140,7 +140,7 @@ expand_content_files= \
 | 
			
		||||
# e.g. GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS)
 | 
			
		||||
# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib)
 | 
			
		||||
GTKDOC_CFLAGS=$(MUTTER_CFLAGS)
 | 
			
		||||
GTKDOC_LIBS=$(MUTTER_LIBS) $(top_builddir)/src/libmutter.la
 | 
			
		||||
GTKDOC_LIBS=$(MUTTER_LIBS) $(top_builddir)/src/libmutter-wayland.la
 | 
			
		||||
 | 
			
		||||
# This includes the standard gtk-doc make rules, copied by gtkdocize.
 | 
			
		||||
include $(top_srcdir)/gtk-doc.make
 | 
			
		||||
 
 | 
			
		||||
@@ -207,7 +207,6 @@ meta_key_binding_get_modifiers
 | 
			
		||||
meta_key_binding_get_mask
 | 
			
		||||
meta_key_binding_is_builtin
 | 
			
		||||
meta_keybindings_set_custom_handler
 | 
			
		||||
meta_keybindings_switch_window
 | 
			
		||||
meta_screen_ungrab_all_keys
 | 
			
		||||
meta_screen_grab_all_keys
 | 
			
		||||
</SECTION>
 | 
			
		||||
@@ -389,6 +388,23 @@ MetaWindowActorPrivate
 | 
			
		||||
meta_window_actor_get_type
 | 
			
		||||
</SECTION>
 | 
			
		||||
 | 
			
		||||
<SECTION>
 | 
			
		||||
<FILE>meta-cullable</FILE>
 | 
			
		||||
<TITLE>MetaCullable</TITLE>
 | 
			
		||||
MetaCullable
 | 
			
		||||
MetaCullableInterface
 | 
			
		||||
meta_cullable_cull_out
 | 
			
		||||
meta_cullable_reset_culling
 | 
			
		||||
meta_cullable_cull_out_children
 | 
			
		||||
meta_cullable_reset_culling_children
 | 
			
		||||
<SUBSECTION Standard>
 | 
			
		||||
META_TYPE_CULLABLE
 | 
			
		||||
META_CULLABLE
 | 
			
		||||
META_IS_CULLABLE
 | 
			
		||||
META_CULLABLE_GET_IFACE
 | 
			
		||||
meta_cullable_get_type
 | 
			
		||||
</SECTION>
 | 
			
		||||
 | 
			
		||||
<SECTION>
 | 
			
		||||
<FILE>prefs</FILE>
 | 
			
		||||
MetaPreference
 | 
			
		||||
@@ -542,7 +558,10 @@ meta_window_is_override_redirect
 | 
			
		||||
meta_window_is_skip_taskbar
 | 
			
		||||
meta_window_get_rect
 | 
			
		||||
meta_window_get_input_rect
 | 
			
		||||
meta_window_get_frame_rect
 | 
			
		||||
meta_window_get_outer_rect
 | 
			
		||||
meta_window_client_rect_to_frame_rect
 | 
			
		||||
meta_window_frame_rect_to_client_rect
 | 
			
		||||
meta_window_get_screen
 | 
			
		||||
meta_window_get_display
 | 
			
		||||
meta_window_get_xwindow
 | 
			
		||||
 
 | 
			
		||||
@@ -21,6 +21,7 @@ environment.</description>
 | 
			
		||||
  -->
 | 
			
		||||
  <mailing-list rdf:resource="http://mail.gnome.org/mailman/listinfo/gnome-shell-list" />
 | 
			
		||||
  <download-page rdf:resource="http://download.gnome.org/sources/mutter/" />
 | 
			
		||||
  <download-page rdf:resource="http://download.gnome.org/sources/mutter-wayland/" />
 | 
			
		||||
  <bug-database rdf:resource="http://bugzilla.gnome.org/browse.cgi?product=mutter" />
 | 
			
		||||
 | 
			
		||||
  <category rdf:resource="http://api.gnome.org/doap-extensions#desktop" />
 | 
			
		||||
 
 | 
			
		||||
@@ -44,6 +44,7 @@ is
 | 
			
		||||
it
 | 
			
		||||
ja
 | 
			
		||||
ka
 | 
			
		||||
kk
 | 
			
		||||
kn
 | 
			
		||||
ko
 | 
			
		||||
ku
 | 
			
		||||
 
 | 
			
		||||
@@ -21,9 +21,9 @@ src/core/util.c
 | 
			
		||||
src/core/window.c
 | 
			
		||||
src/core/window-props.c
 | 
			
		||||
src/core/xprops.c
 | 
			
		||||
src/mutter.desktop.in
 | 
			
		||||
src/mutter-wm.desktop.in
 | 
			
		||||
src/mutter-wayland.desktop.in
 | 
			
		||||
src/org.gnome.mutter.gschema.xml.in
 | 
			
		||||
src/org.gnome.mutter.wayland.gschema.xml.in
 | 
			
		||||
src/ui/frames.c
 | 
			
		||||
src/ui/menu.c
 | 
			
		||||
src/ui/metaaccellabel.c
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										441
									
								
								po/be.po
									
									
									
									
									
								
							
							
						
						
									
										441
									
								
								po/be.po
									
									
									
									
									
								
							@@ -1,10 +1,10 @@
 | 
			
		||||
# Ihar Hrachyshka <ihar.hrachyshka@gmail.com>, 2011.
 | 
			
		||||
# Ihar Hrachyshka <ihar.hrachyshka@gmail.com>, 2011, 2013.
 | 
			
		||||
msgid ""
 | 
			
		||||
msgstr ""
 | 
			
		||||
"Project-Id-Version: mutter.master\n"
 | 
			
		||||
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
 | 
			
		||||
"product=mutter&keywords=I18N+L10N&component=general\n"
 | 
			
		||||
"POT-Creation-Date: 2013-03-01 15:50+0000\n"
 | 
			
		||||
"POT-Creation-Date: 2013-08-18 20:03+0000\n"
 | 
			
		||||
"PO-Revision-Date: 2012-10-13 17:44+0300\n"
 | 
			
		||||
"Last-Translator: Ігар Грачышка <ihar.hrachyshka@gmail.com>\n"
 | 
			
		||||
"Language-Team: Belarusian <i18n-bel-gnome@googlegroups.com>\n"
 | 
			
		||||
@@ -206,7 +206,7 @@ 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:507
 | 
			
		||||
#: ../src/compositor/compositor.c:589
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Another compositing manager is already running on screen %i on display \"%s"
 | 
			
		||||
@@ -214,11 +214,11 @@ msgid ""
 | 
			
		||||
msgstr ""
 | 
			
		||||
"Іншы кампазітны кіраўнік вокнаў ужо абслугоўвае экран %i дысплея \"%s\"."
 | 
			
		||||
 | 
			
		||||
#: ../src/compositor/meta-background.c:1111
 | 
			
		||||
#: ../src/compositor/meta-background.c:1076
 | 
			
		||||
msgid "background texture could not be created from file"
 | 
			
		||||
msgstr "не ўдалося стварыць фонавую тэкстуру з файла"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/bell.c:320
 | 
			
		||||
#: ../src/core/bell.c:322
 | 
			
		||||
msgid "Bell event"
 | 
			
		||||
msgstr "Падзея з сігналам"
 | 
			
		||||
 | 
			
		||||
@@ -251,18 +251,18 @@ msgstr "_Пачакаць"
 | 
			
		||||
msgid "_Force Quit"
 | 
			
		||||
msgstr "_Змусіць да выхаду"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/display.c:401
 | 
			
		||||
#: ../src/core/display.c:421
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Missing %s extension required for compositing"
 | 
			
		||||
msgstr ""
 | 
			
		||||
"Адсутнічае пашырэнне \"%s\", патрэбнае для ажыццяўлення кампазітнага вываду"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/display.c:493
 | 
			
		||||
#: ../src/core/display.c:513
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Failed to open X Window System display '%s'\n"
 | 
			
		||||
msgstr "Не ўдалося адкрыць X-дысплей аконнай сістэмы \"%s\"\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/keybindings.c:929
 | 
			
		||||
#: ../src/core/keybindings.c:1136
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Some other program is already using the key %s with modifiers %x as a "
 | 
			
		||||
@@ -271,41 +271,41 @@ msgstr ""
 | 
			
		||||
"Нейкая іншая праграма ўжо выкарыстоўвае як скарот клавішу %s з "
 | 
			
		||||
"мадыфікатарамі %x\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/keybindings.c:1129
 | 
			
		||||
#: ../src/core/keybindings.c:1333
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "\"%s\" is not a valid accelerator\n"
 | 
			
		||||
msgstr "\"%s\" - гэта хібны клавіятурны скарот\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:196
 | 
			
		||||
#: ../src/core/main.c:197
 | 
			
		||||
msgid "Disable connection to session manager"
 | 
			
		||||
msgstr "Выключыць злучэнне з кіраўніком сеансаў"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:202
 | 
			
		||||
#: ../src/core/main.c:203
 | 
			
		||||
msgid "Replace the running window manager"
 | 
			
		||||
msgstr "Замяніць дзейнага кіраўніка вокнаў"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:208
 | 
			
		||||
#: ../src/core/main.c:209
 | 
			
		||||
msgid "Specify session management ID"
 | 
			
		||||
msgstr "Вызначыць ідэнтыфікатар для кіравання сеансам"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:213
 | 
			
		||||
#: ../src/core/main.c:214
 | 
			
		||||
msgid "X Display to use"
 | 
			
		||||
msgstr "Патрэбны X-дысплей"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:219
 | 
			
		||||
#: ../src/core/main.c:220
 | 
			
		||||
msgid "Initialize session from savefile"
 | 
			
		||||
msgstr "Ініцыяваць сеанс з файла"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:225
 | 
			
		||||
#: ../src/core/main.c:226
 | 
			
		||||
msgid "Make X calls synchronous"
 | 
			
		||||
msgstr "Сінхронна выконваць выклікі X-сістэмы"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:494
 | 
			
		||||
#: ../src/core/main.c:534
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Failed to scan themes directory: %s\n"
 | 
			
		||||
msgstr "Не ўдалося праглядзець каталог з матывамі аздаблення: %s\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:510
 | 
			
		||||
#: ../src/core/main.c:550
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Could not find a theme! Be sure %s exists and contains the usual themes.\n"
 | 
			
		||||
@@ -313,6 +313,19 @@ msgstr ""
 | 
			
		||||
"Не ўдалося адшукаць матыў аздаблення! Праверце, каб каталог %s існаваў і "
 | 
			
		||||
"змяшчаў звычайныя матывы.\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/monitor.c:711
 | 
			
		||||
msgid "Built-in display"
 | 
			
		||||
msgstr "Убудаваны дысплей"
 | 
			
		||||
 | 
			
		||||
#. TRANSLATORS: this is a monitor name (in case we don't know
 | 
			
		||||
#. the vendor), it's Unknown followed by a size in inches,
 | 
			
		||||
#. like 'Unknown 15"'
 | 
			
		||||
#.
 | 
			
		||||
#: ../src/core/monitor.c:739
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Unknown %s"
 | 
			
		||||
msgstr "Невядомы %s"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/mutter.c:40
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
@@ -337,7 +350,7 @@ msgstr "Вывесці нумар версіі праграмы"
 | 
			
		||||
msgid "Mutter plugin to use"
 | 
			
		||||
msgstr "Патрэбны плугін Mutter"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/prefs.c:1087
 | 
			
		||||
#: ../src/core/prefs.c:1202
 | 
			
		||||
msgid ""
 | 
			
		||||
"Workarounds for broken applications disabled. Some applications may not "
 | 
			
		||||
"behave properly.\n"
 | 
			
		||||
@@ -345,12 +358,12 @@ msgstr ""
 | 
			
		||||
"Асаблівыя паводзіны для некаторых хібных праграм выключаныя. Некаторыя "
 | 
			
		||||
"праграмы могуць перастаць працаваць, як мае быць.\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/prefs.c:1162
 | 
			
		||||
#: ../src/core/prefs.c:1277
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Could not parse font description \"%s\" from GSettings key %s\n"
 | 
			
		||||
msgstr "Не ўдалося разабраць азначэнне шрыфту \"%s\" з GSettings-ключа %s\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/prefs.c:1228
 | 
			
		||||
#: ../src/core/prefs.c:1343
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"\"%s\" found in configuration database is not a valid value for mouse button "
 | 
			
		||||
@@ -359,7 +372,7 @@ msgstr ""
 | 
			
		||||
"Значэнне \"%s\", знойдзенае ў базе канфігурацыйных даных, не азначае "
 | 
			
		||||
"мадыфікатар мышынай кнопкі\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/prefs.c:1780
 | 
			
		||||
#: ../src/core/prefs.c:1909
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"\"%s\" found in configuration database is not a valid value for keybinding "
 | 
			
		||||
@@ -368,17 +381,17 @@ msgstr ""
 | 
			
		||||
"Значэнне \"%s\", знойдзенае ў базе канфігурацыйных даных, не азначае "
 | 
			
		||||
"клавіятурны скарот \"%s\"\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/prefs.c:1879
 | 
			
		||||
#: ../src/core/prefs.c:1999
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Workspace %d"
 | 
			
		||||
msgstr "Прастора працы %d"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/screen.c:673
 | 
			
		||||
#: ../src/core/screen.c:534
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Screen %d on display '%s' is invalid\n"
 | 
			
		||||
msgstr "Экран %d на дысплеі \"%s\" хібны\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/screen.c:689
 | 
			
		||||
#: ../src/core/screen.c:550
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Screen %d on display \"%s\" already has a window manager; try using the --"
 | 
			
		||||
@@ -387,19 +400,19 @@ msgstr ""
 | 
			
		||||
"Экран %d на дысплеі \"%s\" ужо мае аконнага кіраўніка. Каб замяніць яго "
 | 
			
		||||
"новым, дадайце опцыю --replace.\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/screen.c:716
 | 
			
		||||
#: ../src/core/screen.c:577
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Could not acquire window manager selection on screen %d display \"%s\"\n"
 | 
			
		||||
msgstr ""
 | 
			
		||||
"Не ўдалося пераняць вылучэнне кіраўніка вокнаў для экрана %d дысплея \"%s\"\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/screen.c:794
 | 
			
		||||
#: ../src/core/screen.c:655
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Screen %d on display \"%s\" already has a window manager\n"
 | 
			
		||||
msgstr "Экран %d на дысплеі \"%s\" ужо мае кіраўніка вокнаў\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/screen.c:979
 | 
			
		||||
#: ../src/core/screen.c:846
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Could not release screen %d on display \"%s\"\n"
 | 
			
		||||
msgstr "Не ўдалося вызваліць экран %d на дысплеі \"%s\"\n"
 | 
			
		||||
@@ -460,46 +473,45 @@ msgstr ""
 | 
			
		||||
"Гэтыя вокны не падтрымліваюць функцыі захавання дзейнага ладу працы, і таму "
 | 
			
		||||
"іх прыйдзецца запусціць уручную пасля наступнага ўваходу ў сістэму."
 | 
			
		||||
 | 
			
		||||
#: ../src/core/util.c:80
 | 
			
		||||
#: ../src/core/util.c:84
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Failed to open debug log: %s\n"
 | 
			
		||||
msgstr "Не ўдалося адкрыць адладачны журнал: %s\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/util.c:90
 | 
			
		||||
#: ../src/core/util.c:94
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Failed to fdopen() log file %s: %s\n"
 | 
			
		||||
msgstr "Не ўдалося выканаць fdopen() для журнальнага файла %s: %s\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/util.c:96
 | 
			
		||||
#: ../src/core/util.c:100
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Opened log file %s\n"
 | 
			
		||||
msgstr "Журнальны файл %s адкрыты\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/util.c:115 ../src/tools/mutter-message.c:149
 | 
			
		||||
#, c-format
 | 
			
		||||
#: ../src/core/util.c:119
 | 
			
		||||
msgid "Mutter was compiled without support for verbose mode\n"
 | 
			
		||||
msgstr ""
 | 
			
		||||
"Праграма \"Mutter\" была скампіляваная без падтрымкі падрабязнага "
 | 
			
		||||
"пратакаліравання\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/util.c:259
 | 
			
		||||
#: ../src/core/util.c:264
 | 
			
		||||
msgid "Window manager: "
 | 
			
		||||
msgstr "Кіраўнік вокнаў: "
 | 
			
		||||
 | 
			
		||||
#: ../src/core/util.c:407
 | 
			
		||||
#: ../src/core/util.c:414
 | 
			
		||||
msgid "Bug in window manager: "
 | 
			
		||||
msgstr "Хіба ў кіраўніку вокнаў: "
 | 
			
		||||
 | 
			
		||||
#: ../src/core/util.c:438
 | 
			
		||||
#: ../src/core/util.c:445
 | 
			
		||||
msgid "Window manager warning: "
 | 
			
		||||
msgstr "Перасцярога ад кіраўніка вокнаў: "
 | 
			
		||||
 | 
			
		||||
#: ../src/core/util.c:466
 | 
			
		||||
#: ../src/core/util.c:473
 | 
			
		||||
msgid "Window manager error: "
 | 
			
		||||
msgstr "Памылка кіраўніка вокнаў: "
 | 
			
		||||
 | 
			
		||||
#. first time through
 | 
			
		||||
#: ../src/core/window.c:7539
 | 
			
		||||
#: ../src/core/window.c:7533
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Window %s sets SM_CLIENT_ID on itself, instead of on the WM_CLIENT_LEADER "
 | 
			
		||||
@@ -515,7 +527,7 @@ msgstr ""
 | 
			
		||||
#. * MWM but not WM_NORMAL_HINTS are basically broken. We complain
 | 
			
		||||
#. * about these apps but make them work.
 | 
			
		||||
#.
 | 
			
		||||
#: ../src/core/window.c:8263
 | 
			
		||||
#: ../src/core/window.c:8257
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Window %s sets an MWM hint indicating it isn't resizable, but sets min size "
 | 
			
		||||
@@ -525,22 +537,22 @@ msgstr ""
 | 
			
		||||
"памеру, але разам з гэтым прызначыла для сябе мінімальны памер %d x %d і "
 | 
			
		||||
"максімальны памер %d x %d. Такія паводзіны не маюць сэнсу.\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/window-props.c:318
 | 
			
		||||
#: ../src/core/window-props.c:347
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Application set a bogus _NET_WM_PID %lu\n"
 | 
			
		||||
msgstr "Праграма прызначыла памылковае значэнне _NET_WM_PID %lu\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/window-props.c:434
 | 
			
		||||
#: ../src/core/window-props.c:463
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "%s (on %s)"
 | 
			
		||||
msgstr "%s (на %s)"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/window-props.c:1517
 | 
			
		||||
#: ../src/core/window-props.c:1546
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Invalid WM_TRANSIENT_FOR window 0x%lx specified for %s.\n"
 | 
			
		||||
msgstr "Для %2$s вызначана хібнае акно WM_TRANSIENT_FOR 0x%1$lx.\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/window-props.c:1528
 | 
			
		||||
#: ../src/core/window-props.c:1557
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "WM_TRANSIENT_FOR window 0x%lx for %s would create loop.\n"
 | 
			
		||||
msgstr "WM_TRANSIENT_FOR акно 0x%lx для %s стварыла б цыкл.\n"
 | 
			
		||||
@@ -689,7 +701,8 @@ msgstr ""
 | 
			
		||||
 | 
			
		||||
#: ../src/org.gnome.mutter.gschema.xml.in.h:17
 | 
			
		||||
msgid "Auto maximize nearly monitor sized windows"
 | 
			
		||||
msgstr "Аўтаматычна максімалізаваць вокны, якія расцягнутыя амаль на ўвесь экран"
 | 
			
		||||
msgstr ""
 | 
			
		||||
"Аўтаматычна максімалізаваць вокны, якія расцягнутыя амаль на ўвесь экран"
 | 
			
		||||
 | 
			
		||||
#: ../src/org.gnome.mutter.gschema.xml.in.h:18
 | 
			
		||||
msgid ""
 | 
			
		||||
@@ -707,109 +720,104 @@ msgstr "Выбраць акно з выплыўнога акенца"
 | 
			
		||||
msgid "Cancel tab popup"
 | 
			
		||||
msgstr "Закрыць выплыўное акенца"
 | 
			
		||||
 | 
			
		||||
#: ../src/tools/mutter-message.c:123
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Usage: %s\n"
 | 
			
		||||
msgstr "Правілы выкарыстання: %s\n"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:69
 | 
			
		||||
#: ../src/ui/menu.c:67
 | 
			
		||||
msgid "Mi_nimize"
 | 
			
		||||
msgstr "_Мінімалізаваць"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:71
 | 
			
		||||
#: ../src/ui/menu.c:69
 | 
			
		||||
msgid "Ma_ximize"
 | 
			
		||||
msgstr "Ма_ксімалізаваць"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:73
 | 
			
		||||
#: ../src/ui/menu.c:71
 | 
			
		||||
msgid "Unma_ximize"
 | 
			
		||||
msgstr "Скасаваць ма_ксімалізацыю"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:75
 | 
			
		||||
#: ../src/ui/menu.c:73
 | 
			
		||||
msgid "Roll _Up"
 | 
			
		||||
msgstr "_Скруціць акно ў загаловак"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:77
 | 
			
		||||
#: ../src/ui/menu.c:75
 | 
			
		||||
msgid "_Unroll"
 | 
			
		||||
msgstr "Рас_круціць акно з загалоўка"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:79
 | 
			
		||||
#: ../src/ui/menu.c:77
 | 
			
		||||
msgid "_Move"
 | 
			
		||||
msgstr "_Перамясціць акно"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:81
 | 
			
		||||
#: ../src/ui/menu.c:79
 | 
			
		||||
msgid "_Resize"
 | 
			
		||||
msgstr "_Змяніць памер акна"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:83
 | 
			
		||||
#: ../src/ui/menu.c:81
 | 
			
		||||
msgid "Move Titlebar On_screen"
 | 
			
		||||
msgstr "Перамясціць загаловак акна па _экране"
 | 
			
		||||
 | 
			
		||||
#. separator
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:86 ../src/ui/menu.c:88
 | 
			
		||||
#: ../src/ui/menu.c:84 ../src/ui/menu.c:86
 | 
			
		||||
msgid "Always on _Top"
 | 
			
		||||
msgstr "Заўсёды _наверсе"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:90
 | 
			
		||||
#: ../src/ui/menu.c:88
 | 
			
		||||
msgid "_Always on Visible Workspace"
 | 
			
		||||
msgstr "Заўсёды на _бачнай прасторы працы"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:92
 | 
			
		||||
#: ../src/ui/menu.c:90
 | 
			
		||||
msgid "_Only on This Workspace"
 | 
			
		||||
msgstr "_Толькі на гэтай прасторы працы"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:94
 | 
			
		||||
#: ../src/ui/menu.c:92
 | 
			
		||||
msgid "Move to Workspace _Left"
 | 
			
		||||
msgstr "Перамясціць на прастору працы з_лева"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:96
 | 
			
		||||
#: ../src/ui/menu.c:94
 | 
			
		||||
msgid "Move to Workspace R_ight"
 | 
			
		||||
msgstr "Перамясціць на прастору працы с_права"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:98
 | 
			
		||||
#: ../src/ui/menu.c:96
 | 
			
		||||
msgid "Move to Workspace _Up"
 | 
			
		||||
msgstr "Перамясціць на прастору працы з_верху"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:100
 | 
			
		||||
#: ../src/ui/menu.c:98
 | 
			
		||||
msgid "Move to Workspace _Down"
 | 
			
		||||
msgstr "Перамясціць на прастору працы з_нізу"
 | 
			
		||||
 | 
			
		||||
#. separator
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:104
 | 
			
		||||
#: ../src/ui/menu.c:102
 | 
			
		||||
msgid "_Close"
 | 
			
		||||
msgstr "_Закрыць акно"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/menu.c:204
 | 
			
		||||
#: ../src/ui/menu.c:202
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Workspace %d%n"
 | 
			
		||||
msgstr "Прастора працы %d%n"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/menu.c:214
 | 
			
		||||
#: ../src/ui/menu.c:212
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Workspace 1_0"
 | 
			
		||||
msgstr "Прастора працы 1_0"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/menu.c:216
 | 
			
		||||
#: ../src/ui/menu.c:214
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Workspace %s%d"
 | 
			
		||||
msgstr "Прастора працы %s%d"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/menu.c:397
 | 
			
		||||
#: ../src/ui/menu.c:384
 | 
			
		||||
msgid "Move to Another _Workspace"
 | 
			
		||||
msgstr "П_ерамясціць на іншую прастору працы"
 | 
			
		||||
 | 
			
		||||
@@ -911,49 +919,49 @@ msgstr "Mod5"
 | 
			
		||||
msgid "%d x %d"
 | 
			
		||||
msgstr "%d x %d"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:235
 | 
			
		||||
#: ../src/ui/theme.c:236
 | 
			
		||||
msgid "top"
 | 
			
		||||
msgstr "верхнюю"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:237
 | 
			
		||||
#: ../src/ui/theme.c:238
 | 
			
		||||
msgid "bottom"
 | 
			
		||||
msgstr "ніжнюю"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:239
 | 
			
		||||
#: ../src/ui/theme.c:240
 | 
			
		||||
msgid "left"
 | 
			
		||||
msgstr "левую"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:241
 | 
			
		||||
#: ../src/ui/theme.c:242
 | 
			
		||||
msgid "right"
 | 
			
		||||
msgstr "правую"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:269
 | 
			
		||||
#: ../src/ui/theme.c:270
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "frame geometry does not specify \"%s\" dimension"
 | 
			
		||||
msgstr "апісанне геаметрыі рамкі акна не вызначае %s граніцу"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:288
 | 
			
		||||
#: ../src/ui/theme.c:289
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "frame geometry does not specify dimension \"%s\" for border \"%s\""
 | 
			
		||||
msgstr ""
 | 
			
		||||
"апісанне геаметрыі рамкі акна не вызначае %s граніцу для аблямоўкі \"%s\""
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:325
 | 
			
		||||
#: ../src/ui/theme.c:326
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Button aspect ratio %g is not reasonable"
 | 
			
		||||
msgstr "Прапорцыі кнопкі %g не маюць сэнсу"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:337
 | 
			
		||||
#: ../src/ui/theme.c:338
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Frame geometry does not specify size of buttons"
 | 
			
		||||
msgstr "Апісанне геаметрыі рамкі акна не вызначае памер кнопак"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1050
 | 
			
		||||
#: ../src/ui/theme.c:1051
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Gradients should have at least two colors"
 | 
			
		||||
msgstr "Градыент мусіць мець прынамсі два колеры"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1202
 | 
			
		||||
#: ../src/ui/theme.c:1203
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"GTK custom color specification must have color name and fallback in "
 | 
			
		||||
@@ -962,7 +970,7 @@ msgstr ""
 | 
			
		||||
"Уласная спецыфікацыя колеру GTK мусіць змяшчаць назвы асноўнага і запаснога "
 | 
			
		||||
"колераў у дужках, напрыклад, gtk:custom(foo,bar). Не ўдалося разабраць \"%s\""
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1218
 | 
			
		||||
#: ../src/ui/theme.c:1219
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Invalid character '%c' in color_name parameter of gtk:custom, only A-Za-z0-9-"
 | 
			
		||||
@@ -971,7 +979,7 @@ msgstr ""
 | 
			
		||||
"Хібны знак \"%c\" у параметры color_name спецыфікацыі gtk:custom, дазволеныя "
 | 
			
		||||
"толькі A-Za-z0-9-_"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1232
 | 
			
		||||
#: ../src/ui/theme.c:1233
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Gtk:custom format is \"gtk:custom(color_name,fallback)\", \"%s\" does not "
 | 
			
		||||
@@ -980,7 +988,7 @@ msgstr ""
 | 
			
		||||
"Фармат gtk:custom: \"gtk:custom(назва_колеру,запасны_колер)\"; \"%s\" не "
 | 
			
		||||
"адпавядае фармату"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1277
 | 
			
		||||
#: ../src/ui/theme.c:1278
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"GTK color specification must have the state in brackets, e.g. gtk:fg[NORMAL] "
 | 
			
		||||
@@ -989,7 +997,7 @@ msgstr ""
 | 
			
		||||
"Спецыфікацыя колеру GTK мусіць мець стан у квадратных дужках, напрыклад, gtk:"
 | 
			
		||||
"fg[NORMAL], дзе NORMAL - гэта стан. Не ўдалося разабраць \"%s\""
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1291
 | 
			
		||||
#: ../src/ui/theme.c:1292
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"GTK color specification must have a close bracket after the state, e.g. gtk:"
 | 
			
		||||
@@ -999,17 +1007,17 @@ msgstr ""
 | 
			
		||||
"напрыклад, gtk:fg[NORMAL], дзе NORMAL - гэта стан. Не ўдалося разабраць \"%s"
 | 
			
		||||
"\""
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1302
 | 
			
		||||
#: ../src/ui/theme.c:1303
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Did not understand state \"%s\" in color specification"
 | 
			
		||||
msgstr "Незразумелы стан \"%s\" у спецыфікацыі колеру"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1315
 | 
			
		||||
#: ../src/ui/theme.c:1316
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Did not understand color component \"%s\" in color specification"
 | 
			
		||||
msgstr "Незразумелы складнік колеру \"%s\" у спецыфікацыі колеру"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1344
 | 
			
		||||
#: ../src/ui/theme.c:1345
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Blend format is \"blend/bg_color/fg_color/alpha\", \"%s\" does not fit the "
 | 
			
		||||
@@ -1018,58 +1026,58 @@ msgstr ""
 | 
			
		||||
"Фармат змяшанага колеру - \"blend/bg_color/fg_color/alpha\". \"%s\" не "
 | 
			
		||||
"адпавядае фармату."
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1355
 | 
			
		||||
#: ../src/ui/theme.c:1356
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Could not parse alpha value \"%s\" in blended color"
 | 
			
		||||
msgstr "Не ўдалося разабраць значэнне альфа \"%s\" ў змяшаным колеры"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1365
 | 
			
		||||
#: ../src/ui/theme.c:1366
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Alpha value \"%s\" in blended color is not between 0.0 and 1.0"
 | 
			
		||||
msgstr ""
 | 
			
		||||
"Значэнне альфа \"%s\" у змяшаным колеры не ўваходзіць у дыяпазон ад 0.0 да "
 | 
			
		||||
"1.0"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1412
 | 
			
		||||
#: ../src/ui/theme.c:1413
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Shade format is \"shade/base_color/factor\", \"%s\" does not fit the format"
 | 
			
		||||
msgstr ""
 | 
			
		||||
"Фармат ценю - \"shade/base_color/factor\". \"%s\" не адпавядае фармату."
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1423
 | 
			
		||||
#: ../src/ui/theme.c:1424
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Could not parse shade factor \"%s\" in shaded color"
 | 
			
		||||
msgstr "Не ўдалося разабраць каэфіцыент ценю \"%s\" у зацененым колеры"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1433
 | 
			
		||||
#: ../src/ui/theme.c:1434
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Shade factor \"%s\" in shaded color is negative"
 | 
			
		||||
msgstr "Каэфіцыент ценю \"%s\" у зацененым колеры адмоўны"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1462
 | 
			
		||||
#: ../src/ui/theme.c:1463
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Could not parse color \"%s\""
 | 
			
		||||
msgstr "Не ўдалося разабраць колер \"%s\""
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1779
 | 
			
		||||
#: ../src/ui/theme.c:1780
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Coordinate expression contains character '%s' which is not allowed"
 | 
			
		||||
msgstr "Каардынатны выраз змяшчае забаронены знак \"%s\""
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1806
 | 
			
		||||
#: ../src/ui/theme.c:1807
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Coordinate expression contains floating point number '%s' which could not be "
 | 
			
		||||
"parsed"
 | 
			
		||||
msgstr "Каардынатны выраз змяшчае незразумелы лік з нефіксаванай коскай \"%s\""
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1820
 | 
			
		||||
#: ../src/ui/theme.c:1821
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Coordinate expression contains integer '%s' which could not be parsed"
 | 
			
		||||
msgstr "Каардынатны выраз змяшчае незразумелы цэлы лік \"%s\""
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1941
 | 
			
		||||
#: ../src/ui/theme.c:1942
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Coordinate expression contained unknown operator at the start of this text: "
 | 
			
		||||
@@ -1077,17 +1085,17 @@ msgid ""
 | 
			
		||||
msgstr ""
 | 
			
		||||
"Каардынатны выраз змяшчае невядомы аператар у пачатку гэтага тэксту: \"%s\""
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1998
 | 
			
		||||
#: ../src/ui/theme.c:1999
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Coordinate expression was empty or not understood"
 | 
			
		||||
msgstr "Каардынатны выраз пусты ці незразумелы"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:2111 ../src/ui/theme.c:2121 ../src/ui/theme.c:2155
 | 
			
		||||
#: ../src/ui/theme.c:2112 ../src/ui/theme.c:2122 ../src/ui/theme.c:2156
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Coordinate expression results in division by zero"
 | 
			
		||||
msgstr "Каардынатны выраз вымагае дзялення на нуль"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:2163
 | 
			
		||||
#: ../src/ui/theme.c:2164
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Coordinate expression tries to use mod operator on a floating-point number"
 | 
			
		||||
@@ -1095,24 +1103,24 @@ msgstr ""
 | 
			
		||||
"Каардынатны выраз спрабуе ўжыць аператар дзялення па модулі для ліку з "
 | 
			
		||||
"нефіксаванай коскай"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:2219
 | 
			
		||||
#: ../src/ui/theme.c:2220
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Coordinate expression has an operator \"%s\" where an operand was expected"
 | 
			
		||||
msgstr ""
 | 
			
		||||
"У каардынатным выразе ўжыты аператар \"%s\" там, дзе мусіў быць аперанд"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:2228
 | 
			
		||||
#: ../src/ui/theme.c:2229
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Coordinate expression had an operand where an operator was expected"
 | 
			
		||||
msgstr "У каардынатным выразе ўжыты аперанд там, дзе мусіў быць аператар"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:2236
 | 
			
		||||
#: ../src/ui/theme.c:2237
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Coordinate expression ended with an operator instead of an operand"
 | 
			
		||||
msgstr "Каардынатны выраз заканчваецца аператарам, а не аперандам"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:2246
 | 
			
		||||
#: ../src/ui/theme.c:2247
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Coordinate expression has operator \"%c\" following operator \"%c\" with no "
 | 
			
		||||
@@ -1121,41 +1129,41 @@ msgstr ""
 | 
			
		||||
"У каардынатным выразе за аператарам \"%c\" ідзе аператар \"%c\", але паміж "
 | 
			
		||||
"імі няма аперанда"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:2397 ../src/ui/theme.c:2442
 | 
			
		||||
#: ../src/ui/theme.c:2398 ../src/ui/theme.c:2443
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Coordinate expression had unknown variable or constant \"%s\""
 | 
			
		||||
msgstr "У каардынатным выразе невядомая зменная альбо канстанта \"%s\""
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:2496
 | 
			
		||||
#: ../src/ui/theme.c:2497
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Coordinate expression parser overflowed its buffer."
 | 
			
		||||
msgstr "Прылада для разбору каардынатных выразаў перапоўніла свой буфер."
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:2525
 | 
			
		||||
#: ../src/ui/theme.c:2526
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Coordinate expression had a close parenthesis with no open parenthesis"
 | 
			
		||||
msgstr ""
 | 
			
		||||
"У каардынатным выразе ўжытыя дужкі, якія закрываюцца, але няма тых, якія б "
 | 
			
		||||
"адкрываліся"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:2589
 | 
			
		||||
#: ../src/ui/theme.c:2590
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Coordinate expression had an open parenthesis with no close parenthesis"
 | 
			
		||||
msgstr ""
 | 
			
		||||
"У каардынатным выразе ўжытыя дужкі, якія адкрываюцца, але няма тых, якія б "
 | 
			
		||||
"закрываліся"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:2600
 | 
			
		||||
#: ../src/ui/theme.c:2601
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Coordinate expression doesn't seem to have any operators or operands"
 | 
			
		||||
msgstr "У каардынатным выразе няма ні аператараў, ні аперандаў"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:2813 ../src/ui/theme.c:2833 ../src/ui/theme.c:2853
 | 
			
		||||
#: ../src/ui/theme.c:2814 ../src/ui/theme.c:2834 ../src/ui/theme.c:2854
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Theme contained an expression that resulted in an error: %s\n"
 | 
			
		||||
msgstr "Матыў аздаблення змяшчае выраз, які стаў прычынай памылкі: %s\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:4499
 | 
			
		||||
#: ../src/ui/theme.c:4500
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"<button function=\"%s\" state=\"%s\" draw_ops=\"whatever\"/> must be "
 | 
			
		||||
@@ -1164,25 +1172,25 @@ msgstr ""
 | 
			
		||||
"Для гэтага стылю рамкі трэба вызначыць <button function=\"%s\" state=\"%s\" "
 | 
			
		||||
"draw_ops=\"whatever\"/>"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:5010 ../src/ui/theme.c:5035
 | 
			
		||||
#: ../src/ui/theme.c:5011 ../src/ui/theme.c:5036
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Missing <frame state=\"%s\" resize=\"%s\" focus=\"%s\" style=\"whatever\"/>"
 | 
			
		||||
msgstr ""
 | 
			
		||||
"Няма <frame state=\"%s\" resize=\"%s\" focus=\"%s\" style=\"што-небудзь\"/>"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:5083
 | 
			
		||||
#: ../src/ui/theme.c:5082
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Failed to load theme \"%s\": %s\n"
 | 
			
		||||
msgstr "Не ўдалося загрузіць матыў аздаблення \"%s\": %s\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:5219 ../src/ui/theme.c:5226 ../src/ui/theme.c:5233
 | 
			
		||||
#: ../src/ui/theme.c:5240 ../src/ui/theme.c:5247
 | 
			
		||||
#: ../src/ui/theme.c:5218 ../src/ui/theme.c:5225 ../src/ui/theme.c:5232
 | 
			
		||||
#: ../src/ui/theme.c:5239 ../src/ui/theme.c:5246
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "No <%s> set for theme \"%s\""
 | 
			
		||||
msgstr "Для матыву аздаблення \"%2$s\" не прызначана <%1$s>"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:5255
 | 
			
		||||
#: ../src/ui/theme.c:5254
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"No frame style set for window type \"%s\" in theme \"%s\", add a <window "
 | 
			
		||||
@@ -1191,7 +1199,7 @@ msgstr ""
 | 
			
		||||
"Стыль рамкі не вызначаны для вокнаў тыпу \"%s\" для матыву аздаблення \"%s"
 | 
			
		||||
"\". Дадайце <window type=\"%s\" style_set=\"штосьці\"/>."
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:5662 ../src/ui/theme.c:5724 ../src/ui/theme.c:5787
 | 
			
		||||
#: ../src/ui/theme.c:5661 ../src/ui/theme.c:5723 ../src/ui/theme.c:5786
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"User-defined constants must begin with a capital letter; \"%s\" does not"
 | 
			
		||||
@@ -1199,7 +1207,7 @@ msgstr ""
 | 
			
		||||
"Назвы канстантаў, вызначаных карыстальнікам, мусяць пачынацца з вялікай "
 | 
			
		||||
"літары. \"%s\" не адпавядае гэтаму патрабаванню."
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:5670 ../src/ui/theme.c:5732 ../src/ui/theme.c:5795
 | 
			
		||||
#: ../src/ui/theme.c:5669 ../src/ui/theme.c:5731 ../src/ui/theme.c:5794
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Constant \"%s\" has already been defined"
 | 
			
		||||
msgstr "Канстанта \"%s\" ужо азначана"
 | 
			
		||||
@@ -1585,207 +1593,8 @@ msgstr "Выкарыстанне тэксту ўнутры элемента <%s>
 | 
			
		||||
msgid "<%s> specified twice for this theme"
 | 
			
		||||
msgstr "<%s> двойчы вызначаны для гэтага матыву аздаблення"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-parser.c:4334
 | 
			
		||||
#: ../src/ui/theme-parser.c:4336
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Failed to find a valid file for theme %s\n"
 | 
			
		||||
msgstr "Памылка пошуку правільнага файла для матыву аздаблення %s\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:99
 | 
			
		||||
msgid "_Windows"
 | 
			
		||||
msgstr "_Вокны"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:100
 | 
			
		||||
msgid "_Dialog"
 | 
			
		||||
msgstr "_Дыялогавае акенца"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:101
 | 
			
		||||
msgid "_Modal dialog"
 | 
			
		||||
msgstr "_Мадальнае дыялогавае акенца"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:102
 | 
			
		||||
msgid "_Utility"
 | 
			
		||||
msgstr "_Дапаможная праграма"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:103
 | 
			
		||||
msgid "_Splashscreen"
 | 
			
		||||
msgstr "_Экранная застаўка"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:104
 | 
			
		||||
msgid "_Top dock"
 | 
			
		||||
msgstr "_Верхняя ўбудова"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:105
 | 
			
		||||
msgid "_Bottom dock"
 | 
			
		||||
msgstr "_Ніжняя ўбудова"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:106
 | 
			
		||||
msgid "_Left dock"
 | 
			
		||||
msgstr "_Левая ўбудова"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:107
 | 
			
		||||
msgid "_Right dock"
 | 
			
		||||
msgstr "_Правая ўбудова"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:108
 | 
			
		||||
msgid "_All docks"
 | 
			
		||||
msgstr "_Усе ўбудовы"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:109
 | 
			
		||||
msgid "Des_ktop"
 | 
			
		||||
msgstr "_Стол"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:115
 | 
			
		||||
msgid "Open another one of these windows"
 | 
			
		||||
msgstr "Адкрыць чарговае з гэтых вокнаў"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:117
 | 
			
		||||
msgid "This is a demo button with an 'open' icon"
 | 
			
		||||
msgstr "Гэта дэманстрацыйная кнопка са значком \"Адкрыць\""
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:119
 | 
			
		||||
msgid "This is a demo button with a 'quit' icon"
 | 
			
		||||
msgstr "Гэта дэманстрацыйная кнопка са значком \"Выйсці\""
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:248
 | 
			
		||||
msgid "This is a sample message in a sample dialog"
 | 
			
		||||
msgstr "Гэта ўзорнае паведамленне ва ўзорным дыялогавым акенцы"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:328
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Fake menu item %d\n"
 | 
			
		||||
msgstr "Несапраўдны пункт меню %d\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:363
 | 
			
		||||
msgid "Border-only window"
 | 
			
		||||
msgstr "Акно толькі з аблямоўкай"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:365
 | 
			
		||||
msgid "Bar"
 | 
			
		||||
msgstr "Стужка"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:382
 | 
			
		||||
msgid "Normal Application Window"
 | 
			
		||||
msgstr "Звычайнае акно праграмы"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:386
 | 
			
		||||
msgid "Dialog Box"
 | 
			
		||||
msgstr "Дыялогавае акенца"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:390
 | 
			
		||||
msgid "Modal Dialog Box"
 | 
			
		||||
msgstr "Мадальнае дыялогавае акенца"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:394
 | 
			
		||||
msgid "Utility Palette"
 | 
			
		||||
msgstr "Дапаможная палітра"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:398
 | 
			
		||||
msgid "Torn-off Menu"
 | 
			
		||||
msgstr "Адчэпленае меню"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:402
 | 
			
		||||
msgid "Border"
 | 
			
		||||
msgstr "Аблямоўка"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:406
 | 
			
		||||
msgid "Attached Modal Dialog"
 | 
			
		||||
msgstr "Прычапленае мадальнае дыялогавае акенца"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:737
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Button layout test %d"
 | 
			
		||||
msgstr "Выпрабаванне размяшчэння кнопак %d"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:766
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "%g milliseconds to draw one window frame"
 | 
			
		||||
msgstr "%g мілісекунд, каб намаляваць адну рамку акна"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:811
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Usage: metacity-theme-viewer [THEMENAME]\n"
 | 
			
		||||
msgstr "Правілы карыстання: metacity-theme-viewer [НАЗВА_МАТЫВУ]\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:818
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Error loading theme: %s\n"
 | 
			
		||||
msgstr "Памылка загрузкі матыву аздаблення: %s\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:824
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Loaded theme \"%s\" in %g seconds\n"
 | 
			
		||||
msgstr "Матыў аздаблення \"%s\" загружаны за %g секунд\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:869
 | 
			
		||||
msgid "Normal Title Font"
 | 
			
		||||
msgstr "Звычайны шрыфт загалоўка"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:875
 | 
			
		||||
msgid "Small Title Font"
 | 
			
		||||
msgstr "Маленькі шрыфт загалоўка"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:881
 | 
			
		||||
msgid "Large Title Font"
 | 
			
		||||
msgstr "Вялікі шрыфт загалоўка"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:886
 | 
			
		||||
msgid "Button Layouts"
 | 
			
		||||
msgstr "Размяшчэнне кнопак"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:891
 | 
			
		||||
msgid "Benchmark"
 | 
			
		||||
msgstr "Выпрабаванне"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:947
 | 
			
		||||
msgid "Window Title Goes Here"
 | 
			
		||||
msgstr "Месца для загалоўка акна"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:1053
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Drew %d frames in %g client-side seconds (%g milliseconds per frame) and %g "
 | 
			
		||||
"seconds wall clock time including X server resources (%g milliseconds per "
 | 
			
		||||
"frame)\n"
 | 
			
		||||
msgstr ""
 | 
			
		||||
"Намалявана %d рамак цягам %g секунд кліенцкага часу (%g мілісекунд на рамку) "
 | 
			
		||||
"і %g секунд каляндарнага часу, уключна з рэсурсамі X-сервера (%g мілісекунд "
 | 
			
		||||
"на рамку)\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:1273
 | 
			
		||||
msgid "position expression test returned TRUE but set error"
 | 
			
		||||
msgstr "выпрабаванне выразу пазіцыі вярнула TRUE, але паведаміла аб памылцы"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:1275
 | 
			
		||||
msgid "position expression test returned FALSE but didn't set error"
 | 
			
		||||
msgstr ""
 | 
			
		||||
"выпрабаванне выразу пазіцыі вярнула FALSE, але не паведаміла аб памылцы"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:1279
 | 
			
		||||
msgid "Error was expected but none given"
 | 
			
		||||
msgstr "Чакалася памылка, але звесткі не атрыманыя"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:1281
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Error %d was expected but %d given"
 | 
			
		||||
msgstr "Чакалася памылка %d, але атрымана %d"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:1287
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Error not expected but one was returned: %s"
 | 
			
		||||
msgstr "Атрымана нечаканая памылка: %s"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:1291
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "x value was %d, %d was expected"
 | 
			
		||||
msgstr "X-значэнне было %d, а чакалася %d"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:1294
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "y value was %d, %d was expected"
 | 
			
		||||
msgstr "Y-значэнне было %d, а чакалася %d"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:1359
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "%d coordinate expressions parsed in %g seconds (%g seconds average)\n"
 | 
			
		||||
msgstr ""
 | 
			
		||||
"%d каардынатных выразаў разабраныя за %g секунд (у сярэднім %g секунд)\n"
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										231
									
								
								po/et.po
									
									
									
									
									
								
							
							
						
						
									
										231
									
								
								po/et.po
									
									
									
									
									
								
							@@ -14,8 +14,8 @@ msgstr ""
 | 
			
		||||
"Project-Id-Version: mutter MASTER\n"
 | 
			
		||||
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
 | 
			
		||||
"product=mutter&keywords=I18N+L10N&component=general\n"
 | 
			
		||||
"POT-Creation-Date: 2013-03-12 18:53+0000\n"
 | 
			
		||||
"PO-Revision-Date: 2013-03-12 20:55+0300\n"
 | 
			
		||||
"POT-Creation-Date: 2013-09-10 15:25+0000\n"
 | 
			
		||||
"PO-Revision-Date: 2013-09-11 23:20+0300\n"
 | 
			
		||||
"Last-Translator: Mattias Põldaru <mahfiaz@gmail.com>\n"
 | 
			
		||||
"Language-Team: Estonian <>\n"
 | 
			
		||||
"Language: et\n"
 | 
			
		||||
@@ -23,6 +23,7 @@ msgstr ""
 | 
			
		||||
"Content-Type: text/plain; charset=UTF-8\n"
 | 
			
		||||
"Content-Transfer-Encoding: 8bit\n"
 | 
			
		||||
"Plural-Forms: nplurals=2; plural=(n!=1);\n"
 | 
			
		||||
"X-Generator: Poedit 1.5.4\n"
 | 
			
		||||
 | 
			
		||||
msgid "Navigation"
 | 
			
		||||
msgstr "Navigeerimine"
 | 
			
		||||
@@ -249,6 +250,17 @@ msgid ""
 | 
			
		||||
msgstr ""
 | 
			
		||||
"Teemat ei leitud! Veendu, et %s on olemas ja sisaldab harilikke teemasid.\n"
 | 
			
		||||
 | 
			
		||||
msgid "Built-in display"
 | 
			
		||||
msgstr "Sisseehitatud kuva"
 | 
			
		||||
 | 
			
		||||
#. TRANSLATORS: this is a monitor name (in case we don't know
 | 
			
		||||
#. the vendor), it's Unknown followed by a size in inches,
 | 
			
		||||
#. like 'Unknown 15"'
 | 
			
		||||
#.
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Unknown %s"
 | 
			
		||||
msgstr "Tundmatu %s"
 | 
			
		||||
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"mutter %s\n"
 | 
			
		||||
@@ -381,7 +393,6 @@ msgstr "Tõrge logifaili %s avamisel funktsiooniga fdopen(): %s\n"
 | 
			
		||||
msgid "Opened log file %s\n"
 | 
			
		||||
msgstr "Avati logifail %s\n"
 | 
			
		||||
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Mutter was compiled without support for verbose mode\n"
 | 
			
		||||
msgstr "Mutter kompileeriti ilma jutuka režiimi toeta\n"
 | 
			
		||||
 | 
			
		||||
@@ -572,10 +583,6 @@ msgstr "Akna valimine tabulaatori hüpikaknalt"
 | 
			
		||||
msgid "Cancel tab popup"
 | 
			
		||||
msgstr "Tabulaatori hüpikakna katkestamine"
 | 
			
		||||
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Usage: %s\n"
 | 
			
		||||
msgstr "Kasutamine: %s\n"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
msgid "Mi_nimize"
 | 
			
		||||
msgstr "_Minimeeri"
 | 
			
		||||
@@ -1281,159 +1288,151 @@ msgstr "Selle teema jaoks on <%s> määratud kaks korda"
 | 
			
		||||
msgid "Failed to find a valid file for theme %s\n"
 | 
			
		||||
msgstr "Tõrge %s teema jaoks korrektse faili leidmisel\n"
 | 
			
		||||
 | 
			
		||||
msgid "_Windows"
 | 
			
		||||
msgstr "_Aknad"
 | 
			
		||||
#~ msgid "Usage: %s\n"
 | 
			
		||||
#~ msgstr "Kasutamine: %s\n"
 | 
			
		||||
 | 
			
		||||
msgid "_Dialog"
 | 
			
		||||
msgstr "_Dialoog"
 | 
			
		||||
#~ msgid "_Windows"
 | 
			
		||||
#~ msgstr "_Aknad"
 | 
			
		||||
 | 
			
		||||
msgid "_Modal dialog"
 | 
			
		||||
msgstr "_Modaaldialoog"
 | 
			
		||||
#~ msgid "_Dialog"
 | 
			
		||||
#~ msgstr "_Dialoog"
 | 
			
		||||
 | 
			
		||||
msgid "_Utility"
 | 
			
		||||
msgstr "_Utiliit"
 | 
			
		||||
#~ msgid "_Modal dialog"
 | 
			
		||||
#~ msgstr "_Modaaldialoog"
 | 
			
		||||
 | 
			
		||||
msgid "_Splashscreen"
 | 
			
		||||
msgstr "_Käivitusekraan"
 | 
			
		||||
#~ msgid "_Utility"
 | 
			
		||||
#~ msgstr "_Utiliit"
 | 
			
		||||
 | 
			
		||||
msgid "_Top dock"
 | 
			
		||||
msgstr "Ü_lemine dokk"
 | 
			
		||||
#~ msgid "_Splashscreen"
 | 
			
		||||
#~ msgstr "_Käivitusekraan"
 | 
			
		||||
 | 
			
		||||
msgid "_Bottom dock"
 | 
			
		||||
msgstr "_Alumine dokk"
 | 
			
		||||
#~ msgid "_Top dock"
 | 
			
		||||
#~ msgstr "Ü_lemine dokk"
 | 
			
		||||
 | 
			
		||||
msgid "_Left dock"
 | 
			
		||||
msgstr "_Vasak dokk"
 | 
			
		||||
#~ msgid "_Bottom dock"
 | 
			
		||||
#~ msgstr "_Alumine dokk"
 | 
			
		||||
 | 
			
		||||
msgid "_Right dock"
 | 
			
		||||
msgstr "_Parem dokk"
 | 
			
		||||
#~ msgid "_Left dock"
 | 
			
		||||
#~ msgstr "_Vasak dokk"
 | 
			
		||||
 | 
			
		||||
msgid "_All docks"
 | 
			
		||||
msgstr "_Kõik dokid"
 | 
			
		||||
#~ msgid "_Right dock"
 | 
			
		||||
#~ msgstr "_Parem dokk"
 | 
			
		||||
 | 
			
		||||
msgid "Des_ktop"
 | 
			
		||||
msgstr "_Töölaud"
 | 
			
		||||
#~ msgid "_All docks"
 | 
			
		||||
#~ msgstr "_Kõik dokid"
 | 
			
		||||
 | 
			
		||||
msgid "Open another one of these windows"
 | 
			
		||||
msgstr "Ava neist akendest järgmine"
 | 
			
		||||
#~ msgid "Des_ktop"
 | 
			
		||||
#~ msgstr "_Töölaud"
 | 
			
		||||
 | 
			
		||||
msgid "This is a demo button with an 'open' icon"
 | 
			
		||||
msgstr "See on näidisnupp koos 'ava' ikooniga"
 | 
			
		||||
#~ msgid "Open another one of these windows"
 | 
			
		||||
#~ msgstr "Ava neist akendest järgmine"
 | 
			
		||||
 | 
			
		||||
msgid "This is a demo button with a 'quit' icon"
 | 
			
		||||
msgstr "See on näidisnupp koos 'lõpeta' ikooniga"
 | 
			
		||||
#~ msgid "This is a demo button with an 'open' icon"
 | 
			
		||||
#~ msgstr "See on näidisnupp koos 'ava' ikooniga"
 | 
			
		||||
 | 
			
		||||
msgid "This is a sample message in a sample dialog"
 | 
			
		||||
msgstr "See on näidisteade näidisdialoogis"
 | 
			
		||||
#~ msgid "This is a demo button with a 'quit' icon"
 | 
			
		||||
#~ msgstr "See on näidisnupp koos 'lõpeta' ikooniga"
 | 
			
		||||
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Fake menu item %d\n"
 | 
			
		||||
msgstr "Võltsitud menüüpunkt %d\n"
 | 
			
		||||
#~ msgid "This is a sample message in a sample dialog"
 | 
			
		||||
#~ msgstr "See on näidisteade näidisdialoogis"
 | 
			
		||||
 | 
			
		||||
msgid "Border-only window"
 | 
			
		||||
msgstr "Ainult raamiga aken"
 | 
			
		||||
#~ msgid "Fake menu item %d\n"
 | 
			
		||||
#~ msgstr "Võltsitud menüüpunkt %d\n"
 | 
			
		||||
 | 
			
		||||
msgid "Bar"
 | 
			
		||||
msgstr "Riba"
 | 
			
		||||
#~ msgid "Border-only window"
 | 
			
		||||
#~ msgstr "Ainult raamiga aken"
 | 
			
		||||
 | 
			
		||||
msgid "Normal Application Window"
 | 
			
		||||
msgstr "Tavaline rakenduseaken"
 | 
			
		||||
#~ msgid "Bar"
 | 
			
		||||
#~ msgstr "Riba"
 | 
			
		||||
 | 
			
		||||
msgid "Dialog Box"
 | 
			
		||||
msgstr "Dialoogikast"
 | 
			
		||||
#~ msgid "Normal Application Window"
 | 
			
		||||
#~ msgstr "Tavaline rakenduseaken"
 | 
			
		||||
 | 
			
		||||
msgid "Modal Dialog Box"
 | 
			
		||||
msgstr "Modaalne dialoogikast"
 | 
			
		||||
#~ msgid "Dialog Box"
 | 
			
		||||
#~ msgstr "Dialoogikast"
 | 
			
		||||
 | 
			
		||||
msgid "Utility Palette"
 | 
			
		||||
msgstr "Rakendite palett"
 | 
			
		||||
#~ msgid "Modal Dialog Box"
 | 
			
		||||
#~ msgstr "Modaalne dialoogikast"
 | 
			
		||||
 | 
			
		||||
msgid "Torn-off Menu"
 | 
			
		||||
msgstr "Ärarebitav menüü"
 | 
			
		||||
#~ msgid "Utility Palette"
 | 
			
		||||
#~ msgstr "Rakendite palett"
 | 
			
		||||
 | 
			
		||||
msgid "Border"
 | 
			
		||||
msgstr "Raam"
 | 
			
		||||
#~ msgid "Torn-off Menu"
 | 
			
		||||
#~ msgstr "Ärarebitav menüü"
 | 
			
		||||
 | 
			
		||||
msgid "Attached Modal Dialog"
 | 
			
		||||
msgstr "Kinnistatud modaaldialoog"
 | 
			
		||||
#~ msgid "Border"
 | 
			
		||||
#~ msgstr "Raam"
 | 
			
		||||
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Button layout test %d"
 | 
			
		||||
msgstr "Nuppude paigutuse test %d"
 | 
			
		||||
#~ msgid "Attached Modal Dialog"
 | 
			
		||||
#~ msgstr "Kinnistatud modaaldialoog"
 | 
			
		||||
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "%g milliseconds to draw one window frame"
 | 
			
		||||
msgstr "%g millisekundit kulub ühe akna raami joonistamiseks"
 | 
			
		||||
#~ msgid "Button layout test %d"
 | 
			
		||||
#~ msgstr "Nuppude paigutuse test %d"
 | 
			
		||||
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Usage: metacity-theme-viewer [THEMENAME]\n"
 | 
			
		||||
msgstr "Kasutamine: metacity-theme-viewer [TEEMANIMI]\n"
 | 
			
		||||
#~ msgid "%g milliseconds to draw one window frame"
 | 
			
		||||
#~ msgstr "%g millisekundit kulub ühe akna raami joonistamiseks"
 | 
			
		||||
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Error loading theme: %s\n"
 | 
			
		||||
msgstr "Viga teema laadimisel: %s\n"
 | 
			
		||||
#~ msgid "Usage: metacity-theme-viewer [THEMENAME]\n"
 | 
			
		||||
#~ msgstr "Kasutamine: metacity-theme-viewer [TEEMANIMI]\n"
 | 
			
		||||
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Loaded theme \"%s\" in %g seconds\n"
 | 
			
		||||
msgstr "Teema \"%s\" laaditi %g sekundiga\n"
 | 
			
		||||
#~ msgid "Error loading theme: %s\n"
 | 
			
		||||
#~ msgstr "Viga teema laadimisel: %s\n"
 | 
			
		||||
 | 
			
		||||
msgid "Normal Title Font"
 | 
			
		||||
msgstr "Tiitli tavasuurusega kirjatüüp"
 | 
			
		||||
#~ msgid "Loaded theme \"%s\" in %g seconds\n"
 | 
			
		||||
#~ msgstr "Teema \"%s\" laaditi %g sekundiga\n"
 | 
			
		||||
 | 
			
		||||
msgid "Small Title Font"
 | 
			
		||||
msgstr "Tiitli väike kirjatüüp"
 | 
			
		||||
#~ msgid "Normal Title Font"
 | 
			
		||||
#~ msgstr "Tiitli tavasuurusega kirjatüüp"
 | 
			
		||||
 | 
			
		||||
msgid "Large Title Font"
 | 
			
		||||
msgstr "Tiitli suur kirjatüüp"
 | 
			
		||||
#~ msgid "Small Title Font"
 | 
			
		||||
#~ msgstr "Tiitli väike kirjatüüp"
 | 
			
		||||
 | 
			
		||||
msgid "Button Layouts"
 | 
			
		||||
msgstr "Nuppude paigutus"
 | 
			
		||||
#~ msgid "Large Title Font"
 | 
			
		||||
#~ msgstr "Tiitli suur kirjatüüp"
 | 
			
		||||
 | 
			
		||||
msgid "Benchmark"
 | 
			
		||||
msgstr "Jõudlus"
 | 
			
		||||
#~ msgid "Button Layouts"
 | 
			
		||||
#~ msgstr "Nuppude paigutus"
 | 
			
		||||
 | 
			
		||||
msgid "Window Title Goes Here"
 | 
			
		||||
msgstr "Siia tuleb akna pealkiri"
 | 
			
		||||
#~ msgid "Benchmark"
 | 
			
		||||
#~ msgstr "Jõudlus"
 | 
			
		||||
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Drew %d frames in %g client-side seconds (%g milliseconds per frame) and %g "
 | 
			
		||||
"seconds wall clock time including X server resources (%g milliseconds per "
 | 
			
		||||
"frame)\n"
 | 
			
		||||
msgstr ""
 | 
			
		||||
"Joonistati %d kaadrit %g kliendi-kella sekundiga (%g millisekundit kaadrile) "
 | 
			
		||||
"ja %g sekundiga seinakella järgi, millesse on kaasatud X-serveri "
 | 
			
		||||
"ressursikasutus (%g millisekundit kaadrile)\n"
 | 
			
		||||
#~ msgid "Window Title Goes Here"
 | 
			
		||||
#~ msgstr "Siia tuleb akna pealkiri"
 | 
			
		||||
 | 
			
		||||
msgid "position expression test returned TRUE but set error"
 | 
			
		||||
msgstr "asukoha avaldise kontroll tagastas TÕENE, aga määras vea"
 | 
			
		||||
#~ msgid ""
 | 
			
		||||
#~ "Drew %d frames in %g client-side seconds (%g milliseconds per frame) and "
 | 
			
		||||
#~ "%g seconds wall clock time including X server resources (%g milliseconds "
 | 
			
		||||
#~ "per frame)\n"
 | 
			
		||||
#~ msgstr ""
 | 
			
		||||
#~ "Joonistati %d kaadrit %g kliendi-kella sekundiga (%g millisekundit "
 | 
			
		||||
#~ "kaadrile) ja %g sekundiga seinakella järgi, millesse on kaasatud X-"
 | 
			
		||||
#~ "serveri ressursikasutus (%g millisekundit kaadrile)\n"
 | 
			
		||||
 | 
			
		||||
msgid "position expression test returned FALSE but didn't set error"
 | 
			
		||||
msgstr "asukoha avaldise kontroll tagastas VÄÄR, aga ei määranud viga"
 | 
			
		||||
#~ msgid "position expression test returned TRUE but set error"
 | 
			
		||||
#~ msgstr "asukoha avaldise kontroll tagastas TÕENE, aga määras vea"
 | 
			
		||||
 | 
			
		||||
msgid "Error was expected but none given"
 | 
			
		||||
msgstr "Oodati viga, aga ühtegi ei edastatud"
 | 
			
		||||
#~ msgid "position expression test returned FALSE but didn't set error"
 | 
			
		||||
#~ msgstr "asukoha avaldise kontroll tagastas VÄÄR, aga ei määranud viga"
 | 
			
		||||
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Error %d was expected but %d given"
 | 
			
		||||
msgstr "Oodati viga %d, aga edastati viga %d"
 | 
			
		||||
#~ msgid "Error was expected but none given"
 | 
			
		||||
#~ msgstr "Oodati viga, aga ühtegi ei edastatud"
 | 
			
		||||
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Error not expected but one was returned: %s"
 | 
			
		||||
msgstr "Viga ei oodatud, aga üks edastati: %s"
 | 
			
		||||
#~ msgid "Error %d was expected but %d given"
 | 
			
		||||
#~ msgstr "Oodati viga %d, aga edastati viga %d"
 | 
			
		||||
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "x value was %d, %d was expected"
 | 
			
		||||
msgstr "x väärtus oli %d, oodati väärtust %d"
 | 
			
		||||
#~ msgid "Error not expected but one was returned: %s"
 | 
			
		||||
#~ msgstr "Viga ei oodatud, aga üks edastati: %s"
 | 
			
		||||
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "y value was %d, %d was expected"
 | 
			
		||||
msgstr "y väärtus oli %d, oodati väärtust %d"
 | 
			
		||||
#~ msgid "x value was %d, %d was expected"
 | 
			
		||||
#~ msgstr "x väärtus oli %d, oodati väärtust %d"
 | 
			
		||||
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "%d coordinate expressions parsed in %g seconds (%g seconds average)\n"
 | 
			
		||||
msgstr ""
 | 
			
		||||
"%d koordinaatide avaldis töödeldi %g sekundiga (keskmine %g sekundit)\n"
 | 
			
		||||
#~ msgid "y value was %d, %d was expected"
 | 
			
		||||
#~ msgstr "y väärtus oli %d, oodati väärtust %d"
 | 
			
		||||
 | 
			
		||||
#~ msgid ""
 | 
			
		||||
#~ "%d coordinate expressions parsed in %g seconds (%g seconds average)\n"
 | 
			
		||||
#~ msgstr ""
 | 
			
		||||
#~ "%d koordinaatide avaldis töödeldi %g sekundiga (keskmine %g sekundit)\n"
 | 
			
		||||
 | 
			
		||||
#~ msgid "Minimize window"
 | 
			
		||||
#~ msgstr "Akna minimeerimine"
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										327
									
								
								po/id.po
									
									
									
									
									
								
							
							
						
						
									
										327
									
								
								po/id.po
									
									
									
									
									
								
							@@ -11,15 +11,15 @@ msgstr ""
 | 
			
		||||
"Project-Id-Version: mutter master\n"
 | 
			
		||||
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
 | 
			
		||||
"product=mutter&keywords=I18N+L10N&component=general\n"
 | 
			
		||||
"POT-Creation-Date: 2013-03-28 10:28+0000\n"
 | 
			
		||||
"PO-Revision-Date: 2013-03-30 11:24+0700\n"
 | 
			
		||||
"POT-Creation-Date: 2013-08-18 20:03+0000\n"
 | 
			
		||||
"PO-Revision-Date: 2013-09-14 15:44+0700\n"
 | 
			
		||||
"Last-Translator: Andika Triwidada <andika@gmail.com>\n"
 | 
			
		||||
"Language-Team: Indonesian <gnome@i15n.org>\n"
 | 
			
		||||
"Language: id\n"
 | 
			
		||||
"MIME-Version: 1.0\n"
 | 
			
		||||
"Content-Type: text/plain; charset=UTF-8\n"
 | 
			
		||||
"Content-Transfer-Encoding: 8bit\n"
 | 
			
		||||
"X-Generator: Poedit 1.5.5\n"
 | 
			
		||||
"X-Generator: Poedit 1.5.7\n"
 | 
			
		||||
"Plural-Forms: nplurals=1; plural=0;\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/50-mutter-navigation.xml.in.h:1
 | 
			
		||||
@@ -212,7 +212,7 @@ msgstr "Tampilan dipisah ke kanan"
 | 
			
		||||
 | 
			
		||||
#. 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:568
 | 
			
		||||
#: ../src/compositor/compositor.c:589
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Another compositing manager is already running on screen %i on display \"%s"
 | 
			
		||||
@@ -220,7 +220,7 @@ msgid ""
 | 
			
		||||
msgstr ""
 | 
			
		||||
"Manajer komposit lain telah berjalan pada layar %i pada tampilan \"%s\"."
 | 
			
		||||
 | 
			
		||||
#: ../src/compositor/meta-background.c:1065
 | 
			
		||||
#: ../src/compositor/meta-background.c:1076
 | 
			
		||||
msgid "background texture could not be created from file"
 | 
			
		||||
msgstr "tekstur latar tak bisa dibuat dari berkas"
 | 
			
		||||
 | 
			
		||||
@@ -257,24 +257,24 @@ msgstr "_Tunggu"
 | 
			
		||||
msgid "_Force Quit"
 | 
			
		||||
msgstr "_Matikan Paksa"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/display.c:401
 | 
			
		||||
#: ../src/core/display.c:421
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Missing %s extension required for compositing"
 | 
			
		||||
msgstr "Kehilangan ekstensi %s yang diperlukan untuk pengkomposisian"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/display.c:493
 | 
			
		||||
#: ../src/core/display.c:513
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Failed to open X Window System display '%s'\n"
 | 
			
		||||
msgstr "Gagal membuka tampilan X Window System '%s'\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/keybindings.c:935
 | 
			
		||||
#: ../src/core/keybindings.c:1136
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Some other program is already using the key %s with modifiers %x as a "
 | 
			
		||||
"binding\n"
 | 
			
		||||
msgstr "Ada program lain yang menggunakan tombol %s dengan kombinasi %x\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/keybindings.c:1135
 | 
			
		||||
#: ../src/core/keybindings.c:1333
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "\"%s\" is not a valid accelerator\n"
 | 
			
		||||
msgstr "\"%s\" bukan akselerator yang valid\n"
 | 
			
		||||
@@ -314,6 +314,19 @@ msgid ""
 | 
			
		||||
"Could not find a theme! Be sure %s exists and contains the usual themes.\n"
 | 
			
		||||
msgstr "Tak menemukan tema! Pastikan %s ada dan berisi tema yang biasa.\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/monitor.c:711
 | 
			
		||||
msgid "Built-in display"
 | 
			
		||||
msgstr "Tampilan bawaan"
 | 
			
		||||
 | 
			
		||||
#. TRANSLATORS: this is a monitor name (in case we don't know
 | 
			
		||||
#. the vendor), it's Unknown followed by a size in inches,
 | 
			
		||||
#. like 'Unknown 15"'
 | 
			
		||||
#.
 | 
			
		||||
#: ../src/core/monitor.c:739
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Unknown %s"
 | 
			
		||||
msgstr "%s tidak dikenal"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/mutter.c:40
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
@@ -338,7 +351,7 @@ msgstr "Cetak versi"
 | 
			
		||||
msgid "Mutter plugin to use"
 | 
			
		||||
msgstr "Pengaya Mutter yang dipakai"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/prefs.c:1095
 | 
			
		||||
#: ../src/core/prefs.c:1202
 | 
			
		||||
msgid ""
 | 
			
		||||
"Workarounds for broken applications disabled. Some applications may not "
 | 
			
		||||
"behave properly.\n"
 | 
			
		||||
@@ -346,12 +359,12 @@ msgstr ""
 | 
			
		||||
"Pencegahan kesalahan bagi aplikasi yang rusak sedang dinonaktifkan. Mungkin "
 | 
			
		||||
"nanti ada beberapa aplikasi yang akan bertingkah aneh.\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/prefs.c:1170
 | 
			
		||||
#: ../src/core/prefs.c:1277
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Could not parse font description \"%s\" from GSettings key %s\n"
 | 
			
		||||
msgstr "Tak dapat mengurai deskripsi fonta \"%s\" dari kunci GSettings %s\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/prefs.c:1236
 | 
			
		||||
#: ../src/core/prefs.c:1343
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"\"%s\" found in configuration database is not a valid value for mouse button "
 | 
			
		||||
@@ -360,7 +373,7 @@ msgstr ""
 | 
			
		||||
"\"%s\" yang ada pada database konfigurasi bukanlah nilai yang benar untuk "
 | 
			
		||||
"tombol mouse.\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/prefs.c:1788
 | 
			
		||||
#: ../src/core/prefs.c:1909
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"\"%s\" found in configuration database is not a valid value for keybinding "
 | 
			
		||||
@@ -369,17 +382,17 @@ msgstr ""
 | 
			
		||||
"\"%s\" yang ada pada database konfigurasi bernilai tidak benar untuk "
 | 
			
		||||
"kombinasi tombol \"%s\"\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/prefs.c:1887
 | 
			
		||||
#: ../src/core/prefs.c:1999
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Workspace %d"
 | 
			
		||||
msgstr "Area kerja %d"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/screen.c:691
 | 
			
		||||
#: ../src/core/screen.c:534
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Screen %d on display '%s' is invalid\n"
 | 
			
		||||
msgstr "Layar %d pada tampilan '%s' tidak benar\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/screen.c:707
 | 
			
		||||
#: ../src/core/screen.c:550
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Screen %d on display \"%s\" already has a window manager; try using the --"
 | 
			
		||||
@@ -388,7 +401,7 @@ msgstr ""
 | 
			
		||||
"Layar %d pada tampilan \"%s\" sudah memiliki pengatur jendela. Cobalah "
 | 
			
		||||
"gunakan pilihan --replace untuk mengganti pengatur jendela yang aktif.\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/screen.c:734
 | 
			
		||||
#: ../src/core/screen.c:577
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Could not acquire window manager selection on screen %d display \"%s\"\n"
 | 
			
		||||
@@ -396,12 +409,12 @@ msgstr ""
 | 
			
		||||
"Tidak dapat mendapatkan pilihan pengatur jendela pada layar %d tampilan \"%s"
 | 
			
		||||
"\"\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/screen.c:812
 | 
			
		||||
#: ../src/core/screen.c:655
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Screen %d on display \"%s\" already has a window manager\n"
 | 
			
		||||
msgstr "Layar %d pada tampilan \"%s\" sudah ada pengatur jendelanya\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/screen.c:998
 | 
			
		||||
#: ../src/core/screen.c:846
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Could not release screen %d on display \"%s\"\n"
 | 
			
		||||
msgstr "Layar %d pada tampilan \"%s\" tidak dapat dilepas\n"
 | 
			
		||||
@@ -476,8 +489,7 @@ msgstr "Gagal melakukan fdopen pada berkas log %s: %s\n"
 | 
			
		||||
msgid "Opened log file %s\n"
 | 
			
		||||
msgstr "Berkas log yang dibuka %s\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/util.c:119 ../src/tools/mutter-message.c:149
 | 
			
		||||
#, c-format
 | 
			
		||||
#: ../src/core/util.c:119
 | 
			
		||||
msgid "Mutter was compiled without support for verbose mode\n"
 | 
			
		||||
msgstr "Muter dikompilasi tanpa dukungan mode riuh\n"
 | 
			
		||||
 | 
			
		||||
@@ -485,20 +497,20 @@ msgstr "Muter dikompilasi tanpa dukungan mode riuh\n"
 | 
			
		||||
msgid "Window manager: "
 | 
			
		||||
msgstr "Pengatur jendela: "
 | 
			
		||||
 | 
			
		||||
#: ../src/core/util.c:412
 | 
			
		||||
#: ../src/core/util.c:414
 | 
			
		||||
msgid "Bug in window manager: "
 | 
			
		||||
msgstr "Bug pada pengatur jendela: "
 | 
			
		||||
 | 
			
		||||
#: ../src/core/util.c:443
 | 
			
		||||
#: ../src/core/util.c:445
 | 
			
		||||
msgid "Window manager warning: "
 | 
			
		||||
msgstr "Peringatan pengatur jendela: "
 | 
			
		||||
 | 
			
		||||
#: ../src/core/util.c:471
 | 
			
		||||
#: ../src/core/util.c:473
 | 
			
		||||
msgid "Window manager error: "
 | 
			
		||||
msgstr "Eror pengatur jendela: "
 | 
			
		||||
 | 
			
		||||
#. first time through
 | 
			
		||||
#: ../src/core/window.c:7596
 | 
			
		||||
#: ../src/core/window.c:7533
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Window %s sets SM_CLIENT_ID on itself, instead of on the WM_CLIENT_LEADER "
 | 
			
		||||
@@ -514,7 +526,7 @@ msgstr ""
 | 
			
		||||
#. * MWM but not WM_NORMAL_HINTS are basically broken. We complain
 | 
			
		||||
#. * about these apps but make them work.
 | 
			
		||||
#.
 | 
			
		||||
#: ../src/core/window.c:8320
 | 
			
		||||
#: ../src/core/window.c:8257
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Window %s sets an MWM hint indicating it isn't resizable, but sets min size "
 | 
			
		||||
@@ -524,22 +536,22 @@ msgstr ""
 | 
			
		||||
"ukurannya, sedangkan ukuran minimalnya adalah %d x %d dan maksimal %d x %d "
 | 
			
		||||
"yang tidak masuk di akal.\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/window-props.c:318
 | 
			
		||||
#: ../src/core/window-props.c:347
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Application set a bogus _NET_WM_PID %lu\n"
 | 
			
		||||
msgstr "Aplikasi telah membuat _NET_WM_PID %lu bohongan\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/window-props.c:434
 | 
			
		||||
#: ../src/core/window-props.c:463
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "%s (on %s)"
 | 
			
		||||
msgstr "%s (pada %s)"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/window-props.c:1517
 | 
			
		||||
#: ../src/core/window-props.c:1546
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Invalid WM_TRANSIENT_FOR window 0x%lx specified for %s.\n"
 | 
			
		||||
msgstr "WM_TRANSIENT_FOR salah jendela 0x%lx ditentukan untuk %s.\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/window-props.c:1528
 | 
			
		||||
#: ../src/core/window-props.c:1557
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "WM_TRANSIENT_FOR window 0x%lx for %s would create loop.\n"
 | 
			
		||||
msgstr "Jendela WM_TRANSIENT_FOR 0x%lx untuk %s akan membuat loop.\n"
 | 
			
		||||
@@ -703,109 +715,104 @@ msgstr "Pilih jendela dari popup tab"
 | 
			
		||||
msgid "Cancel tab popup"
 | 
			
		||||
msgstr "Batalkan popup tab"
 | 
			
		||||
 | 
			
		||||
#: ../src/tools/mutter-message.c:123
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Usage: %s\n"
 | 
			
		||||
msgstr "Cara pakai: %s\n"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:69
 | 
			
		||||
#: ../src/ui/menu.c:67
 | 
			
		||||
msgid "Mi_nimize"
 | 
			
		||||
msgstr "Kecilka_n"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:71
 | 
			
		||||
#: ../src/ui/menu.c:69
 | 
			
		||||
msgid "Ma_ximize"
 | 
			
		||||
msgstr "Pe_rbesar"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:73
 | 
			
		||||
#: ../src/ui/menu.c:71
 | 
			
		||||
msgid "Unma_ximize"
 | 
			
		||||
msgstr "Kem_balikan"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:75
 | 
			
		||||
#: ../src/ui/menu.c:73
 | 
			
		||||
msgid "Roll _Up"
 | 
			
		||||
msgstr "G_ulung"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:77
 | 
			
		||||
#: ../src/ui/menu.c:75
 | 
			
		||||
msgid "_Unroll"
 | 
			
		||||
msgstr "B_uka"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:79
 | 
			
		||||
#: ../src/ui/menu.c:77
 | 
			
		||||
msgid "_Move"
 | 
			
		||||
msgstr "_Pindahkan"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:81
 | 
			
		||||
#: ../src/ui/menu.c:79
 | 
			
		||||
msgid "_Resize"
 | 
			
		||||
msgstr "Ganti·Uku_ran"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:83
 | 
			
		||||
#: ../src/ui/menu.c:81
 | 
			
		||||
msgid "Move Titlebar On_screen"
 | 
			
		||||
msgstr "Pindahkan Judul Pada _layar"
 | 
			
		||||
 | 
			
		||||
#. separator
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:86 ../src/ui/menu.c:88
 | 
			
		||||
#: ../src/ui/menu.c:84 ../src/ui/menu.c:86
 | 
			
		||||
msgid "Always on _Top"
 | 
			
		||||
msgstr "Selalu di A_tas"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:90
 | 
			
		||||
#: ../src/ui/menu.c:88
 | 
			
		||||
msgid "_Always on Visible Workspace"
 | 
			
		||||
msgstr "T_ampak pada Area Kerja Aktif"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:92
 | 
			
		||||
#: ../src/ui/menu.c:90
 | 
			
		||||
msgid "_Only on This Workspace"
 | 
			
		||||
msgstr "_Tampak pada Area Kerja Ini Saja"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:94
 | 
			
		||||
#: ../src/ui/menu.c:92
 | 
			
		||||
msgid "Move to Workspace _Left"
 | 
			
		||||
msgstr "Pindahkan ke Area Kerja _Kiri"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:96
 | 
			
		||||
#: ../src/ui/menu.c:94
 | 
			
		||||
msgid "Move to Workspace R_ight"
 | 
			
		||||
msgstr "Pindahkan ke A_rea Kerja Kanan"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:98
 | 
			
		||||
#: ../src/ui/menu.c:96
 | 
			
		||||
msgid "Move to Workspace _Up"
 | 
			
		||||
msgstr "Pindahkan ke Area Kerja Ata_s"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:100
 | 
			
		||||
#: ../src/ui/menu.c:98
 | 
			
		||||
msgid "Move to Workspace _Down"
 | 
			
		||||
msgstr "Pindahkan ke Area Kerja _Bawah"
 | 
			
		||||
 | 
			
		||||
#. separator
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:104
 | 
			
		||||
#: ../src/ui/menu.c:102
 | 
			
		||||
msgid "_Close"
 | 
			
		||||
msgstr "_Tutup"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/menu.c:204
 | 
			
		||||
#: ../src/ui/menu.c:202
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Workspace %d%n"
 | 
			
		||||
msgstr "Area Kerja %d%n"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/menu.c:214
 | 
			
		||||
#: ../src/ui/menu.c:212
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Workspace 1_0"
 | 
			
		||||
msgstr "Area Kerja 1_0"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/menu.c:216
 | 
			
		||||
#: ../src/ui/menu.c:214
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Workspace %s%d"
 | 
			
		||||
msgstr "Area Kerja %s%d"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/menu.c:397
 | 
			
		||||
#: ../src/ui/menu.c:384
 | 
			
		||||
msgid "Move to Another _Workspace"
 | 
			
		||||
msgstr "Pindahkan ke Area Kerja _Lain"
 | 
			
		||||
 | 
			
		||||
@@ -1163,18 +1170,18 @@ msgid ""
 | 
			
		||||
msgstr ""
 | 
			
		||||
"<frame state=\"%s\" resize=\"%s\" focus=\"%s\" style=\"whatever\"/> tidak ada"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:5084
 | 
			
		||||
#: ../src/ui/theme.c:5082
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Failed to load theme \"%s\": %s\n"
 | 
			
		||||
msgstr "Gagal membuka tema \"%s\": %s\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:5220 ../src/ui/theme.c:5227 ../src/ui/theme.c:5234
 | 
			
		||||
#: ../src/ui/theme.c:5241 ../src/ui/theme.c:5248
 | 
			
		||||
#: ../src/ui/theme.c:5218 ../src/ui/theme.c:5225 ../src/ui/theme.c:5232
 | 
			
		||||
#: ../src/ui/theme.c:5239 ../src/ui/theme.c:5246
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "No <%s> set for theme \"%s\""
 | 
			
		||||
msgstr "Tidak ada <%s> yang ditentukan untuk tema \"%s\""
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:5256
 | 
			
		||||
#: ../src/ui/theme.c:5254
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"No frame style set for window type \"%s\" in theme \"%s\", add a <window "
 | 
			
		||||
@@ -1183,14 +1190,14 @@ msgstr ""
 | 
			
		||||
"Tidak ada gaya frame untuk tipe window \"%s\" pada tema \"%s\". Tambah dulu "
 | 
			
		||||
"elemen <window type=\"%s\" style_set=\"whatever\"/>"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:5663 ../src/ui/theme.c:5725 ../src/ui/theme.c:5788
 | 
			
		||||
#: ../src/ui/theme.c:5661 ../src/ui/theme.c:5723 ../src/ui/theme.c:5786
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"User-defined constants must begin with a capital letter; \"%s\" does not"
 | 
			
		||||
msgstr ""
 | 
			
		||||
"Konstanta buatan pengguna harus dimulai dengan huruf besar: \"%s\" tidak"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:5671 ../src/ui/theme.c:5733 ../src/ui/theme.c:5796
 | 
			
		||||
#: ../src/ui/theme.c:5669 ../src/ui/theme.c:5731 ../src/ui/theme.c:5794
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Constant \"%s\" has already been defined"
 | 
			
		||||
msgstr "Konstanta \"%s\" telah didefinisikan sebelumnya"
 | 
			
		||||
@@ -1578,201 +1585,3 @@ msgstr "<%s> disebutkan dua kali pada tema ini"
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Failed to find a valid file for theme %s\n"
 | 
			
		||||
msgstr "Gagal menemukan berkas yang sah untuk tema %s\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:99
 | 
			
		||||
msgid "_Windows"
 | 
			
		||||
msgstr "_Jendela"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:100
 | 
			
		||||
msgid "_Dialog"
 | 
			
		||||
msgstr "_Dialog"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:101
 | 
			
		||||
msgid "_Modal dialog"
 | 
			
		||||
msgstr "Dialog _modal"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:102
 | 
			
		||||
msgid "_Utility"
 | 
			
		||||
msgstr "_Utilitas"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:103
 | 
			
		||||
msgid "_Splashscreen"
 | 
			
		||||
msgstr "Layar _pembuka"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:104
 | 
			
		||||
msgid "_Top dock"
 | 
			
		||||
msgstr "Dok a_tas"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:105
 | 
			
		||||
msgid "_Bottom dock"
 | 
			
		||||
msgstr "Dok _bawah"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:106
 | 
			
		||||
msgid "_Left dock"
 | 
			
		||||
msgstr "Dok k_iri"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:107
 | 
			
		||||
msgid "_Right dock"
 | 
			
		||||
msgstr "Dok kana_n"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:108
 | 
			
		||||
msgid "_All docks"
 | 
			
		||||
msgstr "Semu_a dok"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:109
 | 
			
		||||
msgid "Des_ktop"
 | 
			
		||||
msgstr "Des_ktop"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:115
 | 
			
		||||
msgid "Open another one of these windows"
 | 
			
		||||
msgstr "Buka lagi jendela semacam ini"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:117
 | 
			
		||||
msgid "This is a demo button with an 'open' icon"
 | 
			
		||||
msgstr "Ini contoh tombol dengan ikon 'open'"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:119
 | 
			
		||||
msgid "This is a demo button with a 'quit' icon"
 | 
			
		||||
msgstr "Ini contoh tombol dengan ikon 'quit'"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:248
 | 
			
		||||
msgid "This is a sample message in a sample dialog"
 | 
			
		||||
msgstr "Ini contoh pesan pada suatu dialog"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:328
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Fake menu item %d\n"
 | 
			
		||||
msgstr "Item menu %d\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:363
 | 
			
		||||
msgid "Border-only window"
 | 
			
		||||
msgstr "Jendela dengan garis pembatas"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:365
 | 
			
		||||
msgid "Bar"
 | 
			
		||||
msgstr "Kotak"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:382
 | 
			
		||||
msgid "Normal Application Window"
 | 
			
		||||
msgstr "Jendela Aplikasi Normal"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:386
 | 
			
		||||
msgid "Dialog Box"
 | 
			
		||||
msgstr "Kotak Dialog"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:390
 | 
			
		||||
msgid "Modal Dialog Box"
 | 
			
		||||
msgstr "Kotak Dialog Modal"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:394
 | 
			
		||||
msgid "Utility Palette"
 | 
			
		||||
msgstr "Kotak Perkakas"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:398
 | 
			
		||||
msgid "Torn-off Menu"
 | 
			
		||||
msgstr "Menu Dapat Dilepas"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:402
 | 
			
		||||
msgid "Border"
 | 
			
		||||
msgstr "Batas"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:406
 | 
			
		||||
msgid "Attached Modal Dialog"
 | 
			
		||||
msgstr "Dialog Modal yang Dilampirkan"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:737
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Button layout test %d"
 | 
			
		||||
msgstr "Tes komposisi tombol %d"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:766
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "%g milliseconds to draw one window frame"
 | 
			
		||||
msgstr "lama waktu menggambar satu bingkai jendela %g milidetik"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:811
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Usage: metacity-theme-viewer [THEMENAME]\n"
 | 
			
		||||
msgstr "Cara pakai: metacity-theme-viewer [NAMA TEMA]\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:818
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Error loading theme: %s\n"
 | 
			
		||||
msgstr "Ada error saat membaca tema: %s\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:824
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Loaded theme \"%s\" in %g seconds\n"
 | 
			
		||||
msgstr "Tema \"%s\" dibuka dalam %g detik\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:869
 | 
			
		||||
msgid "Normal Title Font"
 | 
			
		||||
msgstr "Judul dengan huruf normal"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:875
 | 
			
		||||
msgid "Small Title Font"
 | 
			
		||||
msgstr "Judul dengan huruf ukuran kecil"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:881
 | 
			
		||||
msgid "Large Title Font"
 | 
			
		||||
msgstr "Judul Raksasa"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:886
 | 
			
		||||
msgid "Button Layouts"
 | 
			
		||||
msgstr "Komposisi Tombol"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:891
 | 
			
		||||
msgid "Benchmark"
 | 
			
		||||
msgstr "Pengukuran"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:947
 | 
			
		||||
msgid "Window Title Goes Here"
 | 
			
		||||
msgstr "Ini tempat judul jendela"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:1053
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Drew %d frames in %g client-side seconds (%g milliseconds per frame) and %g "
 | 
			
		||||
"seconds wall clock time including X server resources (%g milliseconds per "
 | 
			
		||||
"frame)\n"
 | 
			
		||||
msgstr ""
 | 
			
		||||
"%d frame dibuat dalam %g detik dalam waktu klien (%g milidetik per frame) "
 | 
			
		||||
"dan %g detik dalam waktu sebenarnya (%g milidetik per frame)\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:1273
 | 
			
		||||
msgid "position expression test returned TRUE but set error"
 | 
			
		||||
msgstr "tes ekspresi posisi berakhir TRUE tapi justru ada error"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:1275
 | 
			
		||||
msgid "position expression test returned FALSE but didn't set error"
 | 
			
		||||
msgstr "tes ekspresi posisi berakhir FALSE tapi tidak ada error"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:1279
 | 
			
		||||
msgid "Error was expected but none given"
 | 
			
		||||
msgstr "Seharusnya ada error, tapi ini kok tidak ada"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:1281
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Error %d was expected but %d given"
 | 
			
		||||
msgstr "Seharunya ada error %d, tapi yang terjadi %d"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:1287
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Error not expected but one was returned: %s"
 | 
			
		||||
msgstr "Seharusnya tidak ada error, tapi ini tiba-tiba ada error: %s"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:1291
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "x value was %d, %d was expected"
 | 
			
		||||
msgstr "nilai x sebelumnya %d, padahal seharusnya %d"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:1294
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "y value was %d, %d was expected"
 | 
			
		||||
msgstr "nilai y sebelumnya %d, padahal seharusnya %d"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:1359
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "%d coordinate expressions parsed in %g seconds (%g seconds average)\n"
 | 
			
		||||
msgstr "ekspresi koordinat %d diambil dalam %g detik (rata-rata %g detik)\n"
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										458
									
								
								po/ko.po
									
									
									
									
									
								
							
							
						
						
									
										458
									
								
								po/ko.po
									
									
									
									
									
								
							@@ -18,8 +18,8 @@ msgstr ""
 | 
			
		||||
"Project-Id-Version: mutter\n"
 | 
			
		||||
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
 | 
			
		||||
"product=mutter&keywords=I18N+L10N&component=general\n"
 | 
			
		||||
"POT-Creation-Date: 2013-03-01 15:50+0000\n"
 | 
			
		||||
"PO-Revision-Date: 2013-03-13 03:52+0900\n"
 | 
			
		||||
"POT-Creation-Date: 2013-08-18 20:03+0000\n"
 | 
			
		||||
"PO-Revision-Date: 2013-09-09 04:46+0900\n"
 | 
			
		||||
"Last-Translator: Changwoo Ryu <cwryu@debian.org>\n"
 | 
			
		||||
"Language-Team: GNOME Korea <gnome-kr@googlegroups.com>\n"
 | 
			
		||||
"Language: Korean\n"
 | 
			
		||||
@@ -218,7 +218,7 @@ 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:507
 | 
			
		||||
#: ../src/compositor/compositor.c:589
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Another compositing manager is already running on screen %i on display \"%s"
 | 
			
		||||
@@ -227,11 +227,11 @@ msgstr ""
 | 
			
		||||
"다른 창 구성 관리 프로그램이 이미 디스플레이 \"%2$s\" 화면 %1$i번에서 실행 중"
 | 
			
		||||
"입니다."
 | 
			
		||||
 | 
			
		||||
#: ../src/compositor/meta-background.c:1111
 | 
			
		||||
#: ../src/compositor/meta-background.c:1076
 | 
			
		||||
msgid "background texture could not be created from file"
 | 
			
		||||
msgstr "파일에서 배경 텍스처를 만들 수 없습니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/bell.c:320
 | 
			
		||||
#: ../src/core/bell.c:322
 | 
			
		||||
msgid "Bell event"
 | 
			
		||||
msgstr "삑소리 이벤트"
 | 
			
		||||
 | 
			
		||||
@@ -263,17 +263,17 @@ msgstr "기다리기(_W)"
 | 
			
		||||
msgid "_Force Quit"
 | 
			
		||||
msgstr "강제로 끝내기(_F)"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/display.c:401
 | 
			
		||||
#: ../src/core/display.c:421
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Missing %s extension required for compositing"
 | 
			
		||||
msgstr "콤포짓에 필요한 %s 확장 기능이 없습니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/display.c:493
 | 
			
		||||
#: ../src/core/display.c:513
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Failed to open X Window System display '%s'\n"
 | 
			
		||||
msgstr "X 윈도 시스템 디스플레이 '%s'을(를) 여는데 실패하였습니다\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/keybindings.c:929
 | 
			
		||||
#: ../src/core/keybindings.c:1136
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Some other program is already using the key %s with modifiers %x as a "
 | 
			
		||||
@@ -282,41 +282,41 @@ msgstr ""
 | 
			
		||||
"다른 프로그램에서 이미 단축키로 변경 키 %2$x와(과) 키 %1$s을(를) 사용하고 있"
 | 
			
		||||
"습니다\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/keybindings.c:1129
 | 
			
		||||
#: ../src/core/keybindings.c:1333
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "\"%s\" is not a valid accelerator\n"
 | 
			
		||||
msgstr "\"%s\"은(는) 올바른 단축키가 아닙니다\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:196
 | 
			
		||||
#: ../src/core/main.c:197
 | 
			
		||||
msgid "Disable connection to session manager"
 | 
			
		||||
msgstr "세션 관리자와 연결 하지 않습니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:202
 | 
			
		||||
#: ../src/core/main.c:203
 | 
			
		||||
msgid "Replace the running window manager"
 | 
			
		||||
msgstr "실행 중인 창 관리자를 바꿉니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:208
 | 
			
		||||
#: ../src/core/main.c:209
 | 
			
		||||
msgid "Specify session management ID"
 | 
			
		||||
msgstr "세션 관리 ID를 지정합니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:213
 | 
			
		||||
#: ../src/core/main.c:214
 | 
			
		||||
msgid "X Display to use"
 | 
			
		||||
msgstr "사용할 X 디스플레이"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:219
 | 
			
		||||
#: ../src/core/main.c:220
 | 
			
		||||
msgid "Initialize session from savefile"
 | 
			
		||||
msgstr "저장 파일에서 세션을 초기화 합니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:225
 | 
			
		||||
#: ../src/core/main.c:226
 | 
			
		||||
msgid "Make X calls synchronous"
 | 
			
		||||
msgstr "동기 X 호출을 합니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:494
 | 
			
		||||
#: ../src/core/main.c:534
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Failed to scan themes directory: %s\n"
 | 
			
		||||
msgstr "테마 디렉터리를 읽는 데 실패했습니다: %s\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/main.c:510
 | 
			
		||||
#: ../src/core/main.c:550
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Could not find a theme! Be sure %s exists and contains the usual themes.\n"
 | 
			
		||||
@@ -324,6 +324,19 @@ msgstr ""
 | 
			
		||||
"테마를 찾을 수 없습니다! %s이(가) 있고 올바른 테마가 들어 있는지 확인하십시"
 | 
			
		||||
"오.\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/monitor.c:711
 | 
			
		||||
msgid "Built-in display"
 | 
			
		||||
msgstr "내장 디스플레이"
 | 
			
		||||
 | 
			
		||||
#. TRANSLATORS: this is a monitor name (in case we don't know
 | 
			
		||||
#. the vendor), it's Unknown followed by a size in inches,
 | 
			
		||||
#. like 'Unknown 15"'
 | 
			
		||||
#.
 | 
			
		||||
#: ../src/core/monitor.c:739
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Unknown %s"
 | 
			
		||||
msgstr "알 수 없는 %s인치"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/mutter.c:40
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
@@ -347,18 +360,20 @@ msgstr "버전을 출력합니다"
 | 
			
		||||
msgid "Mutter plugin to use"
 | 
			
		||||
msgstr "사용할 머터 플러그인"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/prefs.c:1087
 | 
			
		||||
#: ../src/core/prefs.c:1202
 | 
			
		||||
msgid ""
 | 
			
		||||
"Workarounds for broken applications disabled. Some applications may not "
 | 
			
		||||
"behave properly.\n"
 | 
			
		||||
msgstr "응용 프로그램에 대한 임시 방편을 막았습니다. 몇몇 응용 프로그램이 제대로 동작하지 않을것입니다.\n"
 | 
			
		||||
msgstr ""
 | 
			
		||||
"응용 프로그램에 대한 임시 방편을 막았습니다. 몇몇 응용 프로그램이 제대로 동작"
 | 
			
		||||
"하지 않을것입니다.\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/prefs.c:1162
 | 
			
		||||
#: ../src/core/prefs.c:1277
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Could not parse font description \"%s\" from GSettings key %s\n"
 | 
			
		||||
msgstr "GSettings 키 %2$s에서 글꼴 지정 \"%1$s\"을(를) 분석할 수 없습니다\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/prefs.c:1228
 | 
			
		||||
#: ../src/core/prefs.c:1343
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"\"%s\" found in configuration database is not a valid value for mouse button "
 | 
			
		||||
@@ -367,7 +382,7 @@ msgstr ""
 | 
			
		||||
"설정 데이터베이스에서 찾은 \"%s\"이(가) 마우스 단추 변경 키의 올바른 값이 아"
 | 
			
		||||
"닙니다\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/prefs.c:1780
 | 
			
		||||
#: ../src/core/prefs.c:1909
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"\"%s\" found in configuration database is not a valid value for keybinding "
 | 
			
		||||
@@ -376,17 +391,17 @@ msgstr ""
 | 
			
		||||
"설정 데이터베이스에서 찾은 \"%s\"이(가) 단축키 \"%s\"에 대한 올바른 값이 아닙"
 | 
			
		||||
"니다\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/prefs.c:1879
 | 
			
		||||
#: ../src/core/prefs.c:1999
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Workspace %d"
 | 
			
		||||
msgstr "작업 공간 %d"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/screen.c:673
 | 
			
		||||
#: ../src/core/screen.c:534
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Screen %d on display '%s' is invalid\n"
 | 
			
		||||
msgstr "디스플레이 '%2$s'의 화면 %1$d은(는) 잘못되었습니다\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/screen.c:689
 | 
			
		||||
#: ../src/core/screen.c:550
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Screen %d on display \"%s\" already has a window manager; try using the --"
 | 
			
		||||
@@ -395,19 +410,19 @@ msgstr ""
 | 
			
		||||
"디스플레이 \"%2$s\"의 화면 %1$d에 이미 창 관리자가 실행되고 있습니다. 현재 "
 | 
			
		||||
"창 관리자를 무시하는 --replace 옵션을 써보십시오.\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/screen.c:716
 | 
			
		||||
#: ../src/core/screen.c:577
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Could not acquire window manager selection on screen %d display \"%s\"\n"
 | 
			
		||||
msgstr "디스플레이 \"%2$s\"의 화면 %1$d에 창 관리 선택을 가질 수 없습니다\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/screen.c:794
 | 
			
		||||
#: ../src/core/screen.c:655
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Screen %d on display \"%s\" already has a window manager\n"
 | 
			
		||||
msgstr ""
 | 
			
		||||
"디스플레이 \"%2$s\"의 화면 %1$d은(는) 이미 창 관리자가 실행되고 있습니다\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/screen.c:979
 | 
			
		||||
#: ../src/core/screen.c:846
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Could not release screen %d on display \"%s\"\n"
 | 
			
		||||
msgstr "디스플레이 \"%2$s\"의 화면 %1$d을(를) 떼어 놓을수 없습니다\n"
 | 
			
		||||
@@ -467,44 +482,43 @@ msgstr ""
 | 
			
		||||
"이 창은 "현재 설정 저장"을 지원하지 않기 때문에 다음 번에 로그인 "
 | 
			
		||||
"할 때 수동으로 다시 시작해야 합니다."
 | 
			
		||||
 | 
			
		||||
#: ../src/core/util.c:80
 | 
			
		||||
#: ../src/core/util.c:84
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Failed to open debug log: %s\n"
 | 
			
		||||
msgstr "디버그 로그 열기 실패: %s\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/util.c:90
 | 
			
		||||
#: ../src/core/util.c:94
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Failed to fdopen() log file %s: %s\n"
 | 
			
		||||
msgstr "로그 파일 %s을(를) fdopen()하기 실패: %s\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/util.c:96
 | 
			
		||||
#: ../src/core/util.c:100
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Opened log file %s\n"
 | 
			
		||||
msgstr "로그 파일 %s을(를) 엽니다\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/util.c:115 ../src/tools/mutter-message.c:149
 | 
			
		||||
#, c-format
 | 
			
		||||
#: ../src/core/util.c:119
 | 
			
		||||
msgid "Mutter was compiled without support for verbose mode\n"
 | 
			
		||||
msgstr "머터가 자세한 모드 지원 없이 컴파일 되었습니다\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/util.c:259
 | 
			
		||||
#: ../src/core/util.c:264
 | 
			
		||||
msgid "Window manager: "
 | 
			
		||||
msgstr "창 관리자: "
 | 
			
		||||
 | 
			
		||||
#: ../src/core/util.c:407
 | 
			
		||||
#: ../src/core/util.c:414
 | 
			
		||||
msgid "Bug in window manager: "
 | 
			
		||||
msgstr "창 관리자의 벌레: "
 | 
			
		||||
 | 
			
		||||
#: ../src/core/util.c:438
 | 
			
		||||
#: ../src/core/util.c:445
 | 
			
		||||
msgid "Window manager warning: "
 | 
			
		||||
msgstr "창 관리자 주의: "
 | 
			
		||||
 | 
			
		||||
#: ../src/core/util.c:466
 | 
			
		||||
#: ../src/core/util.c:473
 | 
			
		||||
msgid "Window manager error: "
 | 
			
		||||
msgstr "장 관리자 오류: "
 | 
			
		||||
 | 
			
		||||
#. first time through
 | 
			
		||||
#: ../src/core/window.c:7539
 | 
			
		||||
#: ../src/core/window.c:7533
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Window %s sets SM_CLIENT_ID on itself, instead of on the WM_CLIENT_LEADER "
 | 
			
		||||
@@ -520,7 +534,7 @@ msgstr ""
 | 
			
		||||
#. * MWM but not WM_NORMAL_HINTS are basically broken. We complain
 | 
			
		||||
#. * about these apps but make them work.
 | 
			
		||||
#.
 | 
			
		||||
#: ../src/core/window.c:8263
 | 
			
		||||
#: ../src/core/window.c:8257
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Window %s sets an MWM hint indicating it isn't resizable, but sets min size "
 | 
			
		||||
@@ -529,23 +543,23 @@ msgstr ""
 | 
			
		||||
"%s 창에서 크기 변경이 불가능하다는 MWM 힌트를 설정했지만, 최소 크기 %d x %d "
 | 
			
		||||
"및 최대 크기 %d x %d(으)로 설정했습니다. 앞뒤가 맞지 않습니다.\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/window-props.c:318
 | 
			
		||||
#: ../src/core/window-props.c:347
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Application set a bogus _NET_WM_PID %lu\n"
 | 
			
		||||
msgstr "응용 프로그램이 가짜 _NET_WM_PID %lu을(를) 설정하였습니다\n"
 | 
			
		||||
 | 
			
		||||
# <창제목> (on <기계>)
 | 
			
		||||
#: ../src/core/window-props.c:434
 | 
			
		||||
#: ../src/core/window-props.c:463
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "%s (on %s)"
 | 
			
		||||
msgstr "%s (%s에서)"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/window-props.c:1517
 | 
			
		||||
#: ../src/core/window-props.c:1546
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Invalid WM_TRANSIENT_FOR window 0x%lx specified for %s.\n"
 | 
			
		||||
msgstr "%2$s에 대해 WM_TRANSIENT_FOR 0x%1$lx 창이 잘못되었습니다.\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/window-props.c:1528
 | 
			
		||||
#: ../src/core/window-props.c:1557
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "WM_TRANSIENT_FOR window 0x%lx for %s would create loop.\n"
 | 
			
		||||
msgstr "%2$s에 대해 WM_TRANSIENT_FOR 0x%1$lx 창은 무한 반복입니다.\n"
 | 
			
		||||
@@ -574,9 +588,7 @@ msgstr "창 0x%2$lx의 등록 정보 %1$s은(는) 잘못된 UTF-8이 들어 있
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Property %s on window 0x%lx contained invalid UTF-8 for item %d in the list\n"
 | 
			
		||||
msgstr ""
 | 
			
		||||
"창 0x%2$lx의 등록 정보 %1$s은(는) 목록안의 항목 %3$d에 잘못된 UTF-8을 포함하"
 | 
			
		||||
"고 있습니다\n"
 | 
			
		||||
msgstr "창 0x%2$lx의 등록 정보 %1$s은(는) 목록안의 항목 %3$d에 잘못된 UTF-8 문자가 들어 있습니다\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/mutter.desktop.in.h:1 ../src/mutter-wm.desktop.in.h:1
 | 
			
		||||
msgid "Mutter"
 | 
			
		||||
@@ -705,109 +717,104 @@ msgstr "탭 팝업에서 창 선택"
 | 
			
		||||
msgid "Cancel tab popup"
 | 
			
		||||
msgstr "탭 팝업 취소"
 | 
			
		||||
 | 
			
		||||
#: ../src/tools/mutter-message.c:123
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Usage: %s\n"
 | 
			
		||||
msgstr "사용법: %s\n"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:69
 | 
			
		||||
#: ../src/ui/menu.c:67
 | 
			
		||||
msgid "Mi_nimize"
 | 
			
		||||
msgstr "최소화(_N)"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:71
 | 
			
		||||
#: ../src/ui/menu.c:69
 | 
			
		||||
msgid "Ma_ximize"
 | 
			
		||||
msgstr "최대화(_X)"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:73
 | 
			
		||||
#: ../src/ui/menu.c:71
 | 
			
		||||
msgid "Unma_ximize"
 | 
			
		||||
msgstr "최대화 취소(_X)"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:75
 | 
			
		||||
#: ../src/ui/menu.c:73
 | 
			
		||||
msgid "Roll _Up"
 | 
			
		||||
msgstr "말아올리기(_U)"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:77
 | 
			
		||||
#: ../src/ui/menu.c:75
 | 
			
		||||
msgid "_Unroll"
 | 
			
		||||
msgstr "펼치기(_U)"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:79
 | 
			
		||||
#: ../src/ui/menu.c:77
 | 
			
		||||
msgid "_Move"
 | 
			
		||||
msgstr "옮기기(_M)"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:81
 | 
			
		||||
#: ../src/ui/menu.c:79
 | 
			
		||||
msgid "_Resize"
 | 
			
		||||
msgstr "크기 조정(_R)"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:83
 | 
			
		||||
#: ../src/ui/menu.c:81
 | 
			
		||||
msgid "Move Titlebar On_screen"
 | 
			
		||||
msgstr "창 제목막대 화면에 표시(_S)"
 | 
			
		||||
 | 
			
		||||
#. separator
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:86 ../src/ui/menu.c:88
 | 
			
		||||
#: ../src/ui/menu.c:84 ../src/ui/menu.c:86
 | 
			
		||||
msgid "Always on _Top"
 | 
			
		||||
msgstr "항상 위(_T)"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:90
 | 
			
		||||
#: ../src/ui/menu.c:88
 | 
			
		||||
msgid "_Always on Visible Workspace"
 | 
			
		||||
msgstr "항상 현재 작업 공간에 놓기(_A)"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:92
 | 
			
		||||
#: ../src/ui/menu.c:90
 | 
			
		||||
msgid "_Only on This Workspace"
 | 
			
		||||
msgstr "이 작업 공간에만 놓기(_O)"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:94
 | 
			
		||||
#: ../src/ui/menu.c:92
 | 
			
		||||
msgid "Move to Workspace _Left"
 | 
			
		||||
msgstr "왼쪽 작업 공간으로 옮기기(_L)"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:96
 | 
			
		||||
#: ../src/ui/menu.c:94
 | 
			
		||||
msgid "Move to Workspace R_ight"
 | 
			
		||||
msgstr "오른쪽 작업 공간으로 옮기기(_I)"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:98
 | 
			
		||||
#: ../src/ui/menu.c:96
 | 
			
		||||
msgid "Move to Workspace _Up"
 | 
			
		||||
msgstr "위쪽 작업 공간으로 옮기기(_U)"
 | 
			
		||||
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:100
 | 
			
		||||
#: ../src/ui/menu.c:98
 | 
			
		||||
msgid "Move to Workspace _Down"
 | 
			
		||||
msgstr "아래쪽 작업 공간으로 옮기기(_D)"
 | 
			
		||||
 | 
			
		||||
#. separator
 | 
			
		||||
#. Translators: Translate this string the same way as you do in libwnck!
 | 
			
		||||
#: ../src/ui/menu.c:104
 | 
			
		||||
#: ../src/ui/menu.c:102
 | 
			
		||||
msgid "_Close"
 | 
			
		||||
msgstr "닫기(_C)"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/menu.c:204
 | 
			
		||||
#: ../src/ui/menu.c:202
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Workspace %d%n"
 | 
			
		||||
msgstr "작업 공간 %d%n"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/menu.c:214
 | 
			
		||||
#: ../src/ui/menu.c:212
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Workspace 1_0"
 | 
			
		||||
msgstr "작업 공간 1_0"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/menu.c:216
 | 
			
		||||
#: ../src/ui/menu.c:214
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Workspace %s%d"
 | 
			
		||||
msgstr "작업 공간 %s%d"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/menu.c:397
 | 
			
		||||
#: ../src/ui/menu.c:384
 | 
			
		||||
msgid "Move to Another _Workspace"
 | 
			
		||||
msgstr "다른 작업 공간으로 옮기기(_W)"
 | 
			
		||||
 | 
			
		||||
@@ -909,50 +916,50 @@ msgstr "Mod5"
 | 
			
		||||
msgid "%d x %d"
 | 
			
		||||
msgstr "%d x %d"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:235
 | 
			
		||||
#: ../src/ui/theme.c:236
 | 
			
		||||
msgid "top"
 | 
			
		||||
msgstr "맨 위"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:237
 | 
			
		||||
#: ../src/ui/theme.c:238
 | 
			
		||||
msgid "bottom"
 | 
			
		||||
msgstr "맨 아래"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:239
 | 
			
		||||
#: ../src/ui/theme.c:240
 | 
			
		||||
msgid "left"
 | 
			
		||||
msgstr "왼쪽"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:241
 | 
			
		||||
#: ../src/ui/theme.c:242
 | 
			
		||||
msgid "right"
 | 
			
		||||
msgstr "오른쪽"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:269
 | 
			
		||||
#: ../src/ui/theme.c:270
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "frame geometry does not specify \"%s\" dimension"
 | 
			
		||||
msgstr "프레임 위치가 \"%s\"차원으로 지정되지 않았습니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:288
 | 
			
		||||
#: ../src/ui/theme.c:289
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "frame geometry does not specify dimension \"%s\" for border \"%s\""
 | 
			
		||||
msgstr ""
 | 
			
		||||
"프레임 위치가 가장자리 \"%2$s\" 가장자리의 \"%1$s\"차원으로 지정되지 않았습니"
 | 
			
		||||
"다."
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:325
 | 
			
		||||
#: ../src/ui/theme.c:326
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Button aspect ratio %g is not reasonable"
 | 
			
		||||
msgstr "단추의 가로세로 비 %g이(가) 적당하지 않습니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:337
 | 
			
		||||
#: ../src/ui/theme.c:338
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Frame geometry does not specify size of buttons"
 | 
			
		||||
msgstr "프레임 위치가 단추의 크기로 지정되지 않았습니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1050
 | 
			
		||||
#: ../src/ui/theme.c:1051
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Gradients should have at least two colors"
 | 
			
		||||
msgstr "서서히 변하는 색으로 지정하려면 최소 2색이 필요합니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1202
 | 
			
		||||
#: ../src/ui/theme.c:1203
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"GTK custom color specification must have color name and fallback in "
 | 
			
		||||
@@ -961,7 +968,7 @@ msgstr ""
 | 
			
		||||
"GTK 사용자 지정 색상 지정은 색 이름과 대체할 색을 괄호 안에 써야 합니다. 예"
 | 
			
		||||
"를 들어: gtk:custom(foo,bar). \"%s\"을(를) 분석할 수 없습니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1218
 | 
			
		||||
#: ../src/ui/theme.c:1219
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Invalid character '%c' in color_name parameter of gtk:custom, only A-Za-z0-9-"
 | 
			
		||||
@@ -970,7 +977,7 @@ msgstr ""
 | 
			
		||||
"gtk:custom의 color_name 파라미터 안에 잘못된 문자 '%c'. A-Za-z0-9-_ 문자만 허"
 | 
			
		||||
"용합니다."
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1232
 | 
			
		||||
#: ../src/ui/theme.c:1233
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Gtk:custom format is \"gtk:custom(color_name,fallback)\", \"%s\" does not "
 | 
			
		||||
@@ -979,7 +986,7 @@ msgstr ""
 | 
			
		||||
"gtk:custom 형식은 \"gtk:custom(색이름,대체색)\"입니다, \"%s\"(은)는 형식에 맞"
 | 
			
		||||
"지 않습니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1277
 | 
			
		||||
#: ../src/ui/theme.c:1278
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"GTK color specification must have the state in brackets, e.g. gtk:fg[NORMAL] "
 | 
			
		||||
@@ -988,7 +995,7 @@ msgstr ""
 | 
			
		||||
"GTK 색상 지정은 중괄호안에 있어야 합니다. 예를 들어: gtk:fg[NORMAL], 여기서 "
 | 
			
		||||
"NORMAL이 값입니다. \"%s\"을(를) 분석할 수 없습니다."
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1291
 | 
			
		||||
#: ../src/ui/theme.c:1292
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"GTK color specification must have a close bracket after the state, e.g. gtk:"
 | 
			
		||||
@@ -997,17 +1004,17 @@ msgstr ""
 | 
			
		||||
"GTK 색상 지정은 값 뒤에 중괄호로 닫혀 있어야 합니다. 예를 들어: gtk:fg"
 | 
			
		||||
"[NORMAL], 여기서 NORMAL은 값입니다. \"%s\"을(를) 분석할 수 없습니다."
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1302
 | 
			
		||||
#: ../src/ui/theme.c:1303
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Did not understand state \"%s\" in color specification"
 | 
			
		||||
msgstr "색상 지정의 \"%s\" 값을 이해할 수 없습니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1315
 | 
			
		||||
#: ../src/ui/theme.c:1316
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Did not understand color component \"%s\" in color specification"
 | 
			
		||||
msgstr "색상 지정의 색상 구성요소 \"%s\"을(를) 이해할 수 없습니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1344
 | 
			
		||||
#: ../src/ui/theme.c:1345
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Blend format is \"blend/bg_color/fg_color/alpha\", \"%s\" does not fit the "
 | 
			
		||||
@@ -1016,17 +1023,17 @@ msgstr ""
 | 
			
		||||
"섞기 형식은 \"blend/bg_color/fg_color/alpha\"입니다, \"%s\"은(는) 형식에 맞"
 | 
			
		||||
"지 않습니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1355
 | 
			
		||||
#: ../src/ui/theme.c:1356
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Could not parse alpha value \"%s\" in blended color"
 | 
			
		||||
msgstr "색상 섞기에서 알파 값 \"%s\"을(를) 분석할 수 없습니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1365
 | 
			
		||||
#: ../src/ui/theme.c:1366
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Alpha value \"%s\" in blended color is not between 0.0 and 1.0"
 | 
			
		||||
msgstr "색상 섞기에서 알파 값 \"%s\"은(는) 0.0 과 1.0사이의 값이 아닙니다"
 | 
			
		||||
msgstr "색상 섞기에서 알파 값 \"%s\"은(는) 0.0과 1.0 사이의 값이 아닙니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1412
 | 
			
		||||
#: ../src/ui/theme.c:1413
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Shade format is \"shade/base_color/factor\", \"%s\" does not fit the format"
 | 
			
		||||
@@ -1034,79 +1041,78 @@ msgstr ""
 | 
			
		||||
"그림자 형식은 \"shade/base_color/format\"입니다, \"%s\"(은)는 형식에 맞지 않"
 | 
			
		||||
"습니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1423
 | 
			
		||||
#: ../src/ui/theme.c:1424
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Could not parse shade factor \"%s\" in shaded color"
 | 
			
		||||
msgstr "그림자색에서 그림자 인자 \"%s\"(을)를 해석할 수 없습니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1433
 | 
			
		||||
#: ../src/ui/theme.c:1434
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Shade factor \"%s\" in shaded color is negative"
 | 
			
		||||
msgstr "그림자색에서 그림자 인자 \"%s\"(은)는 음수입니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1462
 | 
			
		||||
#: ../src/ui/theme.c:1463
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Could not parse color \"%s\""
 | 
			
		||||
msgstr "색상 \"%s\"을(를) 해석할 수 없습니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1779
 | 
			
		||||
#: ../src/ui/theme.c:1780
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Coordinate expression contains character '%s' which is not allowed"
 | 
			
		||||
msgstr "좌표식에 허용되지 않는 문자 '%s'(이)가 포함되어 있습니다"
 | 
			
		||||
msgstr "좌표식에 허용되지 않는 문자 '%s'(이)가 들어 있습니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1806
 | 
			
		||||
#: ../src/ui/theme.c:1807
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Coordinate expression contains floating point number '%s' which could not be "
 | 
			
		||||
"parsed"
 | 
			
		||||
msgstr "좌표식에 분석할 수 없는 부동소수점 숫자 '%s'이(가) 포함되어 있습니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1820
 | 
			
		||||
#: ../src/ui/theme.c:1821
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Coordinate expression contains integer '%s' which could not be parsed"
 | 
			
		||||
msgstr "좌표식에 분석할 수 없는 정수 '%s'이(가) 포함되어 있습니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1941
 | 
			
		||||
#: ../src/ui/theme.c:1942
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Coordinate expression contained unknown operator at the start of this text: "
 | 
			
		||||
"\"%s\""
 | 
			
		||||
msgstr ""
 | 
			
		||||
"좌표식에 이 글자 시작부분에 알 수 없는 연산자가 포함되어 있습니다: \"%s\""
 | 
			
		||||
msgstr "좌표식에 이 글자 시작부분에 알 수 없는 연산자가 들어 있습니다: \"%s\""
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:1998
 | 
			
		||||
#: ../src/ui/theme.c:1999
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Coordinate expression was empty or not understood"
 | 
			
		||||
msgstr "좌표식이 비어있거나 이해할 수 없습니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:2111 ../src/ui/theme.c:2121 ../src/ui/theme.c:2155
 | 
			
		||||
#: ../src/ui/theme.c:2112 ../src/ui/theme.c:2122 ../src/ui/theme.c:2156
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Coordinate expression results in division by zero"
 | 
			
		||||
msgstr "좌표식의 결과 값이 0로 나누었습니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:2163
 | 
			
		||||
#: ../src/ui/theme.c:2164
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Coordinate expression tries to use mod operator on a floating-point number"
 | 
			
		||||
msgstr "좌표식에서 부동소수점 수에 나머지 연산을 하려 합니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:2219
 | 
			
		||||
#: ../src/ui/theme.c:2220
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Coordinate expression has an operator \"%s\" where an operand was expected"
 | 
			
		||||
msgstr "좌표식에서 피연산자가 들어갈 곳에 연산자 \"%s\"이(가) 있습니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:2228
 | 
			
		||||
#: ../src/ui/theme.c:2229
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Coordinate expression had an operand where an operator was expected"
 | 
			
		||||
msgstr "좌표식에서 연산자가 들어갈 곳에 피연산자가 있습니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:2236
 | 
			
		||||
#: ../src/ui/theme.c:2237
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Coordinate expression ended with an operator instead of an operand"
 | 
			
		||||
msgstr "좌표식에서 피연산자 대신에 연산자로 끝나있습니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:2246
 | 
			
		||||
#: ../src/ui/theme.c:2247
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Coordinate expression has operator \"%c\" following operator \"%c\" with no "
 | 
			
		||||
@@ -1115,37 +1121,37 @@ msgstr ""
 | 
			
		||||
"좌표식에서 피연산자가 없는 연산자 \"%2$c\"다음에 연산자 \"%1$c\"이(가) 있습니"
 | 
			
		||||
"다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:2397 ../src/ui/theme.c:2442
 | 
			
		||||
#: ../src/ui/theme.c:2398 ../src/ui/theme.c:2443
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Coordinate expression had unknown variable or constant \"%s\""
 | 
			
		||||
msgstr "좌표식에 알 수 없는 변수나 상수 \"%s\"이(가) 있습니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:2496
 | 
			
		||||
#: ../src/ui/theme.c:2497
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Coordinate expression parser overflowed its buffer."
 | 
			
		||||
msgstr "좌표 계산 파서의 버퍼가 크기를 넘어갔습니다."
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:2525
 | 
			
		||||
#: ../src/ui/theme.c:2526
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Coordinate expression had a close parenthesis with no open parenthesis"
 | 
			
		||||
msgstr "좌표식에 닫는 괄호는 있지만 여는 괄호가 없습니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:2589
 | 
			
		||||
#: ../src/ui/theme.c:2590
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Coordinate expression had an open parenthesis with no close parenthesis"
 | 
			
		||||
msgstr "좌표식에 여는 괄호는 있지만 닫는 괄호가 없습니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:2600
 | 
			
		||||
#: ../src/ui/theme.c:2601
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Coordinate expression doesn't seem to have any operators or operands"
 | 
			
		||||
msgstr "좌표식에 어떠한 연산자나 피연산자가 없습니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:2813 ../src/ui/theme.c:2833 ../src/ui/theme.c:2853
 | 
			
		||||
#: ../src/ui/theme.c:2814 ../src/ui/theme.c:2834 ../src/ui/theme.c:2854
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Theme contained an expression that resulted in an error: %s\n"
 | 
			
		||||
msgstr "테마가 오류 값을 내는 표현식이 들어 있습니다: %s\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:4499
 | 
			
		||||
#: ../src/ui/theme.c:4500
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"<button function=\"%s\" state=\"%s\" draw_ops=\"whatever\"/> must be "
 | 
			
		||||
@@ -1154,7 +1160,7 @@ msgstr ""
 | 
			
		||||
"이 프레임 스타일에는 <button function=\"%s\" style=\"%s\" draw_ops=\"whatever"
 | 
			
		||||
"\"/>가 지정되어야 합니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:5010 ../src/ui/theme.c:5035
 | 
			
		||||
#: ../src/ui/theme.c:5011 ../src/ui/theme.c:5036
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Missing <frame state=\"%s\" resize=\"%s\" focus=\"%s\" style=\"whatever\"/>"
 | 
			
		||||
@@ -1162,18 +1168,18 @@ msgstr ""
 | 
			
		||||
"<frame state=\"%s\" resize=\"%s\" focus=\"%s\" state=\"whatever\"/> 가 없습니"
 | 
			
		||||
"다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:5083
 | 
			
		||||
#: ../src/ui/theme.c:5082
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Failed to load theme \"%s\": %s\n"
 | 
			
		||||
msgstr "테마 \"%s\"을(를) 읽을 수 없습니다: %s\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:5219 ../src/ui/theme.c:5226 ../src/ui/theme.c:5233
 | 
			
		||||
#: ../src/ui/theme.c:5240 ../src/ui/theme.c:5247
 | 
			
		||||
#: ../src/ui/theme.c:5218 ../src/ui/theme.c:5225 ../src/ui/theme.c:5232
 | 
			
		||||
#: ../src/ui/theme.c:5239 ../src/ui/theme.c:5246
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "No <%s> set for theme \"%s\""
 | 
			
		||||
msgstr "테마 \"%2$s\"의 <%1$s>(이)가 설정되지 않았습니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:5255
 | 
			
		||||
#: ../src/ui/theme.c:5254
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"No frame style set for window type \"%s\" in theme \"%s\", add a <window "
 | 
			
		||||
@@ -1182,14 +1188,14 @@ msgstr ""
 | 
			
		||||
"테마 \"%2$s\"의 창 형식 \"%1$s\"에 대한 프레임 스타일이 없습니다,<window "
 | 
			
		||||
"type=\"%3$s\" style_set=\"whatever\"/> 엘리먼트를 추가하십시오"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:5662 ../src/ui/theme.c:5724 ../src/ui/theme.c:5787
 | 
			
		||||
#: ../src/ui/theme.c:5661 ../src/ui/theme.c:5723 ../src/ui/theme.c:5786
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"User-defined constants must begin with a capital letter; \"%s\" does not"
 | 
			
		||||
msgstr ""
 | 
			
		||||
"사용자 정의 상수는 대문자로 시작되어야 합니다. \"%s\"은(는) 그렇지 않습니다."
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme.c:5670 ../src/ui/theme.c:5732 ../src/ui/theme.c:5795
 | 
			
		||||
#: ../src/ui/theme.c:5669 ../src/ui/theme.c:5731 ../src/ui/theme.c:5794
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Constant \"%s\" has already been defined"
 | 
			
		||||
msgstr "상수 \"%s\"은(는) 이미 지정되어 있습니다"
 | 
			
		||||
@@ -1324,9 +1330,7 @@ msgstr "<%s> 엘리먼트는 <%s> 아래에 허용되지 않습니다"
 | 
			
		||||
msgid ""
 | 
			
		||||
"Cannot specify both \"button_width\"/\"button_height\" and \"aspect_ratio\" "
 | 
			
		||||
"for buttons"
 | 
			
		||||
msgstr ""
 | 
			
		||||
"단추의 button_width/button_height 와 \"aspect_ratio\"를 한꺼번에 지정할 수 없"
 | 
			
		||||
"습니다"
 | 
			
		||||
msgstr "단추의 \"button_width\"/\"button_height\"와 \"aspect_ratio\"를 한꺼번에 지정할 수 없습니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-parser.c:1450
 | 
			
		||||
#, c-format
 | 
			
		||||
@@ -1387,7 +1391,7 @@ msgstr "\"%s\"라 불리는 <draw_ops>는 정의되지 않았습니다"
 | 
			
		||||
#: ../src/ui/theme-parser.c:2706 ../src/ui/theme-parser.c:2802
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Including draw_ops \"%s\" here would create a circular reference"
 | 
			
		||||
msgstr "draw_ops를 포함하는 \"%s\"이(가) 자기 자신을 참조하고 있습니다"
 | 
			
		||||
msgstr "여기서 draw_ops \"%s\"을(를) 포함하면 순환 참조가 됩니다."
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-parser.c:2917
 | 
			
		||||
#, c-format
 | 
			
		||||
@@ -1569,205 +1573,7 @@ msgstr "<%s> 엘리먼트 안에 텍스트가 허용되지 않습니다"
 | 
			
		||||
msgid "<%s> specified twice for this theme"
 | 
			
		||||
msgstr "이 테마에서 <%s> 태그가 두 번 지정되었습니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-parser.c:4334
 | 
			
		||||
#: ../src/ui/theme-parser.c:4336
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Failed to find a valid file for theme %s\n"
 | 
			
		||||
msgstr "%s 테마의 올바른 파일을 찾는 데 실패했습니다\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:99
 | 
			
		||||
msgid "_Windows"
 | 
			
		||||
msgstr "창(_W)"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:100
 | 
			
		||||
msgid "_Dialog"
 | 
			
		||||
msgstr "대화 상자(_D)"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:101
 | 
			
		||||
msgid "_Modal dialog"
 | 
			
		||||
msgstr "모달 대화 상자(_M)"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:102
 | 
			
		||||
msgid "_Utility"
 | 
			
		||||
msgstr "도구(_U)"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:103
 | 
			
		||||
msgid "_Splashscreen"
 | 
			
		||||
msgstr "스플래시 화면(_S)"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:104
 | 
			
		||||
msgid "_Top dock"
 | 
			
		||||
msgstr "위 도크(_T)"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:105
 | 
			
		||||
msgid "_Bottom dock"
 | 
			
		||||
msgstr "아래 도크(_B)"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:106
 | 
			
		||||
msgid "_Left dock"
 | 
			
		||||
msgstr "왼쪽 도크(_L)"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:107
 | 
			
		||||
msgid "_Right dock"
 | 
			
		||||
msgstr "오른쪽 도크(_R)"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:108
 | 
			
		||||
msgid "_All docks"
 | 
			
		||||
msgstr "모든 도크(_A)"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:109
 | 
			
		||||
msgid "Des_ktop"
 | 
			
		||||
msgstr "데스크톱(_K)"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:115
 | 
			
		||||
msgid "Open another one of these windows"
 | 
			
		||||
msgstr "이 창을 하나 더 엽니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:117
 | 
			
		||||
msgid "This is a demo button with an 'open' icon"
 | 
			
		||||
msgstr "'열기' 아이콘이 들어 있는 데모 단추입니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:119
 | 
			
		||||
msgid "This is a demo button with a 'quit' icon"
 | 
			
		||||
msgstr "'끝내기' 아이콘이 들어 있는 데모 단추입니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:248
 | 
			
		||||
msgid "This is a sample message in a sample dialog"
 | 
			
		||||
msgstr "예제 대화 상자의 예제 메시지입니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:328
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Fake menu item %d\n"
 | 
			
		||||
msgstr "가짜 메뉴 항목 %d\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:363
 | 
			
		||||
msgid "Border-only window"
 | 
			
		||||
msgstr "테두리만 있는 창"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:365
 | 
			
		||||
msgid "Bar"
 | 
			
		||||
msgstr "모음"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:382
 | 
			
		||||
msgid "Normal Application Window"
 | 
			
		||||
msgstr "보통 프로그램 창"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:386
 | 
			
		||||
msgid "Dialog Box"
 | 
			
		||||
msgstr "대화 상자"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:390
 | 
			
		||||
msgid "Modal Dialog Box"
 | 
			
		||||
msgstr "모달 대화 상자"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:394
 | 
			
		||||
msgid "Utility Palette"
 | 
			
		||||
msgstr "도구 팔레트"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:398
 | 
			
		||||
msgid "Torn-off Menu"
 | 
			
		||||
msgstr "떼어내기 메뉴"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:402
 | 
			
		||||
msgid "Border"
 | 
			
		||||
msgstr "테두리"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:406
 | 
			
		||||
msgid "Attached Modal Dialog"
 | 
			
		||||
msgstr "부착한 모달 대화 상자"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:737
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Button layout test %d"
 | 
			
		||||
msgstr "단추 배치 테스트 %d"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:766
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "%g milliseconds to draw one window frame"
 | 
			
		||||
msgstr "창 프레임 하나를 그리는 데 %g ms"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:811
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Usage: metacity-theme-viewer [THEMENAME]\n"
 | 
			
		||||
msgstr "사용법: metacity-theme-viewer [테마이름]\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:818
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Error loading theme: %s\n"
 | 
			
		||||
msgstr "테마를 읽어들이는 데 오류가 발생했습니다: %s\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:824
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Loaded theme \"%s\" in %g seconds\n"
 | 
			
		||||
msgstr "\"%s\" 테마를 읽어들이는 데 %g초\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:869
 | 
			
		||||
msgid "Normal Title Font"
 | 
			
		||||
msgstr "보통 제목 글꼴"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:875
 | 
			
		||||
msgid "Small Title Font"
 | 
			
		||||
msgstr "작은 제목 글꼴"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:881
 | 
			
		||||
msgid "Large Title Font"
 | 
			
		||||
msgstr "큰 제목 글꼴"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:886
 | 
			
		||||
msgid "Button Layouts"
 | 
			
		||||
msgstr "단추 배치"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:891
 | 
			
		||||
msgid "Benchmark"
 | 
			
		||||
msgstr "벤치마크"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:947
 | 
			
		||||
msgid "Window Title Goes Here"
 | 
			
		||||
msgstr "창 제목이 여기에 들어갑니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:1053
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
"Drew %d frames in %g client-side seconds (%g milliseconds per frame) and %g "
 | 
			
		||||
"seconds wall clock time including X server resources (%g milliseconds per "
 | 
			
		||||
"frame)\n"
 | 
			
		||||
msgstr ""
 | 
			
		||||
"%d개 프레임을 그리는 데 클라이언트 입장에서 %g초가 걸렸습니다(한 프레임에 %g "
 | 
			
		||||
"ms). 그리고 X 서버 리소스까지 포함해 실제 시간으로 %g 초가 걸렸습니다(한 프레"
 | 
			
		||||
"임에 %g ms).\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:1273
 | 
			
		||||
msgid "position expression test returned TRUE but set error"
 | 
			
		||||
msgstr "위치 표현식 테스트가 참을 리턴했지만 오류가 발생했습니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:1275
 | 
			
		||||
msgid "position expression test returned FALSE but didn't set error"
 | 
			
		||||
msgstr "위치 표현식 테스트가 거짓을 리턴했지만 오류가 발생하지 않았습니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:1279
 | 
			
		||||
msgid "Error was expected but none given"
 | 
			
		||||
msgstr "오류가 발생해야 하지만 발생하지 않았습니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:1281
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Error %d was expected but %d given"
 | 
			
		||||
msgstr "오류 %d번이 발생해야 하지만 오류 %d번이 발생했습니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:1287
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "Error not expected but one was returned: %s"
 | 
			
		||||
msgstr "오류가 발생하면 안 되지만 오류 한 개가 발생했습니다: %s"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:1291
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "x value was %d, %d was expected"
 | 
			
		||||
msgstr "가로값이 %d입니다. 와야 하는 값은 %d입니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:1294
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "y value was %d, %d was expected"
 | 
			
		||||
msgstr "세로값이 %d입니다. 와야 하는 값은 %d입니다"
 | 
			
		||||
 | 
			
		||||
#: ../src/ui/theme-viewer.c:1359
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid "%d coordinate expressions parsed in %g seconds (%g seconds average)\n"
 | 
			
		||||
msgstr "좌표 표현식 %d개를 %g초에 파싱했습니다(평균 %g초)\n"
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										18
									
								
								po/sr.po
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								po/sr.po
									
									
									
									
									
								
							@@ -10,8 +10,8 @@ msgstr ""
 | 
			
		||||
"Project-Id-Version: mutter\n"
 | 
			
		||||
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=mutter"
 | 
			
		||||
"&keywords=I18N+L10N&component=general\n"
 | 
			
		||||
"POT-Creation-Date: 2013-03-01 15:50+0000\n"
 | 
			
		||||
"PO-Revision-Date: 2013-03-11 11:40+0200\n"
 | 
			
		||||
"POT-Creation-Date: 2013-08-18 20:03+0000\n"
 | 
			
		||||
"PO-Revision-Date: 2013-09-06 09:19+0200\n"
 | 
			
		||||
"Last-Translator: Мирослав Николић <miroslavnikolic@rocketmail.com>\n"
 | 
			
		||||
"Language-Team: Serbian <gnom@prevod.org>\n"
 | 
			
		||||
"Language: sr\n"
 | 
			
		||||
@@ -320,6 +320,20 @@ msgstr ""
 | 
			
		||||
"Не могу да пронађем тему! Проверите да „%s“ постоји и да садржи уобичајене "
 | 
			
		||||
"теме.\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/monitor.c:711
 | 
			
		||||
msgid "Built-in display"
 | 
			
		||||
msgstr "Уграђени дисплеј"
 | 
			
		||||
 | 
			
		||||
#. TRANSLATORS: this is a monitor name (in case we don't know
 | 
			
		||||
#. the vendor), it's Unknown followed by a size in inches,
 | 
			
		||||
#. like 'Unknown 15"'
 | 
			
		||||
#.
 | 
			
		||||
#: ../src/core/monitor.c:739
 | 
			
		||||
#, c-format
 | 
			
		||||
#| msgid "Unknown element %s"
 | 
			
		||||
msgid "Unknown %s"
 | 
			
		||||
msgstr "Непознат %s"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/mutter.c:40
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
 
 | 
			
		||||
@@ -10,8 +10,8 @@ msgstr ""
 | 
			
		||||
"Project-Id-Version: mutter\n"
 | 
			
		||||
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=mutter"
 | 
			
		||||
"&keywords=I18N+L10N&component=general\n"
 | 
			
		||||
"POT-Creation-Date: 2013-03-01 15:50+0000\n"
 | 
			
		||||
"PO-Revision-Date: 2013-03-11 11:40+0200\n"
 | 
			
		||||
"POT-Creation-Date: 2013-08-18 20:03+0000\n"
 | 
			
		||||
"PO-Revision-Date: 2013-09-06 09:19+0200\n"
 | 
			
		||||
"Last-Translator: Miroslav Nikolić <miroslavnikolic@rocketmail.com>\n"
 | 
			
		||||
"Language-Team: Serbian <gnom@prevod.org>\n"
 | 
			
		||||
"Language: sr\n"
 | 
			
		||||
@@ -320,6 +320,20 @@ msgstr ""
 | 
			
		||||
"Ne mogu da pronađem temu! Proverite da „%s“ postoji i da sadrži uobičajene "
 | 
			
		||||
"teme.\n"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/monitor.c:711
 | 
			
		||||
msgid "Built-in display"
 | 
			
		||||
msgstr "Ugrađeni displej"
 | 
			
		||||
 | 
			
		||||
#. TRANSLATORS: this is a monitor name (in case we don't know
 | 
			
		||||
#. the vendor), it's Unknown followed by a size in inches,
 | 
			
		||||
#. like 'Unknown 15"'
 | 
			
		||||
#.
 | 
			
		||||
#: ../src/core/monitor.c:739
 | 
			
		||||
#, c-format
 | 
			
		||||
#| msgid "Unknown element %s"
 | 
			
		||||
msgid "Unknown %s"
 | 
			
		||||
msgstr "Nepoznat %s"
 | 
			
		||||
 | 
			
		||||
#: ../src/core/mutter.c:40
 | 
			
		||||
#, c-format
 | 
			
		||||
msgid ""
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										648
									
								
								po/zh_HK.po
									
									
									
									
									
								
							
							
						
						
									
										648
									
								
								po/zh_HK.po
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										648
									
								
								po/zh_TW.po
									
									
									
									
									
								
							
							
						
						
									
										648
									
								
								po/zh_TW.po
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										7
									
								
								protocol/Makefile.am
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								protocol/Makefile.am
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,7 @@
 | 
			
		||||
NULL =
 | 
			
		||||
 | 
			
		||||
EXTRA_DIST = \
 | 
			
		||||
	gtk-shell.xml \
 | 
			
		||||
	xdg-shell.xml \
 | 
			
		||||
	xserver.xml \
 | 
			
		||||
	$(NULL)
 | 
			
		||||
							
								
								
									
										30
									
								
								protocol/gtk-shell.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								protocol/gtk-shell.xml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,30 @@
 | 
			
		||||
<protocol name="gtk">
 | 
			
		||||
 | 
			
		||||
  <interface name="gtk_shell" version="1">
 | 
			
		||||
    <enum name="capability">
 | 
			
		||||
      <entry name="global_app_menu" value="1"/>
 | 
			
		||||
      <entry name="global_menu_bar" value="2"/>
 | 
			
		||||
    </enum>
 | 
			
		||||
 | 
			
		||||
    <event name="capabilities">
 | 
			
		||||
      <arg name="capabilities" type="uint"/>
 | 
			
		||||
    </event>
 | 
			
		||||
 | 
			
		||||
    <request name="get_gtk_surface">
 | 
			
		||||
      <arg name="gtk_surface" type="new_id" interface="gtk_surface"/>
 | 
			
		||||
      <arg name="surface" type="object" interface="wl_surface"/>
 | 
			
		||||
    </request>
 | 
			
		||||
  </interface>
 | 
			
		||||
 | 
			
		||||
  <interface name="gtk_surface" version="1">
 | 
			
		||||
    <request name="set_dbus_properties">
 | 
			
		||||
      <arg name="application_id" type="string" allow-null="true"/>
 | 
			
		||||
      <arg name="app_menu_path" type="string" allow-null="true"/>
 | 
			
		||||
      <arg name="menubar_path" type="string" allow-null="true"/>
 | 
			
		||||
      <arg name="window_object_path" type="string" allow-null="true"/>
 | 
			
		||||
      <arg name="application_object_path" type="string" allow-null="true"/>
 | 
			
		||||
      <arg name="unique_bus_name" type="string" allow-null="true"/>
 | 
			
		||||
    </request>
 | 
			
		||||
  </interface>
 | 
			
		||||
 | 
			
		||||
</protocol>
 | 
			
		||||
							
								
								
									
										438
									
								
								protocol/xdg-shell.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										438
									
								
								protocol/xdg-shell.xml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,438 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<protocol name="xdg_shell">
 | 
			
		||||
 | 
			
		||||
  <copyright>
 | 
			
		||||
    Copyright © 2008-2013 Kristian Høgsberg
 | 
			
		||||
    Copyright © 2013      Rafael Antognolli
 | 
			
		||||
    Copyright © 2013      Jasper St. Pierre
 | 
			
		||||
    Copyright © 2010-2013 Intel Corporation
 | 
			
		||||
 | 
			
		||||
    Permission to use, copy, modify, distribute, and sell this
 | 
			
		||||
    software and its documentation for any purpose is hereby granted
 | 
			
		||||
    without fee, provided that the above copyright notice appear in
 | 
			
		||||
    all copies and that both that copyright notice and this permission
 | 
			
		||||
    notice appear in supporting documentation, and that the name of
 | 
			
		||||
    the copyright holders not be used in advertising or publicity
 | 
			
		||||
    pertaining to distribution of the software without specific,
 | 
			
		||||
    written prior permission.  The copyright holders make no
 | 
			
		||||
    representations about the suitability of this software for any
 | 
			
		||||
    purpose.  It is provided "as is" without express or implied
 | 
			
		||||
    warranty.
 | 
			
		||||
 | 
			
		||||
    THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
 | 
			
		||||
    SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
 | 
			
		||||
    FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
 | 
			
		||||
    SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 | 
			
		||||
    WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
 | 
			
		||||
    AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
 | 
			
		||||
    ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
 | 
			
		||||
    THIS SOFTWARE.
 | 
			
		||||
  </copyright>
 | 
			
		||||
 | 
			
		||||
  <interface name="xdg_shell" version="1">
 | 
			
		||||
    <description summary="create desktop-style surfaces">
 | 
			
		||||
      This interface is implemented by servers that provide
 | 
			
		||||
      desktop-style user interfaces.
 | 
			
		||||
 | 
			
		||||
      It allows clients to associate a xdg_surface with
 | 
			
		||||
      a basic surface.
 | 
			
		||||
    </description>
 | 
			
		||||
 | 
			
		||||
    <enum name="version">
 | 
			
		||||
      <description summary="latest protocol version">
 | 
			
		||||
	Use this enum to check the protocol version, and it will be updated
 | 
			
		||||
	automatically.
 | 
			
		||||
      </description>
 | 
			
		||||
      <entry name="current" value="1" summary="Always the latest version"/>
 | 
			
		||||
    </enum>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    <request name="use_unstable_version">
 | 
			
		||||
      <description summary="enable use of this unstable version">
 | 
			
		||||
	Use this request in order to enable use of this interface.
 | 
			
		||||
 | 
			
		||||
	Understand and agree that one is using an unstable interface,
 | 
			
		||||
	that will likely change in the future, breaking the API.
 | 
			
		||||
      </description>
 | 
			
		||||
      <arg name="version" type="int"/>
 | 
			
		||||
    </request>
 | 
			
		||||
 | 
			
		||||
    <request name="get_xdg_surface">
 | 
			
		||||
      <description summary="create a shell surface from a surface">
 | 
			
		||||
	Create a shell surface for an existing surface.
 | 
			
		||||
 | 
			
		||||
	Only one shell or popup surface can be associated with a given
 | 
			
		||||
	surface.
 | 
			
		||||
      </description>
 | 
			
		||||
      <arg name="id" type="new_id" interface="xdg_surface"/>
 | 
			
		||||
      <arg name="surface" type="object" interface="wl_surface"/>
 | 
			
		||||
    </request>
 | 
			
		||||
 | 
			
		||||
    <request name="get_xdg_popup">
 | 
			
		||||
      <description summary="create a shell surface from a surface">
 | 
			
		||||
	Create a popup surface for an existing surface.
 | 
			
		||||
 | 
			
		||||
	Only one shell or popup surface can be associated with a given
 | 
			
		||||
	surface.
 | 
			
		||||
      </description>
 | 
			
		||||
      <arg name="id" type="new_id" interface="xdg_popup"/>
 | 
			
		||||
      <arg name="surface" type="object" interface="wl_surface"/>
 | 
			
		||||
      <arg name="parent" type="object" interface="wl_surface"/>
 | 
			
		||||
      <arg name="seat" type="object" interface="wl_seat" summary="the wl_seat whose pointer is used"/>
 | 
			
		||||
      <arg name="serial" type="uint" summary="serial of the implicit grab on the pointer"/>
 | 
			
		||||
      <arg name="x" type="int"/>
 | 
			
		||||
      <arg name="y" type="int"/>
 | 
			
		||||
      <arg name="flags" type="uint"/>
 | 
			
		||||
    </request>
 | 
			
		||||
  </interface>
 | 
			
		||||
 | 
			
		||||
  <interface name="xdg_surface" version="1">
 | 
			
		||||
 | 
			
		||||
    <description summary="desktop-style metadata interface">
 | 
			
		||||
      An interface that may be implemented by a wl_surface, for
 | 
			
		||||
      implementations that provide a desktop-style user interface.
 | 
			
		||||
 | 
			
		||||
      It provides requests to treat surfaces like windows, allowing to set
 | 
			
		||||
      properties like maximized, fullscreen, minimized, and to move and resize
 | 
			
		||||
      them, and associate metadata like title and app id.
 | 
			
		||||
 | 
			
		||||
      On the server side the object is automatically destroyed when
 | 
			
		||||
      the related wl_surface is destroyed.  On client side,
 | 
			
		||||
      xdg_surface.destroy() must be called before destroying
 | 
			
		||||
      the wl_surface object.
 | 
			
		||||
    </description>
 | 
			
		||||
 | 
			
		||||
    <request name="destroy" type="destructor">
 | 
			
		||||
      <description summary="remove xdg_surface interface">
 | 
			
		||||
	The xdg_surface interface is removed from the wl_surface object
 | 
			
		||||
	that was turned into a xdg_surface with
 | 
			
		||||
	xdg_shell.get_xdg_surface request. The xdg_surface properties,
 | 
			
		||||
	like maximized and fullscreen, are lost. The wl_surface loses
 | 
			
		||||
	its role as a xdg_surface. The wl_surface is unmapped.
 | 
			
		||||
      </description>
 | 
			
		||||
    </request>
 | 
			
		||||
 | 
			
		||||
    <request name="set_transient_for">
 | 
			
		||||
      <description summary="surface is a child of another surface">
 | 
			
		||||
	Setting a surface as transient of another means that it is child
 | 
			
		||||
	of another surface.
 | 
			
		||||
 | 
			
		||||
	Child surfaces are stacked above their parents, and will be
 | 
			
		||||
	unmapped if the parent is unmapped too. They should not appear
 | 
			
		||||
	on task bars and alt+tab.
 | 
			
		||||
      </description>
 | 
			
		||||
      <arg name="parent" type="object" interface="wl_surface" allow-null="true"/>
 | 
			
		||||
    </request>
 | 
			
		||||
 | 
			
		||||
    <request name="set_title">
 | 
			
		||||
      <description summary="set surface title">
 | 
			
		||||
	Set a short title for the surface.
 | 
			
		||||
 | 
			
		||||
	This string may be used to identify the surface in a task bar,
 | 
			
		||||
	window list, or other user interface elements provided by the
 | 
			
		||||
	compositor.
 | 
			
		||||
 | 
			
		||||
	The string must be encoded in UTF-8.
 | 
			
		||||
      </description>
 | 
			
		||||
      <arg name="title" type="string"/>
 | 
			
		||||
    </request>
 | 
			
		||||
 | 
			
		||||
    <request name="set_app_id">
 | 
			
		||||
      <description summary="set surface class">
 | 
			
		||||
	Set an id for the surface.
 | 
			
		||||
 | 
			
		||||
	The app id identifies the general class of applications to which
 | 
			
		||||
	the surface belongs.
 | 
			
		||||
 | 
			
		||||
	It should be the ID that appears in the new desktop entry
 | 
			
		||||
	specification, the interface name.
 | 
			
		||||
      </description>
 | 
			
		||||
      <arg name="app_id" type="string"/>
 | 
			
		||||
    </request>
 | 
			
		||||
 | 
			
		||||
    <request name="pong">
 | 
			
		||||
      <description summary="respond to a ping event">
 | 
			
		||||
	A client must respond to a ping event with a pong request or
 | 
			
		||||
	the client may be deemed unresponsive.
 | 
			
		||||
      </description>
 | 
			
		||||
      <arg name="serial" type="uint" summary="serial of the ping event"/>
 | 
			
		||||
    </request>
 | 
			
		||||
 | 
			
		||||
    <event name="ping">
 | 
			
		||||
      <description summary="ping client">
 | 
			
		||||
	Ping a client to check if it is receiving events and sending
 | 
			
		||||
	requests. A client is expected to reply with a pong request.
 | 
			
		||||
      </description>
 | 
			
		||||
      <arg name="serial" type="uint"/>
 | 
			
		||||
    </event>
 | 
			
		||||
 | 
			
		||||
    <request name="move">
 | 
			
		||||
      <description summary="start an interactive move">
 | 
			
		||||
	Start a pointer-driven move of the surface.
 | 
			
		||||
 | 
			
		||||
	This request must be used in response to a button press event.
 | 
			
		||||
	The server may ignore move requests depending on the state of
 | 
			
		||||
	the surface (e.g. fullscreen or maximized).
 | 
			
		||||
      </description>
 | 
			
		||||
      <arg name="seat" type="object" interface="wl_seat" summary="the wl_seat whose pointer is used"/>
 | 
			
		||||
      <arg name="serial" type="uint" summary="serial of the implicit grab on the pointer"/>
 | 
			
		||||
    </request>
 | 
			
		||||
 | 
			
		||||
    <enum name="resize_edge">
 | 
			
		||||
      <description summary="edge values for resizing">
 | 
			
		||||
	These values are used to indicate which edge of a surface
 | 
			
		||||
	is being dragged in a resize operation. The server may
 | 
			
		||||
	use this information to adapt its behavior, e.g. choose
 | 
			
		||||
	an appropriate cursor image.
 | 
			
		||||
      </description>
 | 
			
		||||
      <entry name="none" value="0"/>
 | 
			
		||||
      <entry name="top" value="1"/>
 | 
			
		||||
      <entry name="bottom" value="2"/>
 | 
			
		||||
      <entry name="left" value="4"/>
 | 
			
		||||
      <entry name="top_left" value="5"/>
 | 
			
		||||
      <entry name="bottom_left" value="6"/>
 | 
			
		||||
      <entry name="right" value="8"/>
 | 
			
		||||
      <entry name="top_right" value="9"/>
 | 
			
		||||
      <entry name="bottom_right" value="10"/>
 | 
			
		||||
    </enum>
 | 
			
		||||
 | 
			
		||||
    <request name="resize">
 | 
			
		||||
      <description summary="start an interactive resize">
 | 
			
		||||
	Start a pointer-driven resizing of the surface.
 | 
			
		||||
 | 
			
		||||
	This request must be used in response to a button press event.
 | 
			
		||||
	The server may ignore resize requests depending on the state of
 | 
			
		||||
	the surface (e.g. fullscreen or maximized).
 | 
			
		||||
      </description>
 | 
			
		||||
      <arg name="seat" type="object" interface="wl_seat" summary="the wl_seat whose pointer is used"/>
 | 
			
		||||
      <arg name="serial" type="uint" summary="serial of the implicit grab on the pointer"/>
 | 
			
		||||
      <arg name="edges" type="uint" summary="which edge or corner is being dragged"/>
 | 
			
		||||
    </request>
 | 
			
		||||
 | 
			
		||||
    <event name="configure">
 | 
			
		||||
      <description summary="suggest resize">
 | 
			
		||||
	The configure event asks the client to resize its surface.
 | 
			
		||||
 | 
			
		||||
	The size is a hint, in the sense that the client is free to
 | 
			
		||||
	ignore it if it doesn't resize, pick a smaller size (to
 | 
			
		||||
	satisfy aspect ratio or resize in steps of NxM pixels).
 | 
			
		||||
 | 
			
		||||
	The edges parameter provides a hint about how the surface
 | 
			
		||||
	was resized. The client may use this information to decide
 | 
			
		||||
	how to adjust its content to the new size (e.g. a scrolling
 | 
			
		||||
	area might adjust its content position to leave the viewable
 | 
			
		||||
	content unmoved). Valid edge values are from resize_edge enum.
 | 
			
		||||
 | 
			
		||||
	The client is free to dismiss all but the last configure
 | 
			
		||||
	event it received.
 | 
			
		||||
 | 
			
		||||
	The width and height arguments specify the size of the window
 | 
			
		||||
	in surface local coordinates.
 | 
			
		||||
      </description>
 | 
			
		||||
 | 
			
		||||
      <arg name="edges" type="uint"/>
 | 
			
		||||
      <arg name="width" type="int"/>
 | 
			
		||||
      <arg name="height" type="int"/>
 | 
			
		||||
    </event>
 | 
			
		||||
 | 
			
		||||
    <request name="set_output">
 | 
			
		||||
      <description summary="set the default output used by this surface">
 | 
			
		||||
	Set the default output used by this surface when it is first mapped.
 | 
			
		||||
 | 
			
		||||
	If this value is NULL (default), it's up to the compositor to choose
 | 
			
		||||
	which display will be used to map this surface.
 | 
			
		||||
 | 
			
		||||
	When fullscreen or maximized state are set on this surface, and it
 | 
			
		||||
	wasn't mapped yet, the output set with this method will be used.
 | 
			
		||||
	Otherwise, the output where the surface is currently mapped will be
 | 
			
		||||
	used.
 | 
			
		||||
      </description>
 | 
			
		||||
      <arg name="output" type="object" interface="wl_output" allow-null="true"/>
 | 
			
		||||
    </request>
 | 
			
		||||
 | 
			
		||||
    <event name="request_set_fullscreen">
 | 
			
		||||
      <description summary="server requests that the client set fullscreen">
 | 
			
		||||
	Event sent from the compositor to the client requesting that the client
 | 
			
		||||
	goes to a fullscreen state. It's the client job to call set_fullscreen
 | 
			
		||||
	and really trigger the fullscreen state.
 | 
			
		||||
      </description>
 | 
			
		||||
    </event>
 | 
			
		||||
 | 
			
		||||
    <event name="request_unset_fullscreen">
 | 
			
		||||
      <description summary="server requests that the client unset fullscreen">
 | 
			
		||||
	Event sent from the compositor to the client requesting that the client
 | 
			
		||||
	leaves the fullscreen state. It's the client job to call
 | 
			
		||||
	unset_fullscreen and really leave the fullscreen state.
 | 
			
		||||
      </description>
 | 
			
		||||
    </event>
 | 
			
		||||
 | 
			
		||||
    <request name="set_fullscreen">
 | 
			
		||||
      <description summary="set the surface state as fullscreen">
 | 
			
		||||
	Set the surface as fullscreen.
 | 
			
		||||
 | 
			
		||||
	After this request, the compositor should send a configure event
 | 
			
		||||
	informing the output size.
 | 
			
		||||
 | 
			
		||||
	This request informs the compositor that the next attached buffer
 | 
			
		||||
	committed will be in a fullscreen state. The buffer size should be the
 | 
			
		||||
	same size as the size informed in the configure event, if the client
 | 
			
		||||
	doesn't want to leave any empty area.
 | 
			
		||||
 | 
			
		||||
	In other words: the next attached buffer after set_maximized is the new
 | 
			
		||||
	maximized buffer. And the surface will be positioned at the maximized
 | 
			
		||||
	position on commit.
 | 
			
		||||
 | 
			
		||||
	A simple way to synchronize and wait for the correct configure event is
 | 
			
		||||
	to use a wl_display.sync request right after the set_fullscreen
 | 
			
		||||
	request. When the sync callback returns, the last configure event
 | 
			
		||||
	received just before it will be the correct one, and should contain the
 | 
			
		||||
	right size for the surface to maximize.
 | 
			
		||||
 | 
			
		||||
	Setting one state won't unset another state. Use
 | 
			
		||||
	xdg_surface.unset_fullscreen for unsetting it.
 | 
			
		||||
      </description>
 | 
			
		||||
    </request>
 | 
			
		||||
 | 
			
		||||
    <request name="unset_fullscreen">
 | 
			
		||||
      <description summary="unset the surface state as fullscreen">
 | 
			
		||||
	Unset the surface fullscreen state.
 | 
			
		||||
 | 
			
		||||
	Same negotiation as set_fullscreen must be used.
 | 
			
		||||
      </description>
 | 
			
		||||
    </request>
 | 
			
		||||
 | 
			
		||||
    <event name="request_set_maximized">
 | 
			
		||||
      <description summary="server requests that the client set maximized">
 | 
			
		||||
	Event sent from the compositor to the client requesting that the client
 | 
			
		||||
	goes to a maximized state. It's the client job to call set_maximized
 | 
			
		||||
	and really trigger the maximized state.
 | 
			
		||||
      </description>
 | 
			
		||||
    </event>
 | 
			
		||||
 | 
			
		||||
    <event name="request_unset_maximized">
 | 
			
		||||
      <description summary="server requests that the client unset maximized">
 | 
			
		||||
	Event sent from the compositor to the client requesting that the client
 | 
			
		||||
	leaves the maximized state. It's the client job to call unset_maximized
 | 
			
		||||
	and really leave the maximized state.
 | 
			
		||||
      </description>
 | 
			
		||||
    </event>
 | 
			
		||||
 | 
			
		||||
    <request name="set_maximized">
 | 
			
		||||
      <description summary="set the surface state as maximized">
 | 
			
		||||
	Set the surface as maximized.
 | 
			
		||||
 | 
			
		||||
	After this request, the compositor will send a configure event
 | 
			
		||||
	informing the output size minus panel and other MW decorations.
 | 
			
		||||
 | 
			
		||||
	This request informs the compositor that the next attached buffer
 | 
			
		||||
	committed will be in a maximized state. The buffer size should be the
 | 
			
		||||
	same size as the size informed in the configure event, if the client
 | 
			
		||||
	doesn't want to leave any empty area.
 | 
			
		||||
 | 
			
		||||
	In other words: the next attached buffer after set_maximized is the new
 | 
			
		||||
	maximized buffer. And the surface will be positioned at the maximized
 | 
			
		||||
	position on commit.
 | 
			
		||||
 | 
			
		||||
	A simple way to synchronize and wait for the correct configure event is
 | 
			
		||||
	to use a wl_display.sync request right after the set_maximized request.
 | 
			
		||||
	When the sync callback returns, the last configure event received just
 | 
			
		||||
	before it will be the correct one, and should contain the right size
 | 
			
		||||
	for the surface to maximize.
 | 
			
		||||
 | 
			
		||||
	Setting one state won't unset another state. Use
 | 
			
		||||
	xdg_surface.unset_maximized for unsetting it.
 | 
			
		||||
      </description>
 | 
			
		||||
    </request>
 | 
			
		||||
 | 
			
		||||
    <request name="unset_maximized">
 | 
			
		||||
      <description summary="unset the surface state as maximized">
 | 
			
		||||
	Unset the surface maximized state.
 | 
			
		||||
 | 
			
		||||
	Same negotiation as set_maximized must be used.
 | 
			
		||||
      </description>
 | 
			
		||||
    </request>
 | 
			
		||||
 | 
			
		||||
    <request name="set_minimized">
 | 
			
		||||
      <description summary="set the surface state as minimized">
 | 
			
		||||
	Set the surface minimized state.
 | 
			
		||||
 | 
			
		||||
	Setting one state won't unset another state.
 | 
			
		||||
      </description>
 | 
			
		||||
    </request>
 | 
			
		||||
 | 
			
		||||
    <event name="focused_set">
 | 
			
		||||
      <description summary="surface was focused">
 | 
			
		||||
	The focused_set event is sent when this surface has been
 | 
			
		||||
	activated. Window decorations should be updated accordingly.
 | 
			
		||||
      </description>
 | 
			
		||||
    </event>
 | 
			
		||||
 | 
			
		||||
    <event name="focused_unset">
 | 
			
		||||
      <description summary="surface was unfocused">
 | 
			
		||||
	The focused_unset event is sent when this surface has been
 | 
			
		||||
	deactivated, because another surface has been activated. Window
 | 
			
		||||
	decorations should be updated accordingly.
 | 
			
		||||
      </description>
 | 
			
		||||
    </event>
 | 
			
		||||
  </interface>
 | 
			
		||||
 | 
			
		||||
  <interface name="xdg_popup" version="1">
 | 
			
		||||
    <description summary="desktop-style metadata interface">
 | 
			
		||||
      An interface that may be implemented by a wl_surface, for
 | 
			
		||||
      implementations that provide a desktop-style popups/menus. A popup
 | 
			
		||||
      surface is a transient surface with an added pointer grab.
 | 
			
		||||
 | 
			
		||||
      An existing implicit grab will be changed to owner-events mode,
 | 
			
		||||
      and the popup grab will continue after the implicit grab ends
 | 
			
		||||
      (i.e. releasing the mouse button does not cause the popup to be
 | 
			
		||||
      unmapped).
 | 
			
		||||
 | 
			
		||||
      The popup grab continues until the window is destroyed or a mouse
 | 
			
		||||
      button is pressed in any other clients window. A click in any of
 | 
			
		||||
      the clients surfaces is reported as normal, however, clicks in
 | 
			
		||||
      other clients surfaces will be discarded and trigger the callback.
 | 
			
		||||
 | 
			
		||||
      The x and y arguments specify the locations of the upper left
 | 
			
		||||
      corner of the surface relative to the upper left corner of the
 | 
			
		||||
      parent surface, in surface local coordinates.
 | 
			
		||||
 | 
			
		||||
      xdg_popup surfaces are always transient for another surface.
 | 
			
		||||
    </description>
 | 
			
		||||
 | 
			
		||||
    <request name="destroy" type="destructor">
 | 
			
		||||
      <description summary="remove xdg_surface interface">
 | 
			
		||||
	The xdg_surface interface is removed from the wl_surface object
 | 
			
		||||
	that was turned into a xdg_surface with
 | 
			
		||||
	xdg_shell.get_xdg_surface request. The xdg_surface properties,
 | 
			
		||||
	like maximized and fullscreen, are lost. The wl_surface loses
 | 
			
		||||
	its role as a xdg_surface. The wl_surface is unmapped.
 | 
			
		||||
      </description>
 | 
			
		||||
    </request>
 | 
			
		||||
 | 
			
		||||
    <request name="pong">
 | 
			
		||||
      <description summary="respond to a ping event">
 | 
			
		||||
	A client must respond to a ping event with a pong request or
 | 
			
		||||
	the client may be deemed unresponsive.
 | 
			
		||||
      </description>
 | 
			
		||||
      <arg name="serial" type="uint" summary="serial of the ping event"/>
 | 
			
		||||
    </request>
 | 
			
		||||
 | 
			
		||||
    <event name="ping">
 | 
			
		||||
      <description summary="ping client">
 | 
			
		||||
	Ping a client to check if it is receiving events and sending
 | 
			
		||||
	requests. A client is expected to reply with a pong request.
 | 
			
		||||
      </description>
 | 
			
		||||
      <arg name="serial" type="uint"/>
 | 
			
		||||
    </event>
 | 
			
		||||
 | 
			
		||||
    <event name="popup_done">
 | 
			
		||||
      <description summary="popup interaction is done">
 | 
			
		||||
	The popup_done event is sent out when a popup grab is broken,
 | 
			
		||||
	that is, when the users clicks a surface that doesn't belong
 | 
			
		||||
	to the client owning the popup surface.
 | 
			
		||||
      </description>
 | 
			
		||||
      <arg name="serial" type="uint" summary="serial of the implicit grab on the pointer"/>
 | 
			
		||||
    </event>
 | 
			
		||||
 | 
			
		||||
  </interface>
 | 
			
		||||
</protocol>
 | 
			
		||||
							
								
								
									
										18
									
								
								protocol/xserver.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								protocol/xserver.xml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,18 @@
 | 
			
		||||
<protocol name="xserver">
 | 
			
		||||
 | 
			
		||||
  <interface name="xserver" version="1">
 | 
			
		||||
    <request name="set_window_id">
 | 
			
		||||
      <arg name="surface" type="object" interface="wl_surface"/>
 | 
			
		||||
      <arg name="id" type="uint"/>
 | 
			
		||||
    </request>
 | 
			
		||||
 | 
			
		||||
    <event name="client">
 | 
			
		||||
      <arg name="fd" type="fd"/>
 | 
			
		||||
    </event>
 | 
			
		||||
 | 
			
		||||
    <event name="listen_socket">
 | 
			
		||||
      <arg name="fd" type="fd"/>
 | 
			
		||||
    </event>
 | 
			
		||||
  </interface>
 | 
			
		||||
 | 
			
		||||
</protocol>
 | 
			
		||||
							
								
								
									
										149
									
								
								src/Makefile.am
									
									
									
									
									
								
							
							
						
						
									
										149
									
								
								src/Makefile.am
									
									
									
									
									
								
							@@ -1,7 +1,7 @@
 | 
			
		||||
# Flag build for parallelism; see https://savannah.gnu.org/patch/?6905
 | 
			
		||||
.AUTOPARALLEL:
 | 
			
		||||
 | 
			
		||||
lib_LTLIBRARIES = libmutter.la
 | 
			
		||||
lib_LTLIBRARIES = libmutter-wayland.la
 | 
			
		||||
 | 
			
		||||
SUBDIRS=compositor/plugins
 | 
			
		||||
 | 
			
		||||
@@ -10,6 +10,7 @@ INCLUDES=								\
 | 
			
		||||
	-DCOGL_ENABLE_EXPERIMENTAL_API					\
 | 
			
		||||
	-DCOGL_ENABLE_EXPERIMENTAL_2_0_API                              \
 | 
			
		||||
	$(MUTTER_CFLAGS)						\
 | 
			
		||||
	-I$(top_builddir)						\
 | 
			
		||||
	-I$(srcdir)							\
 | 
			
		||||
	-I$(srcdir)/core						\
 | 
			
		||||
	-I$(srcdir)/ui							\
 | 
			
		||||
@@ -29,12 +30,27 @@ INCLUDES=								\
 | 
			
		||||
	-DMUTTER_PLUGIN_DIR=\"@MUTTER_PLUGIN_DIR@\"			\
 | 
			
		||||
	-DGETTEXT_PACKAGE=\"$(GETTEXT_PACKAGE)\"
 | 
			
		||||
 | 
			
		||||
mutter_built_sources = \
 | 
			
		||||
	$(dbus_xrandr_built_sources)	\
 | 
			
		||||
	mutter-enum-types.h \
 | 
			
		||||
	mutter-enum-types.c
 | 
			
		||||
INCLUDES += \
 | 
			
		||||
	-I$(srcdir)/wayland						\
 | 
			
		||||
	-I$(builddir)/wayland						\
 | 
			
		||||
	-DXWAYLAND_PATH='"@XWAYLAND_PATH@"'
 | 
			
		||||
 | 
			
		||||
libmutter_la_SOURCES =				\
 | 
			
		||||
mutter_built_sources = \
 | 
			
		||||
	$(dbus_idle_built_sources)		\
 | 
			
		||||
	$(dbus_xrandr_built_sources)		\
 | 
			
		||||
	mutter-enum-types.h 			\
 | 
			
		||||
	mutter-enum-types.c			\
 | 
			
		||||
	wayland/gtk-shell-protocol.c		\
 | 
			
		||||
	wayland/gtk-shell-server-protocol.h	\
 | 
			
		||||
	wayland/gtk-shell-client-protocol.h	\
 | 
			
		||||
	wayland/xdg-shell-protocol.c		\
 | 
			
		||||
	wayland/xdg-shell-server-protocol.h	\
 | 
			
		||||
	wayland/xdg-shell-client-protocol.h	\
 | 
			
		||||
	wayland/xserver-protocol.c		\
 | 
			
		||||
	wayland/xserver-server-protocol.h	\
 | 
			
		||||
	wayland/xserver-client-protocol.h
 | 
			
		||||
 | 
			
		||||
libmutter_wayland_la_SOURCES =			\
 | 
			
		||||
	core/async-getprop.c			\
 | 
			
		||||
	core/async-getprop.h			\
 | 
			
		||||
	core/barrier.c				\
 | 
			
		||||
@@ -54,7 +70,8 @@ libmutter_la_SOURCES =				\
 | 
			
		||||
	compositor/meta-background-actor.c	\
 | 
			
		||||
	compositor/meta-background-actor-private.h	\
 | 
			
		||||
	compositor/meta-background-group.c	\
 | 
			
		||||
	compositor/meta-background-group-private.h	\
 | 
			
		||||
	compositor/meta-cullable.c		\
 | 
			
		||||
	compositor/meta-cullable.h		\
 | 
			
		||||
	compositor/meta-module.c		\
 | 
			
		||||
	compositor/meta-module.h		\
 | 
			
		||||
	compositor/meta-plugin.c		\
 | 
			
		||||
@@ -63,6 +80,9 @@ libmutter_la_SOURCES =				\
 | 
			
		||||
	compositor/meta-shadow-factory.c	\
 | 
			
		||||
	compositor/meta-shadow-factory-private.h	\
 | 
			
		||||
	compositor/meta-shaped-texture.c	\
 | 
			
		||||
	compositor/meta-shaped-texture-private.h 	\
 | 
			
		||||
	compositor/meta-surface-actor.c		\
 | 
			
		||||
	compositor/meta-surface-actor.h		\
 | 
			
		||||
	compositor/meta-texture-rectangle.c	\
 | 
			
		||||
	compositor/meta-texture-rectangle.h	\
 | 
			
		||||
	compositor/meta-texture-tower.c		\
 | 
			
		||||
@@ -113,9 +133,14 @@ libmutter_la_SOURCES =				\
 | 
			
		||||
	core/keybindings.c			\
 | 
			
		||||
	core/keybindings-private.h		\
 | 
			
		||||
	core/main.c				\
 | 
			
		||||
	core/meta-cursor-tracker.c		\
 | 
			
		||||
	core/meta-cursor-tracker-private.h	\
 | 
			
		||||
	core/meta-idle-monitor.c		\
 | 
			
		||||
	core/meta-idle-monitor-private.h	\
 | 
			
		||||
	core/meta-xrandr-shared.h		\
 | 
			
		||||
	core/monitor.c				\
 | 
			
		||||
	core/monitor-config.c			\
 | 
			
		||||
	core/monitor-kms.c			\
 | 
			
		||||
	core/monitor-private.h			\
 | 
			
		||||
	core/monitor-xrandr.c			\
 | 
			
		||||
	core/mutter-Xatomtype.h			\
 | 
			
		||||
@@ -135,6 +160,7 @@ libmutter_la_SOURCES =				\
 | 
			
		||||
	core/stack-tracker.h			\
 | 
			
		||||
	core/util.c				\
 | 
			
		||||
	meta/util.h				\
 | 
			
		||||
	core/util-private.h			\
 | 
			
		||||
	core/window-props.c			\
 | 
			
		||||
	core/window-props.h			\
 | 
			
		||||
	core/window.c				\
 | 
			
		||||
@@ -163,11 +189,35 @@ libmutter_la_SOURCES =				\
 | 
			
		||||
	ui/theme.c				\
 | 
			
		||||
	meta/theme.h				\
 | 
			
		||||
	ui/theme-private.h			\
 | 
			
		||||
	ui/ui.c					\
 | 
			
		||||
	ui/ui.c
 | 
			
		||||
 | 
			
		||||
nodist_libmutter_wayland_la_SOURCES =		\
 | 
			
		||||
	$(mutter_built_sources)
 | 
			
		||||
 | 
			
		||||
libmutter_la_LDFLAGS = -no-undefined
 | 
			
		||||
libmutter_la_LIBADD  = $(MUTTER_LIBS)
 | 
			
		||||
libmutter_wayland_la_SOURCES +=			\
 | 
			
		||||
	wayland/meta-wayland.c			\
 | 
			
		||||
	wayland/meta-wayland-private.h		\
 | 
			
		||||
	wayland/meta-xwayland-private.h		\
 | 
			
		||||
	wayland/meta-xwayland.c			\
 | 
			
		||||
	wayland/meta-wayland-data-device.c      \
 | 
			
		||||
	wayland/meta-wayland-data-device.h      \
 | 
			
		||||
	wayland/meta-wayland-keyboard.c		\
 | 
			
		||||
	wayland/meta-wayland-keyboard.h		\
 | 
			
		||||
	wayland/meta-wayland-pointer.c		\
 | 
			
		||||
	wayland/meta-wayland-pointer.h		\
 | 
			
		||||
	wayland/meta-wayland-seat.c		\
 | 
			
		||||
	wayland/meta-wayland-seat.h		\
 | 
			
		||||
	wayland/meta-wayland-stage.h		\
 | 
			
		||||
	wayland/meta-wayland-stage.c		\
 | 
			
		||||
	wayland/meta-wayland-surface.c		\
 | 
			
		||||
	wayland/meta-wayland-surface.h		\
 | 
			
		||||
	wayland/meta-wayland-types.h		\
 | 
			
		||||
	wayland/meta-wayland-versions.h		\
 | 
			
		||||
	wayland/meta-weston-launch.c		\
 | 
			
		||||
	wayland/meta-weston-launch.h
 | 
			
		||||
 | 
			
		||||
libmutter_wayland_la_LDFLAGS = -no-undefined
 | 
			
		||||
libmutter_wayland_la_LIBADD  = $(MUTTER_LIBS)
 | 
			
		||||
 | 
			
		||||
# Headers installed for plugins; introspected information will
 | 
			
		||||
# be extracted into Mutter-<version>.gir
 | 
			
		||||
@@ -186,6 +236,8 @@ libmutterinclude_base_headers =		\
 | 
			
		||||
	meta/meta-background-actor.h		\
 | 
			
		||||
	meta/meta-background-group.h		\
 | 
			
		||||
	meta/meta-background.h			\
 | 
			
		||||
	meta/meta-cursor-tracker.h		\
 | 
			
		||||
	meta/meta-idle-monitor.h		\
 | 
			
		||||
	meta/meta-plugin.h			\
 | 
			
		||||
	meta/meta-shaped-texture.h		\
 | 
			
		||||
	meta/meta-shadow-factory.h		\
 | 
			
		||||
@@ -203,16 +255,27 @@ libmutterinclude_base_headers =		\
 | 
			
		||||
libmutterinclude_extra_headers =		\
 | 
			
		||||
	meta/atomnames.h
 | 
			
		||||
 | 
			
		||||
libmutterincludedir = $(includedir)/mutter/meta
 | 
			
		||||
libmutterincludedir = $(includedir)/mutter-wayland/meta
 | 
			
		||||
 | 
			
		||||
libmutterinclude_HEADERS =			\
 | 
			
		||||
	$(libmutterinclude_base_headers)	\
 | 
			
		||||
	$(libmutterinclude_extra_headers)
 | 
			
		||||
 | 
			
		||||
bin_PROGRAMS=mutter
 | 
			
		||||
bin_PROGRAMS=mutter-wayland
 | 
			
		||||
 | 
			
		||||
mutter_SOURCES = core/mutter.c
 | 
			
		||||
mutter_LDADD = $(MUTTER_LIBS) libmutter.la
 | 
			
		||||
mutter_wayland_SOURCES = core/mutter.c
 | 
			
		||||
mutter_wayland_LDADD = $(MUTTER_LIBS) libmutter-wayland.la
 | 
			
		||||
 | 
			
		||||
bin_PROGRAMS+=mutter-launch
 | 
			
		||||
 | 
			
		||||
mutter_launch_SOURCES = wayland/weston-launch.c wayland/weston-launch.h
 | 
			
		||||
 | 
			
		||||
mutter_launch_CFLAGS = $(MUTTER_LAUNCH_CFLAGS) -DLIBDIR=\"$(libdir)\"
 | 
			
		||||
mutter_launch_LDFLAGS = $(MUTTER_LAUNCH_LIBS) -lpam
 | 
			
		||||
 | 
			
		||||
install-exec-hook:
 | 
			
		||||
	-chown root $(DESTDIR)$(bindir)/mutter-launch
 | 
			
		||||
	-chmod u+s $(DESTDIR)$(bindir)/mutter-launch
 | 
			
		||||
 | 
			
		||||
if HAVE_INTROSPECTION
 | 
			
		||||
include $(INTROSPECTION_MAKEFILE)
 | 
			
		||||
@@ -234,15 +297,15 @@ typelib_DATA = Meta-$(api_version).typelib
 | 
			
		||||
 | 
			
		||||
INTROSPECTION_GIRS = Meta-$(api_version).gir
 | 
			
		||||
 | 
			
		||||
Meta-$(api_version).gir: libmutter.la
 | 
			
		||||
Meta-$(api_version).gir: libmutter-wayland.la
 | 
			
		||||
@META_GIR@_INCLUDES = GObject-2.0 GDesktopEnums-3.0 Gdk-3.0 Gtk-3.0 Clutter-1.0 xlib-2.0 xfixes-4.0 Cogl-1.0
 | 
			
		||||
@META_GIR@_EXPORT_PACKAGES = libmutter
 | 
			
		||||
@META_GIR@_EXPORT_PACKAGES = libmutter-wayland
 | 
			
		||||
@META_GIR@_CFLAGS = $(INCLUDES)
 | 
			
		||||
@META_GIR@_LIBS = libmutter.la
 | 
			
		||||
@META_GIR@_LIBS = libmutter-wayland.la
 | 
			
		||||
@META_GIR@_FILES =				\
 | 
			
		||||
	mutter-enum-types.h			\
 | 
			
		||||
	$(libmutterinclude_base_headers)	\
 | 
			
		||||
	$(filter %.c,$(libmutter_la_SOURCES))
 | 
			
		||||
	$(filter %.c,$(libmutter_wayland_la_SOURCES) $(nodist_libmutter_wayland_la_SOURCES))
 | 
			
		||||
@META_GIR@_SCANNERFLAGS = --warn-all --warn-error
 | 
			
		||||
 | 
			
		||||
endif
 | 
			
		||||
@@ -253,22 +316,17 @@ testasyncgetprop_SOURCES = core/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
 | 
			
		||||
testboxes_LDADD = $(MUTTER_LIBS) libmutter-wayland.la
 | 
			
		||||
testgradient_LDADD = $(MUTTER_LIBS) libmutter-wayland.la
 | 
			
		||||
testasyncgetprop_LDADD = $(MUTTER_LIBS) libmutter-wayland.la
 | 
			
		||||
 | 
			
		||||
@INTLTOOL_DESKTOP_RULE@
 | 
			
		||||
 | 
			
		||||
desktopfilesdir=$(datadir)/applications
 | 
			
		||||
desktopfiles_in_files=mutter.desktop.in
 | 
			
		||||
desktopfiles_in_files=mutter-wayland.desktop.in
 | 
			
		||||
desktopfiles_files=$(desktopfiles_in_files:.desktop.in=.desktop)
 | 
			
		||||
desktopfiles_DATA = $(desktopfiles_files)
 | 
			
		||||
 | 
			
		||||
wmpropertiesdir=$(datadir)/gnome/wm-properties
 | 
			
		||||
wmproperties_in_files=mutter-wm.desktop.in
 | 
			
		||||
wmproperties_files=$(wmproperties_in_files:.desktop.in=.desktop)
 | 
			
		||||
wmproperties_DATA = $(wmproperties_files)
 | 
			
		||||
 | 
			
		||||
xmldir       = @GNOME_KEYBINDINGS_KEYSDIR@
 | 
			
		||||
xml_in_files = \
 | 
			
		||||
        50-mutter-navigation.xml.in	\
 | 
			
		||||
@@ -276,7 +334,9 @@ xml_in_files = \
 | 
			
		||||
        50-mutter-windows.xml.in
 | 
			
		||||
xml_DATA     = $(xml_in_files:.xml.in=.xml)
 | 
			
		||||
 | 
			
		||||
gsettings_SCHEMAS = org.gnome.mutter.gschema.xml
 | 
			
		||||
dbus_idle_built_sources = meta-dbus-idle-monitor.c meta-dbus-idle-monitor.h
 | 
			
		||||
 | 
			
		||||
gsettings_SCHEMAS = org.gnome.mutter.gschema.xml org.gnome.mutter.wayland.gschema.xml
 | 
			
		||||
@INTLTOOL_XML_NOMERGE_RULE@
 | 
			
		||||
@GSETTINGS_RULES@
 | 
			
		||||
 | 
			
		||||
@@ -284,9 +344,10 @@ convertdir = $(datadir)/GConf/gsettings
 | 
			
		||||
convert_DATA = mutter-schemas.convert
 | 
			
		||||
 | 
			
		||||
CLEANFILES =					\
 | 
			
		||||
	mutter.desktop				\
 | 
			
		||||
	mutter-wayland.desktop			\
 | 
			
		||||
	mutter-wm.desktop			\
 | 
			
		||||
	org.gnome.mutter.gschema.xml		\
 | 
			
		||||
	org.gnome.mutter.wayland.gschema.xml	\
 | 
			
		||||
	$(xml_DATA)				\
 | 
			
		||||
	$(mutter_built_sources)			\
 | 
			
		||||
	$(typelib_DATA)				\
 | 
			
		||||
@@ -294,7 +355,7 @@ CLEANFILES =					\
 | 
			
		||||
 | 
			
		||||
pkgconfigdir = $(libdir)/pkgconfig
 | 
			
		||||
 | 
			
		||||
pkgconfig_DATA = libmutter.pc mutter-plugins.pc
 | 
			
		||||
pkgconfig_DATA = libmutter-wayland.pc
 | 
			
		||||
 | 
			
		||||
EXTRA_DIST=$(desktopfiles_files) 	\
 | 
			
		||||
	$(wmproperties_files)		\
 | 
			
		||||
@@ -303,11 +364,12 @@ EXTRA_DIST=$(desktopfiles_files) 	\
 | 
			
		||||
	$(wmproperties_in_files)	\
 | 
			
		||||
	$(xml_in_files)			\
 | 
			
		||||
	org.gnome.mutter.gschema.xml.in \
 | 
			
		||||
	org.gnome.mutter.wayland.gschema.xml.in \
 | 
			
		||||
	mutter-schemas.convert \
 | 
			
		||||
	libmutter.pc.in \
 | 
			
		||||
	mutter-plugins.pc.in  \
 | 
			
		||||
	libmutter-wayland.pc.in \
 | 
			
		||||
	mutter-enum-types.h.in \
 | 
			
		||||
	mutter-enum-types.c.in
 | 
			
		||||
	mutter-enum-types.c.in \
 | 
			
		||||
	xrandr.xml idle-monitor.xml
 | 
			
		||||
 | 
			
		||||
BUILT_SOURCES = $(mutter_built_sources)
 | 
			
		||||
MUTTER_STAMP_FILES = stamp-mutter-enum-types.h
 | 
			
		||||
@@ -335,8 +397,27 @@ mutter-enum-types.c: stamp-mutter-enum-types.h mutter-enum-types.c.in
 | 
			
		||||
dbus_xrandr_built_sources = meta-dbus-xrandr.c meta-dbus-xrandr.h
 | 
			
		||||
 | 
			
		||||
$(dbus_xrandr_built_sources) : Makefile.am xrandr.xml
 | 
			
		||||
	$(AM_V_GEN)gdbus-codegen								\
 | 
			
		||||
	$(AM_V_GEN)gdbus-codegen							\
 | 
			
		||||
		--interface-prefix org.gnome.Mutter					\
 | 
			
		||||
		--c-namespace MetaDBus							\
 | 
			
		||||
		--generate-c-code meta-dbus-xrandr					\
 | 
			
		||||
		$(srcdir)/xrandr.xml
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
$(dbus_idle_built_sources) : Makefile.am idle-monitor.xml
 | 
			
		||||
	$(AM_V_GEN)gdbus-codegen							\
 | 
			
		||||
		--interface-prefix org.gnome.Mutter					\
 | 
			
		||||
		--c-namespace MetaDBus							\
 | 
			
		||||
		--generate-c-code meta-dbus-idle-monitor				\
 | 
			
		||||
		--c-generate-object-manager						\
 | 
			
		||||
		$(srcdir)/idle-monitor.xml
 | 
			
		||||
 | 
			
		||||
wayland/%-protocol.c : $(top_builddir)/protocol/%.xml
 | 
			
		||||
	mkdir -p wayland
 | 
			
		||||
	$(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@
 | 
			
		||||
wayland/%-server-protocol.h : $(top_builddir)/protocol/%.xml
 | 
			
		||||
	mkdir -p wayland
 | 
			
		||||
	$(AM_V_GEN)$(WAYLAND_SCANNER) server-header < $< > $@
 | 
			
		||||
wayland/%-client-protocol.h : $(top_builddir)/protocol/%.xml
 | 
			
		||||
	mkdir -p wayland
 | 
			
		||||
	$(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@
 | 
			
		||||
 
 | 
			
		||||
@@ -95,8 +95,10 @@ meta_actor_vertices_are_untransformed (ClutterVertex *verts,
 | 
			
		||||
      v3x != v1x || v3y != v2y)
 | 
			
		||||
    return FALSE;
 | 
			
		||||
 | 
			
		||||
  *x_origin = x;
 | 
			
		||||
  *y_origin = y;
 | 
			
		||||
  if (x_origin)
 | 
			
		||||
    *x_origin = x;
 | 
			
		||||
  if (y_origin)
 | 
			
		||||
    *y_origin = y;
 | 
			
		||||
 | 
			
		||||
  return TRUE;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -50,7 +50,7 @@ meta_create_color_texture_4ub (guint8           red,
 | 
			
		||||
  CoglColor color;
 | 
			
		||||
  guint8 pixel[4];
 | 
			
		||||
 | 
			
		||||
  cogl_color_set_from_4ub (&color, red, green, blue, alpha);
 | 
			
		||||
  cogl_color_init_from_4ub (&color, red, green, blue, alpha);
 | 
			
		||||
  cogl_color_premultiply (&color);
 | 
			
		||||
 | 
			
		||||
  pixel[0] = cogl_color_get_red_byte (&color);
 | 
			
		||||
@@ -73,10 +73,8 @@ meta_create_color_texture_4ub (guint8           red,
 | 
			
		||||
 * @src_texture: (allow-none): texture to use initially for the layer
 | 
			
		||||
 *
 | 
			
		||||
 * Creates a pipeline with a single layer. Using a common template
 | 
			
		||||
 * allows sharing a shader for different uses in Mutter. To share the same
 | 
			
		||||
 * shader with all other pipelines that are just texture plus opacity
 | 
			
		||||
 * would require Cogl fixes.
 | 
			
		||||
 * (See http://bugzilla.clutter-project.org/show_bug.cgi?id=2425)
 | 
			
		||||
 * makes it easier for Cogl to share a shader for different uses in
 | 
			
		||||
 * Mutter.
 | 
			
		||||
 *
 | 
			
		||||
 * Return value: (transfer full): a newly created #CoglPipeline
 | 
			
		||||
 */
 | 
			
		||||
@@ -86,22 +84,21 @@ meta_create_texture_pipeline (CoglTexture *src_texture)
 | 
			
		||||
  static CoglPipeline *texture_pipeline_template = NULL;
 | 
			
		||||
  CoglPipeline *pipeline;
 | 
			
		||||
 | 
			
		||||
  /* We use a pipeline that has a dummy texture as a base for all
 | 
			
		||||
     texture pipelines. The idea is that only the Cogl texture object
 | 
			
		||||
     would be different in the children so it is likely that Cogl will
 | 
			
		||||
     be able to share GL programs between all the textures. */
 | 
			
		||||
  /* The only state used in the pipeline that would affect the shader
 | 
			
		||||
     generation is the texture type on the layer. Therefore we create
 | 
			
		||||
     a template pipeline which sets this state and all texture
 | 
			
		||||
     pipelines are created as a copy of this. That way Cogl can find
 | 
			
		||||
     the shader state for the pipeline more quickly by looking at the
 | 
			
		||||
     pipeline ancestry instead of resorting to the shader cache. */
 | 
			
		||||
  if (G_UNLIKELY (texture_pipeline_template == NULL))
 | 
			
		||||
    {
 | 
			
		||||
      CoglTexture *dummy_texture;
 | 
			
		||||
      CoglContext *ctx = clutter_backend_get_cogl_context (clutter_get_default_backend ());
 | 
			
		||||
 | 
			
		||||
      dummy_texture = meta_create_color_texture_4ub (0xff, 0xff, 0xff, 0xff,
 | 
			
		||||
                                                     COGL_TEXTURE_NONE);
 | 
			
		||||
 | 
			
		||||
      CoglContext *ctx =
 | 
			
		||||
        clutter_backend_get_cogl_context (clutter_get_default_backend ());
 | 
			
		||||
 | 
			
		||||
      texture_pipeline_template = cogl_pipeline_new (ctx);
 | 
			
		||||
      cogl_pipeline_set_layer_texture (texture_pipeline_template, 0, dummy_texture);
 | 
			
		||||
      cogl_object_unref (dummy_texture);
 | 
			
		||||
      cogl_pipeline_set_layer_null_texture (texture_pipeline_template,
 | 
			
		||||
                                            0, /* layer */
 | 
			
		||||
                                            COGL_TEXTURE_TYPE_2D);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  pipeline = cogl_pipeline_copy (texture_pipeline_template);
 | 
			
		||||
 
 | 
			
		||||
@@ -17,8 +17,6 @@ struct _MetaCompositor
 | 
			
		||||
{
 | 
			
		||||
  MetaDisplay    *display;
 | 
			
		||||
 | 
			
		||||
  Atom            atom_x_root_pixmap;
 | 
			
		||||
  Atom            atom_net_wm_window_opacity;
 | 
			
		||||
  guint           repaint_func_id;
 | 
			
		||||
 | 
			
		||||
  ClutterActor   *shadow_src;
 | 
			
		||||
@@ -66,8 +64,6 @@ void meta_switch_workspace_completed (MetaScreen    *screen);
 | 
			
		||||
 | 
			
		||||
gboolean meta_begin_modal_for_plugin (MetaScreen       *screen,
 | 
			
		||||
                                      MetaPlugin       *plugin,
 | 
			
		||||
                                      Window            grab_window,
 | 
			
		||||
                                      Cursor            cursor,
 | 
			
		||||
                                      MetaModalOptions  options,
 | 
			
		||||
                                      guint32           timestamp);
 | 
			
		||||
void     meta_end_modal_for_plugin   (MetaScreen       *screen,
 | 
			
		||||
 
 | 
			
		||||
@@ -84,6 +84,10 @@
 | 
			
		||||
#include "meta-window-group.h"
 | 
			
		||||
#include "window-private.h" /* to check window->hidden */
 | 
			
		||||
#include "display-private.h" /* for meta_display_lookup_x_window() */
 | 
			
		||||
#include "util-private.h"
 | 
			
		||||
#include "meta-wayland-private.h"
 | 
			
		||||
#include "meta-wayland-pointer.h"
 | 
			
		||||
#include "meta-wayland-keyboard.h"
 | 
			
		||||
#include <X11/extensions/shape.h>
 | 
			
		||||
#include <X11/extensions/Xcomposite.h>
 | 
			
		||||
 | 
			
		||||
@@ -172,32 +176,7 @@ process_damage (MetaCompositor     *compositor,
 | 
			
		||||
  if (window_actor == NULL)
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  meta_window_actor_process_damage (window_actor, event);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
process_property_notify (MetaCompositor	*compositor,
 | 
			
		||||
                         XPropertyEvent *event,
 | 
			
		||||
                         MetaWindow     *window)
 | 
			
		||||
{
 | 
			
		||||
  MetaWindowActor *window_actor;
 | 
			
		||||
 | 
			
		||||
  if (window == NULL)
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
 | 
			
		||||
  if (window_actor == NULL)
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  /* Check for the opacity changing */
 | 
			
		||||
  if (event->atom == compositor->atom_net_wm_window_opacity)
 | 
			
		||||
    {
 | 
			
		||||
      meta_window_actor_update_opacity (window_actor);
 | 
			
		||||
      DEBUG_TRACE ("process_property_notify: net_wm_window_opacity\n");
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  DEBUG_TRACE ("process_property_notify: unknown\n");
 | 
			
		||||
  meta_window_actor_process_x11_damage (window_actor, event);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static Window
 | 
			
		||||
@@ -327,29 +306,37 @@ void
 | 
			
		||||
meta_set_stage_input_region (MetaScreen   *screen,
 | 
			
		||||
                             XserverRegion region)
 | 
			
		||||
{
 | 
			
		||||
  MetaCompScreen *info = meta_screen_get_compositor_data (screen);
 | 
			
		||||
  MetaDisplay  *display = meta_screen_get_display (screen);
 | 
			
		||||
  Display      *xdpy    = meta_display_get_xdisplay (display);
 | 
			
		||||
  /* As a wayland compositor we can simply ignore all this trickery
 | 
			
		||||
   * for setting an input region on the stage for capturing events in
 | 
			
		||||
   * clutter since all input comes to us first and we get to choose
 | 
			
		||||
   * who else sees them.
 | 
			
		||||
   */
 | 
			
		||||
  if (!meta_is_wayland_compositor ())
 | 
			
		||||
    {
 | 
			
		||||
      MetaCompScreen *info = meta_screen_get_compositor_data (screen);
 | 
			
		||||
      MetaDisplay  *display = meta_screen_get_display (screen);
 | 
			
		||||
      Display      *xdpy    = meta_display_get_xdisplay (display);
 | 
			
		||||
 | 
			
		||||
  if (info->stage && info->output)
 | 
			
		||||
    {
 | 
			
		||||
      do_set_stage_input_region (screen, region);
 | 
			
		||||
      if (info->stage && info->output)
 | 
			
		||||
        {
 | 
			
		||||
          do_set_stage_input_region (screen, region);
 | 
			
		||||
        }
 | 
			
		||||
      else 
 | 
			
		||||
        {
 | 
			
		||||
          /* Reset info->pending_input_region if one existed before and set the new
 | 
			
		||||
           * one to use it later. */ 
 | 
			
		||||
          if (info->pending_input_region)
 | 
			
		||||
            {
 | 
			
		||||
              XFixesDestroyRegion (xdpy, info->pending_input_region);
 | 
			
		||||
              info->pending_input_region = None;
 | 
			
		||||
            }
 | 
			
		||||
          if (region != None)
 | 
			
		||||
            {
 | 
			
		||||
              info->pending_input_region = XFixesCreateRegion (xdpy, NULL, 0);
 | 
			
		||||
              XFixesCopyRegion (xdpy, info->pending_input_region, region);
 | 
			
		||||
            }
 | 
			
		||||
        } 
 | 
			
		||||
    }
 | 
			
		||||
  else 
 | 
			
		||||
    {
 | 
			
		||||
      /* Reset info->pending_input_region if one existed before and set the new
 | 
			
		||||
       * one to use it later. */ 
 | 
			
		||||
      if (info->pending_input_region)
 | 
			
		||||
        {
 | 
			
		||||
          XFixesDestroyRegion (xdpy, info->pending_input_region);
 | 
			
		||||
          info->pending_input_region = None;
 | 
			
		||||
        }
 | 
			
		||||
      if (region != None)
 | 
			
		||||
        {
 | 
			
		||||
          info->pending_input_region = XFixesCreateRegion (xdpy, NULL, 0);
 | 
			
		||||
          XFixesCopyRegion (xdpy, info->pending_input_region, region);
 | 
			
		||||
        }
 | 
			
		||||
    } 
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
@@ -380,56 +367,55 @@ meta_focus_stage_window (MetaScreen *screen,
 | 
			
		||||
  if (!stage)
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  window = clutter_x11_get_stage_window (stage);
 | 
			
		||||
  if (!meta_is_wayland_compositor ())
 | 
			
		||||
    {
 | 
			
		||||
      window = clutter_x11_get_stage_window (stage);
 | 
			
		||||
 | 
			
		||||
  if (window == None)
 | 
			
		||||
    return;
 | 
			
		||||
      if (window == None)
 | 
			
		||||
        return;
 | 
			
		||||
 | 
			
		||||
  meta_display_set_input_focus_xwindow (screen->display,
 | 
			
		||||
                                        screen,
 | 
			
		||||
                                        window,
 | 
			
		||||
                                        timestamp);
 | 
			
		||||
      meta_display_set_input_focus_xwindow (screen->display,
 | 
			
		||||
                                            screen,
 | 
			
		||||
                                            META_FOCUS_STAGE,
 | 
			
		||||
                                            window,
 | 
			
		||||
                                            timestamp);
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    {
 | 
			
		||||
      meta_display_set_input_focus_xwindow (screen->display,
 | 
			
		||||
                                            screen,
 | 
			
		||||
                                            META_FOCUS_STAGE,
 | 
			
		||||
                                            None,
 | 
			
		||||
                                            timestamp);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
gboolean
 | 
			
		||||
meta_stage_is_focused (MetaScreen *screen)
 | 
			
		||||
{
 | 
			
		||||
  ClutterStage *stage;
 | 
			
		||||
  Window window;
 | 
			
		||||
 | 
			
		||||
  stage = CLUTTER_STAGE (meta_get_stage_for_screen (screen));
 | 
			
		||||
  if (!stage)
 | 
			
		||||
    return FALSE;
 | 
			
		||||
 | 
			
		||||
  window = clutter_x11_get_stage_window (stage);
 | 
			
		||||
 | 
			
		||||
  if (window == None)
 | 
			
		||||
    return FALSE;
 | 
			
		||||
 | 
			
		||||
  return (screen->display->focus_xwindow == window);
 | 
			
		||||
  return (screen->display->focus_type == META_FOCUS_STAGE);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
gboolean
 | 
			
		||||
meta_begin_modal_for_plugin (MetaScreen       *screen,
 | 
			
		||||
                             MetaPlugin       *plugin,
 | 
			
		||||
                             Window            grab_window,
 | 
			
		||||
                             Cursor            cursor,
 | 
			
		||||
                             MetaModalOptions  options,
 | 
			
		||||
                             guint32           timestamp)
 | 
			
		||||
static gboolean
 | 
			
		||||
begin_modal_x11 (MetaScreen       *screen,
 | 
			
		||||
                 MetaPlugin       *plugin,
 | 
			
		||||
                 MetaModalOptions  options,
 | 
			
		||||
                 guint32           timestamp)
 | 
			
		||||
{
 | 
			
		||||
  /* To some extent this duplicates code in meta_display_begin_grab_op(), but there
 | 
			
		||||
   * are significant differences in how we handle grabs that make it difficult to
 | 
			
		||||
   * merge the two.
 | 
			
		||||
   */
 | 
			
		||||
  MetaDisplay    *display    = meta_screen_get_display (screen);
 | 
			
		||||
  Display        *xdpy       = meta_display_get_xdisplay (display);
 | 
			
		||||
  MetaCompositor *compositor = display->compositor;
 | 
			
		||||
  gboolean pointer_grabbed = FALSE;
 | 
			
		||||
  gboolean keyboard_grabbed = FALSE;
 | 
			
		||||
  int result;
 | 
			
		||||
 | 
			
		||||
  if (compositor->modal_plugin != NULL || display->grab_op != META_GRAB_OP_NONE)
 | 
			
		||||
    return FALSE;
 | 
			
		||||
  MetaDisplay    *display     = meta_screen_get_display (screen);
 | 
			
		||||
  Display        *xdpy        = meta_display_get_xdisplay (display);
 | 
			
		||||
  MetaCompScreen *info        = meta_screen_get_compositor_data (screen);
 | 
			
		||||
  Window          grab_window = clutter_x11_get_stage_window (CLUTTER_STAGE (info->stage));
 | 
			
		||||
  Cursor          cursor      = None;
 | 
			
		||||
  int             result;
 | 
			
		||||
  gboolean        pointer_grabbed = FALSE;
 | 
			
		||||
  gboolean        keyboard_grabbed = FALSE;
 | 
			
		||||
 | 
			
		||||
  if ((options & META_MODAL_POINTER_ALREADY_GRABBED) == 0)
 | 
			
		||||
    {
 | 
			
		||||
@@ -479,14 +465,6 @@ meta_begin_modal_for_plugin (MetaScreen       *screen,
 | 
			
		||||
      keyboard_grabbed = TRUE;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  display->grab_op = META_GRAB_OP_COMPOSITOR;
 | 
			
		||||
  display->grab_window = NULL;
 | 
			
		||||
  display->grab_screen = screen;
 | 
			
		||||
  display->grab_have_pointer = TRUE;
 | 
			
		||||
  display->grab_have_keyboard = TRUE;
 | 
			
		||||
 | 
			
		||||
  compositor->modal_plugin = plugin;
 | 
			
		||||
 | 
			
		||||
  return TRUE;
 | 
			
		||||
 | 
			
		||||
 fail:
 | 
			
		||||
@@ -498,6 +476,80 @@ meta_begin_modal_for_plugin (MetaScreen       *screen,
 | 
			
		||||
  return FALSE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static gboolean
 | 
			
		||||
begin_modal_wayland (MetaScreen       *screen,
 | 
			
		||||
                     MetaPlugin       *plugin,
 | 
			
		||||
                     MetaModalOptions  options,
 | 
			
		||||
                     guint32           timestamp)
 | 
			
		||||
{
 | 
			
		||||
  MetaWaylandCompositor *compositor;
 | 
			
		||||
  gboolean pointer_grabbed = FALSE;
 | 
			
		||||
  gboolean keyboard_grabbed = FALSE;
 | 
			
		||||
 | 
			
		||||
  compositor = meta_wayland_compositor_get_default ();
 | 
			
		||||
 | 
			
		||||
  if ((options & META_MODAL_POINTER_ALREADY_GRABBED) == 0)
 | 
			
		||||
    {
 | 
			
		||||
      if (!meta_wayland_pointer_begin_modal (&compositor->seat->pointer))
 | 
			
		||||
        goto fail;
 | 
			
		||||
 | 
			
		||||
      pointer_grabbed = TRUE;
 | 
			
		||||
    }
 | 
			
		||||
  if ((options & META_MODAL_KEYBOARD_ALREADY_GRABBED) == 0)
 | 
			
		||||
    {
 | 
			
		||||
      if (!meta_wayland_keyboard_begin_modal (&compositor->seat->keyboard,
 | 
			
		||||
                                              timestamp))
 | 
			
		||||
        goto fail;
 | 
			
		||||
 | 
			
		||||
      keyboard_grabbed = TRUE;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  return TRUE;
 | 
			
		||||
 | 
			
		||||
 fail:
 | 
			
		||||
  if (pointer_grabbed)
 | 
			
		||||
    meta_wayland_pointer_end_modal (&compositor->seat->pointer);
 | 
			
		||||
  if (keyboard_grabbed)
 | 
			
		||||
    meta_wayland_keyboard_end_modal (&compositor->seat->keyboard, timestamp);
 | 
			
		||||
 | 
			
		||||
  return FALSE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
gboolean
 | 
			
		||||
meta_begin_modal_for_plugin (MetaScreen       *screen,
 | 
			
		||||
                             MetaPlugin       *plugin,
 | 
			
		||||
                             MetaModalOptions  options,
 | 
			
		||||
                             guint32           timestamp)
 | 
			
		||||
{
 | 
			
		||||
  /* To some extent this duplicates code in meta_display_begin_grab_op(), but there
 | 
			
		||||
   * are significant differences in how we handle grabs that make it difficult to
 | 
			
		||||
   * merge the two.
 | 
			
		||||
   */
 | 
			
		||||
  MetaDisplay    *display    = meta_screen_get_display (screen);
 | 
			
		||||
  MetaCompositor *compositor = display->compositor;
 | 
			
		||||
  gboolean ok;
 | 
			
		||||
 | 
			
		||||
  if (compositor->modal_plugin != NULL || display->grab_op != META_GRAB_OP_NONE)
 | 
			
		||||
    return FALSE;
 | 
			
		||||
 | 
			
		||||
  if (meta_is_wayland_compositor ())
 | 
			
		||||
    ok = begin_modal_wayland (screen, plugin, options, timestamp);
 | 
			
		||||
  else
 | 
			
		||||
    ok = begin_modal_x11 (screen, plugin, options, timestamp);
 | 
			
		||||
  if (!ok)
 | 
			
		||||
    return FALSE;
 | 
			
		||||
 | 
			
		||||
  display->grab_op = META_GRAB_OP_COMPOSITOR;
 | 
			
		||||
  display->grab_window = NULL;
 | 
			
		||||
  display->grab_screen = screen;
 | 
			
		||||
  display->grab_have_pointer = TRUE;
 | 
			
		||||
  display->grab_have_keyboard = TRUE;
 | 
			
		||||
 | 
			
		||||
  compositor->modal_plugin = plugin;
 | 
			
		||||
 | 
			
		||||
  return TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_end_modal_for_plugin (MetaScreen     *screen,
 | 
			
		||||
                           MetaPlugin     *plugin,
 | 
			
		||||
@@ -509,8 +561,19 @@ meta_end_modal_for_plugin (MetaScreen     *screen,
 | 
			
		||||
 | 
			
		||||
  g_return_if_fail (compositor->modal_plugin == plugin);
 | 
			
		||||
 | 
			
		||||
  XIUngrabDevice (xdpy, META_VIRTUAL_CORE_POINTER_ID, timestamp);
 | 
			
		||||
  XIUngrabDevice (xdpy, META_VIRTUAL_CORE_KEYBOARD_ID, timestamp);
 | 
			
		||||
  if (meta_is_wayland_compositor ())
 | 
			
		||||
    {
 | 
			
		||||
      MetaWaylandCompositor *compositor = meta_wayland_compositor_get_default ();
 | 
			
		||||
 | 
			
		||||
      meta_wayland_pointer_end_modal (&compositor->seat->pointer);
 | 
			
		||||
      meta_wayland_keyboard_end_modal (&compositor->seat->keyboard,
 | 
			
		||||
                                       timestamp);
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    {
 | 
			
		||||
      XIUngrabDevice (xdpy, META_VIRTUAL_CORE_POINTER_ID, timestamp);
 | 
			
		||||
      XIUngrabDevice (xdpy, META_VIRTUAL_CORE_KEYBOARD_ID, timestamp);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  display->grab_op = META_GRAB_OP_NONE;
 | 
			
		||||
  display->grab_window = NULL;
 | 
			
		||||
@@ -549,6 +612,9 @@ after_stage_paint (ClutterStage *stage,
 | 
			
		||||
 | 
			
		||||
  for (l = info->windows; l; l = l->next)
 | 
			
		||||
    meta_window_actor_post_paint (l->data);
 | 
			
		||||
 | 
			
		||||
  if (meta_is_wayland_compositor ())
 | 
			
		||||
    meta_wayland_compositor_paint_finished (meta_wayland_compositor_get_default ());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
@@ -602,8 +668,9 @@ meta_compositor_manage_screen (MetaCompositor *compositor,
 | 
			
		||||
  MetaCompScreen *info;
 | 
			
		||||
  MetaDisplay    *display       = meta_screen_get_display (screen);
 | 
			
		||||
  Display        *xdisplay      = meta_display_get_xdisplay (display);
 | 
			
		||||
  Window          xwin;
 | 
			
		||||
  Window          xwin = None;
 | 
			
		||||
  gint            width, height;
 | 
			
		||||
  MetaWaylandCompositor *wayland_compositor;
 | 
			
		||||
 | 
			
		||||
  /* Check if the screen is already managed */
 | 
			
		||||
  if (meta_screen_get_compositor_data (screen))
 | 
			
		||||
@@ -616,7 +683,14 @@ meta_compositor_manage_screen (MetaCompositor *compositor,
 | 
			
		||||
   * We have to initialize info->pending_input_region to an empty region explicitly, 
 | 
			
		||||
   * because None value is used to mean that the whole screen is an input region.
 | 
			
		||||
   */
 | 
			
		||||
  info->pending_input_region = XFixesCreateRegion (xdisplay, NULL, 0);
 | 
			
		||||
  if (!meta_is_wayland_compositor ())
 | 
			
		||||
    info->pending_input_region = XFixesCreateRegion (xdisplay, NULL, 0);
 | 
			
		||||
  else
 | 
			
		||||
    {
 | 
			
		||||
      /* Stage input region trickery isn't needed when we're running as a
 | 
			
		||||
       * wayland compositor. */
 | 
			
		||||
      info->pending_input_region = None;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  info->screen = screen;
 | 
			
		||||
 | 
			
		||||
@@ -627,7 +701,56 @@ meta_compositor_manage_screen (MetaCompositor *compositor,
 | 
			
		||||
 | 
			
		||||
  meta_screen_set_cm_selection (screen);
 | 
			
		||||
 | 
			
		||||
  info->stage = clutter_stage_new ();
 | 
			
		||||
  /* We will have already created a stage if running as a wayland
 | 
			
		||||
   * compositor... */
 | 
			
		||||
  if (meta_is_wayland_compositor ())
 | 
			
		||||
    {
 | 
			
		||||
      wayland_compositor = meta_wayland_compositor_get_default ();
 | 
			
		||||
      info->stage = wayland_compositor->stage;
 | 
			
		||||
 | 
			
		||||
      meta_screen_get_size (screen, &width, &height);
 | 
			
		||||
      clutter_actor_set_size (info->stage, width, height);
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    {
 | 
			
		||||
      info->stage = clutter_stage_new ();
 | 
			
		||||
 | 
			
		||||
      meta_screen_get_size (screen, &width, &height);
 | 
			
		||||
      clutter_actor_realize (info->stage);
 | 
			
		||||
 | 
			
		||||
      xwin = clutter_x11_get_stage_window (CLUTTER_STAGE (info->stage));
 | 
			
		||||
 | 
			
		||||
      XResizeWindow (xdisplay, xwin, width, height);
 | 
			
		||||
 | 
			
		||||
        {
 | 
			
		||||
          long event_mask;
 | 
			
		||||
          unsigned char mask_bits[XIMaskLen (XI_LASTEVENT)] = { 0 };
 | 
			
		||||
          XIEventMask mask = { XIAllMasterDevices, sizeof (mask_bits), mask_bits };
 | 
			
		||||
          XWindowAttributes attr;
 | 
			
		||||
 | 
			
		||||
          meta_core_add_old_event_mask (xdisplay, xwin, &mask);
 | 
			
		||||
 | 
			
		||||
          XISetMask (mask.mask, XI_KeyPress);
 | 
			
		||||
          XISetMask (mask.mask, XI_KeyRelease);
 | 
			
		||||
          XISetMask (mask.mask, XI_ButtonPress);
 | 
			
		||||
          XISetMask (mask.mask, XI_ButtonRelease);
 | 
			
		||||
          XISetMask (mask.mask, XI_Enter);
 | 
			
		||||
          XISetMask (mask.mask, XI_Leave);
 | 
			
		||||
          XISetMask (mask.mask, XI_FocusIn);
 | 
			
		||||
          XISetMask (mask.mask, XI_FocusOut);
 | 
			
		||||
          XISetMask (mask.mask, XI_Motion);
 | 
			
		||||
          XIClearMask (mask.mask, XI_TouchBegin);
 | 
			
		||||
          XIClearMask (mask.mask, XI_TouchEnd);
 | 
			
		||||
          XIClearMask (mask.mask, XI_TouchUpdate);
 | 
			
		||||
          XISelectEvents (xdisplay, xwin, &mask, 1);
 | 
			
		||||
 | 
			
		||||
          event_mask = ExposureMask | PropertyChangeMask | StructureNotifyMask;
 | 
			
		||||
          if (XGetWindowAttributes (xdisplay, xwin, &attr))
 | 
			
		||||
            event_mask |= attr.your_event_mask;
 | 
			
		||||
 | 
			
		||||
          XSelectInput (xdisplay, xwin, event_mask);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  clutter_stage_set_paint_callback (CLUTTER_STAGE (info->stage),
 | 
			
		||||
                                    after_stage_paint,
 | 
			
		||||
@@ -636,97 +759,67 @@ meta_compositor_manage_screen (MetaCompositor *compositor,
 | 
			
		||||
 | 
			
		||||
  clutter_stage_set_sync_delay (CLUTTER_STAGE (info->stage), META_SYNC_DELAY);
 | 
			
		||||
 | 
			
		||||
  meta_screen_get_size (screen, &width, &height);
 | 
			
		||||
  clutter_actor_realize (info->stage);
 | 
			
		||||
 | 
			
		||||
  xwin = clutter_x11_get_stage_window (CLUTTER_STAGE (info->stage));
 | 
			
		||||
 | 
			
		||||
  XResizeWindow (xdisplay, xwin, width, height);
 | 
			
		||||
 | 
			
		||||
  {
 | 
			
		||||
    long event_mask;
 | 
			
		||||
    unsigned char mask_bits[XIMaskLen (XI_LASTEVENT)] = { 0 };
 | 
			
		||||
    XIEventMask mask = { XIAllMasterDevices, sizeof (mask_bits), mask_bits };
 | 
			
		||||
    XWindowAttributes attr;
 | 
			
		||||
 | 
			
		||||
    meta_core_add_old_event_mask (xdisplay, xwin, &mask);
 | 
			
		||||
 | 
			
		||||
    XISetMask (mask.mask, XI_KeyPress);
 | 
			
		||||
    XISetMask (mask.mask, XI_KeyRelease);
 | 
			
		||||
    XISetMask (mask.mask, XI_ButtonPress);
 | 
			
		||||
    XISetMask (mask.mask, XI_ButtonRelease);
 | 
			
		||||
    XISetMask (mask.mask, XI_Enter);
 | 
			
		||||
    XISetMask (mask.mask, XI_Leave);
 | 
			
		||||
    XISetMask (mask.mask, XI_FocusIn);
 | 
			
		||||
    XISetMask (mask.mask, XI_FocusOut);
 | 
			
		||||
    XISetMask (mask.mask, XI_Motion);
 | 
			
		||||
    XIClearMask (mask.mask, XI_TouchBegin);
 | 
			
		||||
    XIClearMask (mask.mask, XI_TouchEnd);
 | 
			
		||||
    XIClearMask (mask.mask, XI_TouchUpdate);
 | 
			
		||||
    XISelectEvents (xdisplay, xwin, &mask, 1);
 | 
			
		||||
 | 
			
		||||
    event_mask = ExposureMask | PropertyChangeMask | StructureNotifyMask;
 | 
			
		||||
    if (XGetWindowAttributes (xdisplay, xwin, &attr))
 | 
			
		||||
      event_mask |= attr.your_event_mask;
 | 
			
		||||
 | 
			
		||||
    XSelectInput (xdisplay, xwin, event_mask);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  info->window_group = meta_window_group_new (screen);
 | 
			
		||||
  info->top_window_group = meta_window_group_new (screen);
 | 
			
		||||
 | 
			
		||||
  clutter_actor_add_child (info->stage, info->window_group);
 | 
			
		||||
  clutter_actor_add_child (info->stage, info->top_window_group);
 | 
			
		||||
 | 
			
		||||
  info->plugin_mgr = meta_plugin_manager_new (screen);
 | 
			
		||||
 | 
			
		||||
  /*
 | 
			
		||||
   * Delay the creation of the overlay window as long as we can, to avoid
 | 
			
		||||
   * blanking out the screen. This means that during the plugin loading, the
 | 
			
		||||
   * overlay window is not accessible; if the plugin needs to access it
 | 
			
		||||
   * directly, it should hook into the "show" signal on stage, and do
 | 
			
		||||
   * its stuff there.
 | 
			
		||||
   */
 | 
			
		||||
  info->output = get_output_window (screen);
 | 
			
		||||
  XReparentWindow (xdisplay, xwin, info->output, 0, 0);
 | 
			
		||||
 | 
			
		||||
 /* Make sure there isn't any left-over output shape on the 
 | 
			
		||||
  * overlay window by setting the whole screen to be an
 | 
			
		||||
  * output region.
 | 
			
		||||
  * 
 | 
			
		||||
  * Note: there doesn't seem to be any real chance of that
 | 
			
		||||
  *  because the X server will destroy the overlay window
 | 
			
		||||
  *  when the last client using it exits.
 | 
			
		||||
  */
 | 
			
		||||
  XFixesSetWindowShapeRegion (xdisplay, info->output, ShapeBounding, 0, 0, None);
 | 
			
		||||
 | 
			
		||||
  do_set_stage_input_region (screen, info->pending_input_region);
 | 
			
		||||
  if (info->pending_input_region != None)
 | 
			
		||||
  if (meta_is_wayland_compositor ())
 | 
			
		||||
    {
 | 
			
		||||
      XFixesDestroyRegion (xdisplay, info->pending_input_region);
 | 
			
		||||
      info->pending_input_region = None;
 | 
			
		||||
      /* NB: When running as a wayland compositor we don't need an X
 | 
			
		||||
       * composite overlay window, and we don't need to play any input
 | 
			
		||||
       * region tricks to redirect events into clutter. */
 | 
			
		||||
      info->output = None;
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    {
 | 
			
		||||
      info->output = get_output_window (screen);
 | 
			
		||||
      XReparentWindow (xdisplay, xwin, info->output, 0, 0);
 | 
			
		||||
 | 
			
		||||
      /* Make sure there isn't any left-over output shape on the 
 | 
			
		||||
       * overlay window by setting the whole screen to be an
 | 
			
		||||
       * output region.
 | 
			
		||||
       * 
 | 
			
		||||
       * Note: there doesn't seem to be any real chance of that
 | 
			
		||||
       *  because the X server will destroy the overlay window
 | 
			
		||||
       *  when the last client using it exits.
 | 
			
		||||
       */
 | 
			
		||||
      XFixesSetWindowShapeRegion (xdisplay, info->output, ShapeBounding, 0, 0, None);
 | 
			
		||||
 | 
			
		||||
      do_set_stage_input_region (screen, info->pending_input_region);
 | 
			
		||||
      if (info->pending_input_region != None)
 | 
			
		||||
        {
 | 
			
		||||
          XFixesDestroyRegion (xdisplay, info->pending_input_region);
 | 
			
		||||
          info->pending_input_region = None;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      /* Map overlay window before redirecting windows offscreen so we catch their
 | 
			
		||||
       * contents until we show the stage.
 | 
			
		||||
       */
 | 
			
		||||
      XMapWindow (xdisplay, info->output);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  /* Map overlay window before redirecting windows offscreen so we catch their
 | 
			
		||||
   * contents until we show the stage.
 | 
			
		||||
   */
 | 
			
		||||
  XMapWindow (xdisplay, info->output);
 | 
			
		||||
 | 
			
		||||
  redirect_windows (compositor, screen);
 | 
			
		||||
 | 
			
		||||
  info->plugin_mgr = meta_plugin_manager_new (screen);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_compositor_unmanage_screen (MetaCompositor *compositor,
 | 
			
		||||
                                 MetaScreen     *screen)
 | 
			
		||||
{
 | 
			
		||||
  MetaDisplay    *display       = meta_screen_get_display (screen);
 | 
			
		||||
  Display        *xdisplay      = meta_display_get_xdisplay (display);
 | 
			
		||||
  Window          xroot         = meta_screen_get_xroot (screen);
 | 
			
		||||
  if (!meta_is_wayland_compositor ())
 | 
			
		||||
    {
 | 
			
		||||
      MetaDisplay    *display       = meta_screen_get_display (screen);
 | 
			
		||||
      Display        *xdisplay      = meta_display_get_xdisplay (display);
 | 
			
		||||
      Window          xroot         = meta_screen_get_xroot (screen);
 | 
			
		||||
 | 
			
		||||
  /* This is the most important part of cleanup - we have to do this
 | 
			
		||||
   * before giving up the window manager selection or the next
 | 
			
		||||
   * window manager won't be able to redirect subwindows */
 | 
			
		||||
  XCompositeUnredirectSubwindows (xdisplay, xroot, CompositeRedirectManual);
 | 
			
		||||
      /* This is the most important part of cleanup - we have to do this
 | 
			
		||||
       * before giving up the window manager selection or the next
 | 
			
		||||
       * window manager won't be able to redirect subwindows */
 | 
			
		||||
      XCompositeUnredirectSubwindows (xdisplay, xroot, CompositeRedirectManual);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
@@ -749,7 +842,7 @@ meta_shape_cow_for_window (MetaScreen *screen,
 | 
			
		||||
      int width, height;
 | 
			
		||||
      MetaRectangle rect;
 | 
			
		||||
 | 
			
		||||
      meta_window_get_outer_rect (metaWindow, &rect);
 | 
			
		||||
      meta_window_get_frame_rect (metaWindow, &rect);
 | 
			
		||||
 | 
			
		||||
      window_bounds.x = rect.x;
 | 
			
		||||
      window_bounds.y = rect.y;
 | 
			
		||||
@@ -798,15 +891,18 @@ meta_compositor_remove_window (MetaCompositor *compositor,
 | 
			
		||||
  if (!window_actor)
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  screen = meta_window_get_screen (window);
 | 
			
		||||
  info = meta_screen_get_compositor_data (screen);
 | 
			
		||||
 | 
			
		||||
  if (window_actor == info->unredirected_window)
 | 
			
		||||
  if (!meta_is_wayland_compositor ())
 | 
			
		||||
    {
 | 
			
		||||
      meta_window_actor_set_redirected (window_actor, TRUE);
 | 
			
		||||
      meta_shape_cow_for_window (meta_window_get_screen (meta_window_actor_get_meta_window (info->unredirected_window)),
 | 
			
		||||
                                 NULL);
 | 
			
		||||
      info->unredirected_window = NULL;
 | 
			
		||||
      screen = meta_window_get_screen (window);
 | 
			
		||||
      info = meta_screen_get_compositor_data (screen);
 | 
			
		||||
 | 
			
		||||
      if (window_actor == info->unredirected_window)
 | 
			
		||||
        {
 | 
			
		||||
          meta_window_actor_set_redirected (window_actor, TRUE);
 | 
			
		||||
          meta_shape_cow_for_window (meta_window_get_screen (meta_window_actor_get_meta_window (info->unredirected_window)),
 | 
			
		||||
                                     NULL);
 | 
			
		||||
          info->unredirected_window = NULL;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  meta_window_actor_destroy (window_actor);
 | 
			
		||||
@@ -877,23 +973,30 @@ meta_compositor_window_shape_changed (MetaCompositor *compositor,
 | 
			
		||||
  meta_window_actor_update_shape (window_actor);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_compositor_window_opacity_changed (MetaCompositor *compositor,
 | 
			
		||||
                                        MetaWindow     *window)
 | 
			
		||||
{
 | 
			
		||||
  MetaWindowActor *window_actor;
 | 
			
		||||
  window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
 | 
			
		||||
  if (!window_actor)
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  meta_window_actor_update_opacity (window_actor);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Clutter makes the assumption that there is only one X window
 | 
			
		||||
 * per stage, which is a valid assumption to make for a generic
 | 
			
		||||
 * application toolkit. As such, it will ignore any events sent
 | 
			
		||||
 * to the a stage that isn't its X window.
 | 
			
		||||
 *
 | 
			
		||||
 * When a user clicks on what she thinks is the wallpaper, she
 | 
			
		||||
 * is actually clicking on the guard window, which is an entirely
 | 
			
		||||
 * separate top-level override-redirect window in the hierarchy.
 | 
			
		||||
 * We want to recieve events on this guard window so that users
 | 
			
		||||
 * can right-click on the background actor. We do this by telling
 | 
			
		||||
 * Clutter a little white lie, by transforming clicks on the guard
 | 
			
		||||
 * window to become clicks on the stage window, allowing Clutter
 | 
			
		||||
 * to process the event normally.
 | 
			
		||||
 * When running as an X window manager, we need to respond to
 | 
			
		||||
 * events from lots of windows. Trick Clutter into translating
 | 
			
		||||
 * these events by pretending we got an event on the stage window.
 | 
			
		||||
 */
 | 
			
		||||
static void
 | 
			
		||||
maybe_spoof_guard_window_event_as_stage_event (MetaCompScreen *info,
 | 
			
		||||
                                               XEvent         *event)
 | 
			
		||||
maybe_spoof_event_as_stage_event (MetaCompScreen *info,
 | 
			
		||||
                                  XEvent         *event)
 | 
			
		||||
{
 | 
			
		||||
  MetaDisplay *display = meta_screen_get_display (info->screen);
 | 
			
		||||
 | 
			
		||||
@@ -902,19 +1005,22 @@ maybe_spoof_guard_window_event_as_stage_event (MetaCompScreen *info,
 | 
			
		||||
    {
 | 
			
		||||
      XIEvent *input_event = (XIEvent *) event->xcookie.data;
 | 
			
		||||
 | 
			
		||||
      /* Only care about pointer events for now. */
 | 
			
		||||
      switch (input_event->evtype)
 | 
			
		||||
        {
 | 
			
		||||
        case XI_Motion:
 | 
			
		||||
        case XI_ButtonPress:
 | 
			
		||||
        case XI_ButtonRelease:
 | 
			
		||||
        case XI_KeyPress:
 | 
			
		||||
        case XI_KeyRelease:
 | 
			
		||||
          {
 | 
			
		||||
            XIDeviceEvent *device_event = ((XIDeviceEvent *) input_event);
 | 
			
		||||
            if (device_event->event == info->screen->guard_window)
 | 
			
		||||
              {
 | 
			
		||||
                Window xwin = clutter_x11_get_stage_window (CLUTTER_STAGE (info->stage));
 | 
			
		||||
                device_event->event = xwin;
 | 
			
		||||
              }
 | 
			
		||||
 | 
			
		||||
            /* If this is a GTK+ widget, like a window menu, let GTK+ handle
 | 
			
		||||
             * it as-is without mangling. */
 | 
			
		||||
            if (meta_ui_window_is_widget (info->screen->ui, device_event->event))
 | 
			
		||||
              break;
 | 
			
		||||
 | 
			
		||||
            device_event->event = clutter_x11_get_stage_window (CLUTTER_STAGE (info->stage));
 | 
			
		||||
          }
 | 
			
		||||
          break;
 | 
			
		||||
        default:
 | 
			
		||||
@@ -937,10 +1043,7 @@ meta_compositor_process_event (MetaCompositor *compositor,
 | 
			
		||||
{
 | 
			
		||||
  if (compositor->modal_plugin && is_grabbed_event (compositor->display, event))
 | 
			
		||||
    {
 | 
			
		||||
      MetaPluginClass *klass = META_PLUGIN_GET_CLASS (compositor->modal_plugin);
 | 
			
		||||
 | 
			
		||||
      if (klass->xevent_filter)
 | 
			
		||||
        klass->xevent_filter (compositor->modal_plugin, event);
 | 
			
		||||
      _meta_plugin_xevent_filter (compositor->modal_plugin, event);
 | 
			
		||||
 | 
			
		||||
      /* We always consume events even if the plugin says it didn't handle them;
 | 
			
		||||
       * exclusive is exclusive */
 | 
			
		||||
@@ -974,7 +1077,7 @@ meta_compositor_process_event (MetaCompositor *compositor,
 | 
			
		||||
 | 
			
		||||
	  info = meta_screen_get_compositor_data (screen);
 | 
			
		||||
 | 
			
		||||
          maybe_spoof_guard_window_event_as_stage_event (info, event);
 | 
			
		||||
          maybe_spoof_event_as_stage_event (info, event);
 | 
			
		||||
 | 
			
		||||
	  if (meta_plugin_manager_xevent_filter (info->plugin_mgr, event))
 | 
			
		||||
	    {
 | 
			
		||||
@@ -986,33 +1089,25 @@ meta_compositor_process_event (MetaCompositor *compositor,
 | 
			
		||||
	}
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  switch (event->type)
 | 
			
		||||
  if (!meta_is_wayland_compositor () &&
 | 
			
		||||
      event->type == meta_display_get_damage_event_base (compositor->display) + XDamageNotify)
 | 
			
		||||
    {
 | 
			
		||||
    case PropertyNotify:
 | 
			
		||||
      process_property_notify (compositor, (XPropertyEvent *) event, window);
 | 
			
		||||
      break;
 | 
			
		||||
 | 
			
		||||
    default:
 | 
			
		||||
      if (event->type == meta_display_get_damage_event_base (compositor->display) + XDamageNotify)
 | 
			
		||||
      /* Core code doesn't handle damage events, so we need to extract the MetaWindow
 | 
			
		||||
       * ourselves
 | 
			
		||||
       */
 | 
			
		||||
      if (window == NULL)
 | 
			
		||||
        {
 | 
			
		||||
          /* Core code doesn't handle damage events, so we need to extract the MetaWindow
 | 
			
		||||
           * ourselves
 | 
			
		||||
           */
 | 
			
		||||
          if (window == NULL)
 | 
			
		||||
            {
 | 
			
		||||
              Window xwin = ((XDamageNotifyEvent *) event)->drawable;
 | 
			
		||||
              window = meta_display_lookup_x_window (compositor->display, xwin);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
	  DEBUG_TRACE ("meta_compositor_process_event (process_damage)\n");
 | 
			
		||||
          process_damage (compositor, (XDamageNotifyEvent *) event, window);
 | 
			
		||||
          Window xwin = ((XDamageNotifyEvent *) event)->drawable;
 | 
			
		||||
          window = meta_display_lookup_x_window (compositor->display, xwin);
 | 
			
		||||
        }
 | 
			
		||||
      break;
 | 
			
		||||
 | 
			
		||||
      DEBUG_TRACE ("meta_compositor_process_event (process_damage)\n");
 | 
			
		||||
      process_damage (compositor, (XDamageNotifyEvent *) event, window);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  /* Clutter needs to know about MapNotify events otherwise it will
 | 
			
		||||
     think the stage is invisible */
 | 
			
		||||
  if (event->type == MapNotify)
 | 
			
		||||
  if (!meta_is_wayland_compositor () && event->type == MapNotify)
 | 
			
		||||
    clutter_x11_handle_event (event);
 | 
			
		||||
 | 
			
		||||
  /* The above handling is basically just "observing" the events, so we return
 | 
			
		||||
@@ -1145,6 +1240,7 @@ sync_actor_stacking (MetaCompScreen *info)
 | 
			
		||||
   * we go ahead and do it */
 | 
			
		||||
 | 
			
		||||
  children = clutter_actor_get_children (info->window_group);
 | 
			
		||||
  has_windows = FALSE;
 | 
			
		||||
  reordered = FALSE;
 | 
			
		||||
 | 
			
		||||
  /* We allow for actors in the window group other than the actors we
 | 
			
		||||
@@ -1356,20 +1452,38 @@ meta_compositor_sync_screen_size (MetaCompositor  *compositor,
 | 
			
		||||
{
 | 
			
		||||
  MetaDisplay    *display = meta_screen_get_display (screen);
 | 
			
		||||
  MetaCompScreen *info    = meta_screen_get_compositor_data (screen);
 | 
			
		||||
  Display        *xdisplay;
 | 
			
		||||
  Window          xwin;
 | 
			
		||||
 | 
			
		||||
  DEBUG_TRACE ("meta_compositor_sync_screen_size\n");
 | 
			
		||||
  g_return_if_fail (info);
 | 
			
		||||
  if (meta_is_wayland_compositor ())
 | 
			
		||||
    {
 | 
			
		||||
      /* FIXME: when we support a sliced stage, this is the place to do it
 | 
			
		||||
         But! This is not the place to apply KMS config, here we only
 | 
			
		||||
         notify Clutter/Cogl/GL that the framebuffer sizes changed.
 | 
			
		||||
 | 
			
		||||
  xdisplay = meta_display_get_xdisplay (display);
 | 
			
		||||
  xwin = clutter_x11_get_stage_window (CLUTTER_STAGE (info->stage));
 | 
			
		||||
         And because for now clutter does not do sliced, we use one
 | 
			
		||||
         framebuffer the size of the whole screen, and when running on
 | 
			
		||||
         bare metal MetaMonitorManager will do the necessary tricks to
 | 
			
		||||
         show the right portions on the right screens.
 | 
			
		||||
      */
 | 
			
		||||
 | 
			
		||||
  XResizeWindow (xdisplay, xwin, width, height);
 | 
			
		||||
      clutter_actor_set_size (info->stage, width, height);
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    {
 | 
			
		||||
      Display        *xdisplay;
 | 
			
		||||
      Window          xwin;
 | 
			
		||||
 | 
			
		||||
      DEBUG_TRACE ("meta_compositor_sync_screen_size\n");
 | 
			
		||||
      g_return_if_fail (info);
 | 
			
		||||
 | 
			
		||||
      xdisplay = meta_display_get_xdisplay (display);
 | 
			
		||||
      xwin = clutter_x11_get_stage_window (CLUTTER_STAGE (info->stage));
 | 
			
		||||
 | 
			
		||||
      XResizeWindow (xdisplay, xwin, width, height);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  meta_verbose ("Changed size for stage on screen %d to %dx%d\n",
 | 
			
		||||
		meta_screen_get_screen_number (screen),
 | 
			
		||||
		width, height);
 | 
			
		||||
                meta_screen_get_screen_number (screen),
 | 
			
		||||
                width, height);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
@@ -1433,29 +1547,32 @@ pre_paint_windows (MetaCompScreen *info)
 | 
			
		||||
  if (info->windows == NULL)
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  top_window = g_list_last (info->windows)->data;
 | 
			
		||||
 | 
			
		||||
  if (meta_window_actor_should_unredirect (top_window) &&
 | 
			
		||||
      info->disable_unredirect_count == 0)
 | 
			
		||||
    expected_unredirected_window = top_window;
 | 
			
		||||
 | 
			
		||||
  if (info->unredirected_window != expected_unredirected_window)
 | 
			
		||||
  if (!meta_is_wayland_compositor ())
 | 
			
		||||
    {
 | 
			
		||||
      if (info->unredirected_window != NULL)
 | 
			
		||||
        {
 | 
			
		||||
          meta_window_actor_set_redirected (info->unredirected_window, TRUE);
 | 
			
		||||
          meta_shape_cow_for_window (meta_window_get_screen (meta_window_actor_get_meta_window (info->unredirected_window)),
 | 
			
		||||
                                     NULL);
 | 
			
		||||
        }
 | 
			
		||||
      top_window = g_list_last (info->windows)->data;
 | 
			
		||||
 | 
			
		||||
      if (expected_unredirected_window != NULL)
 | 
			
		||||
        {
 | 
			
		||||
          meta_shape_cow_for_window (meta_window_get_screen (meta_window_actor_get_meta_window (top_window)),
 | 
			
		||||
                                     meta_window_actor_get_meta_window (top_window));
 | 
			
		||||
          meta_window_actor_set_redirected (top_window, FALSE);
 | 
			
		||||
        }
 | 
			
		||||
      if (meta_window_actor_should_unredirect (top_window) &&
 | 
			
		||||
          info->disable_unredirect_count == 0)
 | 
			
		||||
        expected_unredirected_window = top_window;
 | 
			
		||||
 | 
			
		||||
      info->unredirected_window = expected_unredirected_window;
 | 
			
		||||
      if (info->unredirected_window != expected_unredirected_window)
 | 
			
		||||
        {
 | 
			
		||||
          if (info->unredirected_window != NULL)
 | 
			
		||||
            {
 | 
			
		||||
              meta_window_actor_set_redirected (info->unredirected_window, TRUE);
 | 
			
		||||
              meta_shape_cow_for_window (meta_window_get_screen (meta_window_actor_get_meta_window (info->unredirected_window)),
 | 
			
		||||
                                         NULL);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
          if (expected_unredirected_window != NULL)
 | 
			
		||||
            {
 | 
			
		||||
              meta_shape_cow_for_window (meta_window_get_screen (meta_window_actor_get_meta_window (top_window)),
 | 
			
		||||
                                         meta_window_actor_get_meta_window (top_window));
 | 
			
		||||
              meta_window_actor_set_redirected (top_window, FALSE);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
          info->unredirected_window = expected_unredirected_window;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  for (l = info->windows; l; l = l->next)
 | 
			
		||||
@@ -1510,13 +1627,7 @@ on_shadow_factory_changed (MetaShadowFactory *factory,
 | 
			
		||||
MetaCompositor *
 | 
			
		||||
meta_compositor_new (MetaDisplay *display)
 | 
			
		||||
{
 | 
			
		||||
  char *atom_names[] = {
 | 
			
		||||
    "_XROOTPMAP_ID",
 | 
			
		||||
    "_NET_WM_WINDOW_OPACITY",
 | 
			
		||||
  };
 | 
			
		||||
  Atom                   atoms[G_N_ELEMENTS(atom_names)];
 | 
			
		||||
  MetaCompositor        *compositor;
 | 
			
		||||
  Display               *xdisplay = meta_display_get_xdisplay (display);
 | 
			
		||||
 | 
			
		||||
  if (!composite_at_least_version (display, 0, 3))
 | 
			
		||||
    return NULL;
 | 
			
		||||
@@ -1528,18 +1639,11 @@ meta_compositor_new (MetaDisplay *display)
 | 
			
		||||
  if (g_getenv("META_DISABLE_MIPMAPS"))
 | 
			
		||||
    compositor->no_mipmaps = TRUE;
 | 
			
		||||
 | 
			
		||||
  meta_verbose ("Creating %d atoms\n", (int) G_N_ELEMENTS (atom_names));
 | 
			
		||||
  XInternAtoms (xdisplay, atom_names, G_N_ELEMENTS (atom_names),
 | 
			
		||||
                False, atoms);
 | 
			
		||||
 | 
			
		||||
  g_signal_connect (meta_shadow_factory_get_default (),
 | 
			
		||||
                    "changed",
 | 
			
		||||
                    G_CALLBACK (on_shadow_factory_changed),
 | 
			
		||||
                    compositor);
 | 
			
		||||
 | 
			
		||||
  compositor->atom_x_root_pixmap = atoms[0];
 | 
			
		||||
  compositor->atom_net_wm_window_opacity = atoms[1];
 | 
			
		||||
 | 
			
		||||
  compositor->repaint_func_id = clutter_threads_add_repaint_func (meta_repaint_func,
 | 
			
		||||
                                                                  compositor,
 | 
			
		||||
                                                                  NULL);
 | 
			
		||||
 
 | 
			
		||||
@@ -6,9 +6,6 @@
 | 
			
		||||
#include <meta/screen.h>
 | 
			
		||||
#include <meta/meta-background-actor.h>
 | 
			
		||||
 | 
			
		||||
void meta_background_actor_set_visible_region  (MetaBackgroundActor *self,
 | 
			
		||||
                                                cairo_region_t      *visible_region);
 | 
			
		||||
 | 
			
		||||
cairo_region_t *meta_background_actor_get_visible_region (MetaBackgroundActor *self);
 | 
			
		||||
cairo_region_t *meta_background_actor_get_clip_region (MetaBackgroundActor *self);
 | 
			
		||||
 | 
			
		||||
#endif /* META_BACKGROUND_ACTOR_PRIVATE_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -41,20 +41,35 @@
 | 
			
		||||
#include <meta/errors.h>
 | 
			
		||||
#include <meta/meta-background.h>
 | 
			
		||||
#include "meta-background-actor-private.h"
 | 
			
		||||
#include "meta-cullable.h"
 | 
			
		||||
 | 
			
		||||
struct _MetaBackgroundActorPrivate
 | 
			
		||||
{
 | 
			
		||||
  cairo_region_t *visible_region;
 | 
			
		||||
  cairo_region_t *clip_region;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
G_DEFINE_TYPE (MetaBackgroundActor, meta_background_actor, CLUTTER_TYPE_ACTOR);
 | 
			
		||||
static void cullable_iface_init (MetaCullableInterface *iface);
 | 
			
		||||
 | 
			
		||||
G_DEFINE_TYPE_WITH_CODE (MetaBackgroundActor, meta_background_actor, CLUTTER_TYPE_ACTOR,
 | 
			
		||||
                         G_IMPLEMENT_INTERFACE (META_TYPE_CULLABLE, cullable_iface_init));
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
set_clip_region (MetaBackgroundActor *self,
 | 
			
		||||
                 cairo_region_t      *clip_region)
 | 
			
		||||
{
 | 
			
		||||
  MetaBackgroundActorPrivate *priv = self->priv;
 | 
			
		||||
 | 
			
		||||
  g_clear_pointer (&priv->clip_region, (GDestroyNotify) cairo_region_destroy);
 | 
			
		||||
  if (clip_region)
 | 
			
		||||
    priv->clip_region = cairo_region_copy (clip_region);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_background_actor_dispose (GObject *object)
 | 
			
		||||
{
 | 
			
		||||
  MetaBackgroundActor *self = META_BACKGROUND_ACTOR (object);
 | 
			
		||||
 | 
			
		||||
  meta_background_actor_set_visible_region (self, NULL);
 | 
			
		||||
  set_clip_region (self, NULL);
 | 
			
		||||
 | 
			
		||||
  G_OBJECT_CLASS (meta_background_actor_parent_class)->dispose (object);
 | 
			
		||||
}
 | 
			
		||||
@@ -104,26 +119,6 @@ meta_background_actor_get_preferred_height (ClutterActor *actor,
 | 
			
		||||
    *natural_height_p = height;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static gboolean
 | 
			
		||||
meta_background_actor_get_paint_volume (ClutterActor       *actor,
 | 
			
		||||
                                        ClutterPaintVolume *volume)
 | 
			
		||||
{
 | 
			
		||||
  ClutterContent *content;
 | 
			
		||||
  gfloat width, height;
 | 
			
		||||
 | 
			
		||||
  content = clutter_actor_get_content (actor);
 | 
			
		||||
 | 
			
		||||
  if (!content)
 | 
			
		||||
    return FALSE;
 | 
			
		||||
 | 
			
		||||
  clutter_content_get_preferred_size (content, &width, &height);
 | 
			
		||||
 | 
			
		||||
  clutter_paint_volume_set_width (volume, width);
 | 
			
		||||
  clutter_paint_volume_set_height (volume, height);
 | 
			
		||||
 | 
			
		||||
  return TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_background_actor_class_init (MetaBackgroundActorClass *klass)
 | 
			
		||||
{
 | 
			
		||||
@@ -136,7 +131,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;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
@@ -166,35 +160,31 @@ meta_background_actor_new (void)
 | 
			
		||||
  return CLUTTER_ACTOR (self);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * meta_background_actor_set_visible_region:
 | 
			
		||||
 * @self: a #MetaBackgroundActor
 | 
			
		||||
 * @visible_region: (allow-none): the area of the actor (in allocate-relative
 | 
			
		||||
 *   coordinates) that is visible.
 | 
			
		||||
 *
 | 
			
		||||
 * Sets the area of the background that is unobscured by overlapping windows.
 | 
			
		||||
 * This is used to optimize and only paint the visible portions.
 | 
			
		||||
 */
 | 
			
		||||
void
 | 
			
		||||
meta_background_actor_set_visible_region (MetaBackgroundActor *self,
 | 
			
		||||
                                          cairo_region_t      *visible_region)
 | 
			
		||||
static void
 | 
			
		||||
meta_background_actor_cull_out (MetaCullable   *cullable,
 | 
			
		||||
                                cairo_region_t *unobscured_region,
 | 
			
		||||
                                cairo_region_t *clip_region)
 | 
			
		||||
{
 | 
			
		||||
  MetaBackgroundActorPrivate *priv;
 | 
			
		||||
  MetaBackgroundActor *self = META_BACKGROUND_ACTOR (cullable);
 | 
			
		||||
  set_clip_region (self, clip_region);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
  g_return_if_fail (META_IS_BACKGROUND_ACTOR (self));
 | 
			
		||||
static void
 | 
			
		||||
meta_background_actor_reset_culling (MetaCullable *cullable)
 | 
			
		||||
{
 | 
			
		||||
  MetaBackgroundActor *self = META_BACKGROUND_ACTOR (cullable);
 | 
			
		||||
  set_clip_region (self, NULL);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
  priv = self->priv;
 | 
			
		||||
 | 
			
		||||
  g_clear_pointer (&priv->visible_region,
 | 
			
		||||
                   (GDestroyNotify)
 | 
			
		||||
                   cairo_region_destroy);
 | 
			
		||||
 | 
			
		||||
  if (visible_region)
 | 
			
		||||
    priv->visible_region = cairo_region_copy (visible_region);
 | 
			
		||||
static void
 | 
			
		||||
cullable_iface_init (MetaCullableInterface *iface)
 | 
			
		||||
{
 | 
			
		||||
  iface->cull_out = meta_background_actor_cull_out;
 | 
			
		||||
  iface->reset_culling = meta_background_actor_reset_culling;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * meta_background_actor_get_visible_region:
 | 
			
		||||
 * meta_background_actor_get_clip_region:
 | 
			
		||||
 * @self: a #MetaBackgroundActor
 | 
			
		||||
 *
 | 
			
		||||
 * Return value (transfer full): a #cairo_region_t that represents the part of
 | 
			
		||||
@@ -202,16 +192,16 @@ meta_background_actor_set_visible_region (MetaBackgroundActor *self,
 | 
			
		||||
 * #MetaWindowActor objects.
 | 
			
		||||
 */
 | 
			
		||||
cairo_region_t *
 | 
			
		||||
meta_background_actor_get_visible_region (MetaBackgroundActor *self)
 | 
			
		||||
meta_background_actor_get_clip_region (MetaBackgroundActor *self)
 | 
			
		||||
{
 | 
			
		||||
  MetaBackgroundActorPrivate *priv = self->priv;
 | 
			
		||||
  ClutterActorBox content_box;
 | 
			
		||||
  cairo_rectangle_int_t content_area = { 0 };
 | 
			
		||||
  cairo_region_t *visible_region;
 | 
			
		||||
  cairo_region_t *clip_region;
 | 
			
		||||
 | 
			
		||||
  g_return_val_if_fail (META_IS_BACKGROUND_ACTOR (self), NULL);
 | 
			
		||||
 | 
			
		||||
  if (!priv->visible_region)
 | 
			
		||||
  if (!priv->clip_region)
 | 
			
		||||
      return NULL;
 | 
			
		||||
 | 
			
		||||
  clutter_actor_get_content_box (CLUTTER_ACTOR (self), &content_box);
 | 
			
		||||
@@ -221,8 +211,8 @@ meta_background_actor_get_visible_region (MetaBackgroundActor *self)
 | 
			
		||||
  content_area.width = content_box.x2 - content_box.x1;
 | 
			
		||||
  content_area.height = content_box.y2 - content_box.y1;
 | 
			
		||||
 | 
			
		||||
  visible_region = cairo_region_create_rectangle (&content_area);
 | 
			
		||||
  cairo_region_intersect (visible_region, priv->visible_region);
 | 
			
		||||
  clip_region = cairo_region_create_rectangle (&content_area);
 | 
			
		||||
  cairo_region_intersect (clip_region, priv->clip_region);
 | 
			
		||||
 | 
			
		||||
  return visible_region;
 | 
			
		||||
  return clip_region;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,11 +0,0 @@
 | 
			
		||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
 | 
			
		||||
 | 
			
		||||
#ifndef META_BACKGROUND_GROUP_PRIVATE_H
 | 
			
		||||
#define META_BACKGROUND_GROUP_PRIVATE_H
 | 
			
		||||
 | 
			
		||||
#include <meta/screen.h>
 | 
			
		||||
#include <meta/meta-background-group.h>
 | 
			
		||||
 | 
			
		||||
void meta_background_group_set_visible_region  (MetaBackgroundGroup *self,
 | 
			
		||||
                                                cairo_region_t      *visible_region);
 | 
			
		||||
#endif /* META_BACKGROUND_GROUP_PRIVATE_H */
 | 
			
		||||
@@ -16,87 +16,43 @@
 | 
			
		||||
 | 
			
		||||
#include <config.h>
 | 
			
		||||
 | 
			
		||||
#include "compositor-private.h"
 | 
			
		||||
#include "clutter-utils.h"
 | 
			
		||||
#include "meta-background-actor-private.h"
 | 
			
		||||
#include "meta-background-group-private.h"
 | 
			
		||||
#include <meta/meta-background-group.h>
 | 
			
		||||
#include "meta-cullable.h"
 | 
			
		||||
 | 
			
		||||
G_DEFINE_TYPE (MetaBackgroundGroup, meta_background_group, CLUTTER_TYPE_ACTOR);
 | 
			
		||||
static void cullable_iface_init (MetaCullableInterface *iface);
 | 
			
		||||
 | 
			
		||||
struct _MetaBackgroundGroupPrivate
 | 
			
		||||
{
 | 
			
		||||
  gpointer dummy;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_background_group_dispose (GObject *object)
 | 
			
		||||
{
 | 
			
		||||
  G_OBJECT_CLASS (meta_background_group_parent_class)->dispose (object);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static gboolean
 | 
			
		||||
meta_background_group_get_paint_volume (ClutterActor       *actor,
 | 
			
		||||
                                        ClutterPaintVolume *volume)
 | 
			
		||||
{
 | 
			
		||||
  return clutter_paint_volume_set_from_allocation (volume, actor);
 | 
			
		||||
}
 | 
			
		||||
G_DEFINE_TYPE_WITH_CODE (MetaBackgroundGroup, meta_background_group, CLUTTER_TYPE_ACTOR,
 | 
			
		||||
                         G_IMPLEMENT_INTERFACE (META_TYPE_CULLABLE, cullable_iface_init));
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_background_group_class_init (MetaBackgroundGroupClass *klass)
 | 
			
		||||
{
 | 
			
		||||
  GObjectClass *object_class = G_OBJECT_CLASS (klass);
 | 
			
		||||
  ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
  actor_class->get_paint_volume = meta_background_group_get_paint_volume;
 | 
			
		||||
  object_class->dispose = meta_background_group_dispose;
 | 
			
		||||
static void
 | 
			
		||||
meta_background_group_cull_out (MetaCullable   *cullable,
 | 
			
		||||
                                cairo_region_t *unobscured_region,
 | 
			
		||||
                                cairo_region_t *clip_region)
 | 
			
		||||
{
 | 
			
		||||
  meta_cullable_cull_out_children (cullable, unobscured_region, clip_region);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
  g_type_class_add_private (klass, sizeof (MetaBackgroundGroupPrivate));
 | 
			
		||||
static void
 | 
			
		||||
meta_background_group_reset_culling (MetaCullable *cullable)
 | 
			
		||||
{
 | 
			
		||||
  meta_cullable_reset_culling_children (cullable);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
cullable_iface_init (MetaCullableInterface *iface)
 | 
			
		||||
{
 | 
			
		||||
  iface->cull_out = meta_background_group_cull_out;
 | 
			
		||||
  iface->reset_culling = meta_background_group_reset_culling;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_background_group_init (MetaBackgroundGroup *self)
 | 
			
		||||
{
 | 
			
		||||
  self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
 | 
			
		||||
                                            META_TYPE_BACKGROUND_GROUP,
 | 
			
		||||
                                            MetaBackgroundGroupPrivate);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * meta_background_group_set_visible_region:
 | 
			
		||||
 * @self: a #MetaBackgroundGroup
 | 
			
		||||
 * @visible_region: (allow-none): the parts of the background to paint
 | 
			
		||||
 *
 | 
			
		||||
 * Sets the area of the backgrounds that is unobscured by overlapping windows.
 | 
			
		||||
 * This is used to optimize and only paint the visible portions.
 | 
			
		||||
 */
 | 
			
		||||
void
 | 
			
		||||
meta_background_group_set_visible_region (MetaBackgroundGroup *self,
 | 
			
		||||
                                          cairo_region_t      *region)
 | 
			
		||||
{
 | 
			
		||||
  GList *children, *l;
 | 
			
		||||
 | 
			
		||||
  children = clutter_actor_get_children (CLUTTER_ACTOR (self));
 | 
			
		||||
  for (l = children; l; l = l->next)
 | 
			
		||||
    {
 | 
			
		||||
      ClutterActor *actor = l->data;
 | 
			
		||||
 | 
			
		||||
      if (META_IS_BACKGROUND_ACTOR (actor))
 | 
			
		||||
        {
 | 
			
		||||
          meta_background_actor_set_visible_region (META_BACKGROUND_ACTOR (actor), region);
 | 
			
		||||
        }
 | 
			
		||||
      else if (META_IS_BACKGROUND_GROUP (actor))
 | 
			
		||||
        {
 | 
			
		||||
          int x, y;
 | 
			
		||||
 | 
			
		||||
          if (!meta_actor_is_untransformed (actor, &x, &y))
 | 
			
		||||
            continue;
 | 
			
		||||
 | 
			
		||||
          cairo_region_translate (region, -x, -y);
 | 
			
		||||
          meta_background_group_set_visible_region (META_BACKGROUND_GROUP (actor), region);
 | 
			
		||||
          cairo_region_translate (region, x, y);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
  g_list_free (children);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ClutterActor *
 | 
			
		||||
 
 | 
			
		||||
@@ -37,6 +37,7 @@
 | 
			
		||||
#include "mutter-enum-types.h"
 | 
			
		||||
#include <meta/errors.h>
 | 
			
		||||
#include <meta/meta-background.h>
 | 
			
		||||
#include "util-private.h"
 | 
			
		||||
#include "meta-background-actor-private.h"
 | 
			
		||||
 | 
			
		||||
#define FRAGMENT_SHADER_DECLARATIONS                                           \
 | 
			
		||||
@@ -412,13 +413,13 @@ meta_background_paint_content (ClutterContent   *content,
 | 
			
		||||
   */
 | 
			
		||||
  if (META_IS_BACKGROUND_ACTOR (actor))
 | 
			
		||||
    {
 | 
			
		||||
      cairo_region_t *visible_region;
 | 
			
		||||
      visible_region = meta_background_actor_get_visible_region (META_BACKGROUND_ACTOR (actor));
 | 
			
		||||
      cairo_region_t *clip_region;
 | 
			
		||||
      clip_region = meta_background_actor_get_clip_region (META_BACKGROUND_ACTOR (actor));
 | 
			
		||||
 | 
			
		||||
      if (visible_region != NULL)
 | 
			
		||||
      if (clip_region != NULL)
 | 
			
		||||
        {
 | 
			
		||||
          cairo_region_intersect (paintable_region, visible_region);
 | 
			
		||||
          cairo_region_destroy (visible_region);
 | 
			
		||||
          cairo_region_intersect (paintable_region, clip_region);
 | 
			
		||||
          cairo_region_destroy (clip_region);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -1031,7 +1032,6 @@ meta_background_load_file_finish (MetaBackground  *self,
 | 
			
		||||
                                  GAsyncResult    *result,
 | 
			
		||||
                                  GError         **error)
 | 
			
		||||
{
 | 
			
		||||
  static CoglUserDataKey key;
 | 
			
		||||
  GTask *task;
 | 
			
		||||
  LoadFileTaskData *task_data;
 | 
			
		||||
  CoglTexture *texture;
 | 
			
		||||
@@ -1077,12 +1077,6 @@ meta_background_load_file_finish (MetaBackground  *self,
 | 
			
		||||
      goto out;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  cogl_object_set_user_data (COGL_OBJECT (texture),
 | 
			
		||||
                             &key,
 | 
			
		||||
                             g_object_ref (pixbuf),
 | 
			
		||||
                             (CoglUserDataDestroyCallback)
 | 
			
		||||
                             g_object_unref);
 | 
			
		||||
 | 
			
		||||
  ensure_pipeline (self);
 | 
			
		||||
  unset_texture (self);
 | 
			
		||||
  set_style (self, task_data->style);
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										193
									
								
								src/compositor/meta-cullable.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										193
									
								
								src/compositor/meta-cullable.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,193 @@
 | 
			
		||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (C) 2013 Red Hat
 | 
			
		||||
 *
 | 
			
		||||
 * 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:
 | 
			
		||||
 *     Owen Taylor <otaylor@redhat.com>
 | 
			
		||||
 *     Ray Strode <rstrode@redhat.com>
 | 
			
		||||
 *     Jasper St. Pierre <jstpierre@mecheye.net>
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "config.h"
 | 
			
		||||
#include "meta-cullable.h"
 | 
			
		||||
#include "clutter-utils.h"
 | 
			
		||||
 | 
			
		||||
G_DEFINE_INTERFACE (MetaCullable, meta_cullable, CLUTTER_TYPE_ACTOR);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * SECTION:meta-cullable
 | 
			
		||||
 * @title: MetaCullable
 | 
			
		||||
 * @short_description: CPU culling operations for efficient drawing
 | 
			
		||||
 *
 | 
			
		||||
 * When we are painting a stack of 5-10 large actors, the standard
 | 
			
		||||
 * bottom-to-top method of drawing every actor results in a tremendous
 | 
			
		||||
 * amount of overdraw. If these actors are painting textures like
 | 
			
		||||
 * windows, it can easily max out the available memory bandwidth on a
 | 
			
		||||
 * low-end graphics chipset. It's even worse if window textures are
 | 
			
		||||
 * being accessed over the AGP bus.
 | 
			
		||||
 *
 | 
			
		||||
 * #MetaCullable is our solution. The basic technique applied here is to
 | 
			
		||||
 * do a pre-pass before painting where we walk each actor from top to bottom
 | 
			
		||||
 * and ask each actor to "cull itself out". We pass in a region it can copy
 | 
			
		||||
 * to clip its drawing to, and the actor can subtract its fully opaque pixels
 | 
			
		||||
 * so that actors underneath know not to draw there as well.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * meta_cullable_cull_out_children:
 | 
			
		||||
 * @cullable: The #MetaCullable
 | 
			
		||||
 * @unobscured_region: The unobscured region, as passed into cull_out()
 | 
			
		||||
 * @clip_region: The clip region, as passed into cull_out()
 | 
			
		||||
 *
 | 
			
		||||
 * This is a helper method for actors that want to recurse over their
 | 
			
		||||
 * child actors, and cull them out.
 | 
			
		||||
 *
 | 
			
		||||
 * See #MetaCullable and meta_cullable_cull_out() for more details.
 | 
			
		||||
 */
 | 
			
		||||
void
 | 
			
		||||
meta_cullable_cull_out_children (MetaCullable   *cullable,
 | 
			
		||||
                                 cairo_region_t *unobscured_region,
 | 
			
		||||
                                 cairo_region_t *clip_region)
 | 
			
		||||
{
 | 
			
		||||
  ClutterActor *actor = CLUTTER_ACTOR (cullable);
 | 
			
		||||
  ClutterActor *child;
 | 
			
		||||
  ClutterActorIter iter;
 | 
			
		||||
 | 
			
		||||
  clutter_actor_iter_init (&iter, actor);
 | 
			
		||||
  while (clutter_actor_iter_prev (&iter, &child))
 | 
			
		||||
    {
 | 
			
		||||
      float x, y;
 | 
			
		||||
 | 
			
		||||
      if (!CLUTTER_ACTOR_IS_VISIBLE (child))
 | 
			
		||||
        continue;
 | 
			
		||||
 | 
			
		||||
      /* If an actor has effects applied, then that can change the area
 | 
			
		||||
       * it paints and the opacity, so we no longer can figure out what
 | 
			
		||||
       * portion of the actor is obscured and what portion of the screen
 | 
			
		||||
       * it obscures, so we skip the actor.
 | 
			
		||||
       *
 | 
			
		||||
       * This has a secondary beneficial effect: if a ClutterOffscreenEffect
 | 
			
		||||
       * is applied to an actor, then our clipped redraws interfere with the
 | 
			
		||||
       * caching of the FBO - even if we only need to draw a small portion
 | 
			
		||||
       * of the window right now, ClutterOffscreenEffect may use other portions
 | 
			
		||||
       * of the FBO later. So, skipping actors with effects applied also
 | 
			
		||||
       * prevents these bugs.
 | 
			
		||||
       *
 | 
			
		||||
       * Theoretically, we should check clutter_actor_get_offscreen_redirect()
 | 
			
		||||
       * as well for the same reason, but omitted for simplicity in the
 | 
			
		||||
       * hopes that no-one will do that.
 | 
			
		||||
       */
 | 
			
		||||
      if (clutter_actor_has_effects (child))
 | 
			
		||||
        continue;
 | 
			
		||||
 | 
			
		||||
      if (!META_IS_CULLABLE (child))
 | 
			
		||||
        continue;
 | 
			
		||||
 | 
			
		||||
      if (!meta_actor_is_untransformed (child, NULL, NULL))
 | 
			
		||||
        continue;
 | 
			
		||||
 | 
			
		||||
      clutter_actor_get_position (child, &x, &y);
 | 
			
		||||
 | 
			
		||||
      /* Temporarily move to the coordinate system of the actor */
 | 
			
		||||
      cairo_region_translate (unobscured_region, - x, - y);
 | 
			
		||||
      cairo_region_translate (clip_region, - x, - y);
 | 
			
		||||
 | 
			
		||||
      meta_cullable_cull_out (META_CULLABLE (child), unobscured_region, clip_region);
 | 
			
		||||
 | 
			
		||||
      cairo_region_translate (unobscured_region, x, y);
 | 
			
		||||
      cairo_region_translate (clip_region, x, y);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * meta_cullable_reset_culling_children:
 | 
			
		||||
 * @cullable: The #MetaCullable
 | 
			
		||||
 *
 | 
			
		||||
 * This is a helper method for actors that want to recurse over their
 | 
			
		||||
 * child actors, and cull them out.
 | 
			
		||||
 *
 | 
			
		||||
 * See #MetaCullable and meta_cullable_reset_culling() for more details.
 | 
			
		||||
 */
 | 
			
		||||
void
 | 
			
		||||
meta_cullable_reset_culling_children (MetaCullable *cullable)
 | 
			
		||||
{
 | 
			
		||||
  ClutterActor *actor = CLUTTER_ACTOR (cullable);
 | 
			
		||||
  ClutterActor *child;
 | 
			
		||||
  ClutterActorIter iter;
 | 
			
		||||
 | 
			
		||||
  clutter_actor_iter_init (&iter, actor);
 | 
			
		||||
  while (clutter_actor_iter_next (&iter, &child))
 | 
			
		||||
    {
 | 
			
		||||
      if (!META_IS_CULLABLE (child))
 | 
			
		||||
        continue;
 | 
			
		||||
 | 
			
		||||
      meta_cullable_reset_culling (META_CULLABLE (child));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_cullable_default_init (MetaCullableInterface *iface)
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * meta_cullable_cull_out:
 | 
			
		||||
 * @cullable: The #MetaCullable
 | 
			
		||||
 * @unobscured_region: The unobscured region, in @cullable's space.
 | 
			
		||||
 * @clip_region: The clip region, in @cullable's space.
 | 
			
		||||
 *
 | 
			
		||||
 * When #MetaWindowGroup is painted, we walk over its direct cullable
 | 
			
		||||
 * children from top to bottom and ask themselves to "cull out". Cullables
 | 
			
		||||
 * can use @unobscured_region and @clip_region to clip their drawing. Actors
 | 
			
		||||
 * interested in eliminating overdraw should copy the @clip_region and only
 | 
			
		||||
 * paint those parts, as everything else has been obscured by actors above it.
 | 
			
		||||
 *
 | 
			
		||||
 * Actors that may have fully opaque parts should also subtract out a region
 | 
			
		||||
 * that is fully opaque from @unobscured_region and @clip_region.
 | 
			
		||||
 *
 | 
			
		||||
 * @unobscured_region and @clip_region are extremely similar. The difference
 | 
			
		||||
 * is that @clip_region starts off with the stage's clip, if Clutter detects
 | 
			
		||||
 * that we're doing a clipped redraw. @unobscured_region, however, starts off
 | 
			
		||||
 * with the full stage size, so actors that may want to record what parts of
 | 
			
		||||
 * their window are unobscured for e.g. scheduling repaints can do so.
 | 
			
		||||
 *
 | 
			
		||||
 * Actors that have children can also use the meta_cullable_cull_out_children()
 | 
			
		||||
 * helper method to do a simple cull across all their children.
 | 
			
		||||
 */
 | 
			
		||||
void
 | 
			
		||||
meta_cullable_cull_out (MetaCullable   *cullable,
 | 
			
		||||
                        cairo_region_t *unobscured_region,
 | 
			
		||||
                        cairo_region_t *clip_region)
 | 
			
		||||
{
 | 
			
		||||
  META_CULLABLE_GET_IFACE (cullable)->cull_out (cullable, unobscured_region, clip_region);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * meta_cullable_reset_culling:
 | 
			
		||||
 * @cullable: The #MetaCullable
 | 
			
		||||
 *
 | 
			
		||||
 * Actors that copied data in their cull_out() implementation can now
 | 
			
		||||
 * reset their data, as the paint is now over. Additional paints may be
 | 
			
		||||
 * done by #ClutterClone or similar, and they should not be affected by
 | 
			
		||||
 * the culling operation.
 | 
			
		||||
 */
 | 
			
		||||
void
 | 
			
		||||
meta_cullable_reset_culling (MetaCullable *cullable)
 | 
			
		||||
{
 | 
			
		||||
  META_CULLABLE_GET_IFACE (cullable)->reset_culling (cullable);
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										68
									
								
								src/compositor/meta-cullable.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										68
									
								
								src/compositor/meta-cullable.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,68 @@
 | 
			
		||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (C) 2013 Red Hat
 | 
			
		||||
 *
 | 
			
		||||
 * 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:
 | 
			
		||||
 *     Owen Taylor <otaylor@redhat.com>
 | 
			
		||||
 *     Ray Strode <rstrode@redhat.com>
 | 
			
		||||
 *     Jasper St. Pierre <jstpierre@mecheye.net>
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef __META_CULLABLE_H__
 | 
			
		||||
#define __META_CULLABLE_H__
 | 
			
		||||
 | 
			
		||||
#include <clutter/clutter.h>
 | 
			
		||||
 | 
			
		||||
G_BEGIN_DECLS
 | 
			
		||||
 | 
			
		||||
#define META_TYPE_CULLABLE             (meta_cullable_get_type ())
 | 
			
		||||
#define META_CULLABLE(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_CULLABLE, MetaCullable))
 | 
			
		||||
#define META_IS_CULLABLE(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_CULLABLE))
 | 
			
		||||
#define META_CULLABLE_GET_IFACE(obj)   (G_TYPE_INSTANCE_GET_INTERFACE ((obj),  META_TYPE_CULLABLE, MetaCullableInterface))
 | 
			
		||||
 | 
			
		||||
typedef struct _MetaCullable MetaCullable;
 | 
			
		||||
typedef struct _MetaCullableInterface MetaCullableInterface;
 | 
			
		||||
 | 
			
		||||
struct _MetaCullableInterface
 | 
			
		||||
{
 | 
			
		||||
  GTypeInterface g_iface;
 | 
			
		||||
 | 
			
		||||
  void (* cull_out)      (MetaCullable   *cullable,
 | 
			
		||||
                          cairo_region_t *unobscured_region,
 | 
			
		||||
                          cairo_region_t *clip_region);
 | 
			
		||||
  void (* reset_culling) (MetaCullable  *cullable);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
GType meta_cullable_get_type (void);
 | 
			
		||||
 | 
			
		||||
void meta_cullable_cull_out (MetaCullable   *cullable,
 | 
			
		||||
                             cairo_region_t *unobscured_region,
 | 
			
		||||
                             cairo_region_t *clip_region);
 | 
			
		||||
void meta_cullable_reset_culling (MetaCullable *cullable);
 | 
			
		||||
 | 
			
		||||
/* Utility methods for implementations */
 | 
			
		||||
void meta_cullable_cull_out_children (MetaCullable   *cullable,
 | 
			
		||||
                                      cairo_region_t *unobscured_region,
 | 
			
		||||
                                      cairo_region_t *clip_region);
 | 
			
		||||
void meta_cullable_reset_culling_children (MetaCullable *cullable);
 | 
			
		||||
 | 
			
		||||
G_END_DECLS
 | 
			
		||||
 | 
			
		||||
#endif /* __META_CULLABLE_H__ */
 | 
			
		||||
 | 
			
		||||
@@ -192,10 +192,7 @@ meta_module_class_init (MetaModuleClass *klass)
 | 
			
		||||
static void
 | 
			
		||||
meta_module_init (MetaModule *self)
 | 
			
		||||
{
 | 
			
		||||
  MetaModulePrivate *priv;
 | 
			
		||||
 | 
			
		||||
  self->priv = priv = META_MODULE_GET_PRIVATE (self);
 | 
			
		||||
 | 
			
		||||
  self->priv = META_MODULE_GET_PRIVATE (self);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
GType
 | 
			
		||||
 
 | 
			
		||||
@@ -306,31 +306,13 @@ meta_plugin_manager_filter_keybinding (MetaPluginManager *plugin_mgr,
 | 
			
		||||
  return FALSE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * The public method that the compositor hooks into for desktop switching.
 | 
			
		||||
 *
 | 
			
		||||
 * Returns TRUE if the plugin handled the event type (i.e.,
 | 
			
		||||
 * if the return value is FALSE, there will be no subsequent call to the
 | 
			
		||||
 * manager completed() callback, and the compositor must ensure that any
 | 
			
		||||
 * appropriate post-effect cleanup is carried out.
 | 
			
		||||
 */
 | 
			
		||||
gboolean
 | 
			
		||||
meta_plugin_manager_xevent_filter (MetaPluginManager *plugin_mgr,
 | 
			
		||||
                                   XEvent            *xev)
 | 
			
		||||
{
 | 
			
		||||
  MetaPlugin *plugin = plugin_mgr->plugin;
 | 
			
		||||
  MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
 | 
			
		||||
 | 
			
		||||
  /* We need to make sure that clutter gets certain events, like
 | 
			
		||||
   * ConfigureNotify on the stage window. If there is a plugin that
 | 
			
		||||
   * provides an xevent_filter function, then it's the responsibility
 | 
			
		||||
   * of that plugin to pass events to Clutter. Otherwise, we send the
 | 
			
		||||
   * event directly to Clutter ourselves.
 | 
			
		||||
   */
 | 
			
		||||
  if (klass->xevent_filter)
 | 
			
		||||
    return klass->xevent_filter (plugin, xev);
 | 
			
		||||
  else
 | 
			
		||||
    return clutter_x11_handle_event (xev) != CLUTTER_X11_FILTER_CONTINUE;
 | 
			
		||||
  return _meta_plugin_xevent_filter (plugin, xev);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
 
 | 
			
		||||
@@ -72,6 +72,8 @@ gboolean meta_plugin_manager_filter_keybinding (MetaPluginManager  *mgr,
 | 
			
		||||
 | 
			
		||||
gboolean meta_plugin_manager_xevent_filter (MetaPluginManager *mgr,
 | 
			
		||||
                                            XEvent            *xev);
 | 
			
		||||
gboolean _meta_plugin_xevent_filter (MetaPlugin *plugin,
 | 
			
		||||
                                     XEvent     *xev);
 | 
			
		||||
 | 
			
		||||
void     meta_plugin_manager_confirm_display_change (MetaPluginManager *mgr);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -138,9 +138,7 @@ meta_plugin_class_init (MetaPluginClass *klass)
 | 
			
		||||
static void
 | 
			
		||||
meta_plugin_init (MetaPlugin *self)
 | 
			
		||||
{
 | 
			
		||||
  MetaPluginPrivate *priv;
 | 
			
		||||
 | 
			
		||||
  self->priv = priv = META_PLUGIN_GET_PRIVATE (self);
 | 
			
		||||
  self->priv = META_PLUGIN_GET_PRIVATE (self);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
gboolean
 | 
			
		||||
@@ -185,6 +183,28 @@ _meta_plugin_effect_started (MetaPlugin *plugin)
 | 
			
		||||
  priv->running++;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
gboolean
 | 
			
		||||
_meta_plugin_xevent_filter (MetaPlugin *plugin,
 | 
			
		||||
                            XEvent     *xev)
 | 
			
		||||
{
 | 
			
		||||
  MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
 | 
			
		||||
 | 
			
		||||
  /* When mutter is running as a wayland compositor, things like input
 | 
			
		||||
   * events just come directly from clutter so it won't have disabled
 | 
			
		||||
   * clutter's event retrieval and won't need to forward it events (if
 | 
			
		||||
   * it did it would lead to recursion). Also when running as a
 | 
			
		||||
   * wayland compositor we shouldn't be assuming that we're running
 | 
			
		||||
   * with the clutter x11 backend.
 | 
			
		||||
   */
 | 
			
		||||
 | 
			
		||||
  if (klass->xevent_filter && klass->xevent_filter (plugin, xev))
 | 
			
		||||
    return TRUE;
 | 
			
		||||
  else if (!meta_is_wayland_compositor ())
 | 
			
		||||
    return clutter_x11_handle_event (xev) != CLUTTER_X11_FILTER_CONTINUE;
 | 
			
		||||
  else
 | 
			
		||||
    return FALSE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_plugin_switch_workspace_completed (MetaPlugin *plugin)
 | 
			
		||||
{
 | 
			
		||||
@@ -267,10 +287,6 @@ meta_plugin_destroy_completed (MetaPlugin      *plugin,
 | 
			
		||||
/**
 | 
			
		||||
 * meta_plugin_begin_modal:
 | 
			
		||||
 * @plugin: a #MetaPlugin
 | 
			
		||||
 * @grab_window: the X window to grab the keyboard and mouse on
 | 
			
		||||
 * @cursor: the cursor to use for the pointer grab, or None,
 | 
			
		||||
 *          to use the normal cursor for the grab window and
 | 
			
		||||
 *          its descendants.
 | 
			
		||||
 * @options: flags that modify the behavior of the modal grab
 | 
			
		||||
 * @timestamp: the timestamp used for establishing grabs
 | 
			
		||||
 *
 | 
			
		||||
@@ -291,15 +307,13 @@ meta_plugin_destroy_completed (MetaPlugin      *plugin,
 | 
			
		||||
 */
 | 
			
		||||
gboolean
 | 
			
		||||
meta_plugin_begin_modal (MetaPlugin       *plugin,
 | 
			
		||||
                         Window            grab_window,
 | 
			
		||||
                         Cursor            cursor,
 | 
			
		||||
                         MetaModalOptions  options,
 | 
			
		||||
                         guint32           timestamp)
 | 
			
		||||
{
 | 
			
		||||
  MetaPluginPrivate *priv = META_PLUGIN (plugin)->priv;
 | 
			
		||||
 | 
			
		||||
  return meta_begin_modal_for_plugin (priv->screen, plugin,
 | 
			
		||||
                                      grab_window, cursor, options, timestamp);
 | 
			
		||||
                                      options, timestamp);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										36
									
								
								src/compositor/meta-shaped-texture-private.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								src/compositor/meta-shaped-texture-private.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,36 @@
 | 
			
		||||
/*
 | 
			
		||||
 * shaped texture
 | 
			
		||||
 *
 | 
			
		||||
 * An actor to draw a texture clipped to a list of rectangles
 | 
			
		||||
 *
 | 
			
		||||
 * Authored By Neil Roberts  <neil@linux.intel.com>
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (C) 2008 Intel Corporation
 | 
			
		||||
 *               2013 Red Hat, Inc.
 | 
			
		||||
 *
 | 
			
		||||
 * This program is free software; you can redistribute it and/or
 | 
			
		||||
 * modify it under the terms of the GNU General Public License as
 | 
			
		||||
 * published by the Free Software Foundation; either version 2 of the
 | 
			
		||||
 * License, or (at your option) any later version.
 | 
			
		||||
 *
 | 
			
		||||
 * This program is distributed in the hope that it will be useful, but
 | 
			
		||||
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 | 
			
		||||
 * General Public License for more details.
 | 
			
		||||
 *
 | 
			
		||||
 * You should have received a copy of the GNU General Public License
 | 
			
		||||
 * along with this program; if not, write to the Free Software
 | 
			
		||||
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 | 
			
		||||
 * 02111-1307, USA.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef __META_SHAPED_TEXTURE_PRIVATE_H__
 | 
			
		||||
#define __META_SHAPED_TEXTURE_PRIVATE_H__
 | 
			
		||||
 | 
			
		||||
#include <meta/meta-shaped-texture.h>
 | 
			
		||||
 | 
			
		||||
ClutterActor *meta_shaped_texture_new (void);
 | 
			
		||||
void meta_shaped_texture_set_texture (MetaShapedTexture *stex,
 | 
			
		||||
                                      CoglTexture       *texture);
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
@@ -30,12 +30,16 @@
 | 
			
		||||
#include <config.h>
 | 
			
		||||
 | 
			
		||||
#include <meta/meta-shaped-texture.h>
 | 
			
		||||
#include <meta/util.h>
 | 
			
		||||
#include "clutter-utils.h"
 | 
			
		||||
#include "meta-texture-tower.h"
 | 
			
		||||
 | 
			
		||||
#include "meta-shaped-texture-private.h"
 | 
			
		||||
 | 
			
		||||
#include <clutter/clutter.h>
 | 
			
		||||
#include <cogl/cogl.h>
 | 
			
		||||
#include <cogl/cogl-texture-pixmap-x11.h>
 | 
			
		||||
#include <gdk/gdk.h> /* for gdk_rectangle_intersect() */
 | 
			
		||||
#include "meta-cullable.h"
 | 
			
		||||
 | 
			
		||||
static void meta_shaped_texture_dispose  (GObject    *object);
 | 
			
		||||
 | 
			
		||||
@@ -55,8 +59,10 @@ static void meta_shaped_texture_get_preferred_height (ClutterActor *self,
 | 
			
		||||
 | 
			
		||||
static gboolean meta_shaped_texture_get_paint_volume (ClutterActor *self, ClutterPaintVolume *volume);
 | 
			
		||||
 | 
			
		||||
G_DEFINE_TYPE (MetaShapedTexture, meta_shaped_texture,
 | 
			
		||||
               CLUTTER_TYPE_ACTOR);
 | 
			
		||||
static void cullable_iface_init (MetaCullableInterface *iface);
 | 
			
		||||
 | 
			
		||||
G_DEFINE_TYPE_WITH_CODE (MetaShapedTexture, meta_shaped_texture, CLUTTER_TYPE_ACTOR,
 | 
			
		||||
                         G_IMPLEMENT_INTERFACE (META_TYPE_CULLABLE, cullable_iface_init));
 | 
			
		||||
 | 
			
		||||
#define META_SHAPED_TEXTURE_GET_PRIVATE(obj) \
 | 
			
		||||
  (G_TYPE_INSTANCE_GET_PRIVATE ((obj), META_TYPE_SHAPED_TEXTURE, \
 | 
			
		||||
@@ -65,13 +71,13 @@ G_DEFINE_TYPE (MetaShapedTexture, meta_shaped_texture,
 | 
			
		||||
struct _MetaShapedTexturePrivate
 | 
			
		||||
{
 | 
			
		||||
  MetaTextureTower *paint_tower;
 | 
			
		||||
  Pixmap pixmap;
 | 
			
		||||
  CoglTexturePixmapX11 *texture;
 | 
			
		||||
 | 
			
		||||
  CoglTexture *texture;
 | 
			
		||||
  CoglTexture *mask_texture;
 | 
			
		||||
  CoglPipeline *pipeline;
 | 
			
		||||
  CoglPipeline *pipeline_unshaped;
 | 
			
		||||
 | 
			
		||||
  cairo_region_t *clip_region;
 | 
			
		||||
  cairo_region_t *input_shape_region;
 | 
			
		||||
  cairo_region_t *opaque_region;
 | 
			
		||||
 | 
			
		||||
  guint tex_width, tex_height;
 | 
			
		||||
 | 
			
		||||
@@ -103,11 +109,23 @@ meta_shaped_texture_init (MetaShapedTexture *self)
 | 
			
		||||
  priv = self->priv = META_SHAPED_TEXTURE_GET_PRIVATE (self);
 | 
			
		||||
 | 
			
		||||
  priv->paint_tower = meta_texture_tower_new ();
 | 
			
		||||
 | 
			
		||||
  priv->texture = NULL;
 | 
			
		||||
  priv->mask_texture = NULL;
 | 
			
		||||
  priv->create_mipmaps = TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
set_clip_region (MetaShapedTexture *self,
 | 
			
		||||
                 cairo_region_t    *clip_region)
 | 
			
		||||
{
 | 
			
		||||
  MetaShapedTexturePrivate *priv = self->priv;
 | 
			
		||||
 | 
			
		||||
  g_clear_pointer (&priv->clip_region, (GDestroyNotify) cairo_region_destroy);
 | 
			
		||||
  if (clip_region)
 | 
			
		||||
    priv->clip_region = cairo_region_copy (clip_region);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_shaped_texture_dispose (GObject *object)
 | 
			
		||||
{
 | 
			
		||||
@@ -118,29 +136,145 @@ meta_shaped_texture_dispose (GObject *object)
 | 
			
		||||
    meta_texture_tower_free (priv->paint_tower);
 | 
			
		||||
  priv->paint_tower = NULL;
 | 
			
		||||
 | 
			
		||||
  g_clear_pointer (&priv->pipeline, cogl_object_unref);
 | 
			
		||||
  g_clear_pointer (&priv->pipeline_unshaped, cogl_object_unref);
 | 
			
		||||
  g_clear_pointer (&priv->texture, cogl_object_unref);
 | 
			
		||||
  g_clear_pointer (&priv->opaque_region, cairo_region_destroy);
 | 
			
		||||
 | 
			
		||||
  meta_shaped_texture_set_mask_texture (self, NULL);
 | 
			
		||||
  meta_shaped_texture_set_clip_region (self, NULL);
 | 
			
		||||
  set_clip_region (self, NULL);
 | 
			
		||||
 | 
			
		||||
  G_OBJECT_CLASS (meta_shaped_texture_parent_class)->dispose (object);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static CoglPipeline *
 | 
			
		||||
get_unmasked_pipeline (CoglContext *ctx)
 | 
			
		||||
{
 | 
			
		||||
  return cogl_pipeline_new (ctx);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static CoglPipeline *
 | 
			
		||||
get_masked_pipeline (CoglContext *ctx)
 | 
			
		||||
{
 | 
			
		||||
  static CoglPipeline *template = NULL;
 | 
			
		||||
  if (G_UNLIKELY (template == NULL))
 | 
			
		||||
    {
 | 
			
		||||
      template = cogl_pipeline_new (ctx);
 | 
			
		||||
      cogl_pipeline_set_layer_combine (template, 1,
 | 
			
		||||
                                       "RGBA = MODULATE (PREVIOUS, TEXTURE[A])",
 | 
			
		||||
                                       NULL);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  return cogl_pipeline_copy (template);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static CoglPipeline *
 | 
			
		||||
get_unblended_pipeline (CoglContext *ctx)
 | 
			
		||||
{
 | 
			
		||||
  static CoglPipeline *template = NULL;
 | 
			
		||||
  if (G_UNLIKELY (template == NULL))
 | 
			
		||||
    {
 | 
			
		||||
      CoglColor color;
 | 
			
		||||
      template = cogl_pipeline_new (ctx);
 | 
			
		||||
      cogl_color_init_from_4ub (&color, 255, 255, 255, 255);
 | 
			
		||||
      cogl_pipeline_set_blend (template,
 | 
			
		||||
                               "RGBA = ADD (SRC_COLOR, 0)",
 | 
			
		||||
                               NULL);
 | 
			
		||||
      cogl_pipeline_set_color (template, &color);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  return cogl_pipeline_copy (template);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
paint_clipped_rectangle (CoglFramebuffer       *fb,
 | 
			
		||||
                         CoglPipeline          *pipeline,
 | 
			
		||||
                         cairo_rectangle_int_t *rect,
 | 
			
		||||
                         ClutterActorBox       *alloc)
 | 
			
		||||
{
 | 
			
		||||
  float coords[8];
 | 
			
		||||
  float x1, y1, x2, y2;
 | 
			
		||||
 | 
			
		||||
  x1 = rect->x;
 | 
			
		||||
  y1 = rect->y;
 | 
			
		||||
  x2 = rect->x + rect->width;
 | 
			
		||||
  y2 = rect->y + rect->height;
 | 
			
		||||
 | 
			
		||||
  coords[0] = rect->x / (alloc->x2 - alloc->x1);
 | 
			
		||||
  coords[1] = rect->y / (alloc->y2 - alloc->y1);
 | 
			
		||||
  coords[2] = (rect->x + rect->width) / (alloc->x2 - alloc->x1);
 | 
			
		||||
  coords[3] = (rect->y + rect->height) / (alloc->y2 - alloc->y1);
 | 
			
		||||
 | 
			
		||||
  coords[4] = coords[0];
 | 
			
		||||
  coords[5] = coords[1];
 | 
			
		||||
  coords[6] = coords[2];
 | 
			
		||||
  coords[7] = coords[3];
 | 
			
		||||
 | 
			
		||||
  cogl_framebuffer_draw_multitextured_rectangle (fb, pipeline,
 | 
			
		||||
                                                 x1, y1, x2, y2,
 | 
			
		||||
                                                 &coords[0], 8);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
set_cogl_texture (MetaShapedTexture *stex,
 | 
			
		||||
                  CoglTexture       *cogl_tex)
 | 
			
		||||
{
 | 
			
		||||
  MetaShapedTexturePrivate *priv;
 | 
			
		||||
  guint width, height;
 | 
			
		||||
 | 
			
		||||
  g_return_if_fail (META_IS_SHAPED_TEXTURE (stex));
 | 
			
		||||
 | 
			
		||||
  priv = stex->priv;
 | 
			
		||||
 | 
			
		||||
  if (priv->texture)
 | 
			
		||||
    cogl_object_unref (priv->texture);
 | 
			
		||||
 | 
			
		||||
  priv->texture = cogl_tex;
 | 
			
		||||
 | 
			
		||||
  if (cogl_tex != NULL)
 | 
			
		||||
    {
 | 
			
		||||
      cogl_object_ref (cogl_tex);
 | 
			
		||||
      width = cogl_texture_get_width (COGL_TEXTURE (cogl_tex));
 | 
			
		||||
      height = cogl_texture_get_height (COGL_TEXTURE (cogl_tex));
 | 
			
		||||
 | 
			
		||||
      if (width != priv->tex_width ||
 | 
			
		||||
          height != priv->tex_height)
 | 
			
		||||
        {
 | 
			
		||||
          priv->tex_width = width;
 | 
			
		||||
          priv->tex_height = height;
 | 
			
		||||
 | 
			
		||||
          clutter_actor_queue_relayout (CLUTTER_ACTOR (stex));
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    {
 | 
			
		||||
      /* size changed to 0 going to an invalid handle */
 | 
			
		||||
      priv->tex_width = 0;
 | 
			
		||||
      priv->tex_height = 0;
 | 
			
		||||
      clutter_actor_queue_relayout (CLUTTER_ACTOR (stex));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  /* NB: We don't queue a redraw of the actor here because we don't
 | 
			
		||||
   * know how much of the buffer has changed with respect to the
 | 
			
		||||
   * previous buffer. We only queue a redraw in response to surface
 | 
			
		||||
   * damage. */
 | 
			
		||||
 | 
			
		||||
  if (priv->create_mipmaps)
 | 
			
		||||
    meta_texture_tower_set_base_texture (priv->paint_tower, cogl_tex);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_shaped_texture_paint (ClutterActor *actor)
 | 
			
		||||
{
 | 
			
		||||
  MetaShapedTexture *stex = (MetaShapedTexture *) actor;
 | 
			
		||||
  MetaShapedTexturePrivate *priv = stex->priv;
 | 
			
		||||
  CoglTexture *paint_tex;
 | 
			
		||||
  guint tex_width, tex_height;
 | 
			
		||||
  guchar opacity;
 | 
			
		||||
  CoglContext *ctx;
 | 
			
		||||
  CoglFramebuffer *fb;
 | 
			
		||||
  CoglPipeline *pipeline = NULL;
 | 
			
		||||
  CoglTexture *paint_tex;
 | 
			
		||||
  ClutterActorBox alloc;
 | 
			
		||||
 | 
			
		||||
  static CoglPipeline *pipeline_template = NULL;
 | 
			
		||||
  static CoglPipeline *pipeline_unshaped_template = NULL;
 | 
			
		||||
 | 
			
		||||
  CoglPipeline *pipeline;
 | 
			
		||||
  cairo_region_t *blended_region = NULL;
 | 
			
		||||
  CoglPipelineFilter filter;
 | 
			
		||||
 | 
			
		||||
  if (priv->clip_region && cairo_region_is_empty (priv->clip_region))
 | 
			
		||||
    return;
 | 
			
		||||
@@ -177,105 +311,137 @@ meta_shaped_texture_paint (ClutterActor *actor)
 | 
			
		||||
  if (tex_width == 0 || tex_height == 0) /* no contents yet */
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  /* Use nearest-pixel interpolation if the texture is unscaled. This
 | 
			
		||||
   * improves performance, especially with software rendering.
 | 
			
		||||
   */
 | 
			
		||||
 | 
			
		||||
  filter = COGL_PIPELINE_FILTER_LINEAR;
 | 
			
		||||
 | 
			
		||||
  if (!clutter_actor_is_in_clone_paint (actor) && meta_actor_is_untransformed (actor, NULL, NULL))
 | 
			
		||||
    filter = COGL_PIPELINE_FILTER_NEAREST;
 | 
			
		||||
 | 
			
		||||
  ctx = clutter_backend_get_cogl_context (clutter_get_default_backend ());
 | 
			
		||||
  fb = cogl_get_draw_framebuffer ();
 | 
			
		||||
 | 
			
		||||
  opacity = clutter_actor_get_paint_opacity (actor);
 | 
			
		||||
  clutter_actor_get_allocation_box (actor, &alloc);
 | 
			
		||||
 | 
			
		||||
  if (priv->opaque_region != NULL && opacity == 255)
 | 
			
		||||
    {
 | 
			
		||||
      CoglPipeline *opaque_pipeline;
 | 
			
		||||
      cairo_region_t *region;
 | 
			
		||||
      int n_rects;
 | 
			
		||||
      int i;
 | 
			
		||||
 | 
			
		||||
      if (priv->clip_region != NULL)
 | 
			
		||||
        {
 | 
			
		||||
          region = cairo_region_copy (priv->clip_region);
 | 
			
		||||
          cairo_region_intersect (region, priv->opaque_region);
 | 
			
		||||
        }
 | 
			
		||||
      else
 | 
			
		||||
        {
 | 
			
		||||
          region = cairo_region_reference (priv->opaque_region);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      if (cairo_region_is_empty (region))
 | 
			
		||||
        goto paint_blended;
 | 
			
		||||
 | 
			
		||||
      opaque_pipeline = get_unblended_pipeline (ctx);
 | 
			
		||||
      cogl_pipeline_set_layer_texture (opaque_pipeline, 0, paint_tex);
 | 
			
		||||
      cogl_pipeline_set_layer_filters (opaque_pipeline, 0, filter, filter);
 | 
			
		||||
 | 
			
		||||
      n_rects = cairo_region_num_rectangles (region);
 | 
			
		||||
      for (i = 0; i < n_rects; i++)
 | 
			
		||||
        {
 | 
			
		||||
          cairo_rectangle_int_t rect;
 | 
			
		||||
          cairo_region_get_rectangle (region, i, &rect);
 | 
			
		||||
          paint_clipped_rectangle (fb, opaque_pipeline, &rect, &alloc);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      cogl_object_unref (opaque_pipeline);
 | 
			
		||||
 | 
			
		||||
      if (priv->clip_region != NULL)
 | 
			
		||||
        {
 | 
			
		||||
          blended_region = cairo_region_copy (priv->clip_region);
 | 
			
		||||
        }
 | 
			
		||||
      else
 | 
			
		||||
        {
 | 
			
		||||
          cairo_rectangle_int_t rect = { 0, 0, tex_width, tex_height };
 | 
			
		||||
          blended_region = cairo_region_create_rectangle (&rect);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      cairo_region_subtract (blended_region, priv->opaque_region);
 | 
			
		||||
 | 
			
		||||
    paint_blended:
 | 
			
		||||
      cairo_region_destroy (region);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  if (blended_region == NULL && priv->clip_region != NULL)
 | 
			
		||||
    blended_region = cairo_region_reference (priv->clip_region);
 | 
			
		||||
 | 
			
		||||
  if (blended_region != NULL && cairo_region_is_empty (blended_region))
 | 
			
		||||
    goto out;
 | 
			
		||||
 | 
			
		||||
  if (priv->mask_texture == NULL)
 | 
			
		||||
    {
 | 
			
		||||
      /* Use a single-layer texture if we don't have a mask. */
 | 
			
		||||
 | 
			
		||||
      if (priv->pipeline_unshaped == NULL)
 | 
			
		||||
        {
 | 
			
		||||
          if (G_UNLIKELY (pipeline_unshaped_template == NULL))
 | 
			
		||||
            {
 | 
			
		||||
              CoglContext *ctx = clutter_backend_get_cogl_context (clutter_get_default_backend ());
 | 
			
		||||
              pipeline_unshaped_template = cogl_pipeline_new (ctx);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
          priv->pipeline_unshaped = cogl_pipeline_copy (pipeline_unshaped_template);
 | 
			
		||||
        }
 | 
			
		||||
        pipeline = priv->pipeline_unshaped;
 | 
			
		||||
      pipeline = get_unmasked_pipeline (ctx);
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    {
 | 
			
		||||
      if (priv->pipeline == NULL)
 | 
			
		||||
	{
 | 
			
		||||
	   if (G_UNLIKELY (pipeline_template == NULL))
 | 
			
		||||
	    {
 | 
			
		||||
              CoglContext *ctx = clutter_backend_get_cogl_context (clutter_get_default_backend ());
 | 
			
		||||
	      pipeline_template =  cogl_pipeline_new (ctx);
 | 
			
		||||
	      cogl_pipeline_set_layer_combine (pipeline_template, 1,
 | 
			
		||||
					   "RGBA = MODULATE (PREVIOUS, TEXTURE[A])",
 | 
			
		||||
					   NULL);
 | 
			
		||||
	    }
 | 
			
		||||
	  priv->pipeline = cogl_pipeline_copy (pipeline_template);
 | 
			
		||||
	}
 | 
			
		||||
      pipeline = priv->pipeline;
 | 
			
		||||
 | 
			
		||||
      pipeline = get_masked_pipeline (ctx);
 | 
			
		||||
      cogl_pipeline_set_layer_texture (pipeline, 1, priv->mask_texture);
 | 
			
		||||
      cogl_pipeline_set_layer_filters (pipeline, 1, filter, filter);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  cogl_pipeline_set_layer_texture (pipeline, 0, paint_tex);
 | 
			
		||||
  cogl_pipeline_set_layer_filters (pipeline, 0, filter, filter);
 | 
			
		||||
 | 
			
		||||
  {
 | 
			
		||||
    CoglColor color;
 | 
			
		||||
    guchar opacity = clutter_actor_get_paint_opacity (actor);
 | 
			
		||||
    cogl_color_set_from_4ub (&color, opacity, opacity, opacity, opacity);
 | 
			
		||||
    cogl_color_init_from_4ub (&color, opacity, opacity, opacity, opacity);
 | 
			
		||||
    cogl_pipeline_set_color (pipeline, &color);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  cogl_set_source (pipeline);
 | 
			
		||||
 | 
			
		||||
  clutter_actor_get_allocation_box (actor, &alloc);
 | 
			
		||||
 | 
			
		||||
  if (priv->clip_region)
 | 
			
		||||
  if (blended_region != NULL)
 | 
			
		||||
    {
 | 
			
		||||
      int n_rects;
 | 
			
		||||
      int i;
 | 
			
		||||
      cairo_rectangle_int_t tex_rect = { 0, 0, tex_width, tex_height };
 | 
			
		||||
 | 
			
		||||
      /* Limit to how many separate rectangles we'll draw; beyond this just
 | 
			
		||||
       * fall back and draw the whole thing */
 | 
			
		||||
#     define MAX_RECTS 16
 | 
			
		||||
 | 
			
		||||
      n_rects = cairo_region_num_rectangles (priv->clip_region);
 | 
			
		||||
      n_rects = cairo_region_num_rectangles (blended_region);
 | 
			
		||||
      if (n_rects <= MAX_RECTS)
 | 
			
		||||
	{
 | 
			
		||||
	  float coords[8];
 | 
			
		||||
          float x1, y1, x2, y2;
 | 
			
		||||
          int i;
 | 
			
		||||
          cairo_rectangle_int_t tex_rect = { 0, 0, tex_width, tex_height };
 | 
			
		||||
 | 
			
		||||
	  for (i = 0; i < n_rects; i++)
 | 
			
		||||
	    {
 | 
			
		||||
	      cairo_rectangle_int_t rect;
 | 
			
		||||
 | 
			
		||||
	      cairo_region_get_rectangle (priv->clip_region, i, &rect);
 | 
			
		||||
	      cairo_region_get_rectangle (blended_region, i, &rect);
 | 
			
		||||
 | 
			
		||||
	      if (!gdk_rectangle_intersect (&tex_rect, &rect, &rect))
 | 
			
		||||
		continue;
 | 
			
		||||
 | 
			
		||||
	      x1 = rect.x;
 | 
			
		||||
	      y1 = rect.y;
 | 
			
		||||
	      x2 = rect.x + rect.width;
 | 
			
		||||
	      y2 = rect.y + rect.height;
 | 
			
		||||
 | 
			
		||||
	      coords[0] = rect.x / (alloc.x2 - alloc.x1);
 | 
			
		||||
	      coords[1] = rect.y / (alloc.y2 - alloc.y1);
 | 
			
		||||
	      coords[2] = (rect.x + rect.width) / (alloc.x2 - alloc.x1);
 | 
			
		||||
	      coords[3] = (rect.y + rect.height) / (alloc.y2 - alloc.y1);
 | 
			
		||||
 | 
			
		||||
              coords[4] = coords[0];
 | 
			
		||||
              coords[5] = coords[1];
 | 
			
		||||
              coords[6] = coords[2];
 | 
			
		||||
              coords[7] = coords[3];
 | 
			
		||||
 | 
			
		||||
              cogl_rectangle_with_multitexture_coords (x1, y1, x2, y2,
 | 
			
		||||
                                                       &coords[0], 8);
 | 
			
		||||
              paint_clipped_rectangle (fb, pipeline, &rect, &alloc);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
	  return;
 | 
			
		||||
          goto out;
 | 
			
		||||
	}
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  cogl_rectangle (0, 0,
 | 
			
		||||
		  alloc.x2 - alloc.x1,
 | 
			
		||||
		  alloc.y2 - alloc.y1);
 | 
			
		||||
  cogl_framebuffer_draw_rectangle (fb, pipeline,
 | 
			
		||||
                                   0, 0,
 | 
			
		||||
                                   alloc.x2 - alloc.x1,
 | 
			
		||||
                                   alloc.y2 - alloc.y1);
 | 
			
		||||
 | 
			
		||||
 out:
 | 
			
		||||
  if (pipeline != NULL)
 | 
			
		||||
    cogl_object_unref (pipeline);
 | 
			
		||||
  if (blended_region != NULL)
 | 
			
		||||
    cairo_region_destroy (blended_region);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
@@ -285,38 +451,61 @@ meta_shaped_texture_pick (ClutterActor       *actor,
 | 
			
		||||
  MetaShapedTexture *stex = (MetaShapedTexture *) actor;
 | 
			
		||||
  MetaShapedTexturePrivate *priv = stex->priv;
 | 
			
		||||
 | 
			
		||||
  if (!clutter_actor_should_pick_paint (actor) ||
 | 
			
		||||
      (priv->clip_region && cairo_region_is_empty (priv->clip_region)))
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  /* If there is no region then use the regular pick */
 | 
			
		||||
  if (priv->mask_texture == NULL)
 | 
			
		||||
    CLUTTER_ACTOR_CLASS (meta_shaped_texture_parent_class)
 | 
			
		||||
      ->pick (actor, color);
 | 
			
		||||
  else if (clutter_actor_should_pick_paint (actor))
 | 
			
		||||
  if (priv->input_shape_region == NULL)
 | 
			
		||||
    CLUTTER_ACTOR_CLASS (meta_shaped_texture_parent_class)->pick (actor, color);
 | 
			
		||||
  else
 | 
			
		||||
    {
 | 
			
		||||
      CoglTexture *paint_tex;
 | 
			
		||||
      ClutterActorBox alloc;
 | 
			
		||||
      guint tex_width, tex_height;
 | 
			
		||||
      int n_rects;
 | 
			
		||||
      float *rectangles;
 | 
			
		||||
      int i;
 | 
			
		||||
      CoglPipeline *pipeline;
 | 
			
		||||
      CoglContext *ctx;
 | 
			
		||||
      CoglFramebuffer *fb;
 | 
			
		||||
      CoglColor cogl_color;
 | 
			
		||||
 | 
			
		||||
      paint_tex = COGL_TEXTURE (priv->texture);
 | 
			
		||||
      /* Note: We don't bother trying to intersect the pick and clip regions
 | 
			
		||||
       * since needing to copy the region, do the intersection, and probably
 | 
			
		||||
       * increase the number of rectangles seems more likely to have a negative
 | 
			
		||||
       * effect.
 | 
			
		||||
       *
 | 
			
		||||
       * NB: Most of the time when just using rectangles for picking then
 | 
			
		||||
       * picking shouldn't involve any rendering, and minimizing the number of
 | 
			
		||||
       * rectangles has more benefit than reducing the area of the pick
 | 
			
		||||
       * region.
 | 
			
		||||
       */
 | 
			
		||||
 | 
			
		||||
      if (paint_tex == NULL)
 | 
			
		||||
        return;
 | 
			
		||||
      n_rects = cairo_region_num_rectangles (priv->input_shape_region);
 | 
			
		||||
      rectangles = g_alloca (sizeof (float) * 4 * n_rects);
 | 
			
		||||
 | 
			
		||||
      tex_width = cogl_texture_get_width (paint_tex);
 | 
			
		||||
      tex_height = cogl_texture_get_height (paint_tex);
 | 
			
		||||
      for (i = 0; i < n_rects; i++)
 | 
			
		||||
        {
 | 
			
		||||
          cairo_rectangle_int_t rect;
 | 
			
		||||
          int pos = i * 4;
 | 
			
		||||
 | 
			
		||||
      if (tex_width == 0 || tex_height == 0) /* no contents yet */
 | 
			
		||||
        return;
 | 
			
		||||
          cairo_region_get_rectangle (priv->input_shape_region, i, &rect);
 | 
			
		||||
 | 
			
		||||
      cogl_set_source_color4ub (color->red, color->green, color->blue,
 | 
			
		||||
                                 color->alpha);
 | 
			
		||||
          rectangles[pos] = rect.x;
 | 
			
		||||
          rectangles[pos + 1] = rect.y;
 | 
			
		||||
          rectangles[pos + 2] = rect.x + rect.width;
 | 
			
		||||
          rectangles[pos + 3] = rect.y + rect.height;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      clutter_actor_get_allocation_box (actor, &alloc);
 | 
			
		||||
      ctx = clutter_backend_get_cogl_context (clutter_get_default_backend ());
 | 
			
		||||
      fb = cogl_get_draw_framebuffer ();
 | 
			
		||||
 | 
			
		||||
      /* Paint the mask rectangle in the given color */
 | 
			
		||||
      cogl_set_source_texture (priv->mask_texture);
 | 
			
		||||
      cogl_rectangle_with_texture_coords (0, 0,
 | 
			
		||||
                                          alloc.x2 - alloc.x1,
 | 
			
		||||
                                          alloc.y2 - alloc.y1,
 | 
			
		||||
                                          0, 0, 1, 1);
 | 
			
		||||
      cogl_color_init_from_4ub (&cogl_color, color->red, color->green, color->blue, color->alpha);
 | 
			
		||||
 | 
			
		||||
      pipeline = cogl_pipeline_new (ctx);
 | 
			
		||||
      cogl_pipeline_set_color (pipeline, &cogl_color);
 | 
			
		||||
 | 
			
		||||
      cogl_framebuffer_draw_rectangles (fb, pipeline,
 | 
			
		||||
                                        rectangles, n_rects);
 | 
			
		||||
      cogl_object_unref (pipeline);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -365,14 +554,6 @@ meta_shaped_texture_get_paint_volume (ClutterActor *self,
 | 
			
		||||
  return clutter_paint_volume_set_from_allocation (volume, self);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ClutterActor *
 | 
			
		||||
meta_shaped_texture_new (void)
 | 
			
		||||
{
 | 
			
		||||
  ClutterActor *self = g_object_new (META_TYPE_SHAPED_TEXTURE, NULL);
 | 
			
		||||
 | 
			
		||||
  return self;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_shaped_texture_set_create_mipmaps (MetaShapedTexture *stex,
 | 
			
		||||
					gboolean           create_mipmaps)
 | 
			
		||||
@@ -389,8 +570,7 @@ meta_shaped_texture_set_create_mipmaps (MetaShapedTexture *stex,
 | 
			
		||||
    {
 | 
			
		||||
      CoglTexture *base_texture;
 | 
			
		||||
      priv->create_mipmaps = create_mipmaps;
 | 
			
		||||
      base_texture = create_mipmaps ?
 | 
			
		||||
        COGL_TEXTURE (priv->texture) : NULL;
 | 
			
		||||
      base_texture = create_mipmaps ? priv->texture : NULL;
 | 
			
		||||
      meta_texture_tower_set_base_texture (priv->paint_tower, base_texture);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -416,108 +596,137 @@ meta_shaped_texture_set_mask_texture (MetaShapedTexture *stex,
 | 
			
		||||
  clutter_actor_queue_redraw (CLUTTER_ACTOR (stex));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
static gboolean
 | 
			
		||||
get_clip (MetaShapedTexture *stex,
 | 
			
		||||
          int x,
 | 
			
		||||
          int y,
 | 
			
		||||
          int width,
 | 
			
		||||
          int height,
 | 
			
		||||
          cairo_rectangle_int_t *clip)
 | 
			
		||||
{
 | 
			
		||||
  ClutterActor *self = CLUTTER_ACTOR (stex);
 | 
			
		||||
  MetaShapedTexturePrivate *priv;
 | 
			
		||||
  ClutterActorBox allocation;
 | 
			
		||||
  float scale_x;
 | 
			
		||||
  float scale_y;
 | 
			
		||||
 | 
			
		||||
  /* NB: clutter_actor_queue_redraw_with_clip expects a box in the actor's
 | 
			
		||||
   * coordinate space so we need to convert from surface coordinates to
 | 
			
		||||
   * actor coordinates...
 | 
			
		||||
   */
 | 
			
		||||
 | 
			
		||||
  /* Calling clutter_actor_get_allocation_box() is enormously expensive
 | 
			
		||||
   * if the actor has an out-of-date allocation, since it triggers
 | 
			
		||||
   * a full redraw. clutter_actor_queue_redraw_with_clip() would redraw
 | 
			
		||||
   * the whole stage anyways in that case, so just go ahead and do
 | 
			
		||||
   * it here.
 | 
			
		||||
   */
 | 
			
		||||
  if (!clutter_actor_has_allocation (self))
 | 
			
		||||
    return FALSE;
 | 
			
		||||
 | 
			
		||||
  priv = stex->priv;
 | 
			
		||||
 | 
			
		||||
  if (priv->tex_width == 0 || priv->tex_height == 0)
 | 
			
		||||
    return FALSE;
 | 
			
		||||
 | 
			
		||||
  clutter_actor_get_allocation_box (self, &allocation);
 | 
			
		||||
 | 
			
		||||
  scale_x = (allocation.x2 - allocation.x1) / priv->tex_width;
 | 
			
		||||
  scale_y = (allocation.y2 - allocation.y1) / priv->tex_height;
 | 
			
		||||
 | 
			
		||||
  clip->x = x * scale_x;
 | 
			
		||||
  clip->y = y * scale_y;
 | 
			
		||||
  clip->width = width * scale_x;
 | 
			
		||||
  clip->height = height * scale_y;
 | 
			
		||||
 | 
			
		||||
  return TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * meta_shaped_texture_update_area:
 | 
			
		||||
 * @stex: #MetaShapedTexture
 | 
			
		||||
 * @x: the x coordinate of the damaged area
 | 
			
		||||
 * @y: the y coordinate of the damaged area
 | 
			
		||||
 * @width: the width of the damaged area
 | 
			
		||||
 * @height: the height of the damaged area
 | 
			
		||||
 * @unobscured_region: The unobscured region of the window or %NULL if
 | 
			
		||||
 * there is no valid one (like when the actor is transformed or
 | 
			
		||||
 * has a mapped clone)
 | 
			
		||||
 *
 | 
			
		||||
 * Repairs the damaged area indicated by @x, @y, @width and @height
 | 
			
		||||
 * and queues a redraw for the intersection @unobscured_region and
 | 
			
		||||
 * the damage area. If @unobscured_region is %NULL a redraw will always
 | 
			
		||||
 * get queued.
 | 
			
		||||
 *
 | 
			
		||||
 * Return value: Whether a redraw have been queued or not
 | 
			
		||||
 */
 | 
			
		||||
gboolean
 | 
			
		||||
meta_shaped_texture_update_area (MetaShapedTexture *stex,
 | 
			
		||||
				 int                x,
 | 
			
		||||
				 int                y,
 | 
			
		||||
				 int                width,
 | 
			
		||||
				 int                height)
 | 
			
		||||
				 int                height,
 | 
			
		||||
				 cairo_region_t    *unobscured_region)
 | 
			
		||||
{
 | 
			
		||||
  MetaShapedTexturePrivate *priv;
 | 
			
		||||
  const cairo_rectangle_int_t clip = { x, y, width, height };
 | 
			
		||||
  cairo_rectangle_int_t clip;
 | 
			
		||||
  gboolean has_clip;
 | 
			
		||||
 | 
			
		||||
  priv = stex->priv;
 | 
			
		||||
 | 
			
		||||
  if (priv->texture == NULL)
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  cogl_texture_pixmap_x11_update_area (priv->texture,
 | 
			
		||||
                                       x, y, width, height);
 | 
			
		||||
    return FALSE;
 | 
			
		||||
 | 
			
		||||
  meta_texture_tower_update_area (priv->paint_tower, x, y, width, height);
 | 
			
		||||
 | 
			
		||||
  clutter_actor_queue_redraw_with_clip (CLUTTER_ACTOR (stex), &clip);
 | 
			
		||||
}
 | 
			
		||||
  has_clip = get_clip (stex, x, y, width, height, &clip);
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
set_cogl_texture (MetaShapedTexture    *stex,
 | 
			
		||||
                  CoglTexturePixmapX11 *cogl_tex)
 | 
			
		||||
{
 | 
			
		||||
  MetaShapedTexturePrivate *priv;
 | 
			
		||||
  guint width, height;
 | 
			
		||||
 | 
			
		||||
  g_return_if_fail (META_IS_SHAPED_TEXTURE (stex));
 | 
			
		||||
 | 
			
		||||
  priv = stex->priv;
 | 
			
		||||
 | 
			
		||||
  if (priv->texture != NULL)
 | 
			
		||||
    cogl_object_unref (priv->texture);
 | 
			
		||||
 | 
			
		||||
  priv->texture = cogl_tex;
 | 
			
		||||
 | 
			
		||||
  if (priv->pipeline != NULL)
 | 
			
		||||
    cogl_pipeline_set_layer_texture (priv->pipeline, 0, COGL_TEXTURE (cogl_tex));
 | 
			
		||||
 | 
			
		||||
  if (priv->pipeline_unshaped != NULL)
 | 
			
		||||
    cogl_pipeline_set_layer_texture (priv->pipeline_unshaped, 0, COGL_TEXTURE (cogl_tex));
 | 
			
		||||
 | 
			
		||||
  if (cogl_tex != NULL)
 | 
			
		||||
  if (unobscured_region)
 | 
			
		||||
    {
 | 
			
		||||
      width = cogl_texture_get_width (COGL_TEXTURE (cogl_tex));
 | 
			
		||||
      height = cogl_texture_get_height (COGL_TEXTURE (cogl_tex));
 | 
			
		||||
      cairo_region_t *intersection;
 | 
			
		||||
 | 
			
		||||
      if (width != priv->tex_width ||
 | 
			
		||||
          height != priv->tex_height)
 | 
			
		||||
      if (cairo_region_is_empty (unobscured_region))
 | 
			
		||||
        return FALSE;
 | 
			
		||||
 | 
			
		||||
      intersection = cairo_region_copy (unobscured_region);
 | 
			
		||||
      if (has_clip)
 | 
			
		||||
	cairo_region_intersect_rectangle (intersection, &clip);
 | 
			
		||||
 | 
			
		||||
      if (!cairo_region_is_empty (intersection))
 | 
			
		||||
        {
 | 
			
		||||
          priv->tex_width = width;
 | 
			
		||||
          priv->tex_height = height;
 | 
			
		||||
          cairo_rectangle_int_t damage_rect;
 | 
			
		||||
          cairo_region_get_extents (intersection, &damage_rect);
 | 
			
		||||
          clutter_actor_queue_redraw_with_clip (CLUTTER_ACTOR (stex), &damage_rect);
 | 
			
		||||
          cairo_region_destroy (intersection);
 | 
			
		||||
 | 
			
		||||
          clutter_actor_queue_relayout (CLUTTER_ACTOR (stex));
 | 
			
		||||
          return TRUE;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    {
 | 
			
		||||
      /* size changed to 0 going to an inavlid texture */
 | 
			
		||||
      priv->tex_width = 0;
 | 
			
		||||
      priv->tex_height = 0;
 | 
			
		||||
      clutter_actor_queue_relayout (CLUTTER_ACTOR (stex));
 | 
			
		||||
 | 
			
		||||
      cairo_region_destroy (intersection);
 | 
			
		||||
 | 
			
		||||
      return FALSE;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  clutter_actor_queue_redraw (CLUTTER_ACTOR (stex));
 | 
			
		||||
  if (has_clip)
 | 
			
		||||
    clutter_actor_queue_redraw_with_clip (CLUTTER_ACTOR (stex), &clip);
 | 
			
		||||
  else
 | 
			
		||||
    clutter_actor_queue_redraw (CLUTTER_ACTOR (stex));
 | 
			
		||||
 | 
			
		||||
  return TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * meta_shaped_texture_set_pixmap:
 | 
			
		||||
 * meta_shaped_texture_set_texture:
 | 
			
		||||
 * @stex: The #MetaShapedTexture
 | 
			
		||||
 * @pixmap: The pixmap you want the stex to assume
 | 
			
		||||
 * @pixmap: The #CoglTexture to display
 | 
			
		||||
 */
 | 
			
		||||
void
 | 
			
		||||
meta_shaped_texture_set_pixmap (MetaShapedTexture *stex,
 | 
			
		||||
                                Pixmap             pixmap)
 | 
			
		||||
meta_shaped_texture_set_texture (MetaShapedTexture *stex,
 | 
			
		||||
                                 CoglTexture       *texture)
 | 
			
		||||
{
 | 
			
		||||
  MetaShapedTexturePrivate *priv;
 | 
			
		||||
 | 
			
		||||
  g_return_if_fail (META_IS_SHAPED_TEXTURE (stex));
 | 
			
		||||
 | 
			
		||||
  priv = stex->priv;
 | 
			
		||||
 | 
			
		||||
  if (priv->pixmap == pixmap)
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  priv->pixmap = pixmap;
 | 
			
		||||
 | 
			
		||||
  if (pixmap != None)
 | 
			
		||||
    {
 | 
			
		||||
      CoglContext *ctx =
 | 
			
		||||
        clutter_backend_get_cogl_context (clutter_get_default_backend ());
 | 
			
		||||
      set_cogl_texture (stex, cogl_texture_pixmap_x11_new (ctx, pixmap, FALSE, NULL));
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    set_cogl_texture (stex, NULL);
 | 
			
		||||
 | 
			
		||||
  if (priv->create_mipmaps)
 | 
			
		||||
    meta_texture_tower_set_base_texture (priv->paint_tower,
 | 
			
		||||
                                         COGL_TEXTURE (priv->texture));
 | 
			
		||||
  set_cogl_texture (stex, texture);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
@@ -534,22 +743,18 @@ meta_shaped_texture_get_texture (MetaShapedTexture *stex)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * meta_shaped_texture_set_clip_region:
 | 
			
		||||
 * meta_shaped_texture_set_input_shape_region:
 | 
			
		||||
 * @stex: a #MetaShapedTexture
 | 
			
		||||
 * @clip_region: (transfer full): the region of the texture that
 | 
			
		||||
 *   is visible and should be painted.
 | 
			
		||||
 * @shape_region: the region of the texture that should respond to
 | 
			
		||||
 *    input.
 | 
			
		||||
 *
 | 
			
		||||
 * Provides a hint to the texture about what areas of the texture
 | 
			
		||||
 * are not completely obscured and thus need to be painted. This
 | 
			
		||||
 * is an optimization and is not supposed to have any effect on
 | 
			
		||||
 * the output.
 | 
			
		||||
 *
 | 
			
		||||
 * Typically a parent container will set the clip region before
 | 
			
		||||
 * painting its children, and then unset it afterwards.
 | 
			
		||||
 * Determines what region of the texture should accept input. For
 | 
			
		||||
 * X based windows this is defined by the ShapeInput region of the
 | 
			
		||||
 * window.
 | 
			
		||||
 */
 | 
			
		||||
void
 | 
			
		||||
meta_shaped_texture_set_clip_region (MetaShapedTexture *stex,
 | 
			
		||||
				     cairo_region_t    *clip_region)
 | 
			
		||||
meta_shaped_texture_set_input_shape_region (MetaShapedTexture *stex,
 | 
			
		||||
                                            cairo_region_t    *shape_region)
 | 
			
		||||
{
 | 
			
		||||
  MetaShapedTexturePrivate *priv;
 | 
			
		||||
 | 
			
		||||
@@ -557,16 +762,49 @@ meta_shaped_texture_set_clip_region (MetaShapedTexture *stex,
 | 
			
		||||
 | 
			
		||||
  priv = stex->priv;
 | 
			
		||||
 | 
			
		||||
  if (priv->clip_region)
 | 
			
		||||
  if (priv->input_shape_region != NULL)
 | 
			
		||||
    {
 | 
			
		||||
      cairo_region_destroy (priv->clip_region);
 | 
			
		||||
      priv->clip_region = NULL;
 | 
			
		||||
      cairo_region_destroy (priv->input_shape_region);
 | 
			
		||||
      priv->input_shape_region = NULL;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  if (clip_region)
 | 
			
		||||
    priv->clip_region = cairo_region_copy (clip_region);
 | 
			
		||||
  if (shape_region != NULL)
 | 
			
		||||
    {
 | 
			
		||||
      cairo_region_reference (shape_region);
 | 
			
		||||
      priv->input_shape_region = shape_region;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  clutter_actor_queue_redraw (CLUTTER_ACTOR (stex));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * meta_shaped_texture_set_opaque_region:
 | 
			
		||||
 * @stex: a #MetaShapedTexture
 | 
			
		||||
 * @opaque_region: (transfer full): the region of the texture that
 | 
			
		||||
 *   can have blending turned off.
 | 
			
		||||
 *
 | 
			
		||||
 * As most windows have a large portion that does not require blending,
 | 
			
		||||
 * we can easily turn off blending if we know the areas that do not
 | 
			
		||||
 * require blending. This sets the region where we will not blend for
 | 
			
		||||
 * optimization purposes.
 | 
			
		||||
 */
 | 
			
		||||
void
 | 
			
		||||
meta_shaped_texture_set_opaque_region (MetaShapedTexture *stex,
 | 
			
		||||
                                       cairo_region_t    *opaque_region)
 | 
			
		||||
{
 | 
			
		||||
  MetaShapedTexturePrivate *priv;
 | 
			
		||||
 | 
			
		||||
  g_return_if_fail (META_IS_SHAPED_TEXTURE (stex));
 | 
			
		||||
 | 
			
		||||
  priv = stex->priv;
 | 
			
		||||
 | 
			
		||||
  if (priv->opaque_region)
 | 
			
		||||
    cairo_region_destroy (priv->opaque_region);
 | 
			
		||||
 | 
			
		||||
  if (opaque_region)
 | 
			
		||||
    priv->opaque_region = cairo_region_reference (opaque_region);
 | 
			
		||||
  else
 | 
			
		||||
    priv->clip_region = NULL;
 | 
			
		||||
    priv->opaque_region = NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
@@ -666,3 +904,43 @@ meta_shaped_texture_get_image (MetaShapedTexture     *stex,
 | 
			
		||||
 | 
			
		||||
  return surface;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_shaped_texture_cull_out (MetaCullable   *cullable,
 | 
			
		||||
                              cairo_region_t *unobscured_region,
 | 
			
		||||
                              cairo_region_t *clip_region)
 | 
			
		||||
{
 | 
			
		||||
  MetaShapedTexture *self = META_SHAPED_TEXTURE (cullable);
 | 
			
		||||
  MetaShapedTexturePrivate *priv = self->priv;
 | 
			
		||||
 | 
			
		||||
  set_clip_region (self, clip_region);
 | 
			
		||||
 | 
			
		||||
  if (clutter_actor_get_paint_opacity (CLUTTER_ACTOR (self)) == 0xff)
 | 
			
		||||
    {
 | 
			
		||||
      if (priv->opaque_region)
 | 
			
		||||
        {
 | 
			
		||||
          cairo_region_subtract (unobscured_region, priv->opaque_region);
 | 
			
		||||
          cairo_region_subtract (clip_region, priv->opaque_region);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_shaped_texture_reset_culling (MetaCullable *cullable)
 | 
			
		||||
{
 | 
			
		||||
  MetaShapedTexture *self = META_SHAPED_TEXTURE (cullable);
 | 
			
		||||
  set_clip_region (self, NULL);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
cullable_iface_init (MetaCullableInterface *iface)
 | 
			
		||||
{
 | 
			
		||||
  iface->cull_out = meta_shaped_texture_cull_out;
 | 
			
		||||
  iface->reset_culling = meta_shaped_texture_reset_culling;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ClutterActor *
 | 
			
		||||
meta_shaped_texture_new (void)
 | 
			
		||||
{
 | 
			
		||||
  return g_object_new (META_TYPE_SHAPED_TEXTURE, NULL);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										183
									
								
								src/compositor/meta-surface-actor.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										183
									
								
								src/compositor/meta-surface-actor.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,183 @@
 | 
			
		||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * SECTION:meta-surface-actor
 | 
			
		||||
 * @title: MetaSurfaceActor
 | 
			
		||||
 * @short_description: An actor representing a surface in the scene graph
 | 
			
		||||
 *
 | 
			
		||||
 * A surface can be either a shaped texture, or a group of shaped texture,
 | 
			
		||||
 * used to draw the content of a window.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <config.h>
 | 
			
		||||
#include <clutter/clutter.h>
 | 
			
		||||
#include <cogl/cogl-wayland-server.h>
 | 
			
		||||
#include <cogl/cogl-texture-pixmap-x11.h>
 | 
			
		||||
#include <meta/meta-shaped-texture.h>
 | 
			
		||||
#include "meta-surface-actor.h"
 | 
			
		||||
#include "meta-wayland-private.h"
 | 
			
		||||
#include "meta-cullable.h"
 | 
			
		||||
 | 
			
		||||
#include "meta-shaped-texture-private.h"
 | 
			
		||||
 | 
			
		||||
struct _MetaSurfaceActorPrivate
 | 
			
		||||
{
 | 
			
		||||
  MetaShapedTexture *texture;
 | 
			
		||||
  MetaWaylandBuffer *buffer;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static void cullable_iface_init (MetaCullableInterface *iface);
 | 
			
		||||
 | 
			
		||||
G_DEFINE_TYPE_WITH_CODE (MetaSurfaceActor, meta_surface_actor, CLUTTER_TYPE_ACTOR,
 | 
			
		||||
                         G_IMPLEMENT_INTERFACE (META_TYPE_CULLABLE, cullable_iface_init));
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_surface_actor_class_init (MetaSurfaceActorClass *klass)
 | 
			
		||||
{
 | 
			
		||||
  g_type_class_add_private (klass, sizeof (MetaSurfaceActorPrivate));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_surface_actor_cull_out (MetaCullable   *cullable,
 | 
			
		||||
                             cairo_region_t *unobscured_region,
 | 
			
		||||
                             cairo_region_t *clip_region)
 | 
			
		||||
{
 | 
			
		||||
  meta_cullable_cull_out_children (cullable, unobscured_region, clip_region);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_surface_actor_reset_culling (MetaCullable *cullable)
 | 
			
		||||
{
 | 
			
		||||
  meta_cullable_reset_culling_children (cullable);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
cullable_iface_init (MetaCullableInterface *iface)
 | 
			
		||||
{
 | 
			
		||||
  iface->cull_out = meta_surface_actor_cull_out;
 | 
			
		||||
  iface->reset_culling = meta_surface_actor_reset_culling;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_surface_actor_init (MetaSurfaceActor *self)
 | 
			
		||||
{
 | 
			
		||||
  MetaSurfaceActorPrivate *priv;
 | 
			
		||||
 | 
			
		||||
  priv = self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
 | 
			
		||||
                                                   META_TYPE_SURFACE_ACTOR,
 | 
			
		||||
                                                   MetaSurfaceActorPrivate);
 | 
			
		||||
 | 
			
		||||
  priv->texture = META_SHAPED_TEXTURE (meta_shaped_texture_new ());
 | 
			
		||||
  clutter_actor_add_child (CLUTTER_ACTOR (self), CLUTTER_ACTOR (priv->texture));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
cairo_surface_t *
 | 
			
		||||
meta_surface_actor_get_image (MetaSurfaceActor      *self,
 | 
			
		||||
                              cairo_rectangle_int_t *clip)
 | 
			
		||||
{
 | 
			
		||||
  return meta_shaped_texture_get_image (self->priv->texture, clip);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
MetaShapedTexture *
 | 
			
		||||
meta_surface_actor_get_texture (MetaSurfaceActor *self)
 | 
			
		||||
{
 | 
			
		||||
  return self->priv->texture;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
update_area (MetaSurfaceActor *self,
 | 
			
		||||
             int x, int y, int width, int height)
 | 
			
		||||
{
 | 
			
		||||
  MetaSurfaceActorPrivate *priv = self->priv;
 | 
			
		||||
 | 
			
		||||
  if (meta_is_wayland_compositor ())
 | 
			
		||||
    {
 | 
			
		||||
      struct wl_resource *resource = priv->buffer->resource;
 | 
			
		||||
      struct wl_shm_buffer *shm_buffer = wl_shm_buffer_get (resource);
 | 
			
		||||
 | 
			
		||||
      if (shm_buffer)
 | 
			
		||||
        {
 | 
			
		||||
          CoglTexture2D *texture = COGL_TEXTURE_2D (priv->buffer->texture);
 | 
			
		||||
          cogl_wayland_texture_set_region_from_shm_buffer (texture, x, y, width, height, shm_buffer, x, y, 0, NULL);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    {
 | 
			
		||||
      CoglTexturePixmapX11 *texture = COGL_TEXTURE_PIXMAP_X11 (meta_shaped_texture_get_texture (priv->texture));
 | 
			
		||||
      cogl_texture_pixmap_x11_update_area (texture, x, y, width, height);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
gboolean
 | 
			
		||||
meta_surface_actor_damage_all (MetaSurfaceActor *self,
 | 
			
		||||
                               cairo_region_t   *unobscured_region)
 | 
			
		||||
{
 | 
			
		||||
  MetaSurfaceActorPrivate *priv = self->priv;
 | 
			
		||||
  CoglTexture *texture = meta_shaped_texture_get_texture (priv->texture);
 | 
			
		||||
 | 
			
		||||
  update_area (self, 0, 0, cogl_texture_get_width (texture), cogl_texture_get_height (texture));
 | 
			
		||||
  return meta_shaped_texture_update_area (priv->texture,
 | 
			
		||||
                                          0, 0,
 | 
			
		||||
                                          cogl_texture_get_width (texture),
 | 
			
		||||
                                          cogl_texture_get_height (texture),
 | 
			
		||||
                                          unobscured_region);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
gboolean
 | 
			
		||||
meta_surface_actor_damage_area (MetaSurfaceActor *self,
 | 
			
		||||
                                int               x,
 | 
			
		||||
                                int               y,
 | 
			
		||||
                                int               width,
 | 
			
		||||
                                int               height,
 | 
			
		||||
                                cairo_region_t   *unobscured_region)
 | 
			
		||||
{
 | 
			
		||||
  MetaSurfaceActorPrivate *priv = self->priv;
 | 
			
		||||
 | 
			
		||||
  update_area (self, x, y, width, height);
 | 
			
		||||
  return meta_shaped_texture_update_area (priv->texture,
 | 
			
		||||
                                          x, y, width, height,
 | 
			
		||||
                                          unobscured_region);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_surface_actor_attach_wayland_buffer (MetaSurfaceActor *self,
 | 
			
		||||
                                          MetaWaylandBuffer *buffer)
 | 
			
		||||
{
 | 
			
		||||
  MetaSurfaceActorPrivate *priv = self->priv;
 | 
			
		||||
  priv->buffer = buffer;
 | 
			
		||||
 | 
			
		||||
  if (buffer)
 | 
			
		||||
    meta_shaped_texture_set_texture (priv->texture, buffer->texture);
 | 
			
		||||
  else
 | 
			
		||||
    meta_shaped_texture_set_texture (priv->texture, NULL);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_surface_actor_set_texture (MetaSurfaceActor *self,
 | 
			
		||||
                                CoglTexture      *texture)
 | 
			
		||||
{
 | 
			
		||||
  MetaSurfaceActorPrivate *priv = self->priv;
 | 
			
		||||
  meta_shaped_texture_set_texture (priv->texture, texture);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_surface_actor_set_input_region (MetaSurfaceActor *self,
 | 
			
		||||
                                     cairo_region_t   *region)
 | 
			
		||||
{
 | 
			
		||||
  MetaSurfaceActorPrivate *priv = self->priv;
 | 
			
		||||
  meta_shaped_texture_set_input_shape_region (priv->texture, region);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_surface_actor_set_opaque_region (MetaSurfaceActor *self,
 | 
			
		||||
                                      cairo_region_t   *region)
 | 
			
		||||
{
 | 
			
		||||
  MetaSurfaceActorPrivate *priv = self->priv;
 | 
			
		||||
  meta_shaped_texture_set_opaque_region (priv->texture, region);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
MetaSurfaceActor *
 | 
			
		||||
meta_surface_actor_new (void)
 | 
			
		||||
{
 | 
			
		||||
  return g_object_new (META_TYPE_SURFACE_ACTOR, NULL);
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										67
									
								
								src/compositor/meta-surface-actor.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										67
									
								
								src/compositor/meta-surface-actor.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,67 @@
 | 
			
		||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
 | 
			
		||||
 | 
			
		||||
#ifndef META_SURFACE_ACTOR_PRIVATE_H
 | 
			
		||||
#define META_SURFACE_ACTOR_PRIVATE_H
 | 
			
		||||
 | 
			
		||||
#include <config.h>
 | 
			
		||||
 | 
			
		||||
#include <meta/meta-shaped-texture.h>
 | 
			
		||||
#include "meta-wayland-types.h"
 | 
			
		||||
 | 
			
		||||
G_BEGIN_DECLS
 | 
			
		||||
 | 
			
		||||
#define META_TYPE_SURFACE_ACTOR            (meta_surface_actor_get_type())
 | 
			
		||||
#define META_SURFACE_ACTOR(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_SURFACE_ACTOR, MetaSurfaceActor))
 | 
			
		||||
#define META_SURFACE_ACTOR_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_SURFACE_ACTOR, MetaSurfaceActorClass))
 | 
			
		||||
#define META_IS_SURFACE_ACTOR(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_SURFACE_ACTOR))
 | 
			
		||||
#define META_IS_SURFACE_ACTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_SURFACE_ACTOR))
 | 
			
		||||
#define META_SURFACE_ACTOR_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_SURFACE_ACTOR, MetaSurfaceActorClass))
 | 
			
		||||
 | 
			
		||||
typedef struct _MetaSurfaceActor        MetaSurfaceActor;
 | 
			
		||||
typedef struct _MetaSurfaceActorClass   MetaSurfaceActorClass;
 | 
			
		||||
typedef struct _MetaSurfaceActorPrivate MetaSurfaceActorPrivate;
 | 
			
		||||
 | 
			
		||||
struct _MetaSurfaceActorClass
 | 
			
		||||
{
 | 
			
		||||
  /*< private >*/
 | 
			
		||||
  ClutterActorClass parent_class;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct _MetaSurfaceActor
 | 
			
		||||
{
 | 
			
		||||
  ClutterActor            parent;
 | 
			
		||||
 | 
			
		||||
  MetaSurfaceActorPrivate *priv;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
GType meta_surface_actor_get_type (void);
 | 
			
		||||
 | 
			
		||||
MetaSurfaceActor *meta_surface_actor_new (void);
 | 
			
		||||
 | 
			
		||||
cairo_surface_t *meta_surface_actor_get_image (MetaSurfaceActor      *self,
 | 
			
		||||
                                               cairo_rectangle_int_t *clip);
 | 
			
		||||
 | 
			
		||||
MetaShapedTexture *meta_surface_actor_get_texture (MetaSurfaceActor *self);
 | 
			
		||||
 | 
			
		||||
gboolean meta_surface_actor_damage_all (MetaSurfaceActor *self,
 | 
			
		||||
                                        cairo_region_t   *unobscured_region);
 | 
			
		||||
 | 
			
		||||
gboolean meta_surface_actor_damage_area (MetaSurfaceActor *self,
 | 
			
		||||
                                         int               x,
 | 
			
		||||
                                         int               y,
 | 
			
		||||
                                         int               width,
 | 
			
		||||
                                         int               height,
 | 
			
		||||
                                         cairo_region_t   *unobscured_region);
 | 
			
		||||
 | 
			
		||||
void meta_surface_actor_set_texture (MetaSurfaceActor *self,
 | 
			
		||||
                                     CoglTexture      *texture);
 | 
			
		||||
void meta_surface_actor_attach_wayland_buffer (MetaSurfaceActor  *self,
 | 
			
		||||
                                               MetaWaylandBuffer *buffer);
 | 
			
		||||
void meta_surface_actor_set_input_region (MetaSurfaceActor *self,
 | 
			
		||||
                                          cairo_region_t   *region);
 | 
			
		||||
void meta_surface_actor_set_opaque_region (MetaSurfaceActor *self,
 | 
			
		||||
                                           cairo_region_t   *region);
 | 
			
		||||
 | 
			
		||||
G_END_DECLS
 | 
			
		||||
 | 
			
		||||
#endif /* META_SURFACE_ACTOR_PRIVATE_H */
 | 
			
		||||
@@ -5,8 +5,12 @@
 | 
			
		||||
 | 
			
		||||
#include <config.h>
 | 
			
		||||
 | 
			
		||||
#include <wayland-server.h>
 | 
			
		||||
#include <meta-wayland-private.h>
 | 
			
		||||
 | 
			
		||||
#include <X11/extensions/Xdamage.h>
 | 
			
		||||
#include <meta/compositor-mutter.h>
 | 
			
		||||
#include "meta-surface-actor.h"
 | 
			
		||||
 | 
			
		||||
MetaWindowActor *meta_window_actor_new (MetaWindow *window);
 | 
			
		||||
 | 
			
		||||
@@ -24,8 +28,8 @@ void meta_window_actor_unmaximize (MetaWindowActor *self,
 | 
			
		||||
                                   MetaRectangle   *old_rect,
 | 
			
		||||
                                   MetaRectangle   *new_rect);
 | 
			
		||||
 | 
			
		||||
void meta_window_actor_process_damage (MetaWindowActor    *self,
 | 
			
		||||
                                       XDamageNotifyEvent *event);
 | 
			
		||||
void meta_window_actor_process_x11_damage (MetaWindowActor    *self,
 | 
			
		||||
                                           XDamageNotifyEvent *event);
 | 
			
		||||
 | 
			
		||||
void meta_window_actor_pre_paint      (MetaWindowActor    *self);
 | 
			
		||||
void meta_window_actor_post_paint     (MetaWindowActor    *self);
 | 
			
		||||
@@ -55,15 +59,12 @@ void     meta_window_actor_set_updates_frozen  (MetaWindowActor *self,
 | 
			
		||||
void     meta_window_actor_queue_frame_drawn   (MetaWindowActor *self,
 | 
			
		||||
                                                gboolean         no_delay_frame);
 | 
			
		||||
 | 
			
		||||
cairo_region_t *meta_window_actor_get_obscured_region (MetaWindowActor *self);
 | 
			
		||||
 | 
			
		||||
void meta_window_actor_set_visible_region         (MetaWindowActor *self,
 | 
			
		||||
                                                   cairo_region_t  *visible_region);
 | 
			
		||||
void meta_window_actor_set_visible_region_beneath (MetaWindowActor *self,
 | 
			
		||||
                                                   cairo_region_t  *beneath_region);
 | 
			
		||||
void meta_window_actor_reset_visible_regions      (MetaWindowActor *self);
 | 
			
		||||
void meta_window_actor_set_unobscured_region      (MetaWindowActor *self,
 | 
			
		||||
                                                   cairo_region_t  *unobscured_region);
 | 
			
		||||
 | 
			
		||||
void meta_window_actor_effect_completed (MetaWindowActor *actor,
 | 
			
		||||
                                         gulong           event);
 | 
			
		||||
 | 
			
		||||
MetaSurfaceActor *meta_window_actor_get_surface (MetaWindowActor *self);
 | 
			
		||||
 | 
			
		||||
#endif /* META_WINDOW_ACTOR_PRIVATE_H */
 | 
			
		||||
 
 | 
			
		||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -11,8 +11,8 @@
 | 
			
		||||
#include "compositor-private.h"
 | 
			
		||||
#include "meta-window-actor-private.h"
 | 
			
		||||
#include "meta-window-group.h"
 | 
			
		||||
#include "meta-background-actor-private.h"
 | 
			
		||||
#include "meta-background-group-private.h"
 | 
			
		||||
#include "window-private.h"
 | 
			
		||||
#include "meta-cullable.h"
 | 
			
		||||
 | 
			
		||||
struct _MetaWindowGroupClass
 | 
			
		||||
{
 | 
			
		||||
@@ -26,7 +26,10 @@ struct _MetaWindowGroup
 | 
			
		||||
  MetaScreen *screen;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
G_DEFINE_TYPE (MetaWindowGroup, meta_window_group, CLUTTER_TYPE_ACTOR);
 | 
			
		||||
static void cullable_iface_init (MetaCullableInterface *iface);
 | 
			
		||||
 | 
			
		||||
G_DEFINE_TYPE_WITH_CODE (MetaWindowGroup, meta_window_group, CLUTTER_TYPE_ACTOR,
 | 
			
		||||
                         G_IMPLEMENT_INTERFACE (META_TYPE_CULLABLE, cullable_iface_init));
 | 
			
		||||
 | 
			
		||||
/* Help macros to scale from OpenGL <-1,1> coordinates system to
 | 
			
		||||
 * window coordinates ranging [0,window-size]. Borrowed from clutter-utils.c
 | 
			
		||||
@@ -86,20 +89,53 @@ painting_untransformed (MetaWindowGroup *window_group,
 | 
			
		||||
  return meta_actor_vertices_are_untransformed (vertices, width, height, x_origin, y_origin);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_window_group_cull_out (MetaCullable   *cullable,
 | 
			
		||||
                            cairo_region_t *unobscured_region,
 | 
			
		||||
                            cairo_region_t *clip_region)
 | 
			
		||||
{
 | 
			
		||||
  meta_cullable_cull_out_children (cullable, unobscured_region, clip_region);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_window_group_reset_culling (MetaCullable *cullable)
 | 
			
		||||
{
 | 
			
		||||
  meta_cullable_reset_culling_children (cullable);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
cullable_iface_init (MetaCullableInterface *iface)
 | 
			
		||||
{
 | 
			
		||||
  iface->cull_out = meta_window_group_cull_out;
 | 
			
		||||
  iface->reset_culling = meta_window_group_reset_culling;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_window_group_paint (ClutterActor *actor)
 | 
			
		||||
{
 | 
			
		||||
  cairo_region_t *visible_region;
 | 
			
		||||
  ClutterActor *stage;
 | 
			
		||||
  cairo_region_t *clip_region;
 | 
			
		||||
  cairo_region_t *unobscured_region;
 | 
			
		||||
  ClutterActorIter iter;
 | 
			
		||||
  ClutterActor *child;
 | 
			
		||||
  cairo_rectangle_int_t visible_rect;
 | 
			
		||||
  cairo_rectangle_int_t visible_rect, clip_rect;
 | 
			
		||||
  int paint_x_offset, paint_y_offset;
 | 
			
		||||
  int paint_x_origin, paint_y_origin;
 | 
			
		||||
  int actor_x_origin, actor_y_origin;
 | 
			
		||||
  int paint_x_offset, paint_y_offset;
 | 
			
		||||
 | 
			
		||||
  MetaWindowGroup *window_group = META_WINDOW_GROUP (actor);
 | 
			
		||||
  MetaCompScreen *info = meta_screen_get_compositor_data (window_group->screen);
 | 
			
		||||
  ClutterActor *stage = clutter_actor_get_stage (actor);
 | 
			
		||||
 | 
			
		||||
  /* Start off by treating all windows as completely unobscured, so damage anywhere
 | 
			
		||||
   * in a window queues redraws, but confine it more below. */
 | 
			
		||||
  clutter_actor_iter_init (&iter, actor);
 | 
			
		||||
  while (clutter_actor_iter_next (&iter, &child))
 | 
			
		||||
    {
 | 
			
		||||
      if (META_IS_WINDOW_ACTOR (child))
 | 
			
		||||
        {
 | 
			
		||||
          MetaWindowActor *window_actor = META_WINDOW_ACTOR (child);
 | 
			
		||||
          meta_window_actor_set_unobscured_region (window_actor, NULL);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  /* Normally we expect an actor to be drawn at it's position on the screen.
 | 
			
		||||
   * However, if we're inside the paint of a ClutterClone, that won't be the
 | 
			
		||||
@@ -121,8 +157,11 @@ meta_window_group_paint (ClutterActor *actor)
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  paint_x_offset = paint_x_origin - actor_x_origin;
 | 
			
		||||
  paint_y_offset = paint_y_origin - actor_y_origin;
 | 
			
		||||
  visible_rect.x = visible_rect.y = 0;
 | 
			
		||||
  visible_rect.width = clutter_actor_get_width (CLUTTER_ACTOR (stage));
 | 
			
		||||
  visible_rect.height = clutter_actor_get_height (CLUTTER_ACTOR (stage));
 | 
			
		||||
 | 
			
		||||
  unobscured_region = cairo_region_create_rectangle (&visible_rect);
 | 
			
		||||
 | 
			
		||||
  /* Get the clipped redraw bounds from Clutter so that we can avoid
 | 
			
		||||
   * painting shadows on windows that don't need to be painted in this
 | 
			
		||||
@@ -130,129 +169,63 @@ meta_window_group_paint (ClutterActor *actor)
 | 
			
		||||
   * sizes, we could intersect this with an accurate union of the
 | 
			
		||||
   * monitors to avoid painting shadows that are visible only in the
 | 
			
		||||
   * holes. */
 | 
			
		||||
  stage = clutter_actor_get_stage (actor);
 | 
			
		||||
  clutter_stage_get_redraw_clip_bounds (CLUTTER_STAGE (stage),
 | 
			
		||||
                                        &visible_rect);
 | 
			
		||||
                                        &clip_rect);
 | 
			
		||||
 | 
			
		||||
  visible_region = cairo_region_create_rectangle (&visible_rect);
 | 
			
		||||
  clip_region = cairo_region_create_rectangle (&clip_rect);
 | 
			
		||||
 | 
			
		||||
  if (info->unredirected_window != NULL)
 | 
			
		||||
  paint_x_offset = paint_x_origin - actor_x_origin;
 | 
			
		||||
  paint_y_offset = paint_y_origin - actor_y_origin;
 | 
			
		||||
  cairo_region_translate (clip_region, -paint_x_offset, -paint_y_offset);
 | 
			
		||||
 | 
			
		||||
  if (!meta_is_wayland_compositor ())
 | 
			
		||||
    {
 | 
			
		||||
      cairo_rectangle_int_t unredirected_rect;
 | 
			
		||||
      MetaWindow *window = meta_window_actor_get_meta_window (info->unredirected_window);
 | 
			
		||||
 | 
			
		||||
      meta_window_get_outer_rect (window, (MetaRectangle *)&unredirected_rect);
 | 
			
		||||
      cairo_region_subtract_rectangle (visible_region, &unredirected_rect);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  /* We walk the list from top to bottom (opposite of painting order),
 | 
			
		||||
   * and subtract the opaque area of each window out of the visible
 | 
			
		||||
   * region that we pass to the windows below.
 | 
			
		||||
   */
 | 
			
		||||
  clutter_actor_iter_init (&iter, actor);
 | 
			
		||||
  while (clutter_actor_iter_prev (&iter, &child))
 | 
			
		||||
    {
 | 
			
		||||
      if (!CLUTTER_ACTOR_IS_VISIBLE (child))
 | 
			
		||||
        continue;
 | 
			
		||||
 | 
			
		||||
      if (info->unredirected_window != NULL &&
 | 
			
		||||
          child == CLUTTER_ACTOR (info->unredirected_window))
 | 
			
		||||
        continue;
 | 
			
		||||
 | 
			
		||||
      /* If an actor has effects applied, then that can change the area
 | 
			
		||||
       * it paints and the opacity, so we no longer can figure out what
 | 
			
		||||
       * portion of the actor is obscured and what portion of the screen
 | 
			
		||||
       * it obscures, so we skip the actor.
 | 
			
		||||
       *
 | 
			
		||||
       * This has a secondary beneficial effect: if a ClutterOffscreenEffect
 | 
			
		||||
       * is applied to an actor, then our clipped redraws interfere with the
 | 
			
		||||
       * caching of the FBO - even if we only need to draw a small portion
 | 
			
		||||
       * of the window right now, ClutterOffscreenEffect may use other portions
 | 
			
		||||
       * of the FBO later. So, skipping actors with effects applied also
 | 
			
		||||
       * prevents these bugs.
 | 
			
		||||
       *
 | 
			
		||||
       * Theoretically, we should check clutter_actor_get_offscreen_redirect()
 | 
			
		||||
       * as well for the same reason, but omitted for simplicity in the
 | 
			
		||||
       * hopes that no-one will do that.
 | 
			
		||||
       */
 | 
			
		||||
      if (clutter_actor_has_effects (child))
 | 
			
		||||
        continue;
 | 
			
		||||
 | 
			
		||||
      if (META_IS_WINDOW_ACTOR (child))
 | 
			
		||||
      MetaCompScreen *info = meta_screen_get_compositor_data (window_group->screen);
 | 
			
		||||
      if (info->unredirected_window != NULL)
 | 
			
		||||
        {
 | 
			
		||||
          MetaWindowActor *window_actor = META_WINDOW_ACTOR (child);
 | 
			
		||||
          int x, y;
 | 
			
		||||
          cairo_rectangle_int_t unredirected_rect;
 | 
			
		||||
          MetaWindow *window = meta_window_actor_get_meta_window (info->unredirected_window);
 | 
			
		||||
 | 
			
		||||
          if (!meta_actor_is_untransformed (CLUTTER_ACTOR (window_actor), &x, &y))
 | 
			
		||||
            continue;
 | 
			
		||||
 | 
			
		||||
          x += paint_x_offset;
 | 
			
		||||
          y += paint_y_offset;
 | 
			
		||||
 | 
			
		||||
          /* Temporarily move to the coordinate system of the actor */
 | 
			
		||||
          cairo_region_translate (visible_region, - x, - y);
 | 
			
		||||
 | 
			
		||||
          meta_window_actor_set_visible_region (window_actor, visible_region);
 | 
			
		||||
 | 
			
		||||
          if (clutter_actor_get_paint_opacity (CLUTTER_ACTOR (window_actor)) == 0xff)
 | 
			
		||||
            {
 | 
			
		||||
              cairo_region_t *obscured_region = meta_window_actor_get_obscured_region (window_actor);
 | 
			
		||||
              if (obscured_region)
 | 
			
		||||
                cairo_region_subtract (visible_region, obscured_region);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
          meta_window_actor_set_visible_region_beneath (window_actor, visible_region);
 | 
			
		||||
          cairo_region_translate (visible_region, x, y);
 | 
			
		||||
        }
 | 
			
		||||
      else if (META_IS_BACKGROUND_ACTOR (child) ||
 | 
			
		||||
               META_IS_BACKGROUND_GROUP (child))
 | 
			
		||||
        {
 | 
			
		||||
          int x, y;
 | 
			
		||||
 | 
			
		||||
          if (!meta_actor_is_untransformed (child, &x, &y))
 | 
			
		||||
            continue;
 | 
			
		||||
 | 
			
		||||
          x += paint_x_offset;
 | 
			
		||||
          y += paint_y_offset;
 | 
			
		||||
 | 
			
		||||
          cairo_region_translate (visible_region, - x, - y);
 | 
			
		||||
 | 
			
		||||
          if (META_IS_BACKGROUND_GROUP (child))
 | 
			
		||||
            meta_background_group_set_visible_region (META_BACKGROUND_GROUP (child), visible_region);
 | 
			
		||||
          else
 | 
			
		||||
            meta_background_actor_set_visible_region (META_BACKGROUND_ACTOR (child), visible_region);
 | 
			
		||||
          cairo_region_translate (visible_region, x, y);
 | 
			
		||||
          meta_window_get_frame_rect (window, (MetaRectangle *)&unredirected_rect);
 | 
			
		||||
          cairo_region_subtract_rectangle (unobscured_region, &unredirected_rect);
 | 
			
		||||
          cairo_region_subtract_rectangle (clip_region, &unredirected_rect);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  cairo_region_destroy (visible_region);
 | 
			
		||||
  meta_cullable_cull_out (META_CULLABLE (window_group), unobscured_region, clip_region);
 | 
			
		||||
 | 
			
		||||
  cairo_region_destroy (unobscured_region);
 | 
			
		||||
  cairo_region_destroy (clip_region);
 | 
			
		||||
 | 
			
		||||
  CLUTTER_ACTOR_CLASS (meta_window_group_parent_class)->paint (actor);
 | 
			
		||||
 | 
			
		||||
  /* Now that we are done painting, unset the visible regions (they will
 | 
			
		||||
   * mess up painting clones of our actors)
 | 
			
		||||
   */
 | 
			
		||||
  clutter_actor_iter_init (&iter, actor);
 | 
			
		||||
  while (clutter_actor_iter_next (&iter, &child))
 | 
			
		||||
    {
 | 
			
		||||
      if (META_IS_WINDOW_ACTOR (child))
 | 
			
		||||
        {
 | 
			
		||||
          MetaWindowActor *window_actor = META_WINDOW_ACTOR (child);
 | 
			
		||||
          meta_window_actor_reset_visible_regions (window_actor);
 | 
			
		||||
        }
 | 
			
		||||
      else if (META_IS_BACKGROUND_ACTOR (child))
 | 
			
		||||
        {
 | 
			
		||||
          MetaBackgroundActor *background_actor = META_BACKGROUND_ACTOR (child);
 | 
			
		||||
          meta_background_actor_set_visible_region (background_actor, NULL);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
  meta_cullable_reset_culling (META_CULLABLE (window_group));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Adapted from clutter_actor_update_default_paint_volume() */
 | 
			
		||||
static gboolean
 | 
			
		||||
meta_window_group_get_paint_volume (ClutterActor       *actor,
 | 
			
		||||
meta_window_group_get_paint_volume (ClutterActor       *self,
 | 
			
		||||
                                    ClutterPaintVolume *volume)
 | 
			
		||||
{
 | 
			
		||||
  return clutter_paint_volume_set_from_allocation (volume, actor);
 | 
			
		||||
  ClutterActorIter iter;
 | 
			
		||||
  ClutterActor *child;
 | 
			
		||||
 | 
			
		||||
  clutter_actor_iter_init (&iter, self);
 | 
			
		||||
  while (clutter_actor_iter_next (&iter, &child))
 | 
			
		||||
    {
 | 
			
		||||
      const ClutterPaintVolume *child_volume;
 | 
			
		||||
 | 
			
		||||
      if (!CLUTTER_ACTOR_IS_MAPPED (child))
 | 
			
		||||
        continue;
 | 
			
		||||
 | 
			
		||||
      child_volume = clutter_actor_get_transformed_paint_volume (child, self);
 | 
			
		||||
      if (child_volume == NULL)
 | 
			
		||||
        return FALSE;
 | 
			
		||||
 | 
			
		||||
      clutter_paint_volume_union (volume, child_volume);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  return TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
 
 | 
			
		||||
@@ -11,29 +11,9 @@
 | 
			
		||||
 * MetaWindowGroup:
 | 
			
		||||
 *
 | 
			
		||||
 * This class is a subclass of ClutterActor with special handling for
 | 
			
		||||
 * MetaWindowActor/MetaBackgroundActor/MetaBackgroundGroup when painting
 | 
			
		||||
 * children.
 | 
			
		||||
 *
 | 
			
		||||
 * When we are painting a stack of 5-10 maximized windows, the
 | 
			
		||||
 * standard bottom-to-top method of drawing every actor results in a
 | 
			
		||||
 * tremendous amount of overdraw and can easily max out the available
 | 
			
		||||
 * memory bandwidth on a low-end graphics chipset. It's even worse if
 | 
			
		||||
 * window textures are being accessed over the AGP bus.
 | 
			
		||||
 *
 | 
			
		||||
 * The basic technique applied here is to do a pre-pass before painting
 | 
			
		||||
 * where we walk window from top to bottom and compute the visible area
 | 
			
		||||
 * at each step by subtracting out the windows above it. The visible
 | 
			
		||||
 * area is passed to MetaWindowActor which uses it to clip the portion of
 | 
			
		||||
 * the window which drawn and avoid redrawing the shadow if it is completely
 | 
			
		||||
 * obscured.
 | 
			
		||||
 *
 | 
			
		||||
 * A caveat is that this is ineffective if applications are using ARGB
 | 
			
		||||
 * visuals, since we have no way of knowing whether a window obscures
 | 
			
		||||
 * the windows behind it or not. Alternate approaches using the depth
 | 
			
		||||
 * or stencil buffer rather than client side regions might be able to
 | 
			
		||||
 * handle alpha windows, but the combination of glAlphaFunc and stenciling
 | 
			
		||||
 * tends not to be efficient except on newer cards. (And on newer cards
 | 
			
		||||
 * we have lots of memory and bandwidth.)
 | 
			
		||||
 * #MetaCullable when painting children. It uses code similar to
 | 
			
		||||
 * meta_cullable_cull_out_children(), but also has additional special
 | 
			
		||||
 * cases for the undirected window, and similar.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define META_TYPE_WINDOW_GROUP            (meta_window_group_get_type ())
 | 
			
		||||
 
 | 
			
		||||
@@ -21,15 +21,14 @@
 | 
			
		||||
 * 02111-1307, USA.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <config.h>
 | 
			
		||||
 | 
			
		||||
#include <meta/meta-plugin.h>
 | 
			
		||||
#include <meta/window.h>
 | 
			
		||||
#include <meta/util.h>
 | 
			
		||||
#include <meta/meta-background-group.h>
 | 
			
		||||
#include <meta/meta-background-actor.h>
 | 
			
		||||
 | 
			
		||||
#include <libintl.h>
 | 
			
		||||
#define _(x) dgettext (GETTEXT_PACKAGE, x)
 | 
			
		||||
#define N_(x) x
 | 
			
		||||
#include <meta/util.h>
 | 
			
		||||
#include <glib/gi18n-lib.h>
 | 
			
		||||
 | 
			
		||||
#include <clutter/clutter.h>
 | 
			
		||||
#include <gmodule.h>
 | 
			
		||||
 
 | 
			
		||||
@@ -366,11 +366,25 @@ meta_barrier_fire_event (MetaBarrier    *barrier,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
gboolean
 | 
			
		||||
meta_display_process_barrier_event (MetaDisplay    *display,
 | 
			
		||||
                                    XIBarrierEvent *xev)
 | 
			
		||||
meta_display_process_barrier_event (MetaDisplay *display,
 | 
			
		||||
                                    XIEvent     *event)
 | 
			
		||||
{
 | 
			
		||||
  MetaBarrier *barrier;
 | 
			
		||||
  XIBarrierEvent *xev;
 | 
			
		||||
 | 
			
		||||
  if (event == NULL)
 | 
			
		||||
    return FALSE;
 | 
			
		||||
 | 
			
		||||
  switch (event->evtype)
 | 
			
		||||
    {
 | 
			
		||||
    case XI_BarrierHit:
 | 
			
		||||
    case XI_BarrierLeave:
 | 
			
		||||
      break;
 | 
			
		||||
    default:
 | 
			
		||||
      return FALSE;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  xev = (XIBarrierEvent *) event;
 | 
			
		||||
  barrier = g_hash_table_lookup (display->xids, &xev->barrier);
 | 
			
		||||
  if (barrier != NULL)
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
@@ -53,6 +53,7 @@
 | 
			
		||||
#include "bell.h"
 | 
			
		||||
#include "screen-private.h"
 | 
			
		||||
#include "window-private.h"
 | 
			
		||||
#include "util-private.h"
 | 
			
		||||
#include <meta/prefs.h>
 | 
			
		||||
#include <meta/compositor.h>
 | 
			
		||||
#ifdef HAVE_LIBCANBERRA
 | 
			
		||||
 
 | 
			
		||||
@@ -118,8 +118,6 @@ typedef struct
 | 
			
		||||
{
 | 
			
		||||
  MetaRectangle        orig;
 | 
			
		||||
  MetaRectangle        current;
 | 
			
		||||
  MetaFrameBorders    *borders;
 | 
			
		||||
  gboolean             must_free_borders;
 | 
			
		||||
  ActionType           action_type;
 | 
			
		||||
  gboolean             is_user_action;
 | 
			
		||||
 | 
			
		||||
@@ -195,7 +193,6 @@ static gboolean constrain_partially_onscreen (MetaWindow         *window,
 | 
			
		||||
 | 
			
		||||
static void setup_constraint_info        (ConstraintInfo      *info,
 | 
			
		||||
                                          MetaWindow          *window,
 | 
			
		||||
                                          MetaFrameBorders    *orig_borders,
 | 
			
		||||
                                          MetaMoveResizeFlags  flags,
 | 
			
		||||
                                          int                  resize_gravity,
 | 
			
		||||
                                          const MetaRectangle *orig,
 | 
			
		||||
@@ -204,13 +201,12 @@ static void place_window_if_needed       (MetaWindow     *window,
 | 
			
		||||
                                          ConstraintInfo *info);
 | 
			
		||||
static void update_onscreen_requirements (MetaWindow     *window,
 | 
			
		||||
                                          ConstraintInfo *info);
 | 
			
		||||
static void extend_by_frame              (MetaRectangle           *rect,
 | 
			
		||||
                                          const MetaFrameBorders  *borders);
 | 
			
		||||
static void unextend_by_frame            (MetaRectangle           *rect,
 | 
			
		||||
                                          const MetaFrameBorders  *borders);
 | 
			
		||||
static inline void get_size_limits       (const MetaWindow        *window,
 | 
			
		||||
                                          const MetaFrameBorders  *borders,
 | 
			
		||||
                                          gboolean include_frame,
 | 
			
		||||
static void extend_by_frame              (MetaWindow     *window,
 | 
			
		||||
                                          MetaRectangle  *rect);
 | 
			
		||||
static void unextend_by_frame            (MetaWindow     *window,
 | 
			
		||||
                                          MetaRectangle  *rect);
 | 
			
		||||
static inline void get_size_limits       (MetaWindow    *window,
 | 
			
		||||
                                          gboolean       include_frame,
 | 
			
		||||
                                          MetaRectangle *min_size,
 | 
			
		||||
                                          MetaRectangle *max_size);
 | 
			
		||||
 | 
			
		||||
@@ -280,7 +276,6 @@ do_all_constraints (MetaWindow         *window,
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_window_constrain (MetaWindow          *window,
 | 
			
		||||
                       MetaFrameBorders    *orig_borders,
 | 
			
		||||
                       MetaMoveResizeFlags  flags,
 | 
			
		||||
                       int                  resize_gravity,
 | 
			
		||||
                       const MetaRectangle *orig,
 | 
			
		||||
@@ -303,7 +298,6 @@ meta_window_constrain (MetaWindow          *window,
 | 
			
		||||
 | 
			
		||||
  setup_constraint_info (&info,
 | 
			
		||||
                         window, 
 | 
			
		||||
                         orig_borders,
 | 
			
		||||
                         flags,
 | 
			
		||||
                         resize_gravity,
 | 
			
		||||
                         orig,
 | 
			
		||||
@@ -333,19 +327,11 @@ meta_window_constrain (MetaWindow          *window,
 | 
			
		||||
   * if this was a user move or user move-and-resize operation.
 | 
			
		||||
   */
 | 
			
		||||
  update_onscreen_requirements (window, &info);
 | 
			
		||||
 | 
			
		||||
  /* Ew, what an ugly way to do things.  Destructors (in a real OOP language,
 | 
			
		||||
   * not gobject-style--gobject would be more pain than it's worth) or
 | 
			
		||||
   * smart pointers would be so much nicer here.  *shrug*
 | 
			
		||||
   */
 | 
			
		||||
  if (info.must_free_borders)
 | 
			
		||||
    g_free (info.borders);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
setup_constraint_info (ConstraintInfo      *info,
 | 
			
		||||
                       MetaWindow          *window,
 | 
			
		||||
                       MetaFrameBorders    *orig_borders,
 | 
			
		||||
                       MetaMoveResizeFlags  flags,
 | 
			
		||||
                       int                  resize_gravity,
 | 
			
		||||
                       const MetaRectangle *orig,
 | 
			
		||||
@@ -357,18 +343,6 @@ setup_constraint_info (ConstraintInfo      *info,
 | 
			
		||||
  info->orig    = *orig;
 | 
			
		||||
  info->current = *new;
 | 
			
		||||
 | 
			
		||||
  /* Create a fake frame geometry if none really exists */
 | 
			
		||||
  if (orig_borders && !window->fullscreen)
 | 
			
		||||
    {
 | 
			
		||||
      info->borders = orig_borders;
 | 
			
		||||
      info->must_free_borders = FALSE;
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    {
 | 
			
		||||
      info->borders = g_new0 (MetaFrameBorders, 1);
 | 
			
		||||
      info->must_free_borders = TRUE;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  if (flags & META_IS_MOVE_ACTION && flags & META_IS_RESIZE_ACTION)
 | 
			
		||||
    info->action_type = ACTION_MOVE_AND_RESIZE;
 | 
			
		||||
  else if (flags & META_IS_RESIZE_ACTION)
 | 
			
		||||
@@ -447,12 +421,14 @@ setup_constraint_info (ConstraintInfo      *info,
 | 
			
		||||
 | 
			
		||||
  /* Workaround braindead legacy apps that don't know how to
 | 
			
		||||
   * fullscreen themselves properly - don't get fooled by
 | 
			
		||||
   * windows which hide their titlebar when maximized; that's
 | 
			
		||||
   * not the same as fullscreen, even if there are no struts
 | 
			
		||||
   * making the workarea smaller than the monitor.
 | 
			
		||||
   * windows which hide their titlebar when maximized or which are
 | 
			
		||||
   * client decorated; that's not the same as fullscreen, even
 | 
			
		||||
   * if there are no struts making the workarea smaller than
 | 
			
		||||
   * the monitor.
 | 
			
		||||
   */
 | 
			
		||||
  if (meta_prefs_get_force_fullscreen() &&
 | 
			
		||||
      !window->hide_titlebar_when_maximized &&
 | 
			
		||||
      window->decorated &&
 | 
			
		||||
      meta_rectangle_equal (new, &monitor_info->rect) &&
 | 
			
		||||
      window->has_fullscreen_func &&
 | 
			
		||||
      !window->fullscreen)
 | 
			
		||||
@@ -517,11 +493,12 @@ place_window_if_needed(MetaWindow     *window,
 | 
			
		||||
      !window->minimized &&
 | 
			
		||||
      !window->fullscreen)
 | 
			
		||||
    {
 | 
			
		||||
      MetaRectangle placed_rect = info->orig;
 | 
			
		||||
      MetaRectangle placed_rect;
 | 
			
		||||
      MetaWorkspace *cur_workspace;
 | 
			
		||||
      const MetaMonitorInfo *monitor_info;
 | 
			
		||||
 | 
			
		||||
      meta_window_place (window, info->borders, info->orig.x, info->orig.y,
 | 
			
		||||
      meta_window_get_frame_rect (window, &placed_rect);
 | 
			
		||||
      meta_window_place (window, info->orig.x, info->orig.y,
 | 
			
		||||
                         &placed_rect.x, &placed_rect.y);
 | 
			
		||||
      did_placement = TRUE;
 | 
			
		||||
 | 
			
		||||
@@ -539,6 +516,7 @@ place_window_if_needed(MetaWindow     *window,
 | 
			
		||||
        meta_workspace_get_onmonitor_region (cur_workspace, 
 | 
			
		||||
                                             monitor_info->number);
 | 
			
		||||
 | 
			
		||||
      meta_window_frame_rect_to_client_rect (window, &placed_rect, &placed_rect);
 | 
			
		||||
 | 
			
		||||
      info->current.x = placed_rect.x;
 | 
			
		||||
      info->current.y = placed_rect.y;
 | 
			
		||||
@@ -584,10 +562,6 @@ place_window_if_needed(MetaWindow     *window,
 | 
			
		||||
                (window->maximize_vertically_after_placement ?
 | 
			
		||||
                 META_MAXIMIZE_VERTICAL : 0), &info->current);
 | 
			
		||||
 | 
			
		||||
          /* maximization may have changed frame geometry */
 | 
			
		||||
          if (!window->fullscreen)
 | 
			
		||||
            meta_frame_calc_borders (window->frame, info->borders);
 | 
			
		||||
 | 
			
		||||
          if (window->fullscreen_after_placement)
 | 
			
		||||
            {
 | 
			
		||||
              window->saved_rect = info->current;
 | 
			
		||||
@@ -647,7 +621,7 @@ update_onscreen_requirements (MetaWindow     *window,
 | 
			
		||||
  /* The require onscreen/on-single-monitor and titlebar_visible
 | 
			
		||||
   * stuff is relative to the outer window, not the inner
 | 
			
		||||
   */
 | 
			
		||||
  extend_by_frame (&info->current, info->borders);
 | 
			
		||||
  extend_by_frame (window, &info->current);
 | 
			
		||||
 | 
			
		||||
  /* Update whether we want future constraint runs to require the
 | 
			
		||||
   * window to be on fully onscreen.
 | 
			
		||||
@@ -680,10 +654,13 @@ update_onscreen_requirements (MetaWindow     *window,
 | 
			
		||||
   */
 | 
			
		||||
  if (window->frame && window->decorated)
 | 
			
		||||
    {
 | 
			
		||||
      MetaFrameBorders borders;
 | 
			
		||||
      MetaRectangle titlebar_rect;
 | 
			
		||||
 | 
			
		||||
      meta_frame_calc_borders (window->frame, &borders);
 | 
			
		||||
 | 
			
		||||
      titlebar_rect = info->current;
 | 
			
		||||
      titlebar_rect.height = info->borders->visible.top;
 | 
			
		||||
      titlebar_rect.height = borders.visible.top;
 | 
			
		||||
      old = window->require_titlebar_visible;
 | 
			
		||||
      window->require_titlebar_visible =
 | 
			
		||||
        meta_rectangle_overlaps_with_region (info->usable_screen_region,
 | 
			
		||||
@@ -696,39 +673,33 @@ update_onscreen_requirements (MetaWindow     *window,
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  /* Don't forget to restore the position of the window */
 | 
			
		||||
  unextend_by_frame (&info->current, info->borders);
 | 
			
		||||
  unextend_by_frame (window, &info->current);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
extend_by_frame (MetaRectangle           *rect,
 | 
			
		||||
                 const MetaFrameBorders *borders)
 | 
			
		||||
extend_by_frame (MetaWindow    *window,
 | 
			
		||||
                 MetaRectangle *rect)
 | 
			
		||||
{
 | 
			
		||||
  rect->x -= borders->visible.left;
 | 
			
		||||
  rect->y -= borders->visible.top;
 | 
			
		||||
  rect->width  += borders->visible.left + borders->visible.right;
 | 
			
		||||
  rect->height += borders->visible.top + borders->visible.bottom;
 | 
			
		||||
  meta_window_client_rect_to_frame_rect (window, rect, rect);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
unextend_by_frame (MetaRectangle           *rect,
 | 
			
		||||
                   const MetaFrameBorders *borders)
 | 
			
		||||
unextend_by_frame (MetaWindow    *window,
 | 
			
		||||
                   MetaRectangle *rect)
 | 
			
		||||
{
 | 
			
		||||
  rect->x += borders->visible.left;
 | 
			
		||||
  rect->y += borders->visible.top;
 | 
			
		||||
  rect->width  -= borders->visible.left + borders->visible.right;
 | 
			
		||||
  rect->height -= borders->visible.top + borders->visible.bottom;
 | 
			
		||||
  meta_window_frame_rect_to_client_rect (window, rect, rect);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static inline void
 | 
			
		||||
get_size_limits (const MetaWindow        *window,
 | 
			
		||||
                 const MetaFrameBorders *borders,
 | 
			
		||||
                 gboolean                 include_frame,
 | 
			
		||||
get_size_limits (MetaWindow    *window,
 | 
			
		||||
                 gboolean       include_frame,
 | 
			
		||||
                 MetaRectangle *min_size,
 | 
			
		||||
                 MetaRectangle *max_size)
 | 
			
		||||
{
 | 
			
		||||
  /* We pack the results into MetaRectangle structs just for convienience; we
 | 
			
		||||
   * don't actually use the position of those rects.
 | 
			
		||||
   */
 | 
			
		||||
  min_size->x = min_size->y = max_size->x = max_size->y = 0;
 | 
			
		||||
  min_size->width  = window->size_hints.min_width;
 | 
			
		||||
  min_size->height = window->size_hints.min_height;
 | 
			
		||||
  max_size->width  = window->size_hints.max_width;
 | 
			
		||||
@@ -736,22 +707,8 @@ get_size_limits (const MetaWindow        *window,
 | 
			
		||||
 | 
			
		||||
  if (include_frame)
 | 
			
		||||
    {
 | 
			
		||||
      int fw = borders->visible.left + borders->visible.right;
 | 
			
		||||
      int fh = borders->visible.top + borders->visible.bottom;
 | 
			
		||||
 | 
			
		||||
      min_size->width  += fw;
 | 
			
		||||
      min_size->height += fh;
 | 
			
		||||
      /* Do check to avoid overflow (e.g. max_size->width & max_size->height
 | 
			
		||||
       * may be set to G_MAXINT by meta_set_normal_hints()).
 | 
			
		||||
       */
 | 
			
		||||
      if (max_size->width < (G_MAXINT - fw))
 | 
			
		||||
        max_size->width += fw;
 | 
			
		||||
      else
 | 
			
		||||
        max_size->width = G_MAXINT;
 | 
			
		||||
      if (max_size->height < (G_MAXINT - fh))
 | 
			
		||||
        max_size->height += fh;
 | 
			
		||||
      else
 | 
			
		||||
        max_size->height = G_MAXINT;
 | 
			
		||||
      meta_window_client_rect_to_frame_rect (window, min_size, min_size);
 | 
			
		||||
      meta_window_client_rect_to_frame_rect (window, max_size, max_size);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -763,18 +720,28 @@ constrain_modal_dialog (MetaWindow         *window,
 | 
			
		||||
{
 | 
			
		||||
  int x, y;
 | 
			
		||||
  MetaWindow *parent = meta_window_get_transient_for (window);
 | 
			
		||||
  MetaRectangle child_rect, parent_rect;
 | 
			
		||||
  gboolean constraint_already_satisfied;
 | 
			
		||||
 | 
			
		||||
  if (!meta_window_is_attached_dialog (window))
 | 
			
		||||
    return TRUE;
 | 
			
		||||
 | 
			
		||||
  x = parent->rect.x + (parent->rect.width / 2  - info->current.width / 2);
 | 
			
		||||
  y = parent->rect.y + (parent->rect.height / 2 - info->current.height / 2);
 | 
			
		||||
  if (parent->frame)
 | 
			
		||||
    {
 | 
			
		||||
      x += parent->frame->rect.x;
 | 
			
		||||
      y += parent->frame->rect.y;
 | 
			
		||||
    }
 | 
			
		||||
  /* We want to center the dialog on the parent, including the decorations
 | 
			
		||||
     for both of them. info->current is in client X window coordinates, so we need
 | 
			
		||||
     to convert them to frame coordinates, apply the centering and then
 | 
			
		||||
     convert back to client.
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
  child_rect = info->current;
 | 
			
		||||
  extend_by_frame (window, &child_rect);
 | 
			
		||||
 | 
			
		||||
  meta_window_get_frame_rect (parent, &parent_rect);
 | 
			
		||||
 | 
			
		||||
  child_rect.x = parent_rect.x + (parent_rect.width / 2  - child_rect.width / 2);
 | 
			
		||||
  child_rect.y = parent_rect.y + (parent_rect.height / 2 - child_rect.height / 2);
 | 
			
		||||
  unextend_by_frame (window, &child_rect);
 | 
			
		||||
  x = child_rect.x;
 | 
			
		||||
  y = child_rect.y;
 | 
			
		||||
 | 
			
		||||
  constraint_already_satisfied = (x == info->current.x) && (y == info->current.y);
 | 
			
		||||
 | 
			
		||||
@@ -839,19 +806,19 @@ constrain_maximization (MetaWindow         *window,
 | 
			
		||||
      active_workspace_struts = window->screen->active_workspace->all_struts;
 | 
			
		||||
 | 
			
		||||
      target_size = info->current;
 | 
			
		||||
      extend_by_frame (&target_size, info->borders);
 | 
			
		||||
      extend_by_frame (window, &target_size);
 | 
			
		||||
      meta_rectangle_expand_to_avoiding_struts (&target_size,
 | 
			
		||||
                                                &info->entire_monitor,
 | 
			
		||||
                                                direction,
 | 
			
		||||
                                                active_workspace_struts);
 | 
			
		||||
   }
 | 
			
		||||
  /* Now make target_size = maximized size of client window */
 | 
			
		||||
  unextend_by_frame (&target_size, info->borders);
 | 
			
		||||
  unextend_by_frame (window, &target_size);
 | 
			
		||||
 | 
			
		||||
  /* Check min size constraints; max size constraints are ignored for maximized
 | 
			
		||||
   * windows, as per bug 327543.
 | 
			
		||||
   */
 | 
			
		||||
  get_size_limits (window, info->borders, FALSE, &min_size, &max_size);
 | 
			
		||||
  get_size_limits (window, FALSE, &min_size, &max_size);
 | 
			
		||||
  hminbad = target_size.width < min_size.width && window->maximized_horizontally;
 | 
			
		||||
  vminbad = target_size.height < min_size.height && window->maximized_vertically;
 | 
			
		||||
  if (hminbad || vminbad)
 | 
			
		||||
@@ -905,12 +872,12 @@ constrain_tiling (MetaWindow         *window,
 | 
			
		||||
   * use an external function for the actual calculation
 | 
			
		||||
   */
 | 
			
		||||
  meta_window_get_current_tile_area (window, &target_size);
 | 
			
		||||
  unextend_by_frame (&target_size, info->borders);
 | 
			
		||||
  unextend_by_frame (window, &target_size);
 | 
			
		||||
 | 
			
		||||
  /* Check min size constraints; max size constraints are ignored as for
 | 
			
		||||
   * maximized windows.
 | 
			
		||||
   */
 | 
			
		||||
  get_size_limits (window, info->borders, FALSE, &min_size, &max_size);
 | 
			
		||||
  get_size_limits (window, FALSE, &min_size, &max_size);
 | 
			
		||||
  hminbad = target_size.width < min_size.width;
 | 
			
		||||
  vminbad = target_size.height < min_size.height;
 | 
			
		||||
  if (hminbad || vminbad)
 | 
			
		||||
@@ -953,7 +920,7 @@ constrain_fullscreen (MetaWindow         *window,
 | 
			
		||||
 | 
			
		||||
  monitor = info->entire_monitor;
 | 
			
		||||
 | 
			
		||||
  get_size_limits (window, info->borders, FALSE, &min_size, &max_size);
 | 
			
		||||
  get_size_limits (window, FALSE, &min_size, &max_size);
 | 
			
		||||
  too_big =   !meta_rectangle_could_fit_rect (&monitor, &min_size);
 | 
			
		||||
  too_small = !meta_rectangle_could_fit_rect (&max_size, &monitor);
 | 
			
		||||
  if (too_big || too_small)
 | 
			
		||||
@@ -1062,7 +1029,7 @@ constrain_size_limits (MetaWindow         *window,
 | 
			
		||||
    return TRUE;
 | 
			
		||||
 | 
			
		||||
  /* Determine whether constraint is already satisfied; exit if it is */
 | 
			
		||||
  get_size_limits (window, info->borders, FALSE, &min_size, &max_size);
 | 
			
		||||
  get_size_limits (window, FALSE, &min_size, &max_size);
 | 
			
		||||
  /* We ignore max-size limits for maximized windows; see #327543 */
 | 
			
		||||
  if (window->maximized_horizontally)
 | 
			
		||||
    max_size.width = MAX (max_size.width, info->current.width);
 | 
			
		||||
@@ -1254,8 +1221,8 @@ do_screen_and_monitor_relative_constraints (
 | 
			
		||||
 | 
			
		||||
  /* Determine whether constraint applies; exit if it doesn't */
 | 
			
		||||
  how_far_it_can_be_smushed = info->current;
 | 
			
		||||
  get_size_limits (window, info->borders, TRUE, &min_size, &max_size);
 | 
			
		||||
  extend_by_frame (&info->current, info->borders);
 | 
			
		||||
  get_size_limits (window, TRUE, &min_size, &max_size);
 | 
			
		||||
  extend_by_frame (window, &info->current);
 | 
			
		||||
 | 
			
		||||
  if (info->action_type != ACTION_MOVE)
 | 
			
		||||
    {
 | 
			
		||||
@@ -1275,7 +1242,7 @@ do_screen_and_monitor_relative_constraints (
 | 
			
		||||
                                        &info->current);
 | 
			
		||||
  if (exit_early || constraint_satisfied || check_only)
 | 
			
		||||
    {
 | 
			
		||||
      unextend_by_frame (&info->current, info->borders);
 | 
			
		||||
      unextend_by_frame (window, &info->current);
 | 
			
		||||
      return constraint_satisfied;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -1299,7 +1266,7 @@ do_screen_and_monitor_relative_constraints (
 | 
			
		||||
                                      info->fixed_directions,
 | 
			
		||||
                                      &info->current);
 | 
			
		||||
 | 
			
		||||
  unextend_by_frame (&info->current, info->borders);
 | 
			
		||||
  unextend_by_frame (window, &info->current);
 | 
			
		||||
  return TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -1412,8 +1379,11 @@ constrain_titlebar_visible (MetaWindow         *window,
 | 
			
		||||
   */
 | 
			
		||||
  if (window->frame)
 | 
			
		||||
    {
 | 
			
		||||
      bottom_amount = info->current.height + info->borders->visible.bottom;
 | 
			
		||||
      vert_amount_onscreen = info->borders->visible.top;
 | 
			
		||||
      MetaFrameBorders borders;
 | 
			
		||||
      meta_frame_calc_borders (window->frame, &borders);
 | 
			
		||||
 | 
			
		||||
      bottom_amount = info->current.height + borders.visible.bottom;
 | 
			
		||||
      vert_amount_onscreen = borders.visible.top;
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    bottom_amount = vert_amount_offscreen;
 | 
			
		||||
@@ -1487,8 +1457,11 @@ constrain_partially_onscreen (MetaWindow         *window,
 | 
			
		||||
   */
 | 
			
		||||
  if (window->frame)
 | 
			
		||||
    {
 | 
			
		||||
      bottom_amount = info->current.height + info->borders->visible.bottom;
 | 
			
		||||
      vert_amount_onscreen = info->borders->visible.top;
 | 
			
		||||
      MetaFrameBorders borders;
 | 
			
		||||
      meta_frame_calc_borders (window->frame, &borders);
 | 
			
		||||
 | 
			
		||||
      bottom_amount = info->current.height + borders.visible.bottom;
 | 
			
		||||
      vert_amount_onscreen = borders.visible.top;
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    bottom_amount = vert_amount_offscreen;
 | 
			
		||||
 
 | 
			
		||||
@@ -35,11 +35,11 @@ typedef enum
 | 
			
		||||
  META_DO_GRAVITY_ADJUST    = 1 << 1,
 | 
			
		||||
  META_IS_USER_ACTION       = 1 << 2,
 | 
			
		||||
  META_IS_MOVE_ACTION       = 1 << 3,
 | 
			
		||||
  META_IS_RESIZE_ACTION     = 1 << 4
 | 
			
		||||
  META_IS_RESIZE_ACTION     = 1 << 4,
 | 
			
		||||
  META_IS_WAYLAND_RESIZE    = 1 << 5
 | 
			
		||||
} MetaMoveResizeFlags;
 | 
			
		||||
 | 
			
		||||
void meta_window_constrain (MetaWindow          *window,
 | 
			
		||||
                            MetaFrameBorders    *orig_borders,
 | 
			
		||||
                            MetaMoveResizeFlags  flags,
 | 
			
		||||
                            int                  resize_gravity,
 | 
			
		||||
                            const MetaRectangle *orig,
 | 
			
		||||
 
 | 
			
		||||
@@ -29,6 +29,7 @@
 | 
			
		||||
#include "workspace-private.h"
 | 
			
		||||
#include <meta/prefs.h>
 | 
			
		||||
#include <meta/errors.h>
 | 
			
		||||
#include "util-private.h"
 | 
			
		||||
 | 
			
		||||
/* Looks up the MetaWindow representing the frame of the given X window.
 | 
			
		||||
 * Used as a helper function by a bunch of the functions below.
 | 
			
		||||
@@ -89,7 +90,7 @@ meta_core_get (Display *xdisplay,
 | 
			
		||||
  if (request != META_CORE_WINDOW_HAS_FRAME &&
 | 
			
		||||
      (window == NULL || window->frame == NULL)) {
 | 
			
		||||
    meta_bug ("No such frame window 0x%lx!\n", xwindow);
 | 
			
		||||
    return;
 | 
			
		||||
    goto out;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  while (request != META_CORE_GET_END) {
 | 
			
		||||
@@ -99,7 +100,7 @@ meta_core_get (Display *xdisplay,
 | 
			
		||||
    switch (request) {
 | 
			
		||||
      case META_CORE_WINDOW_HAS_FRAME:
 | 
			
		||||
        *((gboolean*)answer) = window != NULL && window->frame != NULL;
 | 
			
		||||
        if (!*((gboolean*)answer)) return; /* see above */
 | 
			
		||||
        if (!*((gboolean*)answer)) goto out; /* see above */
 | 
			
		||||
        break; 
 | 
			
		||||
      case META_CORE_GET_CLIENT_WIDTH:
 | 
			
		||||
        *((gint*)answer) = window->rect.width;
 | 
			
		||||
@@ -154,12 +155,13 @@ meta_core_get (Display *xdisplay,
 | 
			
		||||
        break;
 | 
			
		||||
 | 
			
		||||
      default:
 | 
			
		||||
        meta_warning(_("Unknown window information request: %d"), request);
 | 
			
		||||
        meta_warning("Unknown window information request: %d\n", request);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    request = va_arg (args, MetaCoreGetType);
 | 
			
		||||
  } 
 | 
			
		||||
 | 
			
		||||
 out:
 | 
			
		||||
  va_end (args);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -170,6 +172,7 @@ meta_core_queue_frame_resize (Display *xdisplay,
 | 
			
		||||
  MetaWindow *window = get_window (xdisplay, frame_xwindow);
 | 
			
		||||
 | 
			
		||||
  meta_window_queue (window, META_QUEUE_MOVE_RESIZE);
 | 
			
		||||
  meta_window_frame_size_changed (window);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
@@ -269,6 +272,8 @@ meta_core_lower_beneath_grab_window (Display *xdisplay,
 | 
			
		||||
  MetaDisplay *display;
 | 
			
		||||
  MetaScreen *screen;
 | 
			
		||||
  MetaWindow *grab_window;
 | 
			
		||||
  MetaStackWindow stack_window;
 | 
			
		||||
  MetaStackWindow stack_sibling;
 | 
			
		||||
 | 
			
		||||
  display = meta_display_for_x_display (xdisplay);
 | 
			
		||||
  screen = meta_display_screen_for_xwindow (display, xwindow);
 | 
			
		||||
@@ -278,12 +283,15 @@ meta_core_lower_beneath_grab_window (Display *xdisplay,
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  changes.stack_mode = Below;
 | 
			
		||||
  changes.sibling = grab_window->frame ? grab_window->frame->xwindow
 | 
			
		||||
                                       : grab_window->xwindow;
 | 
			
		||||
  changes.sibling = meta_window_get_toplevel_xwindow (grab_window);
 | 
			
		||||
 | 
			
		||||
  stack_window.any.type = META_WINDOW_CLIENT_TYPE_X11;
 | 
			
		||||
  stack_window.x11.xwindow = xwindow;
 | 
			
		||||
  stack_sibling.any.type = META_WINDOW_CLIENT_TYPE_X11;
 | 
			
		||||
  stack_sibling.x11.xwindow = changes.sibling;
 | 
			
		||||
  meta_stack_tracker_record_lower_below (screen->stack_tracker,
 | 
			
		||||
                                         xwindow,
 | 
			
		||||
                                         changes.sibling,
 | 
			
		||||
                                         &stack_window,
 | 
			
		||||
                                         &stack_sibling,
 | 
			
		||||
                                         XNextRequest (screen->display->xdisplay));
 | 
			
		||||
 | 
			
		||||
  meta_error_trap_push (display);
 | 
			
		||||
@@ -468,26 +476,6 @@ meta_core_change_workspace (Display *xdisplay,
 | 
			
		||||
                                                                    new_workspace));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
meta_core_get_num_workspaces (Screen  *xscreen)
 | 
			
		||||
{
 | 
			
		||||
  MetaScreen *screen;
 | 
			
		||||
 | 
			
		||||
  screen = meta_screen_for_x_screen (xscreen);
 | 
			
		||||
 | 
			
		||||
  return meta_screen_get_n_workspaces (screen);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
meta_core_get_active_workspace (Screen *xscreen)
 | 
			
		||||
{
 | 
			
		||||
  MetaScreen *screen;
 | 
			
		||||
 | 
			
		||||
  screen = meta_screen_for_x_screen (xscreen);
 | 
			
		||||
 | 
			
		||||
  return meta_workspace_index (screen->active_workspace);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_core_show_window_menu (Display *xdisplay,
 | 
			
		||||
                            Window   frame_xwindow,
 | 
			
		||||
 
 | 
			
		||||
@@ -153,8 +153,6 @@ void meta_core_change_workspace (Display *xdisplay,
 | 
			
		||||
                                 Window   frame_xwindow,
 | 
			
		||||
                                 int      new_workspace);
 | 
			
		||||
 | 
			
		||||
int meta_core_get_num_workspaces (Screen  *xscreen);
 | 
			
		||||
int meta_core_get_active_workspace (Screen *xscreen);
 | 
			
		||||
int meta_core_get_frame_workspace (Display *xdisplay,
 | 
			
		||||
                                   Window frame_xwindow);
 | 
			
		||||
const char* meta_core_get_workspace_name_with_index (Display *xdisplay,
 | 
			
		||||
 
 | 
			
		||||
@@ -25,7 +25,7 @@
 | 
			
		||||
#define _XOPEN_SOURCE /* for kill() */
 | 
			
		||||
 | 
			
		||||
#include <config.h>
 | 
			
		||||
#include <meta/util.h>
 | 
			
		||||
#include "util-private.h"
 | 
			
		||||
#include "window-private.h"
 | 
			
		||||
#include <meta/errors.h>
 | 
			
		||||
#include <meta/workspace.h>
 | 
			
		||||
@@ -43,14 +43,11 @@ static void meta_window_present_delete_dialog (MetaWindow *window,
 | 
			
		||||
                                               guint32     timestamp);
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
delete_ping_reply_func (MetaDisplay *display,
 | 
			
		||||
                        Window       xwindow,
 | 
			
		||||
delete_ping_reply_func (MetaWindow  *window,
 | 
			
		||||
                        guint32      timestamp,
 | 
			
		||||
                        void        *user_data)
 | 
			
		||||
{
 | 
			
		||||
  meta_topic (META_DEBUG_PING,
 | 
			
		||||
              "Got reply to delete ping for %s\n",
 | 
			
		||||
              ((MetaWindow*)user_data)->desc);
 | 
			
		||||
  meta_topic (META_DEBUG_PING, "Got reply to delete ping for %s\n", window->desc);
 | 
			
		||||
 | 
			
		||||
  /* we do nothing */
 | 
			
		||||
}
 | 
			
		||||
@@ -68,12 +65,10 @@ dialog_exited (GPid pid, int status, gpointer user_data)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
delete_ping_timeout_func (MetaDisplay *display,
 | 
			
		||||
                          Window       xwindow,
 | 
			
		||||
delete_ping_timeout_func (MetaWindow  *window,
 | 
			
		||||
                          guint32      timestamp,
 | 
			
		||||
                          void        *user_data)
 | 
			
		||||
{
 | 
			
		||||
  MetaWindow *window = user_data;
 | 
			
		||||
  char *window_title;
 | 
			
		||||
  gchar *window_content, *tmp;
 | 
			
		||||
  GPid dialog_pid;
 | 
			
		||||
@@ -137,12 +132,11 @@ void
 | 
			
		||||
meta_window_check_alive (MetaWindow *window,
 | 
			
		||||
                         guint32     timestamp)
 | 
			
		||||
{
 | 
			
		||||
  meta_display_ping_window (window->display,
 | 
			
		||||
                            window,
 | 
			
		||||
                            timestamp,
 | 
			
		||||
                            delete_ping_reply_func,
 | 
			
		||||
                            delete_ping_timeout_func,
 | 
			
		||||
                            window);
 | 
			
		||||
  meta_window_ping (window,
 | 
			
		||||
                    timestamp,
 | 
			
		||||
                    delete_ping_reply_func,
 | 
			
		||||
                    delete_ping_timeout_func,
 | 
			
		||||
                    NULL);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
 
 | 
			
		||||
@@ -39,6 +39,7 @@
 | 
			
		||||
#include "keybindings-private.h"
 | 
			
		||||
#include <meta/prefs.h>
 | 
			
		||||
#include <meta/barrier.h>
 | 
			
		||||
#include <clutter/clutter.h>
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_STARTUP_NOTIFICATION
 | 
			
		||||
#include <libsn/sn.h>
 | 
			
		||||
@@ -56,11 +57,6 @@ typedef struct _MetaWindowPropHooks MetaWindowPropHooks;
 | 
			
		||||
 | 
			
		||||
typedef struct MetaEdgeResistanceData MetaEdgeResistanceData;
 | 
			
		||||
 | 
			
		||||
typedef void (* MetaWindowPingFunc) (MetaDisplay *display,
 | 
			
		||||
				     Window       xwindow,
 | 
			
		||||
				     guint32      timestamp,
 | 
			
		||||
				     gpointer     user_data);
 | 
			
		||||
 | 
			
		||||
typedef enum {
 | 
			
		||||
  META_LIST_DEFAULT                   = 0,      /* normal windows */
 | 
			
		||||
  META_LIST_INCLUDE_OVERRIDE_REDIRECT = 1 << 0, /* normal and O-R */
 | 
			
		||||
@@ -86,6 +82,14 @@ typedef enum {
 | 
			
		||||
  META_TILE_MAXIMIZED
 | 
			
		||||
} MetaTileMode;
 | 
			
		||||
 | 
			
		||||
typedef enum {
 | 
			
		||||
  META_FOCUS_NONE = 0,
 | 
			
		||||
  META_FOCUS_X_CLIENT = 1,
 | 
			
		||||
  META_FOCUS_WAYLAND_CLIENT = 2,
 | 
			
		||||
  META_FOCUS_NO_FOCUS_WINDOW = 3,
 | 
			
		||||
  META_FOCUS_STAGE = 4
 | 
			
		||||
} MetaFocusType;
 | 
			
		||||
 | 
			
		||||
struct _MetaDisplay
 | 
			
		||||
{
 | 
			
		||||
  GObject parent_instance;
 | 
			
		||||
@@ -93,6 +97,8 @@ struct _MetaDisplay
 | 
			
		||||
  char *name;
 | 
			
		||||
  Display *xdisplay;
 | 
			
		||||
 | 
			
		||||
  int clutter_event_filter;
 | 
			
		||||
 | 
			
		||||
  Window leader_window;
 | 
			
		||||
  Window timestamp_pinging_window;
 | 
			
		||||
 | 
			
		||||
@@ -117,6 +123,7 @@ struct _MetaDisplay
 | 
			
		||||
   * like the no_focus_window or the stage X window. */
 | 
			
		||||
  Window focus_xwindow;
 | 
			
		||||
  gulong focus_serial;
 | 
			
		||||
  MetaFocusType focus_type;
 | 
			
		||||
 | 
			
		||||
  /* last timestamp passed to XSetInputFocus */
 | 
			
		||||
  guint32 last_focus_time;
 | 
			
		||||
@@ -138,6 +145,14 @@ struct _MetaDisplay
 | 
			
		||||
   */
 | 
			
		||||
  guint allow_terminal_deactivation : 1;
 | 
			
		||||
 | 
			
		||||
  /* If true, server->focus_serial refers to us changing the focus; in
 | 
			
		||||
   * this case, we can ignore focus events that have exactly focus_serial,
 | 
			
		||||
   * since we take care to make another request immediately afterwards.
 | 
			
		||||
   * But if focus is being changed by another client, we have to accept
 | 
			
		||||
   * multiple events with the same serial.
 | 
			
		||||
   */
 | 
			
		||||
  guint focused_by_us : 1;
 | 
			
		||||
 | 
			
		||||
  guint static_gravity_works : 1;
 | 
			
		||||
  
 | 
			
		||||
  /*< private-ish >*/
 | 
			
		||||
@@ -145,6 +160,7 @@ struct _MetaDisplay
 | 
			
		||||
  GSList *screens;
 | 
			
		||||
  MetaScreen *active_screen;
 | 
			
		||||
  GHashTable *xids;
 | 
			
		||||
  GHashTable *wayland_windows;
 | 
			
		||||
  int error_traps;
 | 
			
		||||
  int (* error_trap_handler) (Display     *display,
 | 
			
		||||
                              XErrorEvent *error);  
 | 
			
		||||
@@ -169,7 +185,7 @@ struct _MetaDisplay
 | 
			
		||||
  guint32 window_sequence_counter;
 | 
			
		||||
 | 
			
		||||
  /* Pings which we're waiting for a reply from */
 | 
			
		||||
  GSList     *pending_pings;
 | 
			
		||||
  GHashTable *pending_pings;
 | 
			
		||||
 | 
			
		||||
  /* Pending focus change */
 | 
			
		||||
  guint       focus_timeout_id;
 | 
			
		||||
@@ -179,7 +195,7 @@ struct _MetaDisplay
 | 
			
		||||
  MetaWindow* autoraise_window;
 | 
			
		||||
 | 
			
		||||
  /* Alt+click button grabs */
 | 
			
		||||
  unsigned int window_grab_modifiers;
 | 
			
		||||
  ClutterModifierType window_grab_modifiers;
 | 
			
		||||
  
 | 
			
		||||
  /* current window operation */
 | 
			
		||||
  MetaGrabOp  grab_op;
 | 
			
		||||
@@ -371,6 +387,11 @@ void        meta_display_register_x_window   (MetaDisplay *display,
 | 
			
		||||
void        meta_display_unregister_x_window (MetaDisplay *display,
 | 
			
		||||
                                              Window       xwindow);
 | 
			
		||||
 | 
			
		||||
void        meta_display_register_wayland_window   (MetaDisplay *display,
 | 
			
		||||
                                                    MetaWindow  *window);
 | 
			
		||||
void        meta_display_unregister_wayland_window (MetaDisplay *display,
 | 
			
		||||
                                                    MetaWindow  *window);
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_XSYNC
 | 
			
		||||
MetaWindow* meta_display_lookup_sync_alarm     (MetaDisplay *display,
 | 
			
		||||
                                                XSyncAlarm   alarm);
 | 
			
		||||
@@ -430,15 +451,6 @@ void meta_display_retheme_all (void);
 | 
			
		||||
void meta_display_set_cursor_theme (const char *theme, 
 | 
			
		||||
				    int         size);
 | 
			
		||||
 | 
			
		||||
void meta_display_ping_window      (MetaDisplay        *display,
 | 
			
		||||
                                    MetaWindow         *window,
 | 
			
		||||
                                    guint32             timestamp,
 | 
			
		||||
                                    MetaWindowPingFunc  ping_reply_func,
 | 
			
		||||
                                    MetaWindowPingFunc  ping_timeout_func,
 | 
			
		||||
                                    void               *user_data);
 | 
			
		||||
gboolean meta_display_window_has_pending_pings (MetaDisplay        *display,
 | 
			
		||||
						MetaWindow         *window);
 | 
			
		||||
 | 
			
		||||
int meta_resize_gravity_from_grab_op (MetaGrabOp op);
 | 
			
		||||
 | 
			
		||||
gboolean meta_grab_op_is_moving   (MetaGrabOp op);
 | 
			
		||||
@@ -458,23 +470,23 @@ void meta_display_queue_autoraise_callback  (MetaDisplay *display,
 | 
			
		||||
void meta_display_remove_autoraise_callback (MetaDisplay *display);
 | 
			
		||||
 | 
			
		||||
void meta_display_overlay_key_activate (MetaDisplay *display);
 | 
			
		||||
void meta_display_accelerator_activate (MetaDisplay *display,
 | 
			
		||||
                                        guint        action,
 | 
			
		||||
                                        guint        deviceid,
 | 
			
		||||
                                        guint        timestamp);
 | 
			
		||||
void meta_display_accelerator_activate (MetaDisplay     *display,
 | 
			
		||||
                                        guint            action,
 | 
			
		||||
                                        ClutterKeyEvent *event);
 | 
			
		||||
gboolean meta_display_modifiers_accelerator_activate (MetaDisplay *display);
 | 
			
		||||
 | 
			
		||||
/* In above-tab-keycode.c */
 | 
			
		||||
guint meta_display_get_above_tab_keycode (MetaDisplay *display);
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_XI23
 | 
			
		||||
gboolean meta_display_process_barrier_event (MetaDisplay    *display,
 | 
			
		||||
                                             XIBarrierEvent *event);
 | 
			
		||||
gboolean meta_display_process_barrier_event (MetaDisplay *display,
 | 
			
		||||
                                             XIEvent     *event);
 | 
			
		||||
#endif /* HAVE_XI23 */
 | 
			
		||||
 | 
			
		||||
void meta_display_set_input_focus_xwindow (MetaDisplay *display,
 | 
			
		||||
                                           MetaScreen  *screen,
 | 
			
		||||
                                           Window       window,
 | 
			
		||||
                                           guint32      timestamp);
 | 
			
		||||
void meta_display_set_input_focus_xwindow (MetaDisplay   *display,
 | 
			
		||||
                                           MetaScreen    *screen,
 | 
			
		||||
                                           MetaFocusType  type,
 | 
			
		||||
                                           Window         window,
 | 
			
		||||
                                           guint32        timestamp);
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										3075
									
								
								src/core/display.c
									
									
									
									
									
								
							
							
						
						
									
										3075
									
								
								src/core/display.c
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -985,7 +985,7 @@ compute_resistance_and_snapping_edges (MetaDisplay *display)
 | 
			
		||||
        {
 | 
			
		||||
          MetaRectangle *new_rect;
 | 
			
		||||
          new_rect = g_new (MetaRectangle, 1);
 | 
			
		||||
          meta_window_get_outer_rect (cur_window, new_rect);
 | 
			
		||||
          meta_window_get_frame_rect (cur_window, new_rect);
 | 
			
		||||
          obscuring_windows = g_slist_prepend (obscuring_windows, new_rect);
 | 
			
		||||
          window_stacking = 
 | 
			
		||||
            g_slist_prepend (window_stacking, GINT_TO_POINTER (stack_position));
 | 
			
		||||
@@ -1010,7 +1010,7 @@ compute_resistance_and_snapping_edges (MetaDisplay *display)
 | 
			
		||||
    {
 | 
			
		||||
      MetaRectangle  cur_rect;
 | 
			
		||||
      MetaWindow    *cur_window = cur_window_iter->data;
 | 
			
		||||
      meta_window_get_outer_rect (cur_window, &cur_rect);
 | 
			
		||||
      meta_window_get_frame_rect (cur_window, &cur_rect);
 | 
			
		||||
 | 
			
		||||
      /* Check if we want to use this window's edges for edge
 | 
			
		||||
       * resistance (note that dock edges are considered screen edges
 | 
			
		||||
@@ -1151,7 +1151,7 @@ meta_window_edge_resistance_for_move (MetaWindow  *window,
 | 
			
		||||
  MetaRectangle old_outer, proposed_outer, new_outer;
 | 
			
		||||
  gboolean is_resize;
 | 
			
		||||
 | 
			
		||||
  meta_window_get_outer_rect (window, &old_outer);
 | 
			
		||||
  meta_window_get_frame_rect (window, &old_outer);
 | 
			
		||||
 | 
			
		||||
  proposed_outer = old_outer;
 | 
			
		||||
  proposed_outer.x += (*new_x - old_x);
 | 
			
		||||
@@ -1237,7 +1237,7 @@ meta_window_edge_resistance_for_resize (MetaWindow  *window,
 | 
			
		||||
  int proposed_outer_width, proposed_outer_height;
 | 
			
		||||
  gboolean is_resize;
 | 
			
		||||
 | 
			
		||||
  meta_window_get_outer_rect (window, &old_outer);
 | 
			
		||||
  meta_window_get_frame_rect (window, &old_outer);
 | 
			
		||||
  proposed_outer_width  = old_outer.width  + (*new_width  - old_width);
 | 
			
		||||
  proposed_outer_height = old_outer.height + (*new_height - old_height);
 | 
			
		||||
  meta_rectangle_resize_with_gravity (&old_outer, 
 | 
			
		||||
 
 | 
			
		||||
@@ -47,6 +47,7 @@ meta_window_ensure_frame (MetaWindow *window)
 | 
			
		||||
  XSetWindowAttributes attrs;
 | 
			
		||||
  Visual *visual;
 | 
			
		||||
  gulong create_serial;
 | 
			
		||||
  MetaStackWindow stack_window;
 | 
			
		||||
  
 | 
			
		||||
  if (window->frame)
 | 
			
		||||
    return;
 | 
			
		||||
@@ -68,6 +69,7 @@ meta_window_ensure_frame (MetaWindow *window)
 | 
			
		||||
 | 
			
		||||
  frame->mapped = FALSE;
 | 
			
		||||
  frame->is_flashing = FALSE;
 | 
			
		||||
  frame->borders_cached = FALSE;
 | 
			
		||||
  
 | 
			
		||||
  meta_verbose ("Framing window %s: visual %s default, depth %d default depth %d\n",
 | 
			
		||||
                window->desc,
 | 
			
		||||
@@ -105,8 +107,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);
 | 
			
		||||
@@ -138,8 +142,9 @@ meta_window_ensure_frame (MetaWindow *window)
 | 
			
		||||
  window->rect.x = 0;
 | 
			
		||||
  window->rect.y = 0;
 | 
			
		||||
 | 
			
		||||
  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,
 | 
			
		||||
@@ -174,6 +179,7 @@ meta_window_destroy_frame (MetaWindow *window)
 | 
			
		||||
{
 | 
			
		||||
  MetaFrame *frame;
 | 
			
		||||
  MetaFrameBorders borders;
 | 
			
		||||
  MetaStackWindow stack_window;
 | 
			
		||||
  
 | 
			
		||||
  if (window->frame == NULL)
 | 
			
		||||
    return;
 | 
			
		||||
@@ -200,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,
 | 
			
		||||
@@ -327,9 +335,23 @@ meta_frame_calc_borders (MetaFrame        *frame,
 | 
			
		||||
  if (frame == NULL)
 | 
			
		||||
    meta_frame_borders_clear (borders);
 | 
			
		||||
  else
 | 
			
		||||
    meta_ui_get_frame_borders (frame->window->screen->ui,
 | 
			
		||||
                               frame->xwindow,
 | 
			
		||||
                               borders);
 | 
			
		||||
    {
 | 
			
		||||
      if (!frame->borders_cached)
 | 
			
		||||
        {
 | 
			
		||||
          meta_ui_get_frame_borders (frame->window->screen->ui,
 | 
			
		||||
                                     frame->xwindow,
 | 
			
		||||
                                     &frame->cached_borders);
 | 
			
		||||
          frame->borders_cached = TRUE;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      *borders = frame->cached_borders;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_frame_clear_cached_borders (MetaFrame *frame)
 | 
			
		||||
{
 | 
			
		||||
  frame->borders_cached = FALSE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
gboolean
 | 
			
		||||
 
 | 
			
		||||
@@ -41,6 +41,8 @@ struct _MetaFrame
 | 
			
		||||
   */
 | 
			
		||||
  MetaRectangle rect;
 | 
			
		||||
 | 
			
		||||
  MetaFrameBorders cached_borders; /* valid if borders_cached is set */
 | 
			
		||||
 | 
			
		||||
  /* position of client, size of frame */
 | 
			
		||||
  int child_x;
 | 
			
		||||
  int child_y;
 | 
			
		||||
@@ -50,6 +52,7 @@ struct _MetaFrame
 | 
			
		||||
  guint mapped : 1;
 | 
			
		||||
  guint need_reapply_frame_shape : 1;
 | 
			
		||||
  guint is_flashing : 1; /* used by the visual bell flash */
 | 
			
		||||
  guint borders_cached : 1;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
void     meta_window_ensure_frame           (MetaWindow *window);
 | 
			
		||||
@@ -68,6 +71,8 @@ gboolean meta_frame_sync_to_window (MetaFrame         *frame,
 | 
			
		||||
                                    gboolean           need_move,
 | 
			
		||||
                                    gboolean           need_resize);
 | 
			
		||||
 | 
			
		||||
void meta_frame_clear_cached_borders (MetaFrame *frame);
 | 
			
		||||
 | 
			
		||||
cairo_region_t *meta_frame_get_frame_bounds (MetaFrame *frame);
 | 
			
		||||
 | 
			
		||||
void meta_frame_get_mask (MetaFrame *frame,
 | 
			
		||||
 
 | 
			
		||||
@@ -66,9 +66,9 @@ gboolean meta_window_grab_all_keys          (MetaWindow  *window,
 | 
			
		||||
                                             guint32      timestamp);
 | 
			
		||||
void     meta_window_ungrab_all_keys        (MetaWindow  *window,
 | 
			
		||||
                                             guint32      timestamp);
 | 
			
		||||
gboolean meta_display_process_key_event     (MetaDisplay   *display,
 | 
			
		||||
                                             MetaWindow    *window,
 | 
			
		||||
                                             XIDeviceEvent *event);
 | 
			
		||||
gboolean meta_display_process_key_event     (MetaDisplay     *display,
 | 
			
		||||
                                             MetaWindow      *window,
 | 
			
		||||
                                             ClutterKeyEvent *event);
 | 
			
		||||
void     meta_display_process_mapping_event (MetaDisplay *display,
 | 
			
		||||
                                             XEvent      *event);
 | 
			
		||||
 | 
			
		||||
@@ -81,7 +81,3 @@ gboolean meta_prefs_remove_keybinding       (const char    *name);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -48,15 +48,17 @@
 | 
			
		||||
 | 
			
		||||
#include <config.h>
 | 
			
		||||
#include <meta/main.h>
 | 
			
		||||
#include <meta/util.h>
 | 
			
		||||
#include "util-private.h"
 | 
			
		||||
#include "display-private.h"
 | 
			
		||||
#include <meta/errors.h>
 | 
			
		||||
#include "ui.h"
 | 
			
		||||
#include "session.h"
 | 
			
		||||
#include <meta/prefs.h>
 | 
			
		||||
#include <meta/compositor.h>
 | 
			
		||||
#include "meta-wayland-private.h"
 | 
			
		||||
 | 
			
		||||
#include <glib-object.h>
 | 
			
		||||
#include <glib-unix.h>
 | 
			
		||||
#include <gdk/gdkx.h>
 | 
			
		||||
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
@@ -189,6 +191,7 @@ static gchar    *opt_client_id;
 | 
			
		||||
static gboolean  opt_replace_wm;
 | 
			
		||||
static gboolean  opt_disable_sm;
 | 
			
		||||
static gboolean  opt_sync;
 | 
			
		||||
static gboolean  opt_wayland;
 | 
			
		||||
 | 
			
		||||
static GOptionEntry meta_options[] = {
 | 
			
		||||
  {
 | 
			
		||||
@@ -226,6 +229,12 @@ static GOptionEntry meta_options[] = {
 | 
			
		||||
    N_("Make X calls synchronous"),
 | 
			
		||||
    NULL
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    "wayland", 0, 0, G_OPTION_ARG_NONE,
 | 
			
		||||
    &opt_wayland,
 | 
			
		||||
    N_("Run as a wayland compositor"),
 | 
			
		||||
    NULL
 | 
			
		||||
  },
 | 
			
		||||
  {NULL}
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@@ -247,6 +256,14 @@ meta_get_option_context (void)
 | 
			
		||||
  bindtextdomain (GETTEXT_PACKAGE, MUTTER_LOCALEDIR);
 | 
			
		||||
  bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
 | 
			
		||||
 | 
			
		||||
  /* We must set the windowing backend here, because Clutter creates the backend
 | 
			
		||||
     object when the first call is made.
 | 
			
		||||
 | 
			
		||||
     We consider running from mutter-launch equivalent to running from bare metal.
 | 
			
		||||
  */
 | 
			
		||||
  if (getenv ("WESTON_LAUNCHER_SOCK"))
 | 
			
		||||
    clutter_set_windowing_backend (CLUTTER_WINDOWING_EGL);
 | 
			
		||||
 | 
			
		||||
  ctx = g_option_context_new (NULL);
 | 
			
		||||
  g_option_context_add_main_entries (ctx, meta_options, GETTEXT_PACKAGE);
 | 
			
		||||
  g_option_context_add_group (ctx, clutter_get_option_group_without_init ());
 | 
			
		||||
@@ -346,28 +363,17 @@ meta_finalize (void)
 | 
			
		||||
  if (display)
 | 
			
		||||
    meta_display_close (display,
 | 
			
		||||
                        CurrentTime); /* I doubt correct timestamps matter here */
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int sigterm_pipe_fds[2] = { -1, -1 };
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
sigterm_handler (int signum)
 | 
			
		||||
{
 | 
			
		||||
  if (sigterm_pipe_fds[1] >= 0)
 | 
			
		||||
    {
 | 
			
		||||
      int G_GNUC_UNUSED dummy;
 | 
			
		||||
 | 
			
		||||
      dummy = write (sigterm_pipe_fds[1], "", 1);
 | 
			
		||||
      close (sigterm_pipe_fds[1]);
 | 
			
		||||
      sigterm_pipe_fds[1] = -1;
 | 
			
		||||
    }
 | 
			
		||||
  if (meta_is_wayland_compositor ())
 | 
			
		||||
    meta_wayland_finalize ();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static gboolean
 | 
			
		||||
on_sigterm (void)
 | 
			
		||||
on_sigterm (gpointer user_data)
 | 
			
		||||
{
 | 
			
		||||
  meta_quit (META_EXIT_SUCCESS);
 | 
			
		||||
  return FALSE;
 | 
			
		||||
  meta_quit (EXIT_SUCCESS);
 | 
			
		||||
 | 
			
		||||
  return G_SOURCE_REMOVE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
@@ -381,7 +387,6 @@ meta_init (void)
 | 
			
		||||
{
 | 
			
		||||
  struct sigaction act;
 | 
			
		||||
  sigset_t empty_mask;
 | 
			
		||||
  GIOChannel *channel;
 | 
			
		||||
  
 | 
			
		||||
  sigemptyset (&empty_mask);
 | 
			
		||||
  act.sa_handler = SIG_IGN;
 | 
			
		||||
@@ -396,26 +401,15 @@ meta_init (void)
 | 
			
		||||
                g_strerror (errno));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
  if (pipe (sigterm_pipe_fds) != 0)
 | 
			
		||||
    g_printerr ("Failed to create SIGTERM pipe: %s\n",
 | 
			
		||||
                g_strerror (errno));
 | 
			
		||||
 | 
			
		||||
  channel = g_io_channel_unix_new (sigterm_pipe_fds[0]);
 | 
			
		||||
  g_io_channel_set_flags (channel, G_IO_FLAG_NONBLOCK, NULL);
 | 
			
		||||
  g_io_add_watch (channel, G_IO_IN, (GIOFunc) on_sigterm, NULL);
 | 
			
		||||
  g_io_channel_set_close_on_unref (channel, TRUE);
 | 
			
		||||
  g_io_channel_unref (channel);
 | 
			
		||||
 | 
			
		||||
  act.sa_handler = &sigterm_handler;
 | 
			
		||||
  if (sigaction (SIGTERM, &act, NULL) < 0)
 | 
			
		||||
    g_printerr ("Failed to register SIGTERM handler: %s\n",
 | 
			
		||||
		g_strerror (errno));
 | 
			
		||||
  g_unix_signal_add (SIGTERM, on_sigterm, NULL);
 | 
			
		||||
 | 
			
		||||
  if (g_getenv ("MUTTER_VERBOSE"))
 | 
			
		||||
    meta_set_verbose (TRUE);
 | 
			
		||||
  if (g_getenv ("MUTTER_DEBUG"))
 | 
			
		||||
    meta_set_debugging (TRUE);
 | 
			
		||||
 | 
			
		||||
  meta_set_is_wayland_compositor (opt_wayland);
 | 
			
		||||
 | 
			
		||||
  if (g_get_home_dir ())
 | 
			
		||||
    if (chdir (g_get_home_dir ()) < 0)
 | 
			
		||||
      meta_warning ("Could not change to home directory %s.\n",
 | 
			
		||||
@@ -427,9 +421,16 @@ meta_init (void)
 | 
			
		||||
  g_irepository_prepend_search_path (MUTTER_PKGLIBDIR);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
  meta_set_syncing (opt_sync || (g_getenv ("MUTTER_SYNC") != NULL));
 | 
			
		||||
  if (meta_is_wayland_compositor ())
 | 
			
		||||
    {
 | 
			
		||||
      /* NB: When running as a hybrid wayland compositor we run our own headless X
 | 
			
		||||
       * server so the user can't control the X display to connect too. */
 | 
			
		||||
      meta_wayland_init ();
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    meta_select_display (opt_display_name);
 | 
			
		||||
 | 
			
		||||
  meta_select_display (opt_display_name);
 | 
			
		||||
  meta_set_syncing (opt_sync || (g_getenv ("MUTTER_SYNC") != NULL));
 | 
			
		||||
  
 | 
			
		||||
  if (opt_replace_wm)
 | 
			
		||||
    meta_set_replace_current_wm (TRUE);
 | 
			
		||||
@@ -441,10 +442,17 @@ meta_init (void)
 | 
			
		||||
  
 | 
			
		||||
  meta_ui_init ();
 | 
			
		||||
 | 
			
		||||
  /*
 | 
			
		||||
   * Clutter can only be initialized after the UI.
 | 
			
		||||
   */
 | 
			
		||||
  meta_clutter_init ();
 | 
			
		||||
  /* If we are running with wayland then we don't wait until we have
 | 
			
		||||
   * an X connection before initializing clutter we instead initialize
 | 
			
		||||
   * it earlier since we need to initialize the GL driver so the driver
 | 
			
		||||
   * can register any needed wayland extensions. */
 | 
			
		||||
  if (!meta_is_wayland_compositor ())
 | 
			
		||||
    {
 | 
			
		||||
      /*
 | 
			
		||||
       * Clutter can only be initialized after the UI.
 | 
			
		||||
       */
 | 
			
		||||
      meta_clutter_init ();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										48
									
								
								src/core/meta-cursor-tracker-private.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								src/core/meta-cursor-tracker-private.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,48 @@
 | 
			
		||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright 2013 Red Hat, Inc.
 | 
			
		||||
 *
 | 
			
		||||
 * This program is free software; you can redistribute it and/or
 | 
			
		||||
 * modify it under the terms of the GNU General Public License as
 | 
			
		||||
 * published by the Free Software Foundation; either version 2 of the
 | 
			
		||||
 * License, or (at your option) any later version.
 | 
			
		||||
 *
 | 
			
		||||
 * This program is distributed in the hope that it will be useful, but
 | 
			
		||||
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 | 
			
		||||
 * General Public License for more details.
 | 
			
		||||
 *
 | 
			
		||||
 * You should have received a copy of the GNU General Public License
 | 
			
		||||
 * along with this program; if not, write to the Free Software
 | 
			
		||||
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 | 
			
		||||
 * 02111-1307, USA.
 | 
			
		||||
 *
 | 
			
		||||
 * Author: Giovanni Campagna <gcampagn@redhat.com>
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef META_CURSOR_TRACKER_PRIVATE_H
 | 
			
		||||
#define META_CURSOR_TRACKER_PRIVATE_H
 | 
			
		||||
 | 
			
		||||
#include <meta/meta-cursor-tracker.h>
 | 
			
		||||
#include <wayland-server.h>
 | 
			
		||||
#include <clutter/clutter.h>
 | 
			
		||||
 | 
			
		||||
gboolean meta_cursor_tracker_handle_xevent (MetaCursorTracker *tracker,
 | 
			
		||||
					    XEvent            *xevent);
 | 
			
		||||
 | 
			
		||||
void     meta_cursor_tracker_set_grab_cursor     (MetaCursorTracker  *tracker,
 | 
			
		||||
                                                  MetaCursor          cursor);
 | 
			
		||||
void     meta_cursor_tracker_set_window_cursor   (MetaCursorTracker  *tracker,
 | 
			
		||||
                                                  struct wl_resource *buffer,
 | 
			
		||||
                                                  int                 hot_x,
 | 
			
		||||
                                                  int                 hot_y);
 | 
			
		||||
void     meta_cursor_tracker_unset_window_cursor (MetaCursorTracker  *tracker);
 | 
			
		||||
void     meta_cursor_tracker_set_root_cursor     (MetaCursorTracker  *tracker,
 | 
			
		||||
                                                  MetaCursor          cursor);
 | 
			
		||||
 | 
			
		||||
void     meta_cursor_tracker_update_position (MetaCursorTracker *tracker,
 | 
			
		||||
					      int                new_x,
 | 
			
		||||
					      int                new_y);
 | 
			
		||||
void     meta_cursor_tracker_paint           (MetaCursorTracker *tracker);
 | 
			
		||||
#endif
 | 
			
		||||
							
								
								
									
										1185
									
								
								src/core/meta-cursor-tracker.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1185
									
								
								src/core/meta-cursor-tracker.c
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										31
									
								
								src/core/meta-idle-monitor-private.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								src/core/meta-idle-monitor-private.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,31 @@
 | 
			
		||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
 | 
			
		||||
 | 
			
		||||
/* 
 | 
			
		||||
 * Copyright 2013 Red Hat, Inc.
 | 
			
		||||
 * 
 | 
			
		||||
 * This program is free software; you can redistribute it and/or
 | 
			
		||||
 * modify it under the terms of the GNU General Public License as
 | 
			
		||||
 * published by the Free Software Foundation; either version 2 of the
 | 
			
		||||
 * License, or (at your option) any later version.
 | 
			
		||||
 *
 | 
			
		||||
 * This program is distributed in the hope that it will be useful, but
 | 
			
		||||
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 | 
			
		||||
 * General Public License for more details.
 | 
			
		||||
 * 
 | 
			
		||||
 * You should have received a copy of the GNU General Public License
 | 
			
		||||
 * along with this program; if not, write to the Free Software
 | 
			
		||||
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 | 
			
		||||
 * 02111-1307, USA.
 | 
			
		||||
 *
 | 
			
		||||
 * Adapted from gnome-session/gnome-session/gs-idle-monitor.c and
 | 
			
		||||
 *         from gnome-desktop/libgnome-desktop/gnome-idle-monitor.c
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <meta/meta-idle-monitor.h>
 | 
			
		||||
 | 
			
		||||
void meta_idle_monitor_handle_xevent_all (XEvent *xevent);
 | 
			
		||||
 | 
			
		||||
void meta_idle_monitor_reset_idletime (MetaIdleMonitor *monitor);
 | 
			
		||||
 | 
			
		||||
void meta_idle_monitor_init_dbus (void);
 | 
			
		||||
							
								
								
									
										996
									
								
								src/core/meta-idle-monitor.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										996
									
								
								src/core/meta-idle-monitor.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,996 @@
 | 
			
		||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
 | 
			
		||||
 | 
			
		||||
/* 
 | 
			
		||||
 * Copyright 2013 Red Hat, Inc.
 | 
			
		||||
 * 
 | 
			
		||||
 * This program is free software; you can redistribute it and/or
 | 
			
		||||
 * modify it under the terms of the GNU General Public License as
 | 
			
		||||
 * published by the Free Software Foundation; either version 2 of the
 | 
			
		||||
 * License, or (at your option) any later version.
 | 
			
		||||
 *
 | 
			
		||||
 * This program is distributed in the hope that it will be useful, but
 | 
			
		||||
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 | 
			
		||||
 * General Public License for more details.
 | 
			
		||||
 * 
 | 
			
		||||
 * You should have received a copy of the GNU General Public License
 | 
			
		||||
 * along with this program; if not, write to the Free Software
 | 
			
		||||
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 | 
			
		||||
 * 02111-1307, USA.
 | 
			
		||||
 *
 | 
			
		||||
 * Adapted from gnome-session/gnome-session/gs-idle-monitor.c and
 | 
			
		||||
 *         from gnome-desktop/libgnome-desktop/gnome-idle-monitor.c
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * SECTION:idle-monitor
 | 
			
		||||
 * @title: MetaIdleMonitor
 | 
			
		||||
 * @short_description: Mutter idle counter (similar to X's IDLETIME)
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "config.h"
 | 
			
		||||
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include <clutter/clutter.h>
 | 
			
		||||
#include <X11/Xlib.h>
 | 
			
		||||
#include <X11/extensions/sync.h>
 | 
			
		||||
 | 
			
		||||
#include <meta/util.h>
 | 
			
		||||
#include <meta/main.h>
 | 
			
		||||
#include <meta/meta-idle-monitor.h>
 | 
			
		||||
#include "display-private.h"
 | 
			
		||||
#include "meta-idle-monitor-private.h"
 | 
			
		||||
#include "meta-dbus-idle-monitor.h"
 | 
			
		||||
 | 
			
		||||
G_STATIC_ASSERT(sizeof(unsigned long) == sizeof(gpointer));
 | 
			
		||||
 | 
			
		||||
struct _MetaIdleMonitor
 | 
			
		||||
{
 | 
			
		||||
  GObject parent_instance;
 | 
			
		||||
 | 
			
		||||
  GHashTable  *watches;
 | 
			
		||||
  GHashTable  *alarms;
 | 
			
		||||
  int          device_id;
 | 
			
		||||
 | 
			
		||||
  /* X11 implementation */
 | 
			
		||||
  Display     *display;
 | 
			
		||||
  int          sync_event_base;
 | 
			
		||||
  XSyncCounter counter;
 | 
			
		||||
  XSyncAlarm   user_active_alarm;
 | 
			
		||||
 | 
			
		||||
  /* Wayland implementation */
 | 
			
		||||
  guint64      last_event_time;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct _MetaIdleMonitorClass
 | 
			
		||||
{
 | 
			
		||||
  GObjectClass parent_class;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef struct
 | 
			
		||||
{
 | 
			
		||||
  MetaIdleMonitor          *monitor;
 | 
			
		||||
  guint	                    id;
 | 
			
		||||
  MetaIdleMonitorWatchFunc  callback;
 | 
			
		||||
  gpointer		    user_data;
 | 
			
		||||
  GDestroyNotify            notify;
 | 
			
		||||
  guint64                   timeout_msec;
 | 
			
		||||
 | 
			
		||||
  /* x11 */
 | 
			
		||||
  XSyncAlarm                xalarm;
 | 
			
		||||
  int                       idle_source_id;
 | 
			
		||||
 | 
			
		||||
  /* wayland */
 | 
			
		||||
  GSource                  *timeout_source;
 | 
			
		||||
} MetaIdleMonitorWatch;
 | 
			
		||||
 | 
			
		||||
enum
 | 
			
		||||
{
 | 
			
		||||
  PROP_0,
 | 
			
		||||
  PROP_DEVICE_ID,
 | 
			
		||||
  PROP_LAST,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static GParamSpec *obj_props[PROP_LAST];
 | 
			
		||||
 | 
			
		||||
G_DEFINE_TYPE (MetaIdleMonitor, meta_idle_monitor, G_TYPE_OBJECT)
 | 
			
		||||
 | 
			
		||||
static MetaIdleMonitor *device_monitors[256];
 | 
			
		||||
static int              device_id_max;
 | 
			
		||||
 | 
			
		||||
static gint64
 | 
			
		||||
_xsyncvalue_to_int64 (XSyncValue value)
 | 
			
		||||
{
 | 
			
		||||
  return ((guint64) XSyncValueHigh32 (value)) << 32
 | 
			
		||||
    | (guint64) XSyncValueLow32 (value);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#define GUINT64_TO_XSYNCVALUE(value, ret) XSyncIntsToValue (ret, (value) & 0xFFFFFFFF, ((guint64)(value)) >> 32)
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
fire_watch (MetaIdleMonitorWatch *watch)
 | 
			
		||||
{
 | 
			
		||||
  MetaIdleMonitor *monitor;
 | 
			
		||||
  guint id;
 | 
			
		||||
  gboolean is_user_active_watch;
 | 
			
		||||
 | 
			
		||||
  monitor = watch->monitor;
 | 
			
		||||
  g_object_ref (monitor);
 | 
			
		||||
 | 
			
		||||
  if (watch->idle_source_id)
 | 
			
		||||
    {
 | 
			
		||||
      g_source_remove (watch->idle_source_id);
 | 
			
		||||
      watch->idle_source_id = 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  id = watch->id;
 | 
			
		||||
  is_user_active_watch = (watch->timeout_msec == 0);
 | 
			
		||||
 | 
			
		||||
  if (watch->callback)
 | 
			
		||||
    watch->callback (monitor, id, watch->user_data);
 | 
			
		||||
 | 
			
		||||
  if (is_user_active_watch)
 | 
			
		||||
    meta_idle_monitor_remove_watch (monitor, id);
 | 
			
		||||
 | 
			
		||||
  g_object_unref (monitor);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static XSyncAlarm
 | 
			
		||||
_xsync_alarm_set (MetaIdleMonitor	*monitor,
 | 
			
		||||
		  XSyncTestType          test_type,
 | 
			
		||||
		  guint64                interval,
 | 
			
		||||
		  gboolean               want_events)
 | 
			
		||||
{
 | 
			
		||||
  XSyncAlarmAttributes attr;
 | 
			
		||||
  XSyncValue	     delta;
 | 
			
		||||
  guint		     flags;
 | 
			
		||||
 | 
			
		||||
  flags = XSyncCACounter | XSyncCAValueType | XSyncCATestType |
 | 
			
		||||
    XSyncCAValue | XSyncCADelta | XSyncCAEvents;
 | 
			
		||||
 | 
			
		||||
  XSyncIntToValue (&delta, 0);
 | 
			
		||||
  attr.trigger.counter = monitor->counter;
 | 
			
		||||
  attr.trigger.value_type = XSyncAbsolute;
 | 
			
		||||
  attr.delta = delta;
 | 
			
		||||
  attr.events = want_events;
 | 
			
		||||
 | 
			
		||||
  GUINT64_TO_XSYNCVALUE (interval, &attr.trigger.wait_value);
 | 
			
		||||
  attr.trigger.test_type = test_type;
 | 
			
		||||
  return XSyncCreateAlarm (monitor->display, flags, &attr);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
ensure_alarm_rescheduled (Display    *dpy,
 | 
			
		||||
			  XSyncAlarm  alarm)
 | 
			
		||||
{
 | 
			
		||||
  XSyncAlarmAttributes attr;
 | 
			
		||||
 | 
			
		||||
  /* Some versions of Xorg have an issue where alarms aren't
 | 
			
		||||
   * always rescheduled. Calling XSyncChangeAlarm, even
 | 
			
		||||
   * without any attributes, will reschedule the alarm. */
 | 
			
		||||
  XSyncChangeAlarm (dpy, alarm, 0, &attr);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
set_alarm_enabled (Display    *dpy,
 | 
			
		||||
		   XSyncAlarm  alarm,
 | 
			
		||||
		   gboolean    enabled)
 | 
			
		||||
{
 | 
			
		||||
  XSyncAlarmAttributes attr;
 | 
			
		||||
  attr.events = enabled;
 | 
			
		||||
  XSyncChangeAlarm (dpy, alarm, XSyncCAEvents, &attr);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
check_x11_watch (gpointer data,
 | 
			
		||||
                 gpointer user_data)
 | 
			
		||||
{
 | 
			
		||||
  MetaIdleMonitorWatch *watch = data;
 | 
			
		||||
  XSyncAlarm alarm = (XSyncAlarm) user_data;
 | 
			
		||||
 | 
			
		||||
  if (watch->xalarm != alarm)
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  fire_watch (watch);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_idle_monitor_handle_xevent (MetaIdleMonitor       *monitor,
 | 
			
		||||
                                 XSyncAlarmNotifyEvent *alarm_event)
 | 
			
		||||
{
 | 
			
		||||
  XSyncAlarm alarm;
 | 
			
		||||
  GList *watches;
 | 
			
		||||
  gboolean has_alarm;
 | 
			
		||||
 | 
			
		||||
  if (alarm_event->state != XSyncAlarmActive)
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  alarm = alarm_event->alarm;
 | 
			
		||||
 | 
			
		||||
  has_alarm = FALSE;
 | 
			
		||||
 | 
			
		||||
  if (alarm == monitor->user_active_alarm)
 | 
			
		||||
    {
 | 
			
		||||
      set_alarm_enabled (monitor->display,
 | 
			
		||||
                         alarm,
 | 
			
		||||
                         FALSE);
 | 
			
		||||
      has_alarm = TRUE;
 | 
			
		||||
    }
 | 
			
		||||
  else if (g_hash_table_contains (monitor->alarms, (gpointer) alarm))
 | 
			
		||||
    {
 | 
			
		||||
      ensure_alarm_rescheduled (monitor->display,
 | 
			
		||||
                                alarm);
 | 
			
		||||
      has_alarm = TRUE;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  if (has_alarm)
 | 
			
		||||
    {
 | 
			
		||||
      watches = g_hash_table_get_values (monitor->watches);
 | 
			
		||||
 | 
			
		||||
      g_list_foreach (watches, check_x11_watch, (gpointer) alarm);
 | 
			
		||||
      g_list_free (watches);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_idle_monitor_handle_xevent_all (XEvent *xevent)
 | 
			
		||||
{
 | 
			
		||||
  int i;
 | 
			
		||||
 | 
			
		||||
  for (i = 0; i <= device_id_max; i++)
 | 
			
		||||
    if (device_monitors[i])
 | 
			
		||||
      meta_idle_monitor_handle_xevent (device_monitors[i], (XSyncAlarmNotifyEvent*)xevent);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static char *
 | 
			
		||||
counter_name_for_device (int device_id)
 | 
			
		||||
{
 | 
			
		||||
  if (device_id > 0)
 | 
			
		||||
    return g_strdup_printf ("DEVICEIDLETIME %d", device_id);
 | 
			
		||||
 | 
			
		||||
  return g_strdup ("IDLETIME");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static XSyncCounter
 | 
			
		||||
find_idletime_counter (MetaIdleMonitor *monitor)
 | 
			
		||||
{
 | 
			
		||||
  int		      i;
 | 
			
		||||
  int		      ncounters;
 | 
			
		||||
  XSyncSystemCounter *counters;
 | 
			
		||||
  XSyncCounter        counter = None;
 | 
			
		||||
  char               *counter_name;
 | 
			
		||||
 | 
			
		||||
  counter_name = counter_name_for_device (monitor->device_id);
 | 
			
		||||
  counters = XSyncListSystemCounters (monitor->display, &ncounters);
 | 
			
		||||
  for (i = 0; i < ncounters; i++)
 | 
			
		||||
    {
 | 
			
		||||
      if (counters[i].name != NULL && strcmp (counters[i].name, counter_name) == 0)
 | 
			
		||||
        {
 | 
			
		||||
          counter = counters[i].counter;
 | 
			
		||||
          break;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
  XSyncFreeSystemCounterList (counters);
 | 
			
		||||
  g_free (counter_name);
 | 
			
		||||
 | 
			
		||||
  return counter;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static guint32
 | 
			
		||||
get_next_watch_serial (void)
 | 
			
		||||
{
 | 
			
		||||
  static guint32 serial = 0;
 | 
			
		||||
  g_atomic_int_inc (&serial);
 | 
			
		||||
  return serial;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
idle_monitor_watch_free (MetaIdleMonitorWatch *watch)
 | 
			
		||||
{
 | 
			
		||||
  MetaIdleMonitor *monitor;
 | 
			
		||||
 | 
			
		||||
  if (watch == NULL)
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  monitor = watch->monitor;
 | 
			
		||||
  g_object_ref (monitor);
 | 
			
		||||
 | 
			
		||||
  if (watch->idle_source_id)
 | 
			
		||||
    {
 | 
			
		||||
      g_source_remove (watch->idle_source_id);
 | 
			
		||||
      watch->idle_source_id = 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  if (watch->notify != NULL)
 | 
			
		||||
    watch->notify (watch->user_data);
 | 
			
		||||
 | 
			
		||||
  if (watch->xalarm != monitor->user_active_alarm &&
 | 
			
		||||
      watch->xalarm != None)
 | 
			
		||||
    {
 | 
			
		||||
      XSyncDestroyAlarm (monitor->display, watch->xalarm);
 | 
			
		||||
      g_hash_table_remove (monitor->alarms, (gpointer) watch->xalarm);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  if (watch->timeout_source != NULL)
 | 
			
		||||
    g_source_destroy (watch->timeout_source);
 | 
			
		||||
 | 
			
		||||
  g_object_unref (monitor);
 | 
			
		||||
  g_slice_free (MetaIdleMonitorWatch, watch);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
init_xsync (MetaIdleMonitor *monitor)
 | 
			
		||||
{
 | 
			
		||||
  monitor->counter = find_idletime_counter (monitor);
 | 
			
		||||
  /* IDLETIME counter not found? */
 | 
			
		||||
  if (monitor->counter == None)
 | 
			
		||||
    {
 | 
			
		||||
      meta_warning ("IDLETIME counter not found\n");
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  monitor->user_active_alarm = _xsync_alarm_set (monitor, XSyncNegativeTransition, 1, FALSE);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_idle_monitor_dispose (GObject *object)
 | 
			
		||||
{
 | 
			
		||||
  MetaIdleMonitor *monitor;
 | 
			
		||||
 | 
			
		||||
  monitor = META_IDLE_MONITOR (object);
 | 
			
		||||
 | 
			
		||||
  g_clear_pointer (&monitor->watches, g_hash_table_destroy);
 | 
			
		||||
  g_clear_pointer (&monitor->alarms, g_hash_table_destroy);
 | 
			
		||||
 | 
			
		||||
  if (monitor->user_active_alarm != None)
 | 
			
		||||
    {
 | 
			
		||||
      XSyncDestroyAlarm (monitor->display, monitor->user_active_alarm);
 | 
			
		||||
      monitor->user_active_alarm = None;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  G_OBJECT_CLASS (meta_idle_monitor_parent_class)->dispose (object);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_idle_monitor_get_property (GObject    *object,
 | 
			
		||||
                                guint       prop_id,
 | 
			
		||||
                                GValue     *value,
 | 
			
		||||
                                GParamSpec *pspec)
 | 
			
		||||
{
 | 
			
		||||
  MetaIdleMonitor *monitor = META_IDLE_MONITOR (object);
 | 
			
		||||
 | 
			
		||||
  switch (prop_id)
 | 
			
		||||
    {
 | 
			
		||||
    case PROP_DEVICE_ID:
 | 
			
		||||
      g_value_set_int (value, monitor->device_id);
 | 
			
		||||
      break;
 | 
			
		||||
    default:
 | 
			
		||||
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
 | 
			
		||||
      break;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_idle_monitor_set_property (GObject      *object,
 | 
			
		||||
                                guint         prop_id,
 | 
			
		||||
                                const GValue *value,
 | 
			
		||||
                                GParamSpec   *pspec)
 | 
			
		||||
{
 | 
			
		||||
  MetaIdleMonitor *monitor = META_IDLE_MONITOR (object);
 | 
			
		||||
  switch (prop_id)
 | 
			
		||||
    {
 | 
			
		||||
    case PROP_DEVICE_ID:
 | 
			
		||||
      monitor->device_id = g_value_get_int (value);
 | 
			
		||||
      break;
 | 
			
		||||
    default:
 | 
			
		||||
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
 | 
			
		||||
      break;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_idle_monitor_constructed (GObject *object)
 | 
			
		||||
{
 | 
			
		||||
  MetaIdleMonitor *monitor = META_IDLE_MONITOR (object);
 | 
			
		||||
 | 
			
		||||
  if (!meta_is_wayland_compositor ())
 | 
			
		||||
    {
 | 
			
		||||
      monitor->display = meta_get_display ()->xdisplay;
 | 
			
		||||
      init_xsync (monitor);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_idle_monitor_class_init (MetaIdleMonitorClass *klass)
 | 
			
		||||
{
 | 
			
		||||
  GObjectClass *object_class = G_OBJECT_CLASS (klass);
 | 
			
		||||
 | 
			
		||||
  object_class->dispose = meta_idle_monitor_dispose;
 | 
			
		||||
  object_class->constructed = meta_idle_monitor_constructed;
 | 
			
		||||
  object_class->get_property = meta_idle_monitor_get_property;
 | 
			
		||||
  object_class->set_property = meta_idle_monitor_set_property;
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * MetaIdleMonitor:device_id:
 | 
			
		||||
   *
 | 
			
		||||
   * The device to listen to idletime on.
 | 
			
		||||
   */
 | 
			
		||||
  obj_props[PROP_DEVICE_ID] =
 | 
			
		||||
    g_param_spec_int ("device-id",
 | 
			
		||||
                      "Device ID",
 | 
			
		||||
                      "The device to listen to idletime on",
 | 
			
		||||
                      0, 255, 0,
 | 
			
		||||
                      G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
 | 
			
		||||
  g_object_class_install_property (object_class, PROP_DEVICE_ID, obj_props[PROP_DEVICE_ID]);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_idle_monitor_init (MetaIdleMonitor *monitor)
 | 
			
		||||
{
 | 
			
		||||
  monitor->watches = g_hash_table_new_full (NULL,
 | 
			
		||||
                                                  NULL,
 | 
			
		||||
                                                  NULL,
 | 
			
		||||
                                                  (GDestroyNotify)idle_monitor_watch_free);
 | 
			
		||||
 | 
			
		||||
  monitor->alarms = g_hash_table_new (NULL, NULL);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
ensure_device_monitor (int device_id)
 | 
			
		||||
{
 | 
			
		||||
  if (device_monitors[device_id])
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  device_monitors[device_id] = g_object_new (META_TYPE_IDLE_MONITOR, "device-id", device_id, NULL);
 | 
			
		||||
  device_id_max = MAX (device_id_max, device_id);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * meta_idle_monitor_get_core:
 | 
			
		||||
 *
 | 
			
		||||
 * Returns: (transfer none): the #MetaIdleMonitor that tracks the server-global
 | 
			
		||||
 * idletime for all devices. To track device-specific idletime,
 | 
			
		||||
 * use meta_idle_monitor_get_for_device().
 | 
			
		||||
 */
 | 
			
		||||
MetaIdleMonitor *
 | 
			
		||||
meta_idle_monitor_get_core (void)
 | 
			
		||||
{
 | 
			
		||||
  ensure_device_monitor (0);
 | 
			
		||||
  return device_monitors[0];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * meta_idle_monitor_get_for_device:
 | 
			
		||||
 * @device_id: the device to get the idle time for.
 | 
			
		||||
 *
 | 
			
		||||
 * Returns: (transfer none): a new #MetaIdleMonitor that tracks the
 | 
			
		||||
 * device-specific idletime for @device. To track server-global idletime
 | 
			
		||||
 * for all devices, use meta_idle_monitor_get_core().
 | 
			
		||||
 */
 | 
			
		||||
MetaIdleMonitor *
 | 
			
		||||
meta_idle_monitor_get_for_device (int device_id)
 | 
			
		||||
{
 | 
			
		||||
  g_return_val_if_fail (device_id > 0 && device_id < 256, NULL);
 | 
			
		||||
 | 
			
		||||
  ensure_device_monitor (device_id);
 | 
			
		||||
  return device_monitors[device_id];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static gboolean
 | 
			
		||||
wayland_dispatch_timeout (GSource     *source,
 | 
			
		||||
                          GSourceFunc  callback,
 | 
			
		||||
                          gpointer     user_data)
 | 
			
		||||
{
 | 
			
		||||
  MetaIdleMonitorWatch *watch = user_data;
 | 
			
		||||
 | 
			
		||||
  fire_watch (watch);
 | 
			
		||||
  g_source_set_ready_time (watch->timeout_source, -1);
 | 
			
		||||
  return TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static GSourceFuncs wayland_source_funcs = {
 | 
			
		||||
  NULL, /* prepare */
 | 
			
		||||
  NULL, /* check */
 | 
			
		||||
  wayland_dispatch_timeout,
 | 
			
		||||
  NULL, /* finalize */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static gboolean
 | 
			
		||||
fire_watch_idle (gpointer data)
 | 
			
		||||
{
 | 
			
		||||
  MetaIdleMonitorWatch *watch = data;
 | 
			
		||||
 | 
			
		||||
  watch->idle_source_id = 0;
 | 
			
		||||
  fire_watch (watch);
 | 
			
		||||
 | 
			
		||||
  return FALSE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static MetaIdleMonitorWatch *
 | 
			
		||||
make_watch (MetaIdleMonitor           *monitor,
 | 
			
		||||
            guint64                    timeout_msec,
 | 
			
		||||
	    MetaIdleMonitorWatchFunc   callback,
 | 
			
		||||
	    gpointer                   user_data,
 | 
			
		||||
	    GDestroyNotify             notify)
 | 
			
		||||
{
 | 
			
		||||
  MetaIdleMonitorWatch *watch;
 | 
			
		||||
 | 
			
		||||
  watch = g_slice_new0 (MetaIdleMonitorWatch);
 | 
			
		||||
  watch->monitor = monitor;
 | 
			
		||||
  watch->id = get_next_watch_serial ();
 | 
			
		||||
  watch->callback = callback;
 | 
			
		||||
  watch->user_data = user_data;
 | 
			
		||||
  watch->notify = notify;
 | 
			
		||||
  watch->timeout_msec = timeout_msec;
 | 
			
		||||
 | 
			
		||||
  if (meta_is_wayland_compositor ())
 | 
			
		||||
    {
 | 
			
		||||
      if (timeout_msec != 0)
 | 
			
		||||
        {
 | 
			
		||||
          GSource *source = g_source_new (&wayland_source_funcs, sizeof (GSource));
 | 
			
		||||
 | 
			
		||||
          g_source_set_callback (source, NULL, watch, NULL);
 | 
			
		||||
          g_source_set_ready_time (source, monitor->last_event_time + timeout_msec * 1000);
 | 
			
		||||
          g_source_attach (source, NULL);
 | 
			
		||||
          g_source_unref (source);
 | 
			
		||||
 | 
			
		||||
          watch->timeout_source = source;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    {
 | 
			
		||||
      if (timeout_msec != 0)
 | 
			
		||||
        {
 | 
			
		||||
          watch->xalarm = _xsync_alarm_set (monitor, XSyncPositiveTransition, timeout_msec, TRUE);
 | 
			
		||||
 | 
			
		||||
          g_hash_table_add (monitor->alarms, (gpointer) watch->xalarm);
 | 
			
		||||
 | 
			
		||||
          if (meta_idle_monitor_get_idletime (monitor) > (gint64)timeout_msec)
 | 
			
		||||
            watch->idle_source_id = g_idle_add (fire_watch_idle, watch);
 | 
			
		||||
        }
 | 
			
		||||
      else
 | 
			
		||||
        {
 | 
			
		||||
          watch->xalarm = monitor->user_active_alarm;
 | 
			
		||||
 | 
			
		||||
          set_alarm_enabled (monitor->display, monitor->user_active_alarm, TRUE);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  g_hash_table_insert (monitor->watches,
 | 
			
		||||
                       GUINT_TO_POINTER (watch->id),
 | 
			
		||||
                       watch);
 | 
			
		||||
  return watch;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * meta_idle_monitor_add_idle_watch:
 | 
			
		||||
 * @monitor: A #MetaIdleMonitor
 | 
			
		||||
 * @interval_msec: The idletime interval, in milliseconds
 | 
			
		||||
 * @callback: (allow-none): The callback to call when the user has
 | 
			
		||||
 *     accumulated @interval_msec milliseconds of idle time.
 | 
			
		||||
 * @user_data: (allow-none): The user data to pass to the callback
 | 
			
		||||
 * @notify: A #GDestroyNotify
 | 
			
		||||
 *
 | 
			
		||||
 * Returns: a watch id
 | 
			
		||||
 *
 | 
			
		||||
 * Adds a watch for a specific idle time. The callback will be called
 | 
			
		||||
 * when the user has accumulated @interval_msec milliseconds of idle time.
 | 
			
		||||
 * This function will return an ID that can either be passed to
 | 
			
		||||
 * meta_idle_monitor_remove_watch(), or can be used to tell idle time
 | 
			
		||||
 * watches apart if you have more than one.
 | 
			
		||||
 *
 | 
			
		||||
 * Also note that this function will only care about positive transitions
 | 
			
		||||
 * (user's idle time exceeding a certain time). If you want to know about
 | 
			
		||||
 * when the user has become active, use
 | 
			
		||||
 * meta_idle_monitor_add_user_active_watch().
 | 
			
		||||
 */
 | 
			
		||||
guint
 | 
			
		||||
meta_idle_monitor_add_idle_watch (MetaIdleMonitor	       *monitor,
 | 
			
		||||
                                  guint64	                interval_msec,
 | 
			
		||||
                                  MetaIdleMonitorWatchFunc      callback,
 | 
			
		||||
                                  gpointer			user_data,
 | 
			
		||||
                                  GDestroyNotify		notify)
 | 
			
		||||
{
 | 
			
		||||
  MetaIdleMonitorWatch *watch;
 | 
			
		||||
 | 
			
		||||
  g_return_val_if_fail (META_IS_IDLE_MONITOR (monitor), 0);
 | 
			
		||||
  g_return_val_if_fail (interval_msec > 0, 0);
 | 
			
		||||
 | 
			
		||||
  watch = make_watch (monitor,
 | 
			
		||||
                      interval_msec,
 | 
			
		||||
                      callback,
 | 
			
		||||
                      user_data,
 | 
			
		||||
                      notify);
 | 
			
		||||
 | 
			
		||||
  return watch->id;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * meta_idle_monitor_add_user_active_watch:
 | 
			
		||||
 * @monitor: A #MetaIdleMonitor
 | 
			
		||||
 * @callback: (allow-none): The callback to call when the user is
 | 
			
		||||
 *     active again.
 | 
			
		||||
 * @user_data: (allow-none): The user data to pass to the callback
 | 
			
		||||
 * @notify: A #GDestroyNotify
 | 
			
		||||
 *
 | 
			
		||||
 * Returns: a watch id
 | 
			
		||||
 *
 | 
			
		||||
 * Add a one-time watch to know when the user is active again.
 | 
			
		||||
 * Note that this watch is one-time and will de-activate after the
 | 
			
		||||
 * function is called, for efficiency purposes. It's most convenient
 | 
			
		||||
 * to call this when an idle watch, as added by
 | 
			
		||||
 * meta_idle_monitor_add_idle_watch(), has triggered.
 | 
			
		||||
 */
 | 
			
		||||
guint
 | 
			
		||||
meta_idle_monitor_add_user_active_watch (MetaIdleMonitor          *monitor,
 | 
			
		||||
                                         MetaIdleMonitorWatchFunc  callback,
 | 
			
		||||
                                         gpointer		   user_data,
 | 
			
		||||
                                         GDestroyNotify	           notify)
 | 
			
		||||
{
 | 
			
		||||
  MetaIdleMonitorWatch *watch;
 | 
			
		||||
 | 
			
		||||
  g_return_val_if_fail (META_IS_IDLE_MONITOR (monitor), 0);
 | 
			
		||||
 | 
			
		||||
  watch = make_watch (monitor,
 | 
			
		||||
                      0,
 | 
			
		||||
                      callback,
 | 
			
		||||
                      user_data,
 | 
			
		||||
                      notify);
 | 
			
		||||
 | 
			
		||||
  return watch->id;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * meta_idle_monitor_remove_watch:
 | 
			
		||||
 * @monitor: A #MetaIdleMonitor
 | 
			
		||||
 * @id: A watch ID
 | 
			
		||||
 *
 | 
			
		||||
 * Removes an idle time watcher, previously added by
 | 
			
		||||
 * meta_idle_monitor_add_idle_watch() or
 | 
			
		||||
 * meta_idle_monitor_add_user_active_watch().
 | 
			
		||||
 */
 | 
			
		||||
void
 | 
			
		||||
meta_idle_monitor_remove_watch (MetaIdleMonitor *monitor,
 | 
			
		||||
                                guint	         id)
 | 
			
		||||
{
 | 
			
		||||
  g_return_if_fail (META_IS_IDLE_MONITOR (monitor));
 | 
			
		||||
 | 
			
		||||
  g_hash_table_remove (monitor->watches,
 | 
			
		||||
                       GUINT_TO_POINTER (id));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * meta_idle_monitor_get_idletime:
 | 
			
		||||
 * @monitor: A #MetaIdleMonitor
 | 
			
		||||
 *
 | 
			
		||||
 * Returns: The current idle time, in milliseconds, or -1 for not supported
 | 
			
		||||
 */
 | 
			
		||||
gint64
 | 
			
		||||
meta_idle_monitor_get_idletime (MetaIdleMonitor *monitor)
 | 
			
		||||
{
 | 
			
		||||
  XSyncValue value;
 | 
			
		||||
 | 
			
		||||
  if (meta_is_wayland_compositor ())
 | 
			
		||||
    {
 | 
			
		||||
      return (g_get_monotonic_time () - monitor->last_event_time) / 1000;
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    {
 | 
			
		||||
      if (!XSyncQueryCounter (monitor->display, monitor->counter, &value))
 | 
			
		||||
        return -1;
 | 
			
		||||
 | 
			
		||||
      return _xsyncvalue_to_int64 (value);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
typedef struct {
 | 
			
		||||
  MetaIdleMonitor *monitor;
 | 
			
		||||
  GList *fired_watches;
 | 
			
		||||
} CheckWaylandClosure;
 | 
			
		||||
 | 
			
		||||
static gboolean
 | 
			
		||||
check_wayland_watch (gpointer key,
 | 
			
		||||
                     gpointer value,
 | 
			
		||||
                     gpointer user_data)
 | 
			
		||||
{
 | 
			
		||||
  MetaIdleMonitorWatch *watch = value;
 | 
			
		||||
  CheckWaylandClosure *closure = user_data;
 | 
			
		||||
  gboolean steal;
 | 
			
		||||
 | 
			
		||||
  if (watch->timeout_msec == 0)
 | 
			
		||||
    {
 | 
			
		||||
      closure->fired_watches = g_list_prepend (closure->fired_watches, watch);
 | 
			
		||||
      steal = TRUE;
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    {
 | 
			
		||||
      g_source_set_ready_time (watch->timeout_source,
 | 
			
		||||
                               closure->monitor->last_event_time +
 | 
			
		||||
                               watch->timeout_msec * 1000);
 | 
			
		||||
      steal = FALSE;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  return steal;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
fire_wayland_watch (gpointer watch,
 | 
			
		||||
                    gpointer data)
 | 
			
		||||
{
 | 
			
		||||
  fire_watch (watch);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_idle_monitor_reset_idletime (MetaIdleMonitor *monitor)
 | 
			
		||||
{
 | 
			
		||||
  CheckWaylandClosure closure;
 | 
			
		||||
 | 
			
		||||
  monitor->last_event_time = g_get_monotonic_time ();
 | 
			
		||||
 | 
			
		||||
  closure.monitor = monitor;
 | 
			
		||||
  closure.fired_watches = NULL;
 | 
			
		||||
  g_hash_table_foreach_steal (monitor->watches, check_wayland_watch, &closure);
 | 
			
		||||
 | 
			
		||||
  g_list_foreach (closure.fired_watches, fire_wayland_watch, NULL);
 | 
			
		||||
  g_list_free (closure.fired_watches);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static gboolean
 | 
			
		||||
handle_get_idletime (MetaDBusIdleMonitor   *skeleton,
 | 
			
		||||
                     GDBusMethodInvocation *invocation,
 | 
			
		||||
                     MetaIdleMonitor       *monitor)
 | 
			
		||||
{
 | 
			
		||||
  guint64 idletime;
 | 
			
		||||
 | 
			
		||||
  idletime = meta_idle_monitor_get_idletime (monitor);
 | 
			
		||||
  meta_dbus_idle_monitor_complete_get_idletime (skeleton, invocation, idletime);
 | 
			
		||||
 | 
			
		||||
  return TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
typedef struct {
 | 
			
		||||
  MetaDBusIdleMonitor *dbus_monitor;
 | 
			
		||||
  MetaIdleMonitor *monitor;
 | 
			
		||||
  char *dbus_name;
 | 
			
		||||
  guint watch_id;
 | 
			
		||||
  guint name_watcher_id;
 | 
			
		||||
} DBusWatch;
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
destroy_dbus_watch (gpointer data)
 | 
			
		||||
{
 | 
			
		||||
  DBusWatch *watch = data;
 | 
			
		||||
 | 
			
		||||
  g_object_unref (watch->dbus_monitor);
 | 
			
		||||
  g_object_unref (watch->monitor);
 | 
			
		||||
  g_free (watch->dbus_name);
 | 
			
		||||
  g_bus_unwatch_name (watch->name_watcher_id);
 | 
			
		||||
 | 
			
		||||
  g_slice_free (DBusWatch, watch);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
dbus_idle_callback (MetaIdleMonitor *monitor,
 | 
			
		||||
                    guint            watch_id,
 | 
			
		||||
                    gpointer         user_data)
 | 
			
		||||
{
 | 
			
		||||
  DBusWatch *watch = user_data;
 | 
			
		||||
  GDBusInterfaceSkeleton *skeleton = G_DBUS_INTERFACE_SKELETON (watch->dbus_monitor);
 | 
			
		||||
 | 
			
		||||
  g_dbus_connection_emit_signal (g_dbus_interface_skeleton_get_connection (skeleton),
 | 
			
		||||
                                 watch->dbus_name,
 | 
			
		||||
                                 g_dbus_interface_skeleton_get_object_path (skeleton),
 | 
			
		||||
                                 "org.gnome.Mutter.IdleMonitor",
 | 
			
		||||
                                 "WatchFired",
 | 
			
		||||
                                 g_variant_new ("(u)", watch_id),
 | 
			
		||||
                                 NULL);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
name_vanished_callback (GDBusConnection *connection,
 | 
			
		||||
                        const char      *name,
 | 
			
		||||
                        gpointer         user_data)
 | 
			
		||||
{
 | 
			
		||||
  DBusWatch *watch = user_data;
 | 
			
		||||
 | 
			
		||||
  meta_idle_monitor_remove_watch (watch->monitor, watch->watch_id);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static DBusWatch *
 | 
			
		||||
make_dbus_watch (MetaDBusIdleMonitor   *skeleton,
 | 
			
		||||
                 GDBusMethodInvocation *invocation,
 | 
			
		||||
                 MetaIdleMonitor       *monitor)
 | 
			
		||||
{
 | 
			
		||||
  DBusWatch *watch;
 | 
			
		||||
 | 
			
		||||
  watch = g_slice_new (DBusWatch);
 | 
			
		||||
  watch->dbus_monitor = g_object_ref (skeleton);
 | 
			
		||||
  watch->monitor = g_object_ref (monitor);
 | 
			
		||||
  watch->dbus_name = g_strdup (g_dbus_method_invocation_get_sender (invocation));
 | 
			
		||||
  watch->name_watcher_id = g_bus_watch_name_on_connection (g_dbus_method_invocation_get_connection (invocation),
 | 
			
		||||
                                                           watch->dbus_name,
 | 
			
		||||
                                                           G_BUS_NAME_WATCHER_FLAGS_NONE,
 | 
			
		||||
                                                           NULL, /* appeared */
 | 
			
		||||
                                                           name_vanished_callback,
 | 
			
		||||
                                                           watch, NULL);
 | 
			
		||||
 | 
			
		||||
  return watch;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static gboolean
 | 
			
		||||
handle_add_idle_watch (MetaDBusIdleMonitor   *skeleton,
 | 
			
		||||
                       GDBusMethodInvocation *invocation,
 | 
			
		||||
                       guint64                interval,
 | 
			
		||||
                       MetaIdleMonitor       *monitor)
 | 
			
		||||
{
 | 
			
		||||
  DBusWatch *watch;
 | 
			
		||||
 | 
			
		||||
  watch = make_dbus_watch (skeleton, invocation, monitor);
 | 
			
		||||
  watch->watch_id = meta_idle_monitor_add_idle_watch (monitor, interval,
 | 
			
		||||
                                                      dbus_idle_callback, watch, destroy_dbus_watch);
 | 
			
		||||
 | 
			
		||||
  meta_dbus_idle_monitor_complete_add_idle_watch (skeleton, invocation, watch->watch_id);
 | 
			
		||||
 | 
			
		||||
  return TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static gboolean
 | 
			
		||||
handle_add_user_active_watch (MetaDBusIdleMonitor   *skeleton,
 | 
			
		||||
                              GDBusMethodInvocation *invocation,
 | 
			
		||||
                              MetaIdleMonitor       *monitor)
 | 
			
		||||
{
 | 
			
		||||
  DBusWatch *watch;
 | 
			
		||||
 | 
			
		||||
  watch = make_dbus_watch (skeleton, invocation, monitor);
 | 
			
		||||
  watch->watch_id = meta_idle_monitor_add_user_active_watch (monitor,
 | 
			
		||||
                                                             dbus_idle_callback, watch,
 | 
			
		||||
                                                             destroy_dbus_watch);
 | 
			
		||||
 | 
			
		||||
  meta_dbus_idle_monitor_complete_add_user_active_watch (skeleton, invocation, watch->watch_id);
 | 
			
		||||
 | 
			
		||||
  return TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static gboolean
 | 
			
		||||
handle_remove_watch (MetaDBusIdleMonitor   *skeleton,
 | 
			
		||||
                     GDBusMethodInvocation *invocation,
 | 
			
		||||
                     guint                  id,
 | 
			
		||||
                     MetaIdleMonitor       *monitor)
 | 
			
		||||
{
 | 
			
		||||
  meta_idle_monitor_remove_watch (monitor, id);
 | 
			
		||||
  meta_dbus_idle_monitor_complete_remove_watch (skeleton, invocation);
 | 
			
		||||
 | 
			
		||||
  return TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
create_monitor_skeleton (GDBusObjectManagerServer *manager,
 | 
			
		||||
                         MetaIdleMonitor          *monitor,
 | 
			
		||||
                         const char               *path)
 | 
			
		||||
{
 | 
			
		||||
  MetaDBusIdleMonitor *skeleton;
 | 
			
		||||
  MetaDBusObjectSkeleton *object;
 | 
			
		||||
 | 
			
		||||
  skeleton = meta_dbus_idle_monitor_skeleton_new ();
 | 
			
		||||
  g_signal_connect_object (skeleton, "handle-add-idle-watch",
 | 
			
		||||
                           G_CALLBACK (handle_add_idle_watch), monitor, 0);
 | 
			
		||||
  g_signal_connect_object (skeleton, "handle-add-user-active-watch",
 | 
			
		||||
                           G_CALLBACK (handle_add_user_active_watch), monitor, 0);
 | 
			
		||||
  g_signal_connect_object (skeleton, "handle-remove-watch",
 | 
			
		||||
                           G_CALLBACK (handle_remove_watch), monitor, 0);
 | 
			
		||||
  g_signal_connect_object (skeleton, "handle-get-idletime",
 | 
			
		||||
                           G_CALLBACK (handle_get_idletime), monitor, 0);
 | 
			
		||||
 | 
			
		||||
  object = meta_dbus_object_skeleton_new (path);
 | 
			
		||||
  meta_dbus_object_skeleton_set_idle_monitor (object, skeleton);
 | 
			
		||||
 | 
			
		||||
  g_dbus_object_manager_server_export (manager, G_DBUS_OBJECT_SKELETON (object));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
on_device_added (ClutterDeviceManager     *device_manager,
 | 
			
		||||
                 ClutterInputDevice       *device,
 | 
			
		||||
                 GDBusObjectManagerServer *manager)
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
  MetaIdleMonitor *monitor;
 | 
			
		||||
  int device_id;
 | 
			
		||||
  char *path;
 | 
			
		||||
 | 
			
		||||
  device_id = clutter_input_device_get_device_id (device);
 | 
			
		||||
  monitor = meta_idle_monitor_get_for_device (device_id);
 | 
			
		||||
  path = g_strdup_printf ("/org/gnome/Mutter/IdleMonitor/Device%d", device_id);
 | 
			
		||||
 | 
			
		||||
  create_monitor_skeleton (manager, monitor, path);
 | 
			
		||||
  g_free (path);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
on_device_removed (ClutterDeviceManager     *device_manager,
 | 
			
		||||
                   ClutterInputDevice       *device,
 | 
			
		||||
                   GDBusObjectManagerServer *manager)
 | 
			
		||||
{
 | 
			
		||||
  int device_id;
 | 
			
		||||
  char *path;
 | 
			
		||||
 | 
			
		||||
  device_id = clutter_input_device_get_device_id (device);
 | 
			
		||||
  path = g_strdup_printf ("/org/gnome/Mutter/IdleMonitor/Device%d", device_id);
 | 
			
		||||
  g_dbus_object_manager_server_unexport (manager, path);
 | 
			
		||||
  g_free (path);
 | 
			
		||||
 | 
			
		||||
  g_clear_object (&device_monitors[device_id]);
 | 
			
		||||
  if (device_id == device_id_max)
 | 
			
		||||
    device_id_max--;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
on_bus_acquired (GDBusConnection *connection,
 | 
			
		||||
                 const char      *name,
 | 
			
		||||
                 gpointer         user_data)
 | 
			
		||||
{
 | 
			
		||||
  GDBusObjectManagerServer *manager;
 | 
			
		||||
  ClutterDeviceManager *device_manager;
 | 
			
		||||
  MetaIdleMonitor *monitor;
 | 
			
		||||
  GSList *devices, *iter;
 | 
			
		||||
  char *path;
 | 
			
		||||
 | 
			
		||||
  manager = g_dbus_object_manager_server_new ("/org/gnome/Mutter/IdleMonitor");
 | 
			
		||||
 | 
			
		||||
  /* We never clear the core monitor, as that's supposed to cumulate idle times from
 | 
			
		||||
     all devices */
 | 
			
		||||
  monitor = meta_idle_monitor_get_core ();
 | 
			
		||||
  path = g_strdup ("/org/gnome/Mutter/IdleMonitor/Core");
 | 
			
		||||
  create_monitor_skeleton (manager, monitor, path);
 | 
			
		||||
  g_free (path);
 | 
			
		||||
 | 
			
		||||
  device_manager = clutter_device_manager_get_default ();
 | 
			
		||||
  devices = clutter_device_manager_list_devices (device_manager);
 | 
			
		||||
 | 
			
		||||
  for (iter = devices; iter; iter = iter->next)
 | 
			
		||||
    on_device_added (device_manager, iter->data, manager);
 | 
			
		||||
 | 
			
		||||
  g_slist_free (devices);
 | 
			
		||||
 | 
			
		||||
  g_signal_connect_object (device_manager, "device-added",
 | 
			
		||||
                           G_CALLBACK (on_device_added), manager, 0);
 | 
			
		||||
  g_signal_connect_object (device_manager, "device-removed",
 | 
			
		||||
                           G_CALLBACK (on_device_removed), manager, 0);
 | 
			
		||||
 | 
			
		||||
  g_dbus_object_manager_server_set_connection (manager, connection);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
on_name_acquired (GDBusConnection *connection,
 | 
			
		||||
                  const char      *name,
 | 
			
		||||
                  gpointer         user_data)
 | 
			
		||||
{
 | 
			
		||||
  meta_verbose ("Acquired name %s\n", name);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
on_name_lost (GDBusConnection *connection,
 | 
			
		||||
              const char      *name,
 | 
			
		||||
              gpointer         user_data)
 | 
			
		||||
{
 | 
			
		||||
  meta_verbose ("Lost or failed to acquire name %s\n", name);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_idle_monitor_init_dbus (void)
 | 
			
		||||
{
 | 
			
		||||
  static int dbus_name_id;
 | 
			
		||||
 | 
			
		||||
  if (dbus_name_id > 0)
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  dbus_name_id = g_bus_own_name (G_BUS_TYPE_SESSION,
 | 
			
		||||
                                 "org.gnome.Mutter.IdleMonitor",
 | 
			
		||||
                                 G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT |
 | 
			
		||||
                                 (meta_get_replace_current_wm () ?
 | 
			
		||||
                                  G_BUS_NAME_OWNER_FLAGS_REPLACE : 0),
 | 
			
		||||
                                 on_bus_acquired,
 | 
			
		||||
                                 on_name_acquired,
 | 
			
		||||
                                 on_name_lost,
 | 
			
		||||
                                 NULL, NULL);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -30,7 +30,7 @@
 | 
			
		||||
#define META_XRANDR_SHARED_H
 | 
			
		||||
 | 
			
		||||
typedef enum {
 | 
			
		||||
  META_POWER_SAVE_UNKNOWN = -1,
 | 
			
		||||
  META_POWER_SAVE_UNSUPPORTED = -1,
 | 
			
		||||
  META_POWER_SAVE_ON = 0,
 | 
			
		||||
  META_POWER_SAVE_STANDBY,
 | 
			
		||||
  META_POWER_SAVE_SUSPEND,
 | 
			
		||||
 
 | 
			
		||||
@@ -55,6 +55,8 @@ typedef struct {
 | 
			
		||||
  char *serial;
 | 
			
		||||
} MetaOutputKey;
 | 
			
		||||
 | 
			
		||||
/* Keep this structure packed, so that we
 | 
			
		||||
   can use memcmp */
 | 
			
		||||
typedef struct {
 | 
			
		||||
  gboolean enabled;
 | 
			
		||||
  MetaRectangle rect;
 | 
			
		||||
@@ -97,8 +99,9 @@ static gboolean meta_monitor_config_assign_crtcs (MetaConfiguration  *config,
 | 
			
		||||
                                                  GPtrArray          *crtcs,
 | 
			
		||||
                                                  GPtrArray          *outputs);
 | 
			
		||||
 | 
			
		||||
static void     power_client_changed_cb (UpClient *client,
 | 
			
		||||
                                         gpointer  user_data);
 | 
			
		||||
static void     power_client_changed_cb (UpClient   *client,
 | 
			
		||||
                                         GParamSpec *pspec,
 | 
			
		||||
                                         gpointer    user_data);
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
free_output_key (MetaOutputKey *key)
 | 
			
		||||
@@ -147,6 +150,13 @@ output_key_equal (const MetaOutputKey *one,
 | 
			
		||||
    strcmp (one->serial, two->serial) == 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static gboolean
 | 
			
		||||
output_config_equal (const MetaOutputConfig *one,
 | 
			
		||||
                     const MetaOutputConfig *two)
 | 
			
		||||
{
 | 
			
		||||
  return memcmp (one, two, sizeof (MetaOutputConfig)) == 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static unsigned int
 | 
			
		||||
config_hash (gconstpointer data)
 | 
			
		||||
{
 | 
			
		||||
@@ -180,6 +190,30 @@ config_equal (gconstpointer one,
 | 
			
		||||
  return ok;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static gboolean
 | 
			
		||||
config_equal_full (gconstpointer one,
 | 
			
		||||
                   gconstpointer two)
 | 
			
		||||
{
 | 
			
		||||
  const MetaConfiguration *c_one = one;
 | 
			
		||||
  const MetaConfiguration *c_two = two;
 | 
			
		||||
  unsigned int i;
 | 
			
		||||
  gboolean ok;
 | 
			
		||||
 | 
			
		||||
  if (c_one->n_outputs != c_two->n_outputs)
 | 
			
		||||
    return FALSE;
 | 
			
		||||
 | 
			
		||||
  ok = TRUE;
 | 
			
		||||
  for (i = 0; i < c_one->n_outputs && ok; i++)
 | 
			
		||||
    {
 | 
			
		||||
      ok = output_key_equal (&c_one->keys[i],
 | 
			
		||||
                             &c_two->keys[i]);
 | 
			
		||||
      ok = ok && output_config_equal (&c_one->outputs[i],
 | 
			
		||||
                                      &c_two->outputs[i]);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  return ok;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_monitor_config_init (MetaMonitorConfig *self)
 | 
			
		||||
{
 | 
			
		||||
@@ -199,7 +233,7 @@ meta_monitor_config_init (MetaMonitorConfig *self)
 | 
			
		||||
  self->up_client = up_client_new ();
 | 
			
		||||
  self->lid_is_closed = up_client_get_lid_is_closed (self->up_client);
 | 
			
		||||
 | 
			
		||||
  g_signal_connect_object (self->up_client, "changed",
 | 
			
		||||
  g_signal_connect_object (self->up_client, "notify::lid-is-closed",
 | 
			
		||||
                           G_CALLBACK (power_client_changed_cb), self, 0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -716,6 +750,9 @@ meta_monitor_config_load (MetaMonitorConfig  *self)
 | 
			
		||||
 | 
			
		||||
      free_output_key (&parser.key);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  g_markup_parse_context_free (context);
 | 
			
		||||
  g_free (contents);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
MetaMonitorConfig *
 | 
			
		||||
@@ -780,6 +817,22 @@ meta_monitor_config_match_current (MetaMonitorConfig  *self,
 | 
			
		||||
  return ok;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
gboolean
 | 
			
		||||
meta_monitor_manager_has_hotplug_mode_update (MetaMonitorManager *manager)
 | 
			
		||||
{
 | 
			
		||||
  MetaOutput *outputs;
 | 
			
		||||
  unsigned n_outputs;
 | 
			
		||||
  unsigned int i;
 | 
			
		||||
 | 
			
		||||
  outputs = meta_monitor_manager_get_outputs (manager, &n_outputs);
 | 
			
		||||
 | 
			
		||||
  for (i = 0; i < n_outputs; i++)
 | 
			
		||||
    if (outputs[i].hotplug_mode_update)
 | 
			
		||||
      return TRUE;
 | 
			
		||||
 | 
			
		||||
  return FALSE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static MetaConfiguration *
 | 
			
		||||
meta_monitor_config_get_stored (MetaMonitorConfig *self,
 | 
			
		||||
				MetaOutput        *outputs,
 | 
			
		||||
@@ -878,6 +931,8 @@ make_laptop_lid_config (MetaConfiguration  *reference)
 | 
			
		||||
  MetaConfiguration *new;
 | 
			
		||||
  unsigned int i;
 | 
			
		||||
  gboolean has_primary;
 | 
			
		||||
  int x_after, y_after;
 | 
			
		||||
  int x_offset, y_offset;
 | 
			
		||||
 | 
			
		||||
  g_assert (reference->n_outputs > 1);
 | 
			
		||||
 | 
			
		||||
@@ -886,6 +941,8 @@ make_laptop_lid_config (MetaConfiguration  *reference)
 | 
			
		||||
  new->keys = g_new0 (MetaOutputKey, reference->n_outputs);
 | 
			
		||||
  new->outputs = g_new0 (MetaOutputConfig, reference->n_outputs);
 | 
			
		||||
 | 
			
		||||
  x_after = G_MAXINT; y_after = G_MAXINT;
 | 
			
		||||
  x_offset = 0; y_offset = 0;
 | 
			
		||||
  for (i = 0; i < new->n_outputs; i++)
 | 
			
		||||
    {
 | 
			
		||||
      MetaOutputKey *current_key = &reference->keys[i];
 | 
			
		||||
@@ -898,14 +955,26 @@ make_laptop_lid_config (MetaConfiguration  *reference)
 | 
			
		||||
 | 
			
		||||
      if (g_str_has_prefix (current_key->connector, "LVDS") ||
 | 
			
		||||
          g_str_has_prefix (current_key->connector, "eDP"))
 | 
			
		||||
        new->outputs[i].enabled = FALSE;
 | 
			
		||||
        {
 | 
			
		||||
          new->outputs[i].enabled = FALSE;
 | 
			
		||||
          x_after = current_output->rect.x;
 | 
			
		||||
          y_after = current_output->rect.y;
 | 
			
		||||
          x_offset = current_output->rect.width;
 | 
			
		||||
          y_offset = current_output->rect.height;
 | 
			
		||||
        }
 | 
			
		||||
      else
 | 
			
		||||
        /* This can potentially leave a "hole" in the screen,
 | 
			
		||||
           but this is actually a good thing, as it means windows
 | 
			
		||||
           don't move around.
 | 
			
		||||
        */
 | 
			
		||||
        new->outputs[i] = *current_output;
 | 
			
		||||
    }
 | 
			
		||||
  for (i = 0; i < new->n_outputs; i++)
 | 
			
		||||
    {
 | 
			
		||||
      if (new->outputs[i].enabled)
 | 
			
		||||
        {
 | 
			
		||||
          if (new->outputs[i].rect.x > x_after)
 | 
			
		||||
            new->outputs[i].rect.x -= x_offset;
 | 
			
		||||
          if (new->outputs[i].rect.y > y_after)
 | 
			
		||||
            new->outputs[i].rect.y -= y_offset;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  has_primary = FALSE;
 | 
			
		||||
  for (i = 0; i < new->n_outputs; i++)
 | 
			
		||||
@@ -1243,6 +1312,12 @@ meta_monitor_config_update_current (MetaMonitorConfig  *self,
 | 
			
		||||
      init_config_from_output (¤t->outputs[i], &outputs[i]);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  if (self->current && config_equal_full (current, self->current))
 | 
			
		||||
    {
 | 
			
		||||
      config_free (current);
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  if (self->current && !self->current_is_stored)
 | 
			
		||||
    config_free (self->current);
 | 
			
		||||
 | 
			
		||||
@@ -1277,8 +1352,9 @@ turn_off_laptop_display (MetaMonitorConfig  *self,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
power_client_changed_cb (UpClient *client,
 | 
			
		||||
                         gpointer  user_data)
 | 
			
		||||
power_client_changed_cb (UpClient   *client,
 | 
			
		||||
                         GParamSpec *pspec,
 | 
			
		||||
                         gpointer    user_data)
 | 
			
		||||
{
 | 
			
		||||
  MetaMonitorManager *manager = meta_monitor_manager_get ();
 | 
			
		||||
  MetaMonitorConfig *self = user_data;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										939
									
								
								src/core/monitor-kms.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										939
									
								
								src/core/monitor-kms.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,939 @@
 | 
			
		||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
 | 
			
		||||
 | 
			
		||||
/* 
 | 
			
		||||
 * Copyright (C) 2013 Red Hat Inc.
 | 
			
		||||
 * 
 | 
			
		||||
 * This program is free software; you can redistribute it and/or
 | 
			
		||||
 * modify it under the terms of the GNU General Public License as
 | 
			
		||||
 * published by the Free Software Foundation; either version 2 of the
 | 
			
		||||
 * License, or (at your option) any later version.
 | 
			
		||||
 *
 | 
			
		||||
 * This program is distributed in the hope that it will be useful, but
 | 
			
		||||
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 | 
			
		||||
 * General Public License for more details.
 | 
			
		||||
 * 
 | 
			
		||||
 * You should have received a copy of the GNU General Public License
 | 
			
		||||
 * along with this program; if not, write to the Free Software
 | 
			
		||||
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 | 
			
		||||
 * 02111-1307, USA.
 | 
			
		||||
 *
 | 
			
		||||
 * Author: Giovanni Campagna <gcampagn@redhat.com>
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "config.h"
 | 
			
		||||
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <clutter/clutter.h>
 | 
			
		||||
 | 
			
		||||
#include <errno.h>
 | 
			
		||||
#include <sys/ioctl.h>
 | 
			
		||||
#include <sys/mman.h>
 | 
			
		||||
#include <unistd.h>
 | 
			
		||||
#include <xf86drm.h>
 | 
			
		||||
#include <xf86drmMode.h>
 | 
			
		||||
 | 
			
		||||
#include <meta/main.h>
 | 
			
		||||
#include <meta/errors.h>
 | 
			
		||||
#include "monitor-private.h"
 | 
			
		||||
#include "edid.h"
 | 
			
		||||
 | 
			
		||||
#define ALL_WL_TRANSFORMS ((1 << (WL_OUTPUT_TRANSFORM_FLIPPED_270 + 1)) - 1)
 | 
			
		||||
 | 
			
		||||
typedef struct {
 | 
			
		||||
  drmModeConnector *connector;
 | 
			
		||||
 | 
			
		||||
  unsigned n_encoders;
 | 
			
		||||
  drmModeEncoderPtr *encoders;
 | 
			
		||||
  drmModeEncoderPtr  current_encoder;
 | 
			
		||||
 | 
			
		||||
  /* bitmasks of encoder position in the resources array */
 | 
			
		||||
  uint32_t encoder_mask;
 | 
			
		||||
  uint32_t enc_clone_mask;
 | 
			
		||||
 | 
			
		||||
  uint32_t dpms_prop_id;
 | 
			
		||||
  uint32_t edid_blob_id;
 | 
			
		||||
} MetaOutputKms;
 | 
			
		||||
 | 
			
		||||
struct _MetaMonitorManagerKms
 | 
			
		||||
{
 | 
			
		||||
  MetaMonitorManager parent_instance;
 | 
			
		||||
 | 
			
		||||
  int fd;
 | 
			
		||||
 | 
			
		||||
  drmModeConnector **connectors;
 | 
			
		||||
  unsigned int       n_connectors;
 | 
			
		||||
 | 
			
		||||
  drmModeEncoder   **encoders;
 | 
			
		||||
  unsigned int       n_encoders;
 | 
			
		||||
 | 
			
		||||
  drmModeEncoder    *current_encoder;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct _MetaMonitorManagerKmsClass
 | 
			
		||||
{
 | 
			
		||||
  MetaMonitorManagerClass parent_class;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
G_DEFINE_TYPE (MetaMonitorManagerKms, meta_monitor_manager_kms, META_TYPE_MONITOR_MANAGER);
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
free_resources (MetaMonitorManagerKms *manager_kms)
 | 
			
		||||
{
 | 
			
		||||
  unsigned i;
 | 
			
		||||
 | 
			
		||||
  for (i = 0; i < manager_kms->n_encoders; i++)
 | 
			
		||||
    drmModeFreeEncoder (manager_kms->encoders[i]);
 | 
			
		||||
  for (i = 0; i < manager_kms->n_connectors; i++)
 | 
			
		||||
    drmModeFreeConnector (manager_kms->connectors[i]);
 | 
			
		||||
 | 
			
		||||
  g_free (manager_kms->encoders);
 | 
			
		||||
  g_free (manager_kms->connectors);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int
 | 
			
		||||
compare_outputs (const void *one,
 | 
			
		||||
                 const void *two)
 | 
			
		||||
{
 | 
			
		||||
  const MetaOutput *o_one = one, *o_two = two;
 | 
			
		||||
 | 
			
		||||
  return strcmp (o_one->name, o_two->name);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static char *
 | 
			
		||||
make_output_name (drmModeConnector *connector)
 | 
			
		||||
{
 | 
			
		||||
  static const char * const connector_type_names[] = {
 | 
			
		||||
    "unknown", "VGA", "DVII", "DVID", "DVID", "Composite",
 | 
			
		||||
    "SVIDEO", "LVDS", "Component", "9PinDIN", "DisplayPort",
 | 
			
		||||
    "HDMIA", "HDMIB", "TV", "eDP"
 | 
			
		||||
  };
 | 
			
		||||
  const char *connector_type_name;
 | 
			
		||||
 | 
			
		||||
  if (connector->connector_type >= 0 &&
 | 
			
		||||
      connector->connector_type < G_N_ELEMENTS (connector_type_names))
 | 
			
		||||
    connector_type_name = connector_type_names[connector->connector_type];
 | 
			
		||||
  else
 | 
			
		||||
    connector_type_name = "unknown";
 | 
			
		||||
 | 
			
		||||
  return g_strdup_printf ("%s%d", connector_type_name, connector->connector_id);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_output_destroy_notify (MetaOutput *output)
 | 
			
		||||
{
 | 
			
		||||
  MetaOutputKms *output_kms;
 | 
			
		||||
  unsigned i;
 | 
			
		||||
 | 
			
		||||
  output_kms = output->driver_private;
 | 
			
		||||
 | 
			
		||||
  for (i = 0; i < output_kms->n_encoders; i++)
 | 
			
		||||
    drmModeFreeEncoder (output_kms->encoders[i]);
 | 
			
		||||
  g_free (output_kms->encoders);
 | 
			
		||||
 | 
			
		||||
  g_slice_free (MetaOutputKms, output_kms);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_monitor_mode_destroy_notify (MetaMonitorMode *output)
 | 
			
		||||
{
 | 
			
		||||
  g_slice_free (drmModeModeInfo, output->driver_private);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static gboolean
 | 
			
		||||
drm_mode_equal (gconstpointer one,
 | 
			
		||||
                gconstpointer two)
 | 
			
		||||
{
 | 
			
		||||
  const drmModeModeInfo *m_one = one;
 | 
			
		||||
  const drmModeModeInfo *m_two = two;
 | 
			
		||||
 | 
			
		||||
  return m_one->clock == m_two->clock &&
 | 
			
		||||
    m_one->hdisplay == m_two->hdisplay &&
 | 
			
		||||
    m_one->hsync_start == m_two->hsync_start &&
 | 
			
		||||
    m_one->hsync_end == m_two->hsync_end &&
 | 
			
		||||
    m_one->htotal == m_two->htotal &&
 | 
			
		||||
    m_one->hskew == m_two->hskew &&
 | 
			
		||||
    m_one->vdisplay == m_two->vdisplay &&
 | 
			
		||||
    m_one->vsync_start == m_two->vsync_start &&
 | 
			
		||||
    m_one->vsync_end == m_two->vsync_end &&
 | 
			
		||||
    m_one->vtotal == m_two->vtotal &&
 | 
			
		||||
    m_one->vscan == m_two->vscan &&
 | 
			
		||||
    m_one->vrefresh == m_two->vrefresh &&
 | 
			
		||||
    m_one->flags == m_two->flags &&
 | 
			
		||||
    m_one->type == m_two->type &&
 | 
			
		||||
    strncmp (m_one->name, m_two->name, DRM_DISPLAY_MODE_LEN) == 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static guint
 | 
			
		||||
drm_mode_hash (gconstpointer ptr)
 | 
			
		||||
{
 | 
			
		||||
  const drmModeModeInfo *mode = ptr;
 | 
			
		||||
  guint hash = 0;
 | 
			
		||||
 | 
			
		||||
  /* We don't include the name in the hash because it's generally
 | 
			
		||||
     derived from the other fields (hdisplay, vdisplay and flags)
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
  hash ^= mode->clock;
 | 
			
		||||
  hash ^= mode->hdisplay ^ mode->hsync_start ^ mode->hsync_end;
 | 
			
		||||
  hash ^= mode->vdisplay ^ mode->vsync_start ^ mode->vsync_end;
 | 
			
		||||
  hash ^= mode->vrefresh;
 | 
			
		||||
  hash ^= mode->flags ^ mode->type;
 | 
			
		||||
 | 
			
		||||
  return hash;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
find_properties (MetaMonitorManagerKms *manager_kms,
 | 
			
		||||
                 MetaOutputKms         *output_kms)
 | 
			
		||||
{
 | 
			
		||||
  drmModePropertyPtr prop;
 | 
			
		||||
  int i;
 | 
			
		||||
 | 
			
		||||
  for (i = 0; i < output_kms->connector->count_props; i++)
 | 
			
		||||
    {
 | 
			
		||||
      prop = drmModeGetProperty (manager_kms->fd, output_kms->connector->props[i]);
 | 
			
		||||
      if (!prop)
 | 
			
		||||
        continue;
 | 
			
		||||
 | 
			
		||||
      if ((prop->flags & DRM_MODE_PROP_ENUM) &&
 | 
			
		||||
          strcmp(prop->name, "DPMS") == 0)
 | 
			
		||||
        output_kms->dpms_prop_id = prop->prop_id;
 | 
			
		||||
      else if ((prop->flags & DRM_MODE_PROP_BLOB) &&
 | 
			
		||||
               strcmp (prop->name, "EDID") == 0)
 | 
			
		||||
        output_kms->edid_blob_id = output_kms->connector->prop_values[i];
 | 
			
		||||
 | 
			
		||||
      drmModeFreeProperty(prop);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static GBytes *
 | 
			
		||||
read_output_edid (MetaMonitorManagerKms *manager_kms,
 | 
			
		||||
                  MetaOutput            *output)
 | 
			
		||||
{
 | 
			
		||||
  MetaOutputKms *output_kms = output->driver_private;
 | 
			
		||||
  drmModePropertyBlobPtr edid_blob = NULL;
 | 
			
		||||
 | 
			
		||||
  if (output_kms->edid_blob_id == 0)
 | 
			
		||||
    return NULL;
 | 
			
		||||
 | 
			
		||||
  edid_blob = drmModeGetPropertyBlob (manager_kms->fd, output_kms->edid_blob_id);
 | 
			
		||||
  if (!edid_blob)
 | 
			
		||||
    {
 | 
			
		||||
      meta_warning ("Failed to read EDID of output %s: %s\n", output->name, strerror(errno));
 | 
			
		||||
      return NULL;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  if (edid_blob->length > 0)
 | 
			
		||||
    return g_bytes_new_with_free_func (edid_blob->data, edid_blob->length,
 | 
			
		||||
                                       (GDestroyNotify)drmModeFreePropertyBlob, edid_blob);
 | 
			
		||||
  else
 | 
			
		||||
    {
 | 
			
		||||
      drmModeFreePropertyBlob (edid_blob);
 | 
			
		||||
      return NULL;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static MetaMonitorMode *
 | 
			
		||||
find_meta_mode (MetaMonitorManager    *manager,
 | 
			
		||||
                const drmModeModeInfo *drm_mode)
 | 
			
		||||
{
 | 
			
		||||
  unsigned k;
 | 
			
		||||
 | 
			
		||||
  for (k = 0; k < manager->n_modes; k++)
 | 
			
		||||
    {
 | 
			
		||||
      if (drm_mode_equal (drm_mode, manager->modes[k].driver_private))
 | 
			
		||||
        return &manager->modes[k];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  g_assert_not_reached ();
 | 
			
		||||
  return NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static MetaOutput *
 | 
			
		||||
find_output_by_id (MetaOutput *outputs,
 | 
			
		||||
                   unsigned    n_outputs,
 | 
			
		||||
                   glong       id)
 | 
			
		||||
{
 | 
			
		||||
  unsigned i;
 | 
			
		||||
 | 
			
		||||
  for (i = 0; i < n_outputs; i++)
 | 
			
		||||
    if (outputs[i].output_id == id)
 | 
			
		||||
      return &outputs[i];
 | 
			
		||||
 | 
			
		||||
  return NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_monitor_manager_kms_read_current (MetaMonitorManager *manager)
 | 
			
		||||
{
 | 
			
		||||
  MetaMonitorManagerKms *manager_kms = META_MONITOR_MANAGER_KMS (manager);
 | 
			
		||||
  drmModeRes *resources;
 | 
			
		||||
  GHashTable *modes;
 | 
			
		||||
  GHashTableIter iter;
 | 
			
		||||
  drmModeModeInfo *mode;
 | 
			
		||||
  unsigned int i, j, k;
 | 
			
		||||
  unsigned int n_actual_outputs;
 | 
			
		||||
  int width, height;
 | 
			
		||||
  MetaOutput *old_outputs;
 | 
			
		||||
  unsigned int n_old_outputs;
 | 
			
		||||
 | 
			
		||||
  resources = drmModeGetResources(manager_kms->fd);
 | 
			
		||||
  modes = g_hash_table_new (drm_mode_hash, drm_mode_equal);
 | 
			
		||||
 | 
			
		||||
  manager->max_screen_width = resources->max_width;
 | 
			
		||||
  manager->max_screen_height = resources->max_height;
 | 
			
		||||
 | 
			
		||||
  manager->power_save_mode = META_POWER_SAVE_ON;
 | 
			
		||||
 | 
			
		||||
  old_outputs = manager->outputs;
 | 
			
		||||
  n_old_outputs = manager->n_outputs;
 | 
			
		||||
 | 
			
		||||
  /* Note: we must not free the public structures (output, crtc, monitor
 | 
			
		||||
     mode and monitor info) here, they must be kept alive until the API
 | 
			
		||||
     users are done with them after we emit monitors-changed, and thus
 | 
			
		||||
     are freed by the platform-independent layer. */
 | 
			
		||||
  free_resources (manager_kms);
 | 
			
		||||
 | 
			
		||||
  manager_kms->n_connectors = resources->count_connectors;
 | 
			
		||||
  manager_kms->connectors = g_new (drmModeConnector *, manager_kms->n_connectors);
 | 
			
		||||
  for (i = 0; i < manager_kms->n_connectors; i++)
 | 
			
		||||
    {
 | 
			
		||||
      drmModeConnector *connector;
 | 
			
		||||
 | 
			
		||||
      connector = drmModeGetConnector (manager_kms->fd, resources->connectors[i]);
 | 
			
		||||
      manager_kms->connectors[i] = connector;
 | 
			
		||||
 | 
			
		||||
      if (connector->connection == DRM_MODE_CONNECTED)
 | 
			
		||||
        {
 | 
			
		||||
          /* Collect all modes for this connector */
 | 
			
		||||
          for (j = 0; j < (unsigned)connector->count_modes; j++)
 | 
			
		||||
            g_hash_table_add (modes, &connector->modes[j]);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  manager_kms->n_encoders = resources->count_encoders;
 | 
			
		||||
  manager_kms->encoders = g_new (drmModeEncoder *, manager_kms->n_encoders);
 | 
			
		||||
  for (i = 0; i < manager_kms->n_encoders; i++)
 | 
			
		||||
    {
 | 
			
		||||
      manager_kms->encoders[i] = drmModeGetEncoder (manager_kms->fd,
 | 
			
		||||
                                                    resources->encoders[i]);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  manager->n_modes = g_hash_table_size (modes);
 | 
			
		||||
  manager->modes = g_new0 (MetaMonitorMode, manager->n_modes);
 | 
			
		||||
  g_hash_table_iter_init (&iter, modes);
 | 
			
		||||
  i = 0;
 | 
			
		||||
  while (g_hash_table_iter_next (&iter, NULL, (gpointer)&mode))
 | 
			
		||||
    {
 | 
			
		||||
      MetaMonitorMode *meta_mode;
 | 
			
		||||
 | 
			
		||||
      meta_mode = &manager->modes[i];
 | 
			
		||||
 | 
			
		||||
      meta_mode->mode_id = i;
 | 
			
		||||
      meta_mode->name = g_strndup (mode->name, DRM_DISPLAY_MODE_LEN);
 | 
			
		||||
      meta_mode->width = mode->hdisplay;
 | 
			
		||||
      meta_mode->height = mode->vdisplay;
 | 
			
		||||
      meta_mode->refresh_rate = (1000 * mode->clock /
 | 
			
		||||
                                 ((float)mode->htotal * mode->vtotal));
 | 
			
		||||
 | 
			
		||||
      meta_mode->driver_private = g_slice_dup (drmModeModeInfo, mode);
 | 
			
		||||
      meta_mode->driver_notify = (GDestroyNotify)meta_monitor_mode_destroy_notify;
 | 
			
		||||
 | 
			
		||||
      i++;
 | 
			
		||||
    }
 | 
			
		||||
  g_hash_table_destroy (modes);
 | 
			
		||||
 | 
			
		||||
  manager->n_crtcs = resources->count_crtcs;
 | 
			
		||||
  manager->crtcs = g_new0 (MetaCRTC, manager->n_crtcs);
 | 
			
		||||
  width = 0; height = 0;
 | 
			
		||||
  for (i = 0; i < (unsigned)resources->count_crtcs; i++)
 | 
			
		||||
    {
 | 
			
		||||
      drmModeCrtc *crtc;
 | 
			
		||||
      MetaCRTC *meta_crtc;
 | 
			
		||||
 | 
			
		||||
      crtc = drmModeGetCrtc (manager_kms->fd, resources->crtcs[i]);
 | 
			
		||||
 | 
			
		||||
      meta_crtc = &manager->crtcs[i];
 | 
			
		||||
 | 
			
		||||
      meta_crtc->crtc_id = crtc->crtc_id;
 | 
			
		||||
      meta_crtc->rect.x = crtc->x;
 | 
			
		||||
      meta_crtc->rect.y = crtc->y;
 | 
			
		||||
      meta_crtc->rect.width = crtc->width;
 | 
			
		||||
      meta_crtc->rect.height = crtc->height;
 | 
			
		||||
      meta_crtc->is_dirty = FALSE;
 | 
			
		||||
      meta_crtc->transform = WL_OUTPUT_TRANSFORM_NORMAL;
 | 
			
		||||
      /* FIXME: implement! */
 | 
			
		||||
      meta_crtc->all_transforms = 1 << WL_OUTPUT_TRANSFORM_NORMAL;
 | 
			
		||||
 | 
			
		||||
      if (crtc->mode_valid)
 | 
			
		||||
        {
 | 
			
		||||
          for (j = 0; j < manager->n_modes; j++)
 | 
			
		||||
            {
 | 
			
		||||
              if (drm_mode_equal (&crtc->mode, manager->modes[j].driver_private))
 | 
			
		||||
                {
 | 
			
		||||
                  meta_crtc->current_mode = &manager->modes[j];
 | 
			
		||||
                  break;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
          width = MAX (width, meta_crtc->rect.x + meta_crtc->rect.width);
 | 
			
		||||
          height = MAX (height, meta_crtc->rect.y + meta_crtc->rect.height);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      drmModeFreeCrtc (crtc);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  manager->screen_width = width;
 | 
			
		||||
  manager->screen_height = height;
 | 
			
		||||
 | 
			
		||||
  manager->outputs = g_new0 (MetaOutput, manager_kms->n_connectors);
 | 
			
		||||
  n_actual_outputs = 0;
 | 
			
		||||
 | 
			
		||||
  for (i = 0; i < manager_kms->n_connectors; i++)
 | 
			
		||||
    {
 | 
			
		||||
      MetaOutput *meta_output, *old_output;
 | 
			
		||||
      MetaOutputKms *output_kms;
 | 
			
		||||
      drmModeConnector *connector;
 | 
			
		||||
      GArray *crtcs;
 | 
			
		||||
      unsigned int crtc_mask;
 | 
			
		||||
      GBytes *edid;
 | 
			
		||||
 | 
			
		||||
      connector = manager_kms->connectors[i];
 | 
			
		||||
      meta_output = &manager->outputs[n_actual_outputs];
 | 
			
		||||
 | 
			
		||||
      if (connector->connection == DRM_MODE_CONNECTED)
 | 
			
		||||
	{
 | 
			
		||||
          meta_output->driver_private = output_kms = g_slice_new0 (MetaOutputKms);
 | 
			
		||||
          meta_output->driver_notify = (GDestroyNotify)meta_output_destroy_notify;
 | 
			
		||||
 | 
			
		||||
	  meta_output->output_id = connector->connector_id;
 | 
			
		||||
	  meta_output->name = make_output_name (connector);
 | 
			
		||||
	  meta_output->width_mm = connector->mmWidth;
 | 
			
		||||
	  meta_output->height_mm = connector->mmHeight;
 | 
			
		||||
 | 
			
		||||
          switch (connector->subpixel)
 | 
			
		||||
            {
 | 
			
		||||
            case DRM_MODE_SUBPIXEL_NONE:
 | 
			
		||||
              meta_output->subpixel_order = COGL_SUBPIXEL_ORDER_NONE;
 | 
			
		||||
              break;
 | 
			
		||||
            case DRM_MODE_SUBPIXEL_HORIZONTAL_RGB:
 | 
			
		||||
              meta_output->subpixel_order = COGL_SUBPIXEL_ORDER_HORIZONTAL_RGB;
 | 
			
		||||
              break;
 | 
			
		||||
            case DRM_MODE_SUBPIXEL_HORIZONTAL_BGR:
 | 
			
		||||
              meta_output->subpixel_order = COGL_SUBPIXEL_ORDER_HORIZONTAL_BGR;
 | 
			
		||||
              break;
 | 
			
		||||
            case DRM_MODE_SUBPIXEL_VERTICAL_RGB:
 | 
			
		||||
              meta_output->subpixel_order = COGL_SUBPIXEL_ORDER_VERTICAL_RGB;
 | 
			
		||||
              break;
 | 
			
		||||
            case DRM_MODE_SUBPIXEL_VERTICAL_BGR:
 | 
			
		||||
              meta_output->subpixel_order = COGL_SUBPIXEL_ORDER_VERTICAL_BGR;
 | 
			
		||||
              break;
 | 
			
		||||
            case DRM_MODE_SUBPIXEL_UNKNOWN:
 | 
			
		||||
            default:
 | 
			
		||||
              meta_output->subpixel_order = COGL_SUBPIXEL_ORDER_UNKNOWN;
 | 
			
		||||
              break;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
	  meta_output->n_modes = connector->count_modes;
 | 
			
		||||
	  meta_output->modes = g_new0 (MetaMonitorMode *, meta_output->n_modes);
 | 
			
		||||
	  for (j = 0; j < meta_output->n_modes; j++)
 | 
			
		||||
            meta_output->modes[j] = find_meta_mode (manager, &connector->modes[j]);
 | 
			
		||||
	  meta_output->preferred_mode = meta_output->modes[0];
 | 
			
		||||
 | 
			
		||||
          output_kms->connector = connector;
 | 
			
		||||
          output_kms->n_encoders = connector->count_encoders;
 | 
			
		||||
          output_kms->encoders = g_new0 (drmModeEncoderPtr, output_kms->n_encoders);
 | 
			
		||||
 | 
			
		||||
          crtc_mask = ~(unsigned int)0;
 | 
			
		||||
	  for (j = 0; j < output_kms->n_encoders; j++)
 | 
			
		||||
	    {
 | 
			
		||||
              output_kms->encoders[j] = drmModeGetEncoder (manager_kms->fd, connector->encoders[j]);
 | 
			
		||||
 | 
			
		||||
              /* We only list CRTCs as supported if they are supported by all encoders
 | 
			
		||||
                 for this connectors.
 | 
			
		||||
 | 
			
		||||
                 This is what xf86-video-modesetting does (see drmmode_output_init())
 | 
			
		||||
              */
 | 
			
		||||
              crtc_mask &= output_kms->encoders[j]->possible_crtcs;
 | 
			
		||||
 | 
			
		||||
              if (output_kms->encoders[j]->encoder_id == connector->encoder_id)
 | 
			
		||||
                output_kms->current_encoder = output_kms->encoders[j];
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
          crtcs = g_array_new (FALSE, FALSE, sizeof (MetaCRTC*));
 | 
			
		||||
 | 
			
		||||
          for (j = 0; j < manager->n_crtcs; j++)
 | 
			
		||||
            {
 | 
			
		||||
              if (crtc_mask & (1 << j))
 | 
			
		||||
                {
 | 
			
		||||
                  MetaCRTC *crtc = &manager->crtcs[j];
 | 
			
		||||
                  g_array_append_val (crtcs, crtc);
 | 
			
		||||
		}
 | 
			
		||||
	    }
 | 
			
		||||
 | 
			
		||||
	  meta_output->n_possible_crtcs = crtcs->len;
 | 
			
		||||
	  meta_output->possible_crtcs = (void*)g_array_free (crtcs, FALSE);
 | 
			
		||||
 | 
			
		||||
          if (output_kms->current_encoder && output_kms->current_encoder->crtc_id != 0)
 | 
			
		||||
            {
 | 
			
		||||
              for (j = 0; j < manager->n_crtcs; j++)
 | 
			
		||||
                {
 | 
			
		||||
                  if (manager->crtcs[j].crtc_id == output_kms->current_encoder->crtc_id)
 | 
			
		||||
                    {
 | 
			
		||||
                      meta_output->crtc = &manager->crtcs[j];
 | 
			
		||||
                      break;
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
          else
 | 
			
		||||
            meta_output->crtc = NULL;
 | 
			
		||||
 | 
			
		||||
          old_output = find_output_by_id (old_outputs, n_old_outputs,
 | 
			
		||||
                                          meta_output->output_id);
 | 
			
		||||
          if (old_output)
 | 
			
		||||
            {
 | 
			
		||||
              meta_output->is_primary = old_output->is_primary;
 | 
			
		||||
              meta_output->is_presentation = old_output->is_presentation;
 | 
			
		||||
            }
 | 
			
		||||
          else
 | 
			
		||||
            {
 | 
			
		||||
              meta_output->is_primary = FALSE;
 | 
			
		||||
              meta_output->is_presentation = FALSE;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
          find_properties (manager_kms, output_kms);
 | 
			
		||||
 | 
			
		||||
          edid = read_output_edid (manager_kms, meta_output);
 | 
			
		||||
          if (edid)
 | 
			
		||||
            {
 | 
			
		||||
              MonitorInfo *parsed_edid;
 | 
			
		||||
              gsize len;
 | 
			
		||||
 | 
			
		||||
              parsed_edid = decode_edid (g_bytes_get_data (edid, &len));
 | 
			
		||||
              if (parsed_edid)
 | 
			
		||||
                {
 | 
			
		||||
                  meta_output->vendor = g_strndup (parsed_edid->manufacturer_code, 4);
 | 
			
		||||
                  meta_output->product = g_strndup (parsed_edid->dsc_product_name, 14);
 | 
			
		||||
                  meta_output->serial = g_strndup (parsed_edid->dsc_serial_number, 14);
 | 
			
		||||
 | 
			
		||||
                  g_free (parsed_edid);
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
              g_bytes_unref (edid);
 | 
			
		||||
            }
 | 
			
		||||
          if (!meta_output->vendor)
 | 
			
		||||
            {
 | 
			
		||||
              meta_output->vendor = g_strdup ("unknown");
 | 
			
		||||
              meta_output->product = g_strdup ("unknown");
 | 
			
		||||
              meta_output->serial = g_strdup ("unknown");
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
          /* FIXME: backlight is a very driver specific thing unfortunately,
 | 
			
		||||
             every DDX does its own thing, and the dumb KMS API does not include it.
 | 
			
		||||
 | 
			
		||||
             For example, xf86-video-intel has a list of paths to probe in /sys/class/backlight
 | 
			
		||||
             (one for each major HW maker, and then some).
 | 
			
		||||
             We can't do the same because we're not root.
 | 
			
		||||
             It might be best to leave backlight out of the story and rely on the setuid
 | 
			
		||||
             helper in gnome-settings-daemon.
 | 
			
		||||
          */
 | 
			
		||||
	  meta_output->backlight_min = 0;
 | 
			
		||||
          meta_output->backlight_max = 0;
 | 
			
		||||
          meta_output->backlight = -1;
 | 
			
		||||
 | 
			
		||||
	  n_actual_outputs++;
 | 
			
		||||
	}
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  manager->n_outputs = n_actual_outputs;
 | 
			
		||||
  manager->outputs = g_renew (MetaOutput, manager->outputs, manager->n_outputs);
 | 
			
		||||
 | 
			
		||||
  /* Sort the outputs for easier handling in MetaMonitorConfig */
 | 
			
		||||
  qsort (manager->outputs, manager->n_outputs, sizeof (MetaOutput), compare_outputs);
 | 
			
		||||
 | 
			
		||||
  /* Now fix the clones.
 | 
			
		||||
     Code mostly inspired by xf86-video-modesetting. */
 | 
			
		||||
 | 
			
		||||
  /* XXX: intel hardware doesn't usually have clones, but I only have laptops with
 | 
			
		||||
     intel cards, so this code was never tested! */
 | 
			
		||||
  for (i = 0; i < manager->n_outputs; i++)
 | 
			
		||||
    {
 | 
			
		||||
      MetaOutput *meta_output;
 | 
			
		||||
      MetaOutputKms *output_kms;
 | 
			
		||||
 | 
			
		||||
      meta_output = &manager->outputs[i];
 | 
			
		||||
      output_kms = meta_output->driver_private;
 | 
			
		||||
 | 
			
		||||
      output_kms->enc_clone_mask = 0xff;
 | 
			
		||||
      output_kms->encoder_mask = 0;
 | 
			
		||||
 | 
			
		||||
      for (j = 0; j < output_kms->n_encoders; j++)
 | 
			
		||||
	{
 | 
			
		||||
	  for (k = 0; k < manager_kms->n_encoders; k++)
 | 
			
		||||
	    {
 | 
			
		||||
	      if (output_kms->encoders[j]->encoder_id == manager_kms->encoders[k]->encoder_id)
 | 
			
		||||
		{
 | 
			
		||||
                  output_kms->encoder_mask |= (1 << k);
 | 
			
		||||
		  break;
 | 
			
		||||
		}
 | 
			
		||||
	    }
 | 
			
		||||
 | 
			
		||||
          output_kms->enc_clone_mask &= output_kms->encoders[j]->possible_clones;
 | 
			
		||||
	}
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  for (i = 0; i < manager->n_outputs; i++)
 | 
			
		||||
    {
 | 
			
		||||
      MetaOutput *meta_output;
 | 
			
		||||
      MetaOutputKms *output_kms;
 | 
			
		||||
 | 
			
		||||
      meta_output = &manager->outputs[i];
 | 
			
		||||
      output_kms = meta_output->driver_private;
 | 
			
		||||
 | 
			
		||||
      if (output_kms->enc_clone_mask == 0)
 | 
			
		||||
        continue;
 | 
			
		||||
 | 
			
		||||
      for (j = 0; j < manager->n_outputs; j++)
 | 
			
		||||
        {
 | 
			
		||||
          MetaOutput *meta_clone;
 | 
			
		||||
          MetaOutputKms *clone_kms;
 | 
			
		||||
 | 
			
		||||
          meta_clone = &manager->outputs[i];
 | 
			
		||||
          clone_kms = meta_clone->driver_private;
 | 
			
		||||
 | 
			
		||||
          if (meta_clone == meta_output)
 | 
			
		||||
            continue;
 | 
			
		||||
 | 
			
		||||
          if (clone_kms->encoder_mask == 0)
 | 
			
		||||
            continue;
 | 
			
		||||
 | 
			
		||||
          if (clone_kms->encoder_mask == output_kms->enc_clone_mask)
 | 
			
		||||
            {
 | 
			
		||||
              meta_output->n_possible_clones++;
 | 
			
		||||
              meta_output->possible_clones = g_renew (MetaOutput *,
 | 
			
		||||
                                                      meta_output->possible_clones,
 | 
			
		||||
                                                      meta_output->n_possible_clones);
 | 
			
		||||
              meta_output->possible_clones[meta_output->n_possible_clones - 1] = meta_clone;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  drmModeFreeResources (resources);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static GBytes *
 | 
			
		||||
meta_monitor_manager_kms_read_edid (MetaMonitorManager *manager,
 | 
			
		||||
                                    MetaOutput         *output)
 | 
			
		||||
{
 | 
			
		||||
  MetaMonitorManagerKms *manager_kms = META_MONITOR_MANAGER_KMS (manager);
 | 
			
		||||
 | 
			
		||||
  return read_output_edid (manager_kms, output);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_monitor_manager_kms_set_power_save_mode (MetaMonitorManager *manager,
 | 
			
		||||
                                              MetaPowerSave       mode)
 | 
			
		||||
{
 | 
			
		||||
  MetaMonitorManagerKms *manager_kms = META_MONITOR_MANAGER_KMS (manager);
 | 
			
		||||
  uint64_t state;
 | 
			
		||||
  unsigned i;
 | 
			
		||||
 | 
			
		||||
  switch (mode) {
 | 
			
		||||
  case META_POWER_SAVE_ON:
 | 
			
		||||
    state = DRM_MODE_DPMS_ON;
 | 
			
		||||
    break;
 | 
			
		||||
  case META_POWER_SAVE_STANDBY:
 | 
			
		||||
    state = DRM_MODE_DPMS_STANDBY;
 | 
			
		||||
    break;
 | 
			
		||||
  case META_POWER_SAVE_SUSPEND:
 | 
			
		||||
    state = DRM_MODE_DPMS_SUSPEND;
 | 
			
		||||
    break;
 | 
			
		||||
  case META_POWER_SAVE_OFF:
 | 
			
		||||
    state = DRM_MODE_DPMS_SUSPEND;
 | 
			
		||||
    break;
 | 
			
		||||
  default:
 | 
			
		||||
    return;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  for (i = 0; i < manager->n_outputs; i++)
 | 
			
		||||
    {
 | 
			
		||||
      MetaOutput *meta_output;
 | 
			
		||||
      MetaOutputKms *output_kms;
 | 
			
		||||
 | 
			
		||||
      meta_output = &manager->outputs[i];
 | 
			
		||||
      output_kms = meta_output->driver_private;
 | 
			
		||||
 | 
			
		||||
      if (output_kms->dpms_prop_id != 0)
 | 
			
		||||
        {
 | 
			
		||||
          int ok = drmModeConnectorSetProperty(manager_kms->fd, meta_output->output_id,
 | 
			
		||||
                                               output_kms->dpms_prop_id, state);
 | 
			
		||||
 | 
			
		||||
          if (ok < 0)
 | 
			
		||||
            meta_warning ("Failed to set power save mode for output %s: %s\n",
 | 
			
		||||
                          meta_output->name, strerror (errno));
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
crtc_free (CoglKmsCrtc *crtc)
 | 
			
		||||
{
 | 
			
		||||
  g_free (crtc->connectors);
 | 
			
		||||
  g_slice_free (CoglKmsCrtc, crtc);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_monitor_manager_kms_apply_configuration (MetaMonitorManager *manager,
 | 
			
		||||
                                              MetaCRTCInfo       **crtcs,
 | 
			
		||||
                                              unsigned int         n_crtcs,
 | 
			
		||||
                                              MetaOutputInfo     **outputs,
 | 
			
		||||
                                              unsigned int         n_outputs)
 | 
			
		||||
{
 | 
			
		||||
  ClutterBackend *backend;
 | 
			
		||||
  CoglContext *cogl_context;
 | 
			
		||||
  CoglDisplay *cogl_display;
 | 
			
		||||
  unsigned i;
 | 
			
		||||
  GPtrArray *cogl_crtcs;
 | 
			
		||||
  int screen_width, screen_height;
 | 
			
		||||
  gboolean ok;
 | 
			
		||||
  GError *error;
 | 
			
		||||
 | 
			
		||||
  cogl_crtcs = g_ptr_array_new_full (manager->n_crtcs, (GDestroyNotify)crtc_free);
 | 
			
		||||
  screen_width = 0; screen_height = 0;
 | 
			
		||||
  for (i = 0; i < n_crtcs; i++)
 | 
			
		||||
    {
 | 
			
		||||
      MetaCRTCInfo *crtc_info = crtcs[i];
 | 
			
		||||
      MetaCRTC *crtc = crtc_info->crtc;
 | 
			
		||||
      CoglKmsCrtc *cogl_crtc;
 | 
			
		||||
 | 
			
		||||
      crtc->is_dirty = TRUE;
 | 
			
		||||
 | 
			
		||||
      cogl_crtc = g_slice_new0 (CoglKmsCrtc);
 | 
			
		||||
      g_ptr_array_add (cogl_crtcs, cogl_crtc);
 | 
			
		||||
 | 
			
		||||
      if (crtc_info->mode == NULL)
 | 
			
		||||
        {
 | 
			
		||||
          cogl_crtc->id = crtc->crtc_id;
 | 
			
		||||
          cogl_crtc->x = 0;
 | 
			
		||||
          cogl_crtc->y = 0;
 | 
			
		||||
          cogl_crtc->count = 0;
 | 
			
		||||
          memset (&cogl_crtc->mode, 0, sizeof (drmModeModeInfo));
 | 
			
		||||
          cogl_crtc->connectors = NULL;
 | 
			
		||||
          cogl_crtc->count = 0;
 | 
			
		||||
 | 
			
		||||
          crtc->rect.x = 0;
 | 
			
		||||
          crtc->rect.y = 0;
 | 
			
		||||
          crtc->rect.width = 0;
 | 
			
		||||
          crtc->rect.height = 0;
 | 
			
		||||
          crtc->current_mode = NULL;
 | 
			
		||||
        }
 | 
			
		||||
      else
 | 
			
		||||
        {
 | 
			
		||||
          MetaMonitorMode *mode;
 | 
			
		||||
          uint32_t *connectors;
 | 
			
		||||
          unsigned int j, n_connectors;
 | 
			
		||||
          int width, height;
 | 
			
		||||
 | 
			
		||||
          mode = crtc_info->mode;
 | 
			
		||||
 | 
			
		||||
          cogl_crtc->id = crtc->crtc_id;
 | 
			
		||||
          cogl_crtc->x = crtc_info->x;
 | 
			
		||||
          cogl_crtc->y = crtc_info->y;
 | 
			
		||||
          cogl_crtc->count = n_connectors = crtc_info->outputs->len;
 | 
			
		||||
          cogl_crtc->connectors = connectors = g_new (uint32_t, n_connectors);
 | 
			
		||||
 | 
			
		||||
          for (j = 0; j < n_connectors; j++)
 | 
			
		||||
            {
 | 
			
		||||
              MetaOutput *output = g_ptr_array_index (crtc_info->outputs, j);
 | 
			
		||||
 | 
			
		||||
              connectors[j] = output->output_id;
 | 
			
		||||
 | 
			
		||||
              output->is_dirty = TRUE;
 | 
			
		||||
              output->crtc = crtc;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
          memcpy (&cogl_crtc->mode, crtc_info->mode->driver_private,
 | 
			
		||||
                  sizeof (drmModeModeInfo));
 | 
			
		||||
 | 
			
		||||
          if (meta_monitor_transform_is_rotated (crtc_info->transform))
 | 
			
		||||
            {
 | 
			
		||||
              width = mode->height;
 | 
			
		||||
              height = mode->width;
 | 
			
		||||
            }
 | 
			
		||||
          else
 | 
			
		||||
            {
 | 
			
		||||
              width = mode->width;
 | 
			
		||||
              height = mode->height;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
          screen_width = MAX (screen_width, crtc_info->x + width);
 | 
			
		||||
          screen_height = MAX (screen_height, crtc_info->y + height);
 | 
			
		||||
 | 
			
		||||
          crtc->rect.x = crtc_info->x;
 | 
			
		||||
          crtc->rect.y = crtc_info->y;
 | 
			
		||||
          crtc->rect.width = width;
 | 
			
		||||
          crtc->rect.height = height;
 | 
			
		||||
          crtc->current_mode = mode;
 | 
			
		||||
          crtc->transform = crtc_info->transform;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  /* Disable CRTCs not mentioned in the list (they have is_dirty == FALSE,
 | 
			
		||||
     because they weren't seen in the first loop) */
 | 
			
		||||
  for (i = 0; i < manager->n_crtcs; i++)
 | 
			
		||||
    {
 | 
			
		||||
      MetaCRTC *crtc = &manager->crtcs[i];
 | 
			
		||||
      CoglKmsCrtc *cogl_crtc;
 | 
			
		||||
 | 
			
		||||
      crtc->logical_monitor = NULL;
 | 
			
		||||
 | 
			
		||||
      if (crtc->is_dirty)
 | 
			
		||||
        {
 | 
			
		||||
          crtc->is_dirty = FALSE;
 | 
			
		||||
          continue;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      cogl_crtc = g_slice_new0 (CoglKmsCrtc);
 | 
			
		||||
      g_ptr_array_add (cogl_crtcs, cogl_crtc);
 | 
			
		||||
 | 
			
		||||
      cogl_crtc->id = crtc->crtc_id;
 | 
			
		||||
      cogl_crtc->x = 0;
 | 
			
		||||
      cogl_crtc->y = 0;
 | 
			
		||||
      cogl_crtc->count = 0;
 | 
			
		||||
      memset (&cogl_crtc->mode, 0, sizeof (drmModeModeInfo));
 | 
			
		||||
      cogl_crtc->connectors = NULL;
 | 
			
		||||
      cogl_crtc->count = 0;
 | 
			
		||||
 | 
			
		||||
      crtc->rect.x = 0;
 | 
			
		||||
      crtc->rect.y = 0;
 | 
			
		||||
      crtc->rect.width = 0;
 | 
			
		||||
      crtc->rect.height = 0;
 | 
			
		||||
      crtc->current_mode = NULL;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  backend = clutter_get_default_backend ();
 | 
			
		||||
  cogl_context = clutter_backend_get_cogl_context (backend);
 | 
			
		||||
  cogl_display = cogl_context_get_display (cogl_context);
 | 
			
		||||
 | 
			
		||||
  error = NULL;
 | 
			
		||||
  ok = cogl_kms_display_set_layout (cogl_display, screen_width, screen_height,
 | 
			
		||||
                                    (CoglKmsCrtc**)cogl_crtcs->pdata, cogl_crtcs->len, &error);
 | 
			
		||||
  g_ptr_array_unref (cogl_crtcs);
 | 
			
		||||
 | 
			
		||||
  if (!ok)
 | 
			
		||||
    {
 | 
			
		||||
      meta_warning ("Applying display configuration failed: %s\n", error->message);
 | 
			
		||||
      g_error_free (error);
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  for (i = 0; i < n_outputs; i++)
 | 
			
		||||
    {
 | 
			
		||||
      MetaOutputInfo *output_info = outputs[i];
 | 
			
		||||
      MetaOutput *output = output_info->output;
 | 
			
		||||
 | 
			
		||||
      output->is_primary = output_info->is_primary;
 | 
			
		||||
      output->is_presentation = output_info->is_presentation;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  /* Disable outputs not mentioned in the list */
 | 
			
		||||
  for (i = 0; i < manager->n_outputs; i++)
 | 
			
		||||
    {
 | 
			
		||||
      MetaOutput *output = &manager->outputs[i];
 | 
			
		||||
 | 
			
		||||
      if (output->is_dirty)
 | 
			
		||||
        {
 | 
			
		||||
          output->is_dirty = FALSE;
 | 
			
		||||
          continue;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      output->crtc = NULL;
 | 
			
		||||
      output->is_primary = FALSE;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  manager->screen_width = screen_width;
 | 
			
		||||
  manager->screen_height = screen_height;
 | 
			
		||||
 | 
			
		||||
  meta_monitor_manager_rebuild_derived (manager);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_monitor_manager_kms_get_crtc_gamma (MetaMonitorManager  *manager,
 | 
			
		||||
                                         MetaCRTC            *crtc,
 | 
			
		||||
                                         gsize               *size,
 | 
			
		||||
                                         unsigned short     **red,
 | 
			
		||||
                                         unsigned short     **green,
 | 
			
		||||
                                         unsigned short     **blue)
 | 
			
		||||
{
 | 
			
		||||
  MetaMonitorManagerKms *manager_kms = META_MONITOR_MANAGER_KMS (manager);
 | 
			
		||||
  drmModeCrtc *kms_crtc;
 | 
			
		||||
 | 
			
		||||
  kms_crtc = drmModeGetCrtc (manager_kms->fd, crtc->crtc_id);
 | 
			
		||||
 | 
			
		||||
  *size = kms_crtc->gamma_size;
 | 
			
		||||
  *red = g_new (unsigned short, *size);
 | 
			
		||||
  *green = g_new (unsigned short, *size);
 | 
			
		||||
  *blue = g_new (unsigned short, *size);
 | 
			
		||||
 | 
			
		||||
  drmModeCrtcGetGamma (manager_kms->fd, crtc->crtc_id, *size, *red, *green, *blue);
 | 
			
		||||
 | 
			
		||||
  drmModeFreeCrtc (kms_crtc);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_monitor_manager_kms_set_crtc_gamma (MetaMonitorManager *manager,
 | 
			
		||||
                                         MetaCRTC           *crtc,
 | 
			
		||||
                                         gsize               size,
 | 
			
		||||
                                         unsigned short     *red,
 | 
			
		||||
                                         unsigned short     *green,
 | 
			
		||||
                                         unsigned short     *blue)
 | 
			
		||||
{
 | 
			
		||||
  MetaMonitorManagerKms *manager_kms = META_MONITOR_MANAGER_KMS (manager);
 | 
			
		||||
 | 
			
		||||
  drmModeCrtcSetGamma (manager_kms->fd, crtc->crtc_id, size, red, green, blue);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_monitor_manager_kms_init (MetaMonitorManagerKms *manager_kms)
 | 
			
		||||
{
 | 
			
		||||
  ClutterBackend *backend;
 | 
			
		||||
  CoglContext *cogl_context;
 | 
			
		||||
  CoglDisplay *cogl_display;
 | 
			
		||||
  CoglRenderer *cogl_renderer;
 | 
			
		||||
 | 
			
		||||
  backend = clutter_get_default_backend ();
 | 
			
		||||
  cogl_context = clutter_backend_get_cogl_context (backend);
 | 
			
		||||
  cogl_display = cogl_context_get_display (cogl_context);
 | 
			
		||||
  cogl_renderer = cogl_display_get_renderer (cogl_display);
 | 
			
		||||
 | 
			
		||||
  manager_kms->fd = cogl_kms_renderer_get_kms_fd (cogl_renderer);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_monitor_manager_kms_finalize (GObject *object)
 | 
			
		||||
{
 | 
			
		||||
  MetaMonitorManagerKms *manager_kms = META_MONITOR_MANAGER_KMS (object);
 | 
			
		||||
 | 
			
		||||
  free_resources (manager_kms);
 | 
			
		||||
 | 
			
		||||
  G_OBJECT_CLASS (meta_monitor_manager_kms_parent_class)->finalize (object);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_monitor_manager_kms_class_init (MetaMonitorManagerKmsClass *klass)
 | 
			
		||||
{
 | 
			
		||||
  MetaMonitorManagerClass *manager_class = META_MONITOR_MANAGER_CLASS (klass);
 | 
			
		||||
  GObjectClass *object_class = G_OBJECT_CLASS (klass);
 | 
			
		||||
 | 
			
		||||
  object_class->finalize = meta_monitor_manager_kms_finalize;
 | 
			
		||||
 | 
			
		||||
  manager_class->read_current = meta_monitor_manager_kms_read_current;
 | 
			
		||||
  manager_class->read_edid = meta_monitor_manager_kms_read_edid;
 | 
			
		||||
  manager_class->apply_configuration = meta_monitor_manager_kms_apply_configuration;
 | 
			
		||||
  manager_class->set_power_save_mode = meta_monitor_manager_kms_set_power_save_mode;
 | 
			
		||||
  manager_class->get_crtc_gamma = meta_monitor_manager_kms_get_crtc_gamma;
 | 
			
		||||
  manager_class->set_crtc_gamma = meta_monitor_manager_kms_set_crtc_gamma;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -116,6 +116,12 @@ struct _MetaOutput
 | 
			
		||||
  */
 | 
			
		||||
  gboolean is_primary;
 | 
			
		||||
  gboolean is_presentation;
 | 
			
		||||
 | 
			
		||||
  gpointer driver_private;
 | 
			
		||||
  GDestroyNotify driver_notify;
 | 
			
		||||
 | 
			
		||||
  /* get a new preferred mode on hotplug events, to handle dynamic guest resizing */
 | 
			
		||||
  gboolean hotplug_mode_update;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct _MetaCRTC
 | 
			
		||||
@@ -133,16 +139,23 @@ struct _MetaCRTC
 | 
			
		||||
 | 
			
		||||
  /* Used when changing configuration */
 | 
			
		||||
  gboolean is_dirty;
 | 
			
		||||
 | 
			
		||||
  /* Updated by MetaCursorTracker */
 | 
			
		||||
  gboolean has_hw_cursor;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct _MetaMonitorMode
 | 
			
		||||
{
 | 
			
		||||
  /* The low-level ID of this mode, used to apply back configuration */
 | 
			
		||||
  glong mode_id;
 | 
			
		||||
  char *name;
 | 
			
		||||
 | 
			
		||||
  int width;
 | 
			
		||||
  int height;
 | 
			
		||||
  float refresh_rate;
 | 
			
		||||
 | 
			
		||||
  gpointer driver_private;
 | 
			
		||||
  GDestroyNotify driver_notify;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
@@ -301,6 +314,8 @@ GType meta_monitor_manager_get_type (void);
 | 
			
		||||
void                meta_monitor_manager_initialize (void);
 | 
			
		||||
MetaMonitorManager *meta_monitor_manager_get  (void);
 | 
			
		||||
 | 
			
		||||
void                meta_monitor_manager_rebuild_derived   (MetaMonitorManager *manager);
 | 
			
		||||
 | 
			
		||||
MetaMonitorInfo    *meta_monitor_manager_get_monitor_infos (MetaMonitorManager *manager,
 | 
			
		||||
							    unsigned int       *n_infos);
 | 
			
		||||
 | 
			
		||||
@@ -349,6 +364,18 @@ typedef struct _MetaMonitorManagerXrandr         MetaMonitorManagerXrandr;
 | 
			
		||||
 | 
			
		||||
GType meta_monitor_manager_xrandr_get_type (void);
 | 
			
		||||
 | 
			
		||||
#define META_TYPE_MONITOR_MANAGER_KMS            (meta_monitor_manager_kms_get_type ())
 | 
			
		||||
#define META_MONITOR_MANAGER_KMS(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_MONITOR_MANAGER_KMS, MetaMonitorManagerKms))
 | 
			
		||||
#define META_MONITOR_MANAGER_KMS_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  META_TYPE_MONITOR_MANAGER_KMS, MetaMonitorManagerKmsClass))
 | 
			
		||||
#define META_IS_MONITOR_MANAGER_KMS(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_MONITOR_MANAGER_KMS))
 | 
			
		||||
#define META_IS_MONITOR_MANAGER_KMS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  META_TYPE_MONITOR_MANAGER_KMS))
 | 
			
		||||
#define META_MONITOR_MANAGER_KMS_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  META_TYPE_MONITOR_MANAGER_KMS, MetaMonitorManagerKmsClass))
 | 
			
		||||
 | 
			
		||||
typedef struct _MetaMonitorManagerKmsClass    MetaMonitorManagerKmsClass;
 | 
			
		||||
typedef struct _MetaMonitorManagerKms         MetaMonitorManagerKms;
 | 
			
		||||
 | 
			
		||||
GType meta_monitor_manager_kms_get_type (void);
 | 
			
		||||
 | 
			
		||||
#define META_TYPE_MONITOR_CONFIG            (meta_monitor_config_get_type ())
 | 
			
		||||
#define META_MONITOR_CONFIG(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_MONITOR_CONFIG, MetaMonitorConfig))
 | 
			
		||||
#define META_MONITOR_CONFIG_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  META_TYPE_MONITOR_CONFIG, MetaMonitorConfigClass))
 | 
			
		||||
@@ -379,6 +406,12 @@ void               meta_monitor_config_restore_previous (MetaMonitorConfig  *con
 | 
			
		||||
void               meta_crtc_info_free   (MetaCRTCInfo   *info);
 | 
			
		||||
void               meta_output_info_free (MetaOutputInfo *info);
 | 
			
		||||
 | 
			
		||||
void               meta_monitor_manager_free_output_array (MetaOutput *old_outputs,
 | 
			
		||||
                                                           int         n_old_outputs);
 | 
			
		||||
void               meta_monitor_manager_free_mode_array (MetaMonitorMode *old_modes,
 | 
			
		||||
                                                         int              n_old_modes);
 | 
			
		||||
gboolean           meta_monitor_manager_has_hotplug_mode_update (MetaMonitorManager *manager);
 | 
			
		||||
 | 
			
		||||
/* Returns true if transform causes width and height to be inverted
 | 
			
		||||
   This is true for the odd transforms in the enum */
 | 
			
		||||
static inline gboolean
 | 
			
		||||
 
 | 
			
		||||
@@ -311,6 +311,29 @@ read_output_edid (MetaMonitorManagerXrandr *manager_xrandr,
 | 
			
		||||
  return NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static gboolean
 | 
			
		||||
output_get_hotplug_mode_update (MetaMonitorManagerXrandr *manager_xrandr,
 | 
			
		||||
                                XID                       output_id)
 | 
			
		||||
{
 | 
			
		||||
  MetaDisplay *display = meta_get_display ();
 | 
			
		||||
  XRRPropertyInfo *info;
 | 
			
		||||
  gboolean result = FALSE;
 | 
			
		||||
 | 
			
		||||
  meta_error_trap_push (display);
 | 
			
		||||
  info = XRRQueryOutputProperty (manager_xrandr->xdisplay, output_id,
 | 
			
		||||
                                 display->atom_hotplug_mode_update);
 | 
			
		||||
  meta_error_trap_pop (display);
 | 
			
		||||
 | 
			
		||||
  if (info)
 | 
			
		||||
    {
 | 
			
		||||
      result = TRUE;
 | 
			
		||||
      XFree (info);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  return result;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_monitor_manager_xrandr_read_current (MetaMonitorManager *manager)
 | 
			
		||||
{
 | 
			
		||||
@@ -337,22 +360,27 @@ meta_monitor_manager_xrandr_read_current (MetaMonitorManager *manager)
 | 
			
		||||
      dpms_enabled)
 | 
			
		||||
    {
 | 
			
		||||
      switch (dpms_state)
 | 
			
		||||
	{
 | 
			
		||||
	case DPMSModeOn:
 | 
			
		||||
	  manager->power_save_mode = META_POWER_SAVE_ON;
 | 
			
		||||
	case DPMSModeStandby:
 | 
			
		||||
	  manager->power_save_mode = META_POWER_SAVE_STANDBY;
 | 
			
		||||
	case DPMSModeSuspend:
 | 
			
		||||
	  manager->power_save_mode = META_POWER_SAVE_SUSPEND;
 | 
			
		||||
	case DPMSModeOff:
 | 
			
		||||
	  manager->power_save_mode = META_POWER_SAVE_OFF;
 | 
			
		||||
	default:
 | 
			
		||||
	  manager->power_save_mode = META_POWER_SAVE_UNKNOWN;
 | 
			
		||||
	}
 | 
			
		||||
        {
 | 
			
		||||
        case DPMSModeOn:
 | 
			
		||||
          manager->power_save_mode = META_POWER_SAVE_ON;
 | 
			
		||||
          break;
 | 
			
		||||
        case DPMSModeStandby:
 | 
			
		||||
          manager->power_save_mode = META_POWER_SAVE_STANDBY;
 | 
			
		||||
          break;
 | 
			
		||||
        case DPMSModeSuspend:
 | 
			
		||||
          manager->power_save_mode = META_POWER_SAVE_SUSPEND;
 | 
			
		||||
          break;
 | 
			
		||||
        case DPMSModeOff:
 | 
			
		||||
          manager->power_save_mode = META_POWER_SAVE_OFF;
 | 
			
		||||
          break;
 | 
			
		||||
        default:
 | 
			
		||||
          manager->power_save_mode = META_POWER_SAVE_UNSUPPORTED;
 | 
			
		||||
          break;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    {
 | 
			
		||||
      manager->power_save_mode = META_POWER_SAVE_UNKNOWN;
 | 
			
		||||
      manager->power_save_mode = META_POWER_SAVE_UNSUPPORTED;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  XRRGetScreenSizeRange (manager_xrandr->xdisplay, DefaultRootWindow (manager_xrandr->xdisplay),
 | 
			
		||||
@@ -425,8 +453,10 @@ meta_monitor_manager_xrandr_read_current (MetaMonitorManager *manager)
 | 
			
		||||
      XRRFreeCrtcInfo (crtc);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  meta_error_trap_push (meta_get_display ());
 | 
			
		||||
  primary_output = XRRGetOutputPrimary (manager_xrandr->xdisplay,
 | 
			
		||||
					DefaultRootWindow (manager_xrandr->xdisplay));
 | 
			
		||||
  meta_error_trap_pop (meta_get_display ());
 | 
			
		||||
 | 
			
		||||
  n_actual_outputs = 0;
 | 
			
		||||
  for (i = 0; i < (unsigned)resources->noutput; i++)
 | 
			
		||||
@@ -479,6 +509,8 @@ meta_monitor_manager_xrandr_read_current (MetaMonitorManager *manager)
 | 
			
		||||
	  meta_output->width_mm = output->mm_width;
 | 
			
		||||
	  meta_output->height_mm = output->mm_height;
 | 
			
		||||
	  meta_output->subpixel_order = COGL_SUBPIXEL_ORDER_UNKNOWN;
 | 
			
		||||
          meta_output->hotplug_mode_update =
 | 
			
		||||
              output_get_hotplug_mode_update (manager_xrandr, meta_output->output_id);
 | 
			
		||||
 | 
			
		||||
	  meta_output->n_modes = output->nmode;
 | 
			
		||||
	  meta_output->modes = g_new0 (MetaMonitorMode *, meta_output->n_modes);
 | 
			
		||||
@@ -527,7 +559,7 @@ meta_monitor_manager_xrandr_read_current (MetaMonitorManager *manager)
 | 
			
		||||
	  */
 | 
			
		||||
	  for (j = 0; j < (unsigned)output->nclone; j++)
 | 
			
		||||
	    {
 | 
			
		||||
	      meta_output->possible_clones = GINT_TO_POINTER (output->clones[j]);
 | 
			
		||||
	      meta_output->possible_clones[j] = GINT_TO_POINTER (output->clones[j]);
 | 
			
		||||
	    }
 | 
			
		||||
 | 
			
		||||
	  meta_output->is_primary = ((XID)meta_output->output_id == primary_output);
 | 
			
		||||
@@ -661,10 +693,11 @@ meta_monitor_manager_xrandr_apply_configuration (MetaMonitorManager *manager,
 | 
			
		||||
						 unsigned int         n_outputs)
 | 
			
		||||
{
 | 
			
		||||
  MetaMonitorManagerXrandr *manager_xrandr = META_MONITOR_MANAGER_XRANDR (manager);
 | 
			
		||||
  MetaDisplay *display = meta_get_display ();
 | 
			
		||||
  unsigned i;
 | 
			
		||||
  int width, height, width_mm, height_mm;
 | 
			
		||||
 | 
			
		||||
  meta_display_grab (meta_get_display ());
 | 
			
		||||
  meta_display_grab (display);
 | 
			
		||||
 | 
			
		||||
  /* First compute the new size of the screen (framebuffer) */
 | 
			
		||||
  width = 0; height = 0;
 | 
			
		||||
@@ -758,10 +791,10 @@ meta_monitor_manager_xrandr_apply_configuration (MetaMonitorManager *manager,
 | 
			
		||||
   */
 | 
			
		||||
  width_mm = (width / DPI_FALLBACK) * 25.4 + 0.5;
 | 
			
		||||
  height_mm = (height / DPI_FALLBACK) * 25.4 + 0.5;
 | 
			
		||||
  meta_error_trap_push (meta_get_display ());
 | 
			
		||||
  meta_error_trap_push (display);
 | 
			
		||||
  XRRSetScreenSize (manager_xrandr->xdisplay, DefaultRootWindow (manager_xrandr->xdisplay),
 | 
			
		||||
                    width, height, width_mm, height_mm);
 | 
			
		||||
  meta_error_trap_pop (meta_get_display ());
 | 
			
		||||
  meta_error_trap_pop (display);
 | 
			
		||||
 | 
			
		||||
  for (i = 0; i < n_crtcs; i++)
 | 
			
		||||
    {
 | 
			
		||||
@@ -772,19 +805,53 @@ meta_monitor_manager_xrandr_apply_configuration (MetaMonitorManager *manager,
 | 
			
		||||
        {
 | 
			
		||||
          MetaMonitorMode *mode;
 | 
			
		||||
          XID *outputs;
 | 
			
		||||
          int j, n_outputs;
 | 
			
		||||
          unsigned int j, n_outputs;
 | 
			
		||||
          int width, height;
 | 
			
		||||
          Status ok;
 | 
			
		||||
          unsigned long old_controlled_mask;
 | 
			
		||||
          unsigned long new_controlled_mask;
 | 
			
		||||
 | 
			
		||||
          mode = crtc_info->mode;
 | 
			
		||||
 | 
			
		||||
          n_outputs = crtc_info->outputs->len;
 | 
			
		||||
          outputs = g_new (XID, n_outputs);
 | 
			
		||||
 | 
			
		||||
          for (j = 0; j < n_outputs; j++)
 | 
			
		||||
            outputs[j] = ((MetaOutput**)crtc_info->outputs->pdata)[j]->output_id;
 | 
			
		||||
          old_controlled_mask = 0;
 | 
			
		||||
          for (j = 0; j < manager->n_outputs; j++)
 | 
			
		||||
            {
 | 
			
		||||
              MetaOutput *output;
 | 
			
		||||
 | 
			
		||||
          meta_error_trap_push (meta_get_display ());
 | 
			
		||||
              output = &manager->outputs[j];
 | 
			
		||||
 | 
			
		||||
              if (output->crtc == crtc)
 | 
			
		||||
                old_controlled_mask |= 1UL << j;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
          new_controlled_mask = 0;
 | 
			
		||||
          for (j = 0; j < n_outputs; j++)
 | 
			
		||||
            {
 | 
			
		||||
              MetaOutput *output;
 | 
			
		||||
 | 
			
		||||
              output = ((MetaOutput**)crtc_info->outputs->pdata)[j];
 | 
			
		||||
 | 
			
		||||
              output->is_dirty = TRUE;
 | 
			
		||||
              output->crtc = crtc;
 | 
			
		||||
              new_controlled_mask |= 1UL << j;
 | 
			
		||||
 | 
			
		||||
              outputs[j] = output->output_id;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
          if (crtc->current_mode == mode &&
 | 
			
		||||
              crtc->rect.x == crtc_info->x &&
 | 
			
		||||
              crtc->rect.y == crtc_info->y &&
 | 
			
		||||
              crtc->transform == crtc_info->transform &&
 | 
			
		||||
              old_controlled_mask == new_controlled_mask)
 | 
			
		||||
            {
 | 
			
		||||
              /* No change */
 | 
			
		||||
              goto next;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
          meta_error_trap_push (display);
 | 
			
		||||
          ok = XRRSetCrtcConfig (manager_xrandr->xdisplay,
 | 
			
		||||
                                 manager_xrandr->resources,
 | 
			
		||||
                                 (XID)crtc->crtc_id,
 | 
			
		||||
@@ -793,7 +860,7 @@ meta_monitor_manager_xrandr_apply_configuration (MetaMonitorManager *manager,
 | 
			
		||||
                                 (XID)mode->mode_id,
 | 
			
		||||
                                 wl_transform_to_xrandr (crtc_info->transform),
 | 
			
		||||
                                 outputs, n_outputs);
 | 
			
		||||
          meta_error_trap_pop (meta_get_display ());
 | 
			
		||||
          meta_error_trap_pop (display);
 | 
			
		||||
 | 
			
		||||
          if (ok != Success)
 | 
			
		||||
            {
 | 
			
		||||
@@ -801,11 +868,9 @@ meta_monitor_manager_xrandr_apply_configuration (MetaMonitorManager *manager,
 | 
			
		||||
                            (unsigned)(crtc->crtc_id), (unsigned)(mode->mode_id),
 | 
			
		||||
                            mode->width, mode->height, (float)mode->refresh_rate,
 | 
			
		||||
                            crtc_info->x, crtc_info->y, crtc_info->transform);
 | 
			
		||||
              continue;
 | 
			
		||||
              goto next;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
          g_free (outputs);
 | 
			
		||||
 | 
			
		||||
          if (meta_monitor_transform_is_rotated (crtc_info->transform))
 | 
			
		||||
            {
 | 
			
		||||
              width = mode->height;
 | 
			
		||||
@@ -824,15 +889,8 @@ meta_monitor_manager_xrandr_apply_configuration (MetaMonitorManager *manager,
 | 
			
		||||
          crtc->current_mode = mode;
 | 
			
		||||
          crtc->transform = crtc_info->transform;
 | 
			
		||||
 | 
			
		||||
          for (j = 0; j < n_outputs; j++)
 | 
			
		||||
            {
 | 
			
		||||
              MetaOutput *output;
 | 
			
		||||
 | 
			
		||||
              output = ((MetaOutput**)crtc_info->outputs->pdata)[j];
 | 
			
		||||
 | 
			
		||||
              output->is_dirty = TRUE;
 | 
			
		||||
              output->crtc = crtc;
 | 
			
		||||
            }
 | 
			
		||||
        next:
 | 
			
		||||
          g_free (outputs);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -843,9 +901,11 @@ meta_monitor_manager_xrandr_apply_configuration (MetaMonitorManager *manager,
 | 
			
		||||
 | 
			
		||||
      if (output_info->is_primary)
 | 
			
		||||
        {
 | 
			
		||||
          meta_error_trap_push (display);
 | 
			
		||||
          XRRSetOutputPrimary (manager_xrandr->xdisplay,
 | 
			
		||||
                               DefaultRootWindow (manager_xrandr->xdisplay),
 | 
			
		||||
                               (XID)output_info->output->output_id);
 | 
			
		||||
          meta_error_trap_pop (display);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      output_set_presentation_xrandr (manager_xrandr,
 | 
			
		||||
@@ -871,7 +931,7 @@ meta_monitor_manager_xrandr_apply_configuration (MetaMonitorManager *manager,
 | 
			
		||||
      output->is_primary = FALSE;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  meta_display_ungrab (meta_get_display ());
 | 
			
		||||
  meta_display_ungrab (display);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
@@ -939,16 +999,79 @@ meta_monitor_manager_xrandr_set_crtc_gamma (MetaMonitorManager *manager,
 | 
			
		||||
  XRRFreeGamma (gamma);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_monitor_manager_xrandr_rebuild_derived (MetaMonitorManager *manager)
 | 
			
		||||
{
 | 
			
		||||
  /* This will be a no-op if the change was from our side, as
 | 
			
		||||
     we already called it in the DBus method handler */
 | 
			
		||||
  meta_monitor_config_update_current (manager->config, manager);
 | 
			
		||||
 | 
			
		||||
  meta_monitor_manager_rebuild_derived (manager);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static gboolean
 | 
			
		||||
meta_monitor_manager_xrandr_handle_xevent (MetaMonitorManager *manager,
 | 
			
		||||
					   XEvent             *event)
 | 
			
		||||
{
 | 
			
		||||
  MetaMonitorManagerXrandr *manager_xrandr = META_MONITOR_MANAGER_XRANDR (manager);
 | 
			
		||||
  MetaOutput *old_outputs;
 | 
			
		||||
  MetaCRTC *old_crtcs;
 | 
			
		||||
  MetaMonitorMode *old_modes;
 | 
			
		||||
  unsigned int n_old_outputs, n_old_modes;
 | 
			
		||||
  gboolean new_config;
 | 
			
		||||
 | 
			
		||||
  if ((event->type - manager_xrandr->rr_event_base) != RRScreenChangeNotify)
 | 
			
		||||
    return FALSE;
 | 
			
		||||
 | 
			
		||||
  XRRUpdateConfiguration (event);
 | 
			
		||||
 | 
			
		||||
  /* Save the old structures, so they stay valid during the update */
 | 
			
		||||
  old_outputs = manager->outputs;
 | 
			
		||||
  n_old_outputs = manager->n_outputs;
 | 
			
		||||
  old_modes = manager->modes;
 | 
			
		||||
  n_old_modes = manager->n_modes;
 | 
			
		||||
  old_crtcs = manager->crtcs;
 | 
			
		||||
 | 
			
		||||
  manager->serial++;
 | 
			
		||||
  meta_monitor_manager_xrandr_read_current (manager);
 | 
			
		||||
 | 
			
		||||
  new_config = manager_xrandr->resources->timestamp >=
 | 
			
		||||
    manager_xrandr->resources->configTimestamp;
 | 
			
		||||
  if (meta_monitor_manager_has_hotplug_mode_update (manager))
 | 
			
		||||
 | 
			
		||||
    {
 | 
			
		||||
      /* 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);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  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);
 | 
			
		||||
 | 
			
		||||
  return TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -33,16 +33,16 @@
 | 
			
		||||
#include <clutter/clutter.h>
 | 
			
		||||
 | 
			
		||||
#include <meta/main.h>
 | 
			
		||||
#include <meta/util.h>
 | 
			
		||||
#include "util-private.h"
 | 
			
		||||
#include <meta/errors.h>
 | 
			
		||||
#include "monitor-private.h"
 | 
			
		||||
#include "meta-wayland-private.h"
 | 
			
		||||
 | 
			
		||||
#include "meta-dbus-xrandr.h"
 | 
			
		||||
 | 
			
		||||
#define ALL_WL_TRANSFORMS ((1 << (WL_OUTPUT_TRANSFORM_FLIPPED_270 + 1)) - 1)
 | 
			
		||||
 | 
			
		||||
enum {
 | 
			
		||||
  MONITORS_CHANGED,
 | 
			
		||||
  CONFIRM_DISPLAY_CHANGE,
 | 
			
		||||
  SIGNALS_LAST
 | 
			
		||||
};
 | 
			
		||||
@@ -60,67 +60,28 @@ static void meta_monitor_manager_display_config_init (MetaDBusDisplayConfigIface
 | 
			
		||||
G_DEFINE_TYPE_WITH_CODE (MetaMonitorManager, meta_monitor_manager, META_DBUS_TYPE_DISPLAY_CONFIG_SKELETON,
 | 
			
		||||
                         G_IMPLEMENT_INTERFACE (META_DBUS_TYPE_DISPLAY_CONFIG, meta_monitor_manager_display_config_init));
 | 
			
		||||
 | 
			
		||||
static void free_output_array (MetaOutput *old_outputs,
 | 
			
		||||
                               int         n_old_outputs);
 | 
			
		||||
static void invalidate_logical_config (MetaMonitorManager *manager);
 | 
			
		||||
static void initialize_dbus_interface (MetaMonitorManager *manager);
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
read_current_dummy (MetaMonitorManager *manager)
 | 
			
		||||
{
 | 
			
		||||
  /* The dummy monitor config has:
 | 
			
		||||
     - one enabled output, LVDS, primary, at 0x0 and 1024x768
 | 
			
		||||
     - one free CRTC
 | 
			
		||||
     - two disabled outputs
 | 
			
		||||
     - three modes, 1024x768, 800x600 and 640x480
 | 
			
		||||
     - no clones are possible (use different CRTCs)
 | 
			
		||||
 | 
			
		||||
     Low-level IDs should be assigned sequentially, to
 | 
			
		||||
     mimick what XRandR and KMS do
 | 
			
		||||
  */
 | 
			
		||||
 | 
			
		||||
  manager->max_screen_width = 65535;
 | 
			
		||||
  manager->max_screen_height = 65535;
 | 
			
		||||
  manager->screen_width = 1024;
 | 
			
		||||
  manager->screen_height = 768;
 | 
			
		||||
 | 
			
		||||
  manager->modes = g_new0 (MetaMonitorMode, 6);
 | 
			
		||||
  manager->n_modes = 6;
 | 
			
		||||
  manager->modes = g_new0 (MetaMonitorMode, 1);
 | 
			
		||||
  manager->n_modes = 1;
 | 
			
		||||
 | 
			
		||||
  manager->modes[0].mode_id = 1;
 | 
			
		||||
  manager->modes[0].mode_id = 0;
 | 
			
		||||
  manager->modes[0].width = 1024;
 | 
			
		||||
  manager->modes[0].height = 768;
 | 
			
		||||
  manager->modes[0].refresh_rate = 60.0;
 | 
			
		||||
 | 
			
		||||
  manager->modes[1].mode_id = 2;
 | 
			
		||||
  manager->modes[1].width = 800;
 | 
			
		||||
  manager->modes[1].height = 600;
 | 
			
		||||
  manager->modes[1].refresh_rate = 60.0;
 | 
			
		||||
  manager->crtcs = g_new0 (MetaCRTC, 1);
 | 
			
		||||
  manager->n_crtcs = 1;
 | 
			
		||||
 | 
			
		||||
  manager->modes[2].mode_id = 3;
 | 
			
		||||
  manager->modes[2].width = 640;
 | 
			
		||||
  manager->modes[2].height = 480;
 | 
			
		||||
  manager->modes[2].refresh_rate = 60.0;
 | 
			
		||||
 | 
			
		||||
  manager->modes[3].mode_id = 4;
 | 
			
		||||
  manager->modes[3].width = 1920;
 | 
			
		||||
  manager->modes[3].height = 1080;
 | 
			
		||||
  manager->modes[3].refresh_rate = 60.0;
 | 
			
		||||
 | 
			
		||||
  manager->modes[4].mode_id = 5;
 | 
			
		||||
  manager->modes[4].width = 1920;
 | 
			
		||||
  manager->modes[4].height = 1080;
 | 
			
		||||
  manager->modes[4].refresh_rate = 55.0;
 | 
			
		||||
 | 
			
		||||
  manager->modes[5].mode_id = 6;
 | 
			
		||||
  manager->modes[5].width = 1600;
 | 
			
		||||
  manager->modes[5].height = 900;
 | 
			
		||||
  manager->modes[5].refresh_rate = 60.0;
 | 
			
		||||
 | 
			
		||||
  manager->crtcs = g_new0 (MetaCRTC, 3);
 | 
			
		||||
  manager->n_crtcs = 3;
 | 
			
		||||
 | 
			
		||||
  manager->crtcs[0].crtc_id = 4;
 | 
			
		||||
  manager->crtcs[0].crtc_id = 1;
 | 
			
		||||
  manager->crtcs[0].rect.x = 0;
 | 
			
		||||
  manager->crtcs[0].rect.y = 0;
 | 
			
		||||
  manager->crtcs[0].rect.width = manager->modes[0].width;
 | 
			
		||||
@@ -131,111 +92,30 @@ read_current_dummy (MetaMonitorManager *manager)
 | 
			
		||||
  manager->crtcs[0].is_dirty = FALSE;
 | 
			
		||||
  manager->crtcs[0].logical_monitor = NULL;
 | 
			
		||||
 | 
			
		||||
  manager->crtcs[1].crtc_id = 5;
 | 
			
		||||
  manager->crtcs[1].rect.x = 0;
 | 
			
		||||
  manager->crtcs[1].rect.y = 0;
 | 
			
		||||
  manager->crtcs[1].rect.width = 0;
 | 
			
		||||
  manager->crtcs[1].rect.height = 0;
 | 
			
		||||
  manager->crtcs[1].current_mode = NULL;
 | 
			
		||||
  manager->crtcs[1].transform = WL_OUTPUT_TRANSFORM_NORMAL;
 | 
			
		||||
  manager->crtcs[1].all_transforms = ALL_WL_TRANSFORMS;
 | 
			
		||||
  manager->crtcs[1].is_dirty = FALSE;
 | 
			
		||||
  manager->crtcs[1].logical_monitor = NULL;
 | 
			
		||||
  manager->outputs = g_new0 (MetaOutput, 1);
 | 
			
		||||
  manager->n_outputs = 1;
 | 
			
		||||
 | 
			
		||||
  manager->crtcs[2].crtc_id = 5;
 | 
			
		||||
  manager->crtcs[2].rect.x = 0;
 | 
			
		||||
  manager->crtcs[2].rect.y = 0;
 | 
			
		||||
  manager->crtcs[2].rect.width = 0;
 | 
			
		||||
  manager->crtcs[2].rect.height = 0;
 | 
			
		||||
  manager->crtcs[2].current_mode = NULL;
 | 
			
		||||
  manager->crtcs[2].transform = WL_OUTPUT_TRANSFORM_NORMAL;
 | 
			
		||||
  manager->crtcs[2].all_transforms = ALL_WL_TRANSFORMS;
 | 
			
		||||
  manager->crtcs[2].is_dirty = FALSE;
 | 
			
		||||
  manager->crtcs[2].logical_monitor = NULL;
 | 
			
		||||
 | 
			
		||||
  manager->outputs = g_new0 (MetaOutput, 3);
 | 
			
		||||
  manager->n_outputs = 3;
 | 
			
		||||
 | 
			
		||||
  manager->outputs[0].crtc = NULL;
 | 
			
		||||
  manager->outputs[0].output_id = 6;
 | 
			
		||||
  manager->outputs[0].name = g_strdup ("HDMI");
 | 
			
		||||
  manager->outputs[0].crtc = &manager->crtcs[0];
 | 
			
		||||
  manager->outputs[0].output_id = 1;
 | 
			
		||||
  manager->outputs[0].name = g_strdup ("LVDS");
 | 
			
		||||
  manager->outputs[0].vendor = g_strdup ("MetaProducts Inc.");
 | 
			
		||||
  manager->outputs[0].product = g_strdup ("unknown");
 | 
			
		||||
  manager->outputs[0].serial = g_strdup ("0xC0F01A");
 | 
			
		||||
  manager->outputs[0].width_mm = 510;
 | 
			
		||||
  manager->outputs[0].height_mm = 287;
 | 
			
		||||
  manager->outputs[0].serial = g_strdup ("0xC0FFEE");
 | 
			
		||||
  manager->outputs[0].width_mm = 222;
 | 
			
		||||
  manager->outputs[0].height_mm = 125;
 | 
			
		||||
  manager->outputs[0].subpixel_order = COGL_SUBPIXEL_ORDER_UNKNOWN;
 | 
			
		||||
  manager->outputs[0].preferred_mode = &manager->modes[3];
 | 
			
		||||
  manager->outputs[0].n_modes = 5;
 | 
			
		||||
  manager->outputs[0].modes = g_new0 (MetaMonitorMode *, 5);
 | 
			
		||||
  manager->outputs[0].preferred_mode = &manager->modes[0];
 | 
			
		||||
  manager->outputs[0].n_modes = 1;
 | 
			
		||||
  manager->outputs[0].modes = g_new0 (MetaMonitorMode *, 1);
 | 
			
		||||
  manager->outputs[0].modes[0] = &manager->modes[0];
 | 
			
		||||
  manager->outputs[0].modes[1] = &manager->modes[1];
 | 
			
		||||
  manager->outputs[0].modes[2] = &manager->modes[2];
 | 
			
		||||
  manager->outputs[0].modes[3] = &manager->modes[3];
 | 
			
		||||
  manager->outputs[0].modes[4] = &manager->modes[4];
 | 
			
		||||
  manager->outputs[0].n_possible_crtcs = 3;
 | 
			
		||||
  manager->outputs[0].possible_crtcs = g_new0 (MetaCRTC *, 3);
 | 
			
		||||
  manager->outputs[0].n_possible_crtcs = 1;
 | 
			
		||||
  manager->outputs[0].possible_crtcs = g_new0 (MetaCRTC *, 1);
 | 
			
		||||
  manager->outputs[0].possible_crtcs[0] = &manager->crtcs[0];
 | 
			
		||||
  manager->outputs[0].possible_crtcs[1] = &manager->crtcs[1];
 | 
			
		||||
  manager->outputs[0].possible_crtcs[2] = &manager->crtcs[2];
 | 
			
		||||
  manager->outputs[0].n_possible_clones = 0;
 | 
			
		||||
  manager->outputs[0].possible_clones = g_new0 (MetaOutput *, 0);
 | 
			
		||||
  manager->outputs[0].backlight = -1;
 | 
			
		||||
  manager->outputs[0].backlight_min = 0;
 | 
			
		||||
  manager->outputs[0].backlight_max = 0;
 | 
			
		||||
 | 
			
		||||
  manager->outputs[1].crtc = &manager->crtcs[0];
 | 
			
		||||
  manager->outputs[1].output_id = 7;
 | 
			
		||||
  manager->outputs[1].name = g_strdup ("LVDS");
 | 
			
		||||
  manager->outputs[1].vendor = g_strdup ("MetaProducts Inc.");
 | 
			
		||||
  manager->outputs[1].product = g_strdup ("unknown");
 | 
			
		||||
  manager->outputs[1].serial = g_strdup ("0xC0FFEE");
 | 
			
		||||
  manager->outputs[1].width_mm = 222;
 | 
			
		||||
  manager->outputs[1].height_mm = 125;
 | 
			
		||||
  manager->outputs[1].subpixel_order = COGL_SUBPIXEL_ORDER_UNKNOWN;
 | 
			
		||||
  manager->outputs[1].preferred_mode = &manager->modes[5];
 | 
			
		||||
  manager->outputs[1].n_modes = 4;
 | 
			
		||||
  manager->outputs[1].modes = g_new0 (MetaMonitorMode *, 4);
 | 
			
		||||
  manager->outputs[1].modes[0] = &manager->modes[0];
 | 
			
		||||
  manager->outputs[1].modes[1] = &manager->modes[1];
 | 
			
		||||
  manager->outputs[1].modes[2] = &manager->modes[2];
 | 
			
		||||
  manager->outputs[1].modes[3] = &manager->modes[5];
 | 
			
		||||
  manager->outputs[1].n_possible_crtcs = 3;
 | 
			
		||||
  manager->outputs[1].possible_crtcs = g_new0 (MetaCRTC *, 3);
 | 
			
		||||
  manager->outputs[1].possible_crtcs[0] = &manager->crtcs[0];
 | 
			
		||||
  manager->outputs[1].possible_crtcs[1] = &manager->crtcs[1];
 | 
			
		||||
  manager->outputs[1].possible_crtcs[2] = &manager->crtcs[2];
 | 
			
		||||
  manager->outputs[1].n_possible_clones = 0;
 | 
			
		||||
  manager->outputs[1].possible_clones = g_new0 (MetaOutput *, 0);
 | 
			
		||||
  manager->outputs[1].backlight = -1;
 | 
			
		||||
  manager->outputs[1].backlight_min = 0;
 | 
			
		||||
  manager->outputs[1].backlight_max = 0;
 | 
			
		||||
 | 
			
		||||
  manager->outputs[2].crtc = NULL;
 | 
			
		||||
  manager->outputs[2].output_id = 8;
 | 
			
		||||
  manager->outputs[2].name = g_strdup ("VGA");
 | 
			
		||||
  manager->outputs[2].vendor = g_strdup ("MetaProducts Inc.");
 | 
			
		||||
  manager->outputs[2].product = g_strdup ("unknown");
 | 
			
		||||
  manager->outputs[2].serial = g_strdup ("0xC4FE");
 | 
			
		||||
  manager->outputs[2].width_mm = 309;
 | 
			
		||||
  manager->outputs[2].height_mm = 174;
 | 
			
		||||
  manager->outputs[2].subpixel_order = COGL_SUBPIXEL_ORDER_UNKNOWN;
 | 
			
		||||
  manager->outputs[2].preferred_mode = &manager->modes[0];
 | 
			
		||||
  manager->outputs[2].n_modes = 3;
 | 
			
		||||
  manager->outputs[2].modes = g_new0 (MetaMonitorMode *, 3);
 | 
			
		||||
  manager->outputs[2].modes[0] = &manager->modes[0];
 | 
			
		||||
  manager->outputs[2].modes[1] = &manager->modes[1];
 | 
			
		||||
  manager->outputs[2].modes[2] = &manager->modes[2];
 | 
			
		||||
  manager->outputs[2].n_possible_crtcs = 3;
 | 
			
		||||
  manager->outputs[2].possible_crtcs = g_new0 (MetaCRTC *, 3);
 | 
			
		||||
  manager->outputs[2].possible_crtcs[0] = &manager->crtcs[0];
 | 
			
		||||
  manager->outputs[2].possible_crtcs[1] = &manager->crtcs[1];
 | 
			
		||||
  manager->outputs[2].possible_crtcs[2] = &manager->crtcs[2];
 | 
			
		||||
  manager->outputs[2].n_possible_clones = 0;
 | 
			
		||||
  manager->outputs[2].possible_clones = g_new0 (MetaOutput *, 0);
 | 
			
		||||
  manager->outputs[2].backlight = -1;
 | 
			
		||||
  manager->outputs[2].backlight_min = 0;
 | 
			
		||||
  manager->outputs[2].backlight_max = 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
@@ -350,7 +230,7 @@ apply_config_dummy (MetaMonitorManager *manager,
 | 
			
		||||
  manager->screen_width = screen_width;
 | 
			
		||||
  manager->screen_height = screen_height;
 | 
			
		||||
 | 
			
		||||
  invalidate_logical_config (manager);
 | 
			
		||||
  meta_monitor_manager_rebuild_derived (manager);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static GBytes *
 | 
			
		||||
@@ -475,6 +355,24 @@ make_logical_config (MetaMonitorManager *manager)
 | 
			
		||||
  manager->monitor_infos = (void*)g_array_free (monitor_infos, FALSE);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static GType
 | 
			
		||||
get_default_backend (void)
 | 
			
		||||
{
 | 
			
		||||
  if (meta_is_wayland_compositor ())
 | 
			
		||||
    {
 | 
			
		||||
      MetaWaylandCompositor *compositor;
 | 
			
		||||
 | 
			
		||||
      compositor = meta_wayland_compositor_get_default ();
 | 
			
		||||
 | 
			
		||||
      if (meta_wayland_compositor_is_native (compositor))
 | 
			
		||||
        return META_TYPE_MONITOR_MANAGER_KMS;
 | 
			
		||||
      else
 | 
			
		||||
        return META_TYPE_MONITOR_MANAGER;
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    return META_TYPE_MONITOR_MANAGER_XRANDR;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static MetaMonitorManager *
 | 
			
		||||
meta_monitor_manager_new (void)
 | 
			
		||||
{
 | 
			
		||||
@@ -484,7 +382,7 @@ meta_monitor_manager_new (void)
 | 
			
		||||
  env = g_getenv ("META_DEBUG_MULTIMONITOR");
 | 
			
		||||
 | 
			
		||||
  if (env == NULL)
 | 
			
		||||
    type = META_TYPE_MONITOR_MANAGER_XRANDR;
 | 
			
		||||
    type = get_default_backend ();
 | 
			
		||||
  else if (strcmp (env, "xrandr") == 0)
 | 
			
		||||
    type = META_TYPE_MONITOR_MANAGER_XRANDR;
 | 
			
		||||
  else
 | 
			
		||||
@@ -519,17 +417,18 @@ meta_monitor_manager_constructed (GObject *object)
 | 
			
		||||
      MetaOutput *old_outputs;
 | 
			
		||||
      MetaCRTC *old_crtcs;
 | 
			
		||||
      MetaMonitorMode *old_modes;
 | 
			
		||||
      int n_old_outputs;
 | 
			
		||||
      unsigned int n_old_outputs, n_old_modes;
 | 
			
		||||
 | 
			
		||||
      old_outputs = manager->outputs;
 | 
			
		||||
      n_old_outputs = manager->n_outputs;
 | 
			
		||||
      old_modes = manager->modes;
 | 
			
		||||
      n_old_modes = manager->n_modes;
 | 
			
		||||
      old_crtcs = manager->crtcs;
 | 
			
		||||
 | 
			
		||||
      read_current_config (manager);
 | 
			
		||||
 | 
			
		||||
      free_output_array (old_outputs, n_old_outputs);
 | 
			
		||||
      g_free (old_modes);
 | 
			
		||||
      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);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -545,11 +444,8 @@ meta_monitor_manager_set_power_save_mode (MetaMonitorManager *manager,
 | 
			
		||||
{
 | 
			
		||||
  MetaMonitorManagerClass *klass;
 | 
			
		||||
 | 
			
		||||
  if (mode == manager->power_save_mode)
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  if (manager->power_save_mode == META_POWER_SAVE_UNKNOWN ||
 | 
			
		||||
      mode == META_POWER_SAVE_UNKNOWN)
 | 
			
		||||
  if (manager->power_save_mode == META_POWER_SAVE_UNSUPPORTED ||
 | 
			
		||||
      mode == META_POWER_SAVE_UNSUPPORTED)
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  klass = META_MONITOR_MANAGER_GET_CLASS (manager);
 | 
			
		||||
@@ -559,9 +455,9 @@ meta_monitor_manager_set_power_save_mode (MetaMonitorManager *manager,
 | 
			
		||||
  manager->power_save_mode = mode;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
free_output_array (MetaOutput *old_outputs,
 | 
			
		||||
                   int         n_old_outputs)
 | 
			
		||||
void
 | 
			
		||||
meta_monitor_manager_free_output_array (MetaOutput *old_outputs,
 | 
			
		||||
                                        int         n_old_outputs)
 | 
			
		||||
{
 | 
			
		||||
  int i;
 | 
			
		||||
 | 
			
		||||
@@ -574,19 +470,39 @@ free_output_array (MetaOutput *old_outputs,
 | 
			
		||||
      g_free (old_outputs[i].modes);
 | 
			
		||||
      g_free (old_outputs[i].possible_crtcs);
 | 
			
		||||
      g_free (old_outputs[i].possible_clones);
 | 
			
		||||
 | 
			
		||||
      if (old_outputs[i].driver_notify)
 | 
			
		||||
        old_outputs[i].driver_notify (&old_outputs[i]);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  g_free (old_outputs);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_monitor_manager_free_mode_array (MetaMonitorMode *old_modes,
 | 
			
		||||
                                      int              n_old_modes)
 | 
			
		||||
{
 | 
			
		||||
  int i;
 | 
			
		||||
 | 
			
		||||
  for (i = 0; i < n_old_modes; i++)
 | 
			
		||||
    {
 | 
			
		||||
      g_free (old_modes[i].name);
 | 
			
		||||
 | 
			
		||||
      if (old_modes[i].driver_notify)
 | 
			
		||||
        old_modes[i].driver_notify (&old_modes[i]);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  g_free (old_modes);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
meta_monitor_manager_finalize (GObject *object)
 | 
			
		||||
{
 | 
			
		||||
  MetaMonitorManager *manager = META_MONITOR_MANAGER (object);
 | 
			
		||||
 | 
			
		||||
  free_output_array (manager->outputs, manager->n_outputs);
 | 
			
		||||
  meta_monitor_manager_free_output_array (manager->outputs, manager->n_outputs);
 | 
			
		||||
  meta_monitor_manager_free_mode_array (manager->modes, manager->n_modes);
 | 
			
		||||
  g_free (manager->monitor_infos);
 | 
			
		||||
  g_free (manager->modes);
 | 
			
		||||
  g_free (manager->crtcs);
 | 
			
		||||
 | 
			
		||||
  G_OBJECT_CLASS (meta_monitor_manager_parent_class)->finalize (object);
 | 
			
		||||
@@ -660,14 +576,6 @@ meta_monitor_manager_class_init (MetaMonitorManagerClass *klass)
 | 
			
		||||
  klass->get_edid_file = get_edid_file_dummy;
 | 
			
		||||
  klass->read_edid = read_edid_dummy;
 | 
			
		||||
 | 
			
		||||
  signals[MONITORS_CHANGED] =
 | 
			
		||||
    g_signal_new ("monitors-changed",
 | 
			
		||||
		  G_TYPE_FROM_CLASS (object_class),
 | 
			
		||||
		  G_SIGNAL_RUN_LAST,
 | 
			
		||||
		  0,
 | 
			
		||||
                  NULL, NULL, NULL,
 | 
			
		||||
		  G_TYPE_NONE, 0);
 | 
			
		||||
 | 
			
		||||
  signals[CONFIRM_DISPLAY_CHANGE] =
 | 
			
		||||
    g_signal_new ("confirm-display-change",
 | 
			
		||||
		  G_TYPE_FROM_CLASS (object_class),
 | 
			
		||||
@@ -813,10 +721,17 @@ meta_monitor_manager_handle_get_resources (MetaDBusDisplayConfig *skeleton,
 | 
			
		||||
                             g_variant_new_string (output->product));
 | 
			
		||||
      g_variant_builder_add (&properties, "{sv}", "serial",
 | 
			
		||||
                             g_variant_new_string (output->serial));
 | 
			
		||||
      g_variant_builder_add (&properties, "{sv}", "width-mm",
 | 
			
		||||
                             g_variant_new_int32 (output->width_mm));
 | 
			
		||||
      g_variant_builder_add (&properties, "{sv}", "height-mm",
 | 
			
		||||
                             g_variant_new_int32 (output->height_mm));
 | 
			
		||||
      g_variant_builder_add (&properties, "{sv}", "display-name",
 | 
			
		||||
                             g_variant_new_take_string (make_display_name (manager, output)));
 | 
			
		||||
      g_variant_builder_add (&properties, "{sv}", "backlight",
 | 
			
		||||
                             g_variant_new_int32 (output->backlight));
 | 
			
		||||
      g_variant_builder_add (&properties, "{sv}", "min-backlight-step",
 | 
			
		||||
                             g_variant_new_int32 ((output->backlight_max - output->backlight_min) ?
 | 
			
		||||
                                                  100 / (output->backlight_max - output->backlight_min) : -1));
 | 
			
		||||
      g_variant_builder_add (&properties, "{sv}", "primary",
 | 
			
		||||
                             g_variant_new_boolean (output->is_primary));
 | 
			
		||||
      g_variant_builder_add (&properties, "{sv}", "presentation",
 | 
			
		||||
@@ -1233,7 +1148,7 @@ meta_monitor_manager_handle_change_backlight  (MetaDBusDisplayConfig *skeleton,
 | 
			
		||||
 | 
			
		||||
  META_MONITOR_MANAGER_GET_CLASS (manager)->change_backlight (manager, output, value);
 | 
			
		||||
 | 
			
		||||
  meta_dbus_display_config_complete_change_backlight (skeleton, invocation);
 | 
			
		||||
  meta_dbus_display_config_complete_change_backlight (skeleton, invocation, output->backlight);
 | 
			
		||||
  return TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -1449,12 +1364,21 @@ meta_monitor_manager_get_resources (MetaMonitorManager  *manager,
 | 
			
		||||
                                    MetaOutput         **outputs,
 | 
			
		||||
                                    unsigned int        *n_outputs)
 | 
			
		||||
{
 | 
			
		||||
  *modes = manager->modes;
 | 
			
		||||
  *n_modes = manager->n_modes;
 | 
			
		||||
  *crtcs = manager->crtcs;
 | 
			
		||||
  *n_crtcs = manager->n_crtcs;
 | 
			
		||||
  *outputs = manager->outputs;
 | 
			
		||||
  *n_outputs = manager->n_outputs;
 | 
			
		||||
  if (modes)
 | 
			
		||||
    {
 | 
			
		||||
      *modes = manager->modes;
 | 
			
		||||
      *n_modes = manager->n_modes;
 | 
			
		||||
    }
 | 
			
		||||
  if (crtcs)
 | 
			
		||||
    {
 | 
			
		||||
      *crtcs = manager->crtcs;
 | 
			
		||||
      *n_crtcs = manager->n_crtcs;
 | 
			
		||||
    }
 | 
			
		||||
  if (outputs)
 | 
			
		||||
    {
 | 
			
		||||
      *outputs = manager->outputs;
 | 
			
		||||
      *n_outputs = manager->n_outputs;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
@@ -1481,8 +1405,8 @@ meta_monitor_manager_get_screen_limits (MetaMonitorManager *manager,
 | 
			
		||||
  *height = manager->max_screen_height;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
invalidate_logical_config (MetaMonitorManager *manager)
 | 
			
		||||
void
 | 
			
		||||
meta_monitor_manager_rebuild_derived (MetaMonitorManager *manager)
 | 
			
		||||
{
 | 
			
		||||
  MetaMonitorInfo *old_monitor_infos;
 | 
			
		||||
 | 
			
		||||
@@ -1493,7 +1417,7 @@ invalidate_logical_config (MetaMonitorManager *manager)
 | 
			
		||||
 | 
			
		||||
  make_logical_config (manager);
 | 
			
		||||
 | 
			
		||||
  g_signal_emit (manager, signals[MONITORS_CHANGED], 0);
 | 
			
		||||
  g_signal_emit_by_name (manager, "monitors-changed");
 | 
			
		||||
 | 
			
		||||
  g_free (old_monitor_infos);
 | 
			
		||||
}
 | 
			
		||||
@@ -1503,51 +1427,11 @@ meta_monitor_manager_handle_xevent (MetaMonitorManager *manager,
 | 
			
		||||
                                    XEvent             *event)
 | 
			
		||||
{
 | 
			
		||||
  MetaMonitorManagerClass *klass;
 | 
			
		||||
  MetaOutput *old_outputs;
 | 
			
		||||
  MetaCRTC *old_crtcs;
 | 
			
		||||
  MetaMonitorMode *old_modes;
 | 
			
		||||
  int n_old_outputs;
 | 
			
		||||
  gboolean changed;
 | 
			
		||||
 | 
			
		||||
  klass = META_MONITOR_MANAGER_GET_CLASS (manager);
 | 
			
		||||
  if (klass->handle_xevent)
 | 
			
		||||
    changed = klass->handle_xevent (manager, event);
 | 
			
		||||
    return klass->handle_xevent (manager, event);
 | 
			
		||||
  else
 | 
			
		||||
    changed = FALSE;
 | 
			
		||||
 | 
			
		||||
  if (!changed)
 | 
			
		||||
    return FALSE;
 | 
			
		||||
 | 
			
		||||
  /* Save the old structures, so they stay valid during the update */
 | 
			
		||||
  old_outputs = manager->outputs;
 | 
			
		||||
  n_old_outputs = manager->n_outputs;
 | 
			
		||||
  old_modes = manager->modes;
 | 
			
		||||
  old_crtcs = manager->crtcs;
 | 
			
		||||
 | 
			
		||||
  read_current_config (manager);
 | 
			
		||||
 | 
			
		||||
  /* Check if the current intended configuration has the same outputs
 | 
			
		||||
     as the new real one. If so, this was a result of an ApplyConfiguration
 | 
			
		||||
     call (or a change from ourselves), and 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.
 | 
			
		||||
  */
 | 
			
		||||
  if (meta_monitor_config_match_current (manager->config, manager))
 | 
			
		||||
    {
 | 
			
		||||
      invalidate_logical_config (manager);
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    {
 | 
			
		||||
      if (!meta_monitor_config_apply_stored (manager->config, manager))
 | 
			
		||||
        meta_monitor_config_make_default (manager->config, manager);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  free_output_array (old_outputs, n_old_outputs);
 | 
			
		||||
  g_free (old_modes);
 | 
			
		||||
  g_free (old_crtcs);
 | 
			
		||||
 | 
			
		||||
  return TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -25,6 +25,7 @@
 | 
			
		||||
 | 
			
		||||
#include <meta/main.h>
 | 
			
		||||
#include <meta/util.h>
 | 
			
		||||
#include <glib/gi18n-lib.h>
 | 
			
		||||
#include "meta-plugin-manager.h"
 | 
			
		||||
 | 
			
		||||
#include <glib.h>
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										299
									
								
								src/core/place.c
									
									
									
									
									
								
							
							
						
						
									
										299
									
								
								src/core/place.c
									
									
									
									
									
								
							@@ -47,34 +47,18 @@ northwestcmp (gconstpointer a, gconstpointer b)
 | 
			
		||||
{
 | 
			
		||||
  MetaWindow *aw = (gpointer) a;
 | 
			
		||||
  MetaWindow *bw = (gpointer) b;
 | 
			
		||||
  MetaRectangle a_frame;
 | 
			
		||||
  MetaRectangle b_frame;
 | 
			
		||||
  int from_origin_a;
 | 
			
		||||
  int from_origin_b;
 | 
			
		||||
  int ax, ay, bx, by;
 | 
			
		||||
 | 
			
		||||
  /* we're interested in the frame position for cascading,
 | 
			
		||||
   * not meta_window_get_position()
 | 
			
		||||
   */
 | 
			
		||||
  if (aw->frame)
 | 
			
		||||
    {
 | 
			
		||||
      ax = aw->frame->rect.x;
 | 
			
		||||
      ay = aw->frame->rect.y;
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    {
 | 
			
		||||
      ax = aw->rect.x;
 | 
			
		||||
      ay = aw->rect.y;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  if (bw->frame)
 | 
			
		||||
    {
 | 
			
		||||
      bx = bw->frame->rect.x;
 | 
			
		||||
      by = bw->frame->rect.y;
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    {
 | 
			
		||||
      bx = bw->rect.x;
 | 
			
		||||
      by = bw->rect.y;
 | 
			
		||||
    }
 | 
			
		||||
  meta_window_get_frame_rect (aw, &a_frame);
 | 
			
		||||
  meta_window_get_frame_rect (bw, &b_frame);
 | 
			
		||||
  ax = a_frame.x;
 | 
			
		||||
  ay = a_frame.y;
 | 
			
		||||
  bx = b_frame.x;
 | 
			
		||||
  by = b_frame.y;
 | 
			
		||||
  
 | 
			
		||||
  /* probably there's a fast good-enough-guess we could use here. */
 | 
			
		||||
  from_origin_a = sqrt (ax * ax + ay * ay);
 | 
			
		||||
@@ -90,7 +74,6 @@ northwestcmp (gconstpointer a, gconstpointer b)
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
find_next_cascade (MetaWindow *window,
 | 
			
		||||
                   MetaFrameBorders *borders,
 | 
			
		||||
                   /* visible windows on relevant workspaces */
 | 
			
		||||
                   GList      *windows,
 | 
			
		||||
                   int         x,
 | 
			
		||||
@@ -102,6 +85,7 @@ find_next_cascade (MetaWindow *window,
 | 
			
		||||
  GList *sorted;
 | 
			
		||||
  int cascade_x, cascade_y;
 | 
			
		||||
  int x_threshold, y_threshold;
 | 
			
		||||
  MetaRectangle frame_rect;
 | 
			
		||||
  int window_width, window_height;
 | 
			
		||||
  int cascade_stage;
 | 
			
		||||
  MetaRectangle work_area;
 | 
			
		||||
@@ -120,10 +104,13 @@ find_next_cascade (MetaWindow *window,
 | 
			
		||||
   * manually cascade.
 | 
			
		||||
   */
 | 
			
		||||
#define CASCADE_FUZZ 15
 | 
			
		||||
  if (borders)
 | 
			
		||||
  if (window->frame)
 | 
			
		||||
    {
 | 
			
		||||
      x_threshold = MAX (borders->visible.left, CASCADE_FUZZ);
 | 
			
		||||
      y_threshold = MAX (borders->visible.top, CASCADE_FUZZ);
 | 
			
		||||
      MetaFrameBorders borders;
 | 
			
		||||
 | 
			
		||||
      meta_frame_calc_borders (window->frame, &borders);
 | 
			
		||||
      x_threshold = MAX (borders.visible.left, CASCADE_FUZZ);
 | 
			
		||||
      y_threshold = MAX (borders.visible.top, CASCADE_FUZZ);
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    {
 | 
			
		||||
@@ -143,30 +130,25 @@ find_next_cascade (MetaWindow *window,
 | 
			
		||||
  cascade_y = MAX (0, work_area.y);
 | 
			
		||||
  
 | 
			
		||||
  /* Find first cascade position that's not used. */
 | 
			
		||||
  
 | 
			
		||||
  window_width = window->frame ? window->frame->rect.width : window->rect.width;
 | 
			
		||||
  window_height = window->frame ? window->frame->rect.height : window->rect.height;
 | 
			
		||||
 | 
			
		||||
  meta_window_get_frame_rect (window, &frame_rect);
 | 
			
		||||
  window_width = frame_rect.width;
 | 
			
		||||
  window_height = frame_rect.height;
 | 
			
		||||
  
 | 
			
		||||
  cascade_stage = 0;
 | 
			
		||||
  tmp = sorted;
 | 
			
		||||
  while (tmp != NULL)
 | 
			
		||||
    {
 | 
			
		||||
      MetaWindow *w;
 | 
			
		||||
      MetaRectangle w_frame_rect;
 | 
			
		||||
      int wx, wy;
 | 
			
		||||
      
 | 
			
		||||
      w = tmp->data;
 | 
			
		||||
 | 
			
		||||
      /* we want frame position, not window position */
 | 
			
		||||
      if (w->frame)
 | 
			
		||||
        {
 | 
			
		||||
          wx = w->frame->rect.x;
 | 
			
		||||
          wy = w->frame->rect.y;
 | 
			
		||||
        }
 | 
			
		||||
      else
 | 
			
		||||
        {
 | 
			
		||||
          wx = w->rect.x;
 | 
			
		||||
          wy = w->rect.y;
 | 
			
		||||
        }
 | 
			
		||||
      meta_window_get_frame_rect (w, &w_frame_rect);
 | 
			
		||||
      wx = w_frame_rect.x;
 | 
			
		||||
      wy = w_frame_rect.y;
 | 
			
		||||
      
 | 
			
		||||
      if (ABS (wx - cascade_x) < x_threshold &&
 | 
			
		||||
          ABS (wy - cascade_y) < y_threshold)
 | 
			
		||||
@@ -223,22 +205,12 @@ find_next_cascade (MetaWindow *window,
 | 
			
		||||
  
 | 
			
		||||
  g_list_free (sorted);
 | 
			
		||||
 | 
			
		||||
  /* Convert coords to position of window, not position of frame. */
 | 
			
		||||
  if (borders == NULL)
 | 
			
		||||
    {
 | 
			
		||||
      *new_x = cascade_x;
 | 
			
		||||
      *new_y = cascade_y;
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    {
 | 
			
		||||
      *new_x = cascade_x + borders->visible.left;
 | 
			
		||||
      *new_y = cascade_y + borders->visible.top;
 | 
			
		||||
    }
 | 
			
		||||
  *new_x = cascade_x;
 | 
			
		||||
  *new_y = cascade_y;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
find_most_freespace (MetaWindow *window,
 | 
			
		||||
                     MetaFrameBorders *borders,
 | 
			
		||||
                     /* visible windows on relevant workspaces */
 | 
			
		||||
                     MetaWindow *focus_window,
 | 
			
		||||
                     int         x,
 | 
			
		||||
@@ -250,29 +222,25 @@ find_most_freespace (MetaWindow *window,
 | 
			
		||||
  int max_area;
 | 
			
		||||
  int max_width, max_height, left, right, top, bottom;
 | 
			
		||||
  int left_space, right_space, top_space, bottom_space;
 | 
			
		||||
  int frame_size_left, frame_size_top;
 | 
			
		||||
  MetaRectangle work_area;
 | 
			
		||||
  MetaRectangle avoid;
 | 
			
		||||
  MetaRectangle outer;
 | 
			
		||||
 | 
			
		||||
  frame_size_left = borders ? borders->visible.left : 0;
 | 
			
		||||
  frame_size_top  = borders ? borders->visible.top : 0;
 | 
			
		||||
  MetaRectangle frame_rect;
 | 
			
		||||
 | 
			
		||||
  meta_window_get_work_area_current_monitor (focus_window, &work_area);
 | 
			
		||||
  meta_window_get_outer_rect (focus_window, &avoid);
 | 
			
		||||
  meta_window_get_outer_rect (window, &outer);
 | 
			
		||||
  meta_window_get_frame_rect (focus_window, &avoid);
 | 
			
		||||
  meta_window_get_frame_rect (window, &frame_rect);
 | 
			
		||||
 | 
			
		||||
  /* Find the areas of choosing the various sides of the focus window */
 | 
			
		||||
  max_width  = MIN (avoid.width, outer.width);
 | 
			
		||||
  max_height = MIN (avoid.height, outer.height);
 | 
			
		||||
  max_width  = MIN (avoid.width, frame_rect.width);
 | 
			
		||||
  max_height = MIN (avoid.height, frame_rect.height);
 | 
			
		||||
  left_space   = avoid.x - work_area.x;
 | 
			
		||||
  right_space  = work_area.width - (avoid.x + avoid.width - work_area.x);
 | 
			
		||||
  top_space    = avoid.y - work_area.y;
 | 
			
		||||
  bottom_space = work_area.height - (avoid.y + avoid.height - work_area.y);
 | 
			
		||||
  left   = MIN (left_space,   outer.width);
 | 
			
		||||
  right  = MIN (right_space,  outer.width);
 | 
			
		||||
  top    = MIN (top_space,    outer.height);
 | 
			
		||||
  bottom = MIN (bottom_space, outer.height);
 | 
			
		||||
  left   = MIN (left_space,   frame_rect.width);
 | 
			
		||||
  right  = MIN (right_space,  frame_rect.width);
 | 
			
		||||
  top    = MIN (top_space,    frame_rect.height);
 | 
			
		||||
  bottom = MIN (bottom_space, frame_rect.height);
 | 
			
		||||
 | 
			
		||||
  /* Find out which side of the focus_window can show the most of the window */
 | 
			
		||||
  side = META_LEFT;
 | 
			
		||||
@@ -304,39 +272,56 @@ find_most_freespace (MetaWindow *window,
 | 
			
		||||
  switch (side)
 | 
			
		||||
    {
 | 
			
		||||
    case META_LEFT:
 | 
			
		||||
      *new_y = avoid.y + frame_size_top;
 | 
			
		||||
      if (left_space > outer.width)
 | 
			
		||||
        *new_x = avoid.x - outer.width + frame_size_left;
 | 
			
		||||
      *new_y = avoid.y;
 | 
			
		||||
      if (left_space > frame_rect.width)
 | 
			
		||||
        *new_x = avoid.x - frame_rect.width;
 | 
			
		||||
      else
 | 
			
		||||
        *new_x = work_area.x + frame_size_left;
 | 
			
		||||
        *new_x = work_area.x;
 | 
			
		||||
      break;
 | 
			
		||||
    case META_RIGHT:
 | 
			
		||||
      *new_y = avoid.y + frame_size_top;
 | 
			
		||||
      if (right_space > outer.width)
 | 
			
		||||
        *new_x = avoid.x + avoid.width + frame_size_left;
 | 
			
		||||
      *new_y = avoid.y;
 | 
			
		||||
      if (right_space > frame_rect.width)
 | 
			
		||||
        *new_x = avoid.x + avoid.width;
 | 
			
		||||
      else
 | 
			
		||||
        *new_x = work_area.x + work_area.width - outer.width + frame_size_left;
 | 
			
		||||
        *new_x = work_area.x + work_area.width - frame_rect.width;
 | 
			
		||||
      break;
 | 
			
		||||
    case META_TOP:
 | 
			
		||||
      *new_x = avoid.x + frame_size_left;
 | 
			
		||||
      if (top_space > outer.height)
 | 
			
		||||
        *new_y = avoid.y - outer.height + frame_size_top;
 | 
			
		||||
      *new_x = avoid.x;
 | 
			
		||||
      if (top_space > frame_rect.height)
 | 
			
		||||
        *new_y = avoid.y - frame_rect.height;
 | 
			
		||||
      else
 | 
			
		||||
        *new_y = work_area.y + frame_size_top;
 | 
			
		||||
        *new_y = work_area.y;
 | 
			
		||||
      break;
 | 
			
		||||
    case META_BOTTOM:
 | 
			
		||||
      *new_x = avoid.x + frame_size_left;
 | 
			
		||||
      if (bottom_space > outer.height)
 | 
			
		||||
        *new_y = avoid.y + avoid.height + frame_size_top;
 | 
			
		||||
      *new_x = avoid.x;
 | 
			
		||||
      if (bottom_space > frame_rect.height)
 | 
			
		||||
        *new_y = avoid.y + avoid.height;
 | 
			
		||||
      else
 | 
			
		||||
        *new_y = work_area.y + work_area.height - outer.height + frame_size_top;
 | 
			
		||||
        *new_y = work_area.y + work_area.height - frame_rect.height;
 | 
			
		||||
      break;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static gboolean
 | 
			
		||||
window_overlaps_focus_window (MetaWindow *window)
 | 
			
		||||
{
 | 
			
		||||
  MetaWindow *focus_window;
 | 
			
		||||
  MetaRectangle window_frame, focus_frame, overlap;
 | 
			
		||||
 | 
			
		||||
  focus_window = window->display->focus_window;
 | 
			
		||||
  if (focus_window == NULL)
 | 
			
		||||
    return FALSE;
 | 
			
		||||
 | 
			
		||||
  meta_window_get_frame_rect (window, &window_frame);
 | 
			
		||||
  meta_window_get_frame_rect (focus_window, &focus_frame);
 | 
			
		||||
 | 
			
		||||
  return meta_rectangle_intersect (&window_frame,
 | 
			
		||||
                                   &focus_frame,
 | 
			
		||||
                                   &overlap);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
avoid_being_obscured_as_second_modal_dialog (MetaWindow *window,
 | 
			
		||||
                                             MetaFrameBorders *borders,
 | 
			
		||||
                                             int        *x,
 | 
			
		||||
                                             int        *y)
 | 
			
		||||
{
 | 
			
		||||
@@ -355,18 +340,17 @@ avoid_being_obscured_as_second_modal_dialog (MetaWindow *window,
 | 
			
		||||
   */
 | 
			
		||||
 | 
			
		||||
  MetaWindow *focus_window;
 | 
			
		||||
  MetaRectangle overlap;
 | 
			
		||||
 | 
			
		||||
  focus_window = window->display->focus_window;
 | 
			
		||||
 | 
			
		||||
  /* denied_focus_and_not_transient is only set when focus_window != NULL */
 | 
			
		||||
 | 
			
		||||
  if (window->denied_focus_and_not_transient &&
 | 
			
		||||
      window->wm_state_modal && /* FIXME: Maybe do this for all transients? */
 | 
			
		||||
      meta_window_same_application (window, focus_window) &&
 | 
			
		||||
      meta_rectangle_intersect (&window->rect,
 | 
			
		||||
                                &focus_window->rect,
 | 
			
		||||
                                &overlap))
 | 
			
		||||
      window_overlaps_focus_window (window))
 | 
			
		||||
    {
 | 
			
		||||
      find_most_freespace (window, borders, focus_window, *x, *y, x, y);
 | 
			
		||||
      find_most_freespace (window, focus_window, *x, *y, x, y);
 | 
			
		||||
      meta_topic (META_DEBUG_PLACEMENT,
 | 
			
		||||
                  "Dialog window %s was denied focus but may be modal "
 | 
			
		||||
                  "to the focus window; had to move it to avoid the "
 | 
			
		||||
@@ -409,7 +393,7 @@ rectangle_overlaps_some_window (MetaRectangle *rect,
 | 
			
		||||
        case META_WINDOW_UTILITY:
 | 
			
		||||
        case META_WINDOW_TOOLBAR:
 | 
			
		||||
        case META_WINDOW_MENU:
 | 
			
		||||
          meta_window_get_outer_rect (other, &other_rect);
 | 
			
		||||
          meta_window_get_frame_rect (other, &other_rect);
 | 
			
		||||
          
 | 
			
		||||
          if (meta_rectangle_intersect (rect, &other_rect, &dest))
 | 
			
		||||
            return TRUE;
 | 
			
		||||
@@ -427,20 +411,14 @@ leftmost_cmp (gconstpointer a, gconstpointer b)
 | 
			
		||||
{
 | 
			
		||||
  MetaWindow *aw = (gpointer) a;
 | 
			
		||||
  MetaWindow *bw = (gpointer) b;
 | 
			
		||||
  MetaRectangle a_frame;
 | 
			
		||||
  MetaRectangle b_frame;
 | 
			
		||||
  int ax, bx;
 | 
			
		||||
 | 
			
		||||
  /* we're interested in the frame position for cascading,
 | 
			
		||||
   * not meta_window_get_position()
 | 
			
		||||
   */
 | 
			
		||||
  if (aw->frame)
 | 
			
		||||
    ax = aw->frame->rect.x;
 | 
			
		||||
  else
 | 
			
		||||
    ax = aw->rect.x;
 | 
			
		||||
 | 
			
		||||
  if (bw->frame)
 | 
			
		||||
    bx = bw->frame->rect.x;
 | 
			
		||||
  else
 | 
			
		||||
    bx = bw->rect.x;
 | 
			
		||||
  meta_window_get_frame_rect (aw, &a_frame);
 | 
			
		||||
  meta_window_get_frame_rect (bw, &b_frame);
 | 
			
		||||
  ax = a_frame.x;
 | 
			
		||||
  bx = b_frame.x;
 | 
			
		||||
 | 
			
		||||
  if (ax < bx)
 | 
			
		||||
    return -1;
 | 
			
		||||
@@ -455,20 +433,14 @@ topmost_cmp (gconstpointer a, gconstpointer b)
 | 
			
		||||
{
 | 
			
		||||
  MetaWindow *aw = (gpointer) a;
 | 
			
		||||
  MetaWindow *bw = (gpointer) b;
 | 
			
		||||
  MetaRectangle a_frame;
 | 
			
		||||
  MetaRectangle b_frame;
 | 
			
		||||
  int ay, by;
 | 
			
		||||
 | 
			
		||||
  /* we're interested in the frame position for cascading,
 | 
			
		||||
   * not meta_window_get_position()
 | 
			
		||||
   */
 | 
			
		||||
  if (aw->frame)
 | 
			
		||||
    ay = aw->frame->rect.y;
 | 
			
		||||
  else
 | 
			
		||||
    ay = aw->rect.y;
 | 
			
		||||
 | 
			
		||||
  if (bw->frame)
 | 
			
		||||
    by = bw->frame->rect.y;
 | 
			
		||||
  else
 | 
			
		||||
    by = bw->rect.y;
 | 
			
		||||
  meta_window_get_frame_rect (aw, &a_frame);
 | 
			
		||||
  meta_window_get_frame_rect (bw, &b_frame);
 | 
			
		||||
  ay = a_frame.y;
 | 
			
		||||
  by = b_frame.y;
 | 
			
		||||
 | 
			
		||||
  if (ay < by)
 | 
			
		||||
    return -1;
 | 
			
		||||
@@ -506,7 +478,6 @@ center_tile_rect_in_area (MetaRectangle *rect,
 | 
			
		||||
 */
 | 
			
		||||
static gboolean
 | 
			
		||||
find_first_fit (MetaWindow *window,
 | 
			
		||||
                MetaFrameBorders *borders,
 | 
			
		||||
                /* visible windows on relevant workspaces */
 | 
			
		||||
                GList      *windows,
 | 
			
		||||
		int         monitor,
 | 
			
		||||
@@ -540,15 +511,8 @@ find_first_fit (MetaWindow *window,
 | 
			
		||||
  right_sorted = g_list_copy (windows);
 | 
			
		||||
  right_sorted = g_list_sort (right_sorted, topmost_cmp);
 | 
			
		||||
  right_sorted = g_list_sort (right_sorted, leftmost_cmp);
 | 
			
		||||
  
 | 
			
		||||
  rect.width = window->rect.width;
 | 
			
		||||
  rect.height = window->rect.height;
 | 
			
		||||
  
 | 
			
		||||
  if (borders)
 | 
			
		||||
    {
 | 
			
		||||
      rect.width += borders->visible.left + borders->visible.right;
 | 
			
		||||
      rect.height += borders->visible.top + borders->visible.bottom;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  meta_window_get_frame_rect (window, &rect);
 | 
			
		||||
 | 
			
		||||
#ifdef WITH_VERBOSE_MODE
 | 
			
		||||
    {
 | 
			
		||||
@@ -570,11 +534,6 @@ find_first_fit (MetaWindow *window,
 | 
			
		||||
      {
 | 
			
		||||
        *new_x = rect.x;
 | 
			
		||||
        *new_y = rect.y;
 | 
			
		||||
        if (borders)
 | 
			
		||||
          {
 | 
			
		||||
            *new_x += borders->visible.left;
 | 
			
		||||
            *new_y += borders->visible.top;
 | 
			
		||||
          }
 | 
			
		||||
    
 | 
			
		||||
        retval = TRUE;
 | 
			
		||||
       
 | 
			
		||||
@@ -586,23 +545,18 @@ find_first_fit (MetaWindow *window,
 | 
			
		||||
    while (tmp != NULL)
 | 
			
		||||
      {
 | 
			
		||||
        MetaWindow *w = tmp->data;
 | 
			
		||||
        MetaRectangle outer_rect;
 | 
			
		||||
        MetaRectangle frame_rect;
 | 
			
		||||
 | 
			
		||||
        meta_window_get_outer_rect (w, &outer_rect);
 | 
			
		||||
        meta_window_get_frame_rect (w, &frame_rect);
 | 
			
		||||
      
 | 
			
		||||
        rect.x = outer_rect.x;
 | 
			
		||||
        rect.y = outer_rect.y + outer_rect.height;
 | 
			
		||||
        rect.x = frame_rect.x;
 | 
			
		||||
        rect.y = frame_rect.y + frame_rect.height;
 | 
			
		||||
      
 | 
			
		||||
        if (meta_rectangle_contains_rect (&work_area, &rect) &&
 | 
			
		||||
            !rectangle_overlaps_some_window (&rect, below_sorted))
 | 
			
		||||
          {
 | 
			
		||||
            *new_x = rect.x;
 | 
			
		||||
            *new_y = rect.y;
 | 
			
		||||
            if (borders)
 | 
			
		||||
              {
 | 
			
		||||
                *new_x += borders->visible.left;
 | 
			
		||||
                *new_y += borders->visible.top;
 | 
			
		||||
              }
 | 
			
		||||
          
 | 
			
		||||
            retval = TRUE;
 | 
			
		||||
          
 | 
			
		||||
@@ -617,23 +571,18 @@ find_first_fit (MetaWindow *window,
 | 
			
		||||
    while (tmp != NULL)
 | 
			
		||||
      {
 | 
			
		||||
        MetaWindow *w = tmp->data;
 | 
			
		||||
        MetaRectangle outer_rect;
 | 
			
		||||
        MetaRectangle frame_rect;
 | 
			
		||||
   
 | 
			
		||||
        meta_window_get_outer_rect (w, &outer_rect);
 | 
			
		||||
        meta_window_get_frame_rect (w, &frame_rect);
 | 
			
		||||
     
 | 
			
		||||
        rect.x = outer_rect.x + outer_rect.width;
 | 
			
		||||
        rect.y = outer_rect.y;
 | 
			
		||||
        rect.x = frame_rect.x + frame_rect.width;
 | 
			
		||||
        rect.y = frame_rect.y;
 | 
			
		||||
   
 | 
			
		||||
        if (meta_rectangle_contains_rect (&work_area, &rect) &&
 | 
			
		||||
            !rectangle_overlaps_some_window (&rect, right_sorted))
 | 
			
		||||
          {
 | 
			
		||||
            *new_x = rect.x;
 | 
			
		||||
            *new_y = rect.y;
 | 
			
		||||
            if (borders)
 | 
			
		||||
              {
 | 
			
		||||
                *new_x += borders->visible.left;
 | 
			
		||||
                *new_y += borders->visible.top;
 | 
			
		||||
              }
 | 
			
		||||
        
 | 
			
		||||
            retval = TRUE;
 | 
			
		||||
       
 | 
			
		||||
@@ -652,7 +601,6 @@ find_first_fit (MetaWindow *window,
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_window_place (MetaWindow        *window,
 | 
			
		||||
                   MetaFrameBorders  *borders,
 | 
			
		||||
                   int                x,
 | 
			
		||||
                   int                y,
 | 
			
		||||
                   int               *new_x,
 | 
			
		||||
@@ -661,13 +609,6 @@ meta_window_place (MetaWindow        *window,
 | 
			
		||||
  GList *windows;
 | 
			
		||||
  const MetaMonitorInfo *xi;
 | 
			
		||||
 | 
			
		||||
  /* frame member variables should NEVER be used in here, only
 | 
			
		||||
   * MetaFrameBorders. But remember borders == NULL
 | 
			
		||||
   * for undecorated windows. Also, this function should
 | 
			
		||||
   * NEVER have side effects other than computing the
 | 
			
		||||
   * placement coordinates.
 | 
			
		||||
   */
 | 
			
		||||
 | 
			
		||||
  meta_topic (META_DEBUG_PLACEMENT, "Placing window %s\n", window->desc);
 | 
			
		||||
 | 
			
		||||
  windows = NULL;
 | 
			
		||||
@@ -756,7 +697,7 @@ meta_window_place (MetaWindow        *window,
 | 
			
		||||
        {
 | 
			
		||||
          meta_topic (META_DEBUG_PLACEMENT,
 | 
			
		||||
                      "Not placing window with PPosition or USPosition set\n");
 | 
			
		||||
          avoid_being_obscured_as_second_modal_dialog (window, borders, &x, &y);
 | 
			
		||||
          avoid_being_obscured_as_second_modal_dialog (window, &x, &y);
 | 
			
		||||
          goto done_no_constraints;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
@@ -775,29 +716,27 @@ meta_window_place (MetaWindow        *window,
 | 
			
		||||
 | 
			
		||||
      if (parent)
 | 
			
		||||
        {
 | 
			
		||||
          int w;
 | 
			
		||||
          MetaRectangle frame_rect, parent_frame_rect;
 | 
			
		||||
 | 
			
		||||
          meta_window_get_position (parent, &x, &y);
 | 
			
		||||
          w = parent->rect.width;
 | 
			
		||||
          meta_window_get_frame_rect (window, &frame_rect);
 | 
			
		||||
          meta_window_get_frame_rect (parent, &parent_frame_rect);
 | 
			
		||||
 | 
			
		||||
          y = parent_frame_rect.y;
 | 
			
		||||
 | 
			
		||||
          /* center of parent */
 | 
			
		||||
          x = x + w / 2;
 | 
			
		||||
          x = parent_frame_rect.x + parent_frame_rect.width / 2;
 | 
			
		||||
          /* center of child over center of parent */
 | 
			
		||||
          x -= window->rect.width / 2;
 | 
			
		||||
          x -= frame_rect.width / 2;
 | 
			
		||||
 | 
			
		||||
          /* "visually" center window over parent, leaving twice as
 | 
			
		||||
           * much space below as on top.
 | 
			
		||||
           */
 | 
			
		||||
          y += (parent->rect.height - window->rect.height)/3;
 | 
			
		||||
 | 
			
		||||
          /* put top of child's frame, not top of child's client */
 | 
			
		||||
          if (borders)
 | 
			
		||||
            y += borders->visible.top;
 | 
			
		||||
          y += (parent_frame_rect.height - frame_rect.height)/3;
 | 
			
		||||
 | 
			
		||||
          meta_topic (META_DEBUG_PLACEMENT, "Centered window %s over transient parent\n",
 | 
			
		||||
                      window->desc);
 | 
			
		||||
          
 | 
			
		||||
          avoid_being_obscured_as_second_modal_dialog (window, borders, &x, &y);
 | 
			
		||||
          avoid_being_obscured_as_second_modal_dialog (window, &x, &y);
 | 
			
		||||
 | 
			
		||||
          goto done;
 | 
			
		||||
        }
 | 
			
		||||
@@ -813,6 +752,9 @@ meta_window_place (MetaWindow        *window,
 | 
			
		||||
    {
 | 
			
		||||
      /* Center on current monitor */
 | 
			
		||||
      int w, h;
 | 
			
		||||
      MetaRectangle frame_rect;
 | 
			
		||||
 | 
			
		||||
      meta_window_get_frame_rect (window, &frame_rect);
 | 
			
		||||
 | 
			
		||||
      /* Warning, this function is a round trip! */
 | 
			
		||||
      xi = meta_screen_get_current_monitor_info (window->screen);
 | 
			
		||||
@@ -820,8 +762,8 @@ meta_window_place (MetaWindow        *window,
 | 
			
		||||
      w = xi->rect.width;
 | 
			
		||||
      h = xi->rect.height;
 | 
			
		||||
 | 
			
		||||
      x = (w - window->rect.width) / 2;
 | 
			
		||||
      y = (h - window->rect.height) / 2;
 | 
			
		||||
      x = (w - frame_rect.width) / 2;
 | 
			
		||||
      y = (h - frame_rect.height) / 2;
 | 
			
		||||
 | 
			
		||||
      x += xi->rect.x;
 | 
			
		||||
      y += xi->rect.y;
 | 
			
		||||
@@ -865,7 +807,7 @@ meta_window_place (MetaWindow        *window,
 | 
			
		||||
  x = xi->rect.x;
 | 
			
		||||
  y = xi->rect.y;
 | 
			
		||||
 | 
			
		||||
  if (find_first_fit (window, borders, windows,
 | 
			
		||||
  if (find_first_fit (window, windows,
 | 
			
		||||
                      xi->number,
 | 
			
		||||
                      x, y, &x, &y))
 | 
			
		||||
    goto done_check_denied_focus;
 | 
			
		||||
@@ -878,17 +820,17 @@ meta_window_place (MetaWindow        *window,
 | 
			
		||||
      !window->fullscreen)
 | 
			
		||||
    {
 | 
			
		||||
      MetaRectangle workarea;
 | 
			
		||||
      MetaRectangle outer;
 | 
			
		||||
      MetaRectangle frame_rect;
 | 
			
		||||
 | 
			
		||||
      meta_window_get_work_area_for_monitor (window,
 | 
			
		||||
                                             xi->number,
 | 
			
		||||
                                             &workarea);      
 | 
			
		||||
      meta_window_get_outer_rect (window, &outer);
 | 
			
		||||
      meta_window_get_frame_rect (window, &frame_rect);
 | 
			
		||||
      
 | 
			
		||||
      /* If the window is bigger than the screen, then automaximize.  Do NOT
 | 
			
		||||
       * auto-maximize the directions independently.  See #419810.
 | 
			
		||||
       */
 | 
			
		||||
      if (outer.width >= workarea.width && outer.height >= workarea.height)
 | 
			
		||||
      if (frame_rect.width >= workarea.width && frame_rect.height >= workarea.height)
 | 
			
		||||
        {
 | 
			
		||||
          window->maximize_horizontally_after_placement = TRUE;
 | 
			
		||||
          window->maximize_vertically_after_placement = TRUE;
 | 
			
		||||
@@ -899,7 +841,7 @@ meta_window_place (MetaWindow        *window,
 | 
			
		||||
   * fully overlapping window (e.g. starting multiple terminals)
 | 
			
		||||
   * */
 | 
			
		||||
  if (x == xi->rect.x && y == xi->rect.y)  
 | 
			
		||||
    find_next_cascade (window, borders, windows, x, y, &x, &y);
 | 
			
		||||
    find_next_cascade (window, windows, x, y, &x, &y);
 | 
			
		||||
 | 
			
		||||
 done_check_denied_focus:
 | 
			
		||||
  /* If the window is being denied focus and isn't a transient of the
 | 
			
		||||
@@ -909,17 +851,14 @@ meta_window_place (MetaWindow        *window,
 | 
			
		||||
   */
 | 
			
		||||
  if (window->denied_focus_and_not_transient)
 | 
			
		||||
    {
 | 
			
		||||
      gboolean       found_fit;
 | 
			
		||||
      MetaWindow    *focus_window;
 | 
			
		||||
      MetaRectangle  overlap;
 | 
			
		||||
      gboolean       found_fit;
 | 
			
		||||
 | 
			
		||||
      focus_window = window->display->focus_window;
 | 
			
		||||
      g_assert (focus_window != NULL);
 | 
			
		||||
 | 
			
		||||
      /* No need to do anything if the window doesn't overlap at all */
 | 
			
		||||
      found_fit = !meta_rectangle_intersect (&window->rect,
 | 
			
		||||
                                             &focus_window->rect,
 | 
			
		||||
                                             &overlap);
 | 
			
		||||
      found_fit = !window_overlaps_focus_window (window);
 | 
			
		||||
 | 
			
		||||
      /* Try to do a first fit again, this time only taking into account the
 | 
			
		||||
       * focus window.
 | 
			
		||||
@@ -933,7 +872,7 @@ meta_window_place (MetaWindow        *window,
 | 
			
		||||
          x = xi->rect.x;
 | 
			
		||||
          y = xi->rect.y;
 | 
			
		||||
 | 
			
		||||
          found_fit = find_first_fit (window, borders, focus_window_list,
 | 
			
		||||
          found_fit = find_first_fit (window, focus_window_list,
 | 
			
		||||
                                      xi->number,
 | 
			
		||||
                                      x, y, &x, &y);
 | 
			
		||||
          g_list_free (focus_window_list);
 | 
			
		||||
@@ -943,7 +882,7 @@ meta_window_place (MetaWindow        *window,
 | 
			
		||||
       * as possible.
 | 
			
		||||
       */
 | 
			
		||||
      if (!found_fit)
 | 
			
		||||
        find_most_freespace (window, borders, focus_window, x, y, &x, &y);
 | 
			
		||||
        find_most_freespace (window, focus_window, x, y, &x, &y);
 | 
			
		||||
    }
 | 
			
		||||
  
 | 
			
		||||
 done:
 | 
			
		||||
 
 | 
			
		||||
@@ -28,7 +28,6 @@
 | 
			
		||||
#include "frame.h"
 | 
			
		||||
 | 
			
		||||
void meta_window_place (MetaWindow *window,
 | 
			
		||||
                        MetaFrameBorders *borders,
 | 
			
		||||
                        int         x,
 | 
			
		||||
                        int         y,
 | 
			
		||||
                        int        *new_x,
 | 
			
		||||
 
 | 
			
		||||
@@ -31,7 +31,7 @@
 | 
			
		||||
#include <config.h>
 | 
			
		||||
#include <meta/prefs.h>
 | 
			
		||||
#include "ui.h"
 | 
			
		||||
#include <meta/util.h>
 | 
			
		||||
#include "util-private.h"
 | 
			
		||||
#include "meta-plugin-manager.h"
 | 
			
		||||
#include <glib.h>
 | 
			
		||||
#include <gio/gio.h>
 | 
			
		||||
@@ -1199,8 +1199,8 @@ maybe_give_disable_workarounds_warning (void)
 | 
			
		||||
    {
 | 
			
		||||
      first_disable = FALSE;
 | 
			
		||||
 | 
			
		||||
      meta_warning (_("Workarounds for broken applications disabled. "
 | 
			
		||||
                      "Some applications may not behave properly.\n"));
 | 
			
		||||
      meta_warning ("Workarounds for broken applications disabled. "
 | 
			
		||||
                    "Some applications may not behave properly.\n");
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -1274,8 +1274,8 @@ titlebar_handler (GVariant *value,
 | 
			
		||||
 | 
			
		||||
  if (desc == NULL)
 | 
			
		||||
    {
 | 
			
		||||
      meta_warning (_("Could not parse font description "
 | 
			
		||||
                      "\"%s\" from GSettings key %s\n"),
 | 
			
		||||
      meta_warning ("Could not parse font description "
 | 
			
		||||
                    "\"%s\" from GSettings key %s\n",
 | 
			
		||||
                    string_value ? string_value : "(null)",
 | 
			
		||||
                    KEY_TITLEBAR_FONT);
 | 
			
		||||
      return FALSE;
 | 
			
		||||
@@ -1340,8 +1340,8 @@ mouse_button_mods_handler (GVariant *value,
 | 
			
		||||
      meta_topic (META_DEBUG_KEYBINDINGS,
 | 
			
		||||
                  "Failed to parse new GSettings value\n");
 | 
			
		||||
          
 | 
			
		||||
      meta_warning (_("\"%s\" found in configuration database is "
 | 
			
		||||
                      "not a valid value for mouse button modifier\n"),
 | 
			
		||||
      meta_warning ("\"%s\" found in configuration database is "
 | 
			
		||||
                    "not a valid value for mouse button modifier\n",
 | 
			
		||||
                    string_value);
 | 
			
		||||
 | 
			
		||||
      return FALSE;
 | 
			
		||||
@@ -1906,7 +1906,7 @@ update_binding (MetaKeyPref *binding,
 | 
			
		||||
        {
 | 
			
		||||
          meta_topic (META_DEBUG_KEYBINDINGS,
 | 
			
		||||
                      "Failed to parse new GSettings value\n");
 | 
			
		||||
          meta_warning (_("\"%s\" found in configuration database is not a valid value for keybinding \"%s\"\n"),
 | 
			
		||||
          meta_warning ("\"%s\" found in configuration database is not a valid value for keybinding \"%s\"\n",
 | 
			
		||||
                        strokes[i], binding->name);
 | 
			
		||||
 | 
			
		||||
          /* Value is kept and will thus be removed next time we save the key.
 | 
			
		||||
 
 | 
			
		||||
@@ -83,6 +83,7 @@ struct _MetaScreen
 | 
			
		||||
  MetaStack *stack;
 | 
			
		||||
  MetaStackTracker *stack_tracker;
 | 
			
		||||
 | 
			
		||||
  MetaCursorTracker *cursor_tracker;
 | 
			
		||||
  MetaCursor current_cursor;
 | 
			
		||||
 | 
			
		||||
  Window flash_window;
 | 
			
		||||
@@ -150,8 +151,6 @@ void          meta_screen_foreach_window      (MetaScreen                 *scree
 | 
			
		||||
                                               MetaScreenWindowFunc        func,
 | 
			
		||||
                                               gpointer                    data);
 | 
			
		||||
 | 
			
		||||
void          meta_screen_set_cursor          (MetaScreen                 *screen,
 | 
			
		||||
                                               MetaCursor                  cursor);
 | 
			
		||||
void          meta_screen_update_cursor       (MetaScreen                 *screen);
 | 
			
		||||
 | 
			
		||||
void          meta_screen_tab_popup_create       (MetaScreen              *screen,
 | 
			
		||||
@@ -244,6 +243,11 @@ void     meta_screen_workspace_switched (MetaScreen         *screen,
 | 
			
		||||
 | 
			
		||||
void meta_screen_set_active_workspace_hint (MetaScreen *screen);
 | 
			
		||||
 | 
			
		||||
Window   meta_screen_create_guard_window (Display *xdisplay, MetaScreen *screen);
 | 
			
		||||
 | 
			
		||||
gboolean meta_screen_handle_xevent (MetaScreen *screen,
 | 
			
		||||
                                    XEvent     *xevent);
 | 
			
		||||
 | 
			
		||||
int meta_screen_xinerama_index_to_monitor_index (MetaScreen *screen,
 | 
			
		||||
                                                 int         index);
 | 
			
		||||
int meta_screen_monitor_index_to_xinerama_index (MetaScreen *screen,
 | 
			
		||||
 
 | 
			
		||||
@@ -33,7 +33,7 @@
 | 
			
		||||
#include <config.h>
 | 
			
		||||
#include "screen-private.h"
 | 
			
		||||
#include <meta/main.h>
 | 
			
		||||
#include <meta/util.h>
 | 
			
		||||
#include "util-private.h"
 | 
			
		||||
#include <meta/errors.h>
 | 
			
		||||
#include "window-private.h"
 | 
			
		||||
#include "frame.h"
 | 
			
		||||
@@ -45,6 +45,8 @@
 | 
			
		||||
#include <meta/compositor.h>
 | 
			
		||||
#include "mutter-enum-types.h"
 | 
			
		||||
#include "core.h"
 | 
			
		||||
#include "meta-wayland-private.h"
 | 
			
		||||
#include "meta-cursor-tracker-private.h"
 | 
			
		||||
 | 
			
		||||
#include <X11/extensions/Xinerama.h>
 | 
			
		||||
 | 
			
		||||
@@ -445,12 +447,13 @@ reload_monitor_infos (MetaScreen *screen)
 | 
			
		||||
 * should effectively be forwarded to events on the background actor,
 | 
			
		||||
 * providing that the scene graph is set up correctly.
 | 
			
		||||
 */
 | 
			
		||||
static Window
 | 
			
		||||
create_guard_window (Display *xdisplay, MetaScreen *screen)
 | 
			
		||||
Window
 | 
			
		||||
meta_screen_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;
 | 
			
		||||
@@ -483,12 +486,14 @@ create_guard_window (Display *xdisplay, MetaScreen *screen)
 | 
			
		||||
    XISelectEvents (xdisplay, guard_window, &mask, 1);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  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_record_lower (screen->stack_tracker,
 | 
			
		||||
                                   guard_window,
 | 
			
		||||
                                   &stack_window,
 | 
			
		||||
                                   XNextRequest (xdisplay));
 | 
			
		||||
  XLowerWindow (xdisplay, guard_window);
 | 
			
		||||
  XMapWindow (xdisplay, guard_window);
 | 
			
		||||
@@ -574,7 +579,7 @@ meta_screen_new (MetaDisplay *display,
 | 
			
		||||
 | 
			
		||||
  if (XGetSelectionOwner (xdisplay, wm_sn_atom) != new_wm_sn_owner)
 | 
			
		||||
    {
 | 
			
		||||
      meta_warning (_("Could not acquire window manager selection on screen %d display \"%s\"\n"),
 | 
			
		||||
      meta_warning ("Could not acquire window manager selection on screen %d display \"%s\"\n",
 | 
			
		||||
                    number, display->name);
 | 
			
		||||
 | 
			
		||||
      XDestroyWindow (xdisplay, new_wm_sn_owner);
 | 
			
		||||
@@ -669,8 +674,9 @@ meta_screen_new (MetaDisplay *display,
 | 
			
		||||
  screen->xscreen = ScreenOfDisplay (xdisplay, number);
 | 
			
		||||
  screen->xroot = xroot;
 | 
			
		||||
  screen->rect.x = screen->rect.y = 0;
 | 
			
		||||
  
 | 
			
		||||
  meta_monitor_manager_initialize ();
 | 
			
		||||
 | 
			
		||||
  if (!meta_is_wayland_compositor ())
 | 
			
		||||
    meta_monitor_manager_initialize ();
 | 
			
		||||
 | 
			
		||||
  manager = meta_monitor_manager_get ();
 | 
			
		||||
  g_signal_connect (manager, "monitors-changed",
 | 
			
		||||
@@ -705,7 +711,8 @@ meta_screen_new (MetaDisplay *display,
 | 
			
		||||
  screen->guard_window = None;
 | 
			
		||||
 | 
			
		||||
  reload_monitor_infos (screen);
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  meta_cursor_tracker_get_for_screen (screen);
 | 
			
		||||
  meta_screen_set_cursor (screen, META_CURSOR_DEFAULT);
 | 
			
		||||
 | 
			
		||||
  /* Handle creating a no_focus_window for this screen */  
 | 
			
		||||
@@ -843,7 +850,7 @@ meta_screen_free (MetaScreen *screen,
 | 
			
		||||
  meta_error_trap_push_with_return (screen->display);
 | 
			
		||||
  XSelectInput (screen->display->xdisplay, screen->xroot, 0);
 | 
			
		||||
  if (meta_error_trap_pop_with_return (screen->display) != Success)
 | 
			
		||||
    meta_warning (_("Could not release screen %d on display \"%s\"\n"),
 | 
			
		||||
    meta_warning ("Could not release screen %d on display \"%s\"\n",
 | 
			
		||||
                  screen->number, screen->display->name);
 | 
			
		||||
 | 
			
		||||
  unset_wm_check_hint (screen);
 | 
			
		||||
@@ -852,9 +859,9 @@ meta_screen_free (MetaScreen *screen,
 | 
			
		||||
                  screen->wm_sn_selection_window);
 | 
			
		||||
  
 | 
			
		||||
  if (screen->work_area_later != 0)
 | 
			
		||||
    g_source_remove (screen->work_area_later);
 | 
			
		||||
    meta_later_remove (screen->work_area_later);
 | 
			
		||||
  if (screen->check_fullscreen_later != 0)
 | 
			
		||||
    g_source_remove (screen->check_fullscreen_later);
 | 
			
		||||
    meta_later_remove (screen->check_fullscreen_later);
 | 
			
		||||
 | 
			
		||||
  if (screen->monitor_infos)
 | 
			
		||||
    g_free (screen->monitor_infos);
 | 
			
		||||
@@ -930,8 +937,8 @@ meta_screen_manage_all_windows (MetaScreen *screen)
 | 
			
		||||
  meta_display_grab (screen->display);
 | 
			
		||||
 | 
			
		||||
  if (screen->guard_window == None)
 | 
			
		||||
    screen->guard_window = create_guard_window (screen->display->xdisplay,
 | 
			
		||||
                                                screen);
 | 
			
		||||
    screen->guard_window =
 | 
			
		||||
      meta_screen_create_guard_window (screen->display->xdisplay, screen);
 | 
			
		||||
 | 
			
		||||
  windows = list_windows (screen);
 | 
			
		||||
 | 
			
		||||
@@ -1461,29 +1468,18 @@ void
 | 
			
		||||
meta_screen_set_cursor (MetaScreen *screen,
 | 
			
		||||
                        MetaCursor  cursor)
 | 
			
		||||
{
 | 
			
		||||
  Cursor xcursor;
 | 
			
		||||
 | 
			
		||||
  if (cursor == screen->current_cursor)
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  screen->current_cursor = cursor;
 | 
			
		||||
  
 | 
			
		||||
  xcursor = meta_display_create_x_cursor (screen->display, cursor);
 | 
			
		||||
  XDefineCursor (screen->display->xdisplay, screen->xroot, xcursor);
 | 
			
		||||
  XFlush (screen->display->xdisplay);
 | 
			
		||||
  XFreeCursor (screen->display->xdisplay, xcursor);
 | 
			
		||||
  meta_cursor_tracker_set_root_cursor (screen->cursor_tracker, cursor);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_screen_update_cursor (MetaScreen *screen)
 | 
			
		||||
{
 | 
			
		||||
  Cursor xcursor;
 | 
			
		||||
 | 
			
		||||
  xcursor = meta_display_create_x_cursor (screen->display, 
 | 
			
		||||
					  screen->current_cursor);
 | 
			
		||||
  XDefineCursor (screen->display->xdisplay, screen->xroot, xcursor);
 | 
			
		||||
  XFlush (screen->display->xdisplay);
 | 
			
		||||
  XFreeCursor (screen->display->xdisplay, xcursor);
 | 
			
		||||
  meta_cursor_tracker_set_root_cursor (screen->cursor_tracker,
 | 
			
		||||
                                       screen->current_cursor);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
@@ -1532,7 +1528,7 @@ meta_screen_tab_popup_create (MetaScreen      *screen,
 | 
			
		||||
      if (show_type == META_TAB_SHOW_INSTANTLY ||
 | 
			
		||||
          !entries[i].hidden                   ||
 | 
			
		||||
          !meta_window_get_icon_geometry (window, &r))
 | 
			
		||||
        meta_window_get_outer_rect (window, &r);
 | 
			
		||||
        meta_window_get_frame_rect (window, &r);
 | 
			
		||||
 | 
			
		||||
      entries[i].rect = r;
 | 
			
		||||
 | 
			
		||||
@@ -1746,12 +1742,15 @@ meta_screen_tile_preview_update_timeout (gpointer data)
 | 
			
		||||
    {
 | 
			
		||||
      Window xwindow;
 | 
			
		||||
      gulong create_serial;
 | 
			
		||||
      MetaStackWindow stack_window;
 | 
			
		||||
 | 
			
		||||
      screen->tile_preview = meta_tile_preview_new (screen->number);
 | 
			
		||||
      xwindow = meta_tile_preview_get_xwindow (screen->tile_preview,
 | 
			
		||||
                                               &create_serial);
 | 
			
		||||
      stack_window.any.type = META_WINDOW_CLIENT_TYPE_X11;
 | 
			
		||||
      stack_window.x11.xwindow = xwindow;
 | 
			
		||||
      meta_stack_tracker_record_add (screen->stack_tracker,
 | 
			
		||||
                                     xwindow,
 | 
			
		||||
                                     &stack_window,
 | 
			
		||||
                                     create_serial);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -1915,7 +1914,7 @@ meta_screen_get_monitor_for_window (MetaScreen *screen,
 | 
			
		||||
{
 | 
			
		||||
  MetaRectangle window_rect;
 | 
			
		||||
  
 | 
			
		||||
  meta_window_get_outer_rect (window, &window_rect);
 | 
			
		||||
  meta_window_get_frame_rect (window, &window_rect);
 | 
			
		||||
 | 
			
		||||
  return meta_screen_get_monitor_for_rect (screen, &window_rect);
 | 
			
		||||
}
 | 
			
		||||
@@ -3688,3 +3687,13 @@ meta_screen_get_monitor_in_fullscreen (MetaScreen  *screen,
 | 
			
		||||
  /* We use -1 as a flag to mean "not known yet" for notification purposes */
 | 
			
		||||
  return screen->monitor_infos[monitor].in_fullscreen == TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
gboolean
 | 
			
		||||
meta_screen_handle_xevent (MetaScreen *screen,
 | 
			
		||||
                           XEvent     *xevent)
 | 
			
		||||
{
 | 
			
		||||
  if (meta_cursor_tracker_handle_xevent (screen->cursor_tracker, xevent))
 | 
			
		||||
    return TRUE;
 | 
			
		||||
 | 
			
		||||
  return FALSE;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -25,6 +25,8 @@
 | 
			
		||||
 | 
			
		||||
#include <config.h>
 | 
			
		||||
 | 
			
		||||
#include "util-private.h"
 | 
			
		||||
#include <meta/main.h>
 | 
			
		||||
#include "session.h"
 | 
			
		||||
#include <X11/Xatom.h>
 | 
			
		||||
 | 
			
		||||
@@ -531,6 +533,12 @@ die_callback (SmcConn smc_conn, SmPointer client_data)
 | 
			
		||||
   * Anything that wants us to go away outside of session management
 | 
			
		||||
   * can use kill().
 | 
			
		||||
   */
 | 
			
		||||
 | 
			
		||||
  /* All of that is true - unless we're a wayland compositor. In which
 | 
			
		||||
   * case the X server won't go down until we do, so we must die first.
 | 
			
		||||
   */
 | 
			
		||||
  if (meta_is_wayland_compositor ())
 | 
			
		||||
    meta_quit (0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
@@ -840,14 +848,14 @@ save_state (void)
 | 
			
		||||
  if (mkdir (mutter_dir, 0700) < 0 &&
 | 
			
		||||
      errno != EEXIST)
 | 
			
		||||
    {
 | 
			
		||||
      meta_warning (_("Could not create directory '%s': %s\n"),
 | 
			
		||||
      meta_warning ("Could not create directory '%s': %s\n",
 | 
			
		||||
                    mutter_dir, g_strerror (errno));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  if (mkdir (session_dir, 0700) < 0 &&
 | 
			
		||||
      errno != EEXIST)
 | 
			
		||||
    {
 | 
			
		||||
      meta_warning (_("Could not create directory '%s': %s\n"),
 | 
			
		||||
      meta_warning ("Could not create directory '%s': %s\n",
 | 
			
		||||
                    session_dir, g_strerror (errno));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -857,7 +865,7 @@ save_state (void)
 | 
			
		||||
 | 
			
		||||
  if (outfile == NULL)
 | 
			
		||||
    {
 | 
			
		||||
      meta_warning (_("Could not open session file '%s' for writing: %s\n"),
 | 
			
		||||
      meta_warning ("Could not open session file '%s' for writing: %s\n",
 | 
			
		||||
                    full_save_file (), g_strerror (errno));
 | 
			
		||||
      goto out;
 | 
			
		||||
    }
 | 
			
		||||
@@ -998,12 +1006,12 @@ save_state (void)
 | 
			
		||||
      /* FIXME need a dialog for this */
 | 
			
		||||
      if (ferror (outfile))
 | 
			
		||||
        {
 | 
			
		||||
          meta_warning (_("Error writing session file '%s': %s\n"),
 | 
			
		||||
          meta_warning ("Error writing session file '%s': %s\n",
 | 
			
		||||
                        full_save_file (), g_strerror (errno));
 | 
			
		||||
        }
 | 
			
		||||
      if (fclose (outfile))
 | 
			
		||||
        {
 | 
			
		||||
          meta_warning (_("Error closing session file '%s': %s\n"),
 | 
			
		||||
          meta_warning ("Error closing session file '%s': %s\n",
 | 
			
		||||
                        full_save_file (), g_strerror (errno));
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
@@ -1133,7 +1141,7 @@ load_state (const char *previous_save_file)
 | 
			
		||||
 | 
			
		||||
 error:
 | 
			
		||||
  
 | 
			
		||||
  meta_warning (_("Failed to parse saved session file: %s\n"),
 | 
			
		||||
  meta_warning ("Failed to parse saved session file: %s\n",
 | 
			
		||||
                error->message);
 | 
			
		||||
  g_error_free (error);
 | 
			
		||||
 | 
			
		||||
@@ -1182,7 +1190,7 @@ start_element_handler  (GMarkupParseContext *context,
 | 
			
		||||
              g_set_error (error,
 | 
			
		||||
                           G_MARKUP_ERROR,
 | 
			
		||||
                       G_MARKUP_ERROR_PARSE,
 | 
			
		||||
                           _("<mutter_session> attribute seen but we already have the session ID"));
 | 
			
		||||
                           "<mutter_session> attribute seen but we already have the session ID");
 | 
			
		||||
              return;
 | 
			
		||||
            }
 | 
			
		||||
          
 | 
			
		||||
@@ -1195,7 +1203,7 @@ start_element_handler  (GMarkupParseContext *context,
 | 
			
		||||
              g_set_error (error,
 | 
			
		||||
                           G_MARKUP_ERROR,
 | 
			
		||||
                           G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE,
 | 
			
		||||
                           _("Unknown attribute %s on <%s> element"),
 | 
			
		||||
                           "Unknown attribute %s on <%s> element",
 | 
			
		||||
                           name, "mutter_session");
 | 
			
		||||
              return;
 | 
			
		||||
            }
 | 
			
		||||
@@ -1212,7 +1220,7 @@ start_element_handler  (GMarkupParseContext *context,
 | 
			
		||||
          g_set_error (error,
 | 
			
		||||
                       G_MARKUP_ERROR,
 | 
			
		||||
                       G_MARKUP_ERROR_PARSE,
 | 
			
		||||
                       _("nested <window> tag"));
 | 
			
		||||
                       "nested <window> tag");
 | 
			
		||||
          return;
 | 
			
		||||
        }
 | 
			
		||||
      
 | 
			
		||||
@@ -1270,7 +1278,7 @@ start_element_handler  (GMarkupParseContext *context,
 | 
			
		||||
              g_set_error (error,
 | 
			
		||||
                           G_MARKUP_ERROR,
 | 
			
		||||
                           G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE,
 | 
			
		||||
                           _("Unknown attribute %s on <%s> element"),
 | 
			
		||||
                           "Unknown attribute %s on <%s> element",
 | 
			
		||||
                           name, "window");
 | 
			
		||||
              session_info_free (pd->info);
 | 
			
		||||
              pd->info = NULL;
 | 
			
		||||
@@ -1302,7 +1310,7 @@ start_element_handler  (GMarkupParseContext *context,
 | 
			
		||||
              g_set_error (error,
 | 
			
		||||
                           G_MARKUP_ERROR,
 | 
			
		||||
                           G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE,
 | 
			
		||||
                           _("Unknown attribute %s on <%s> element"),
 | 
			
		||||
                           "Unknown attribute %s on <%s> element",
 | 
			
		||||
                           name, "window");
 | 
			
		||||
              session_info_free (pd->info);
 | 
			
		||||
              pd->info = NULL;
 | 
			
		||||
@@ -1374,7 +1382,7 @@ start_element_handler  (GMarkupParseContext *context,
 | 
			
		||||
              g_set_error (error,
 | 
			
		||||
                           G_MARKUP_ERROR,
 | 
			
		||||
                           G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE,
 | 
			
		||||
                           _("Unknown attribute %s on <%s> element"),
 | 
			
		||||
                           "Unknown attribute %s on <%s> element",
 | 
			
		||||
                           name, "maximized");
 | 
			
		||||
              return;
 | 
			
		||||
            }
 | 
			
		||||
@@ -1434,7 +1442,7 @@ start_element_handler  (GMarkupParseContext *context,
 | 
			
		||||
              g_set_error (error,
 | 
			
		||||
                           G_MARKUP_ERROR,
 | 
			
		||||
                           G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE,
 | 
			
		||||
                           _("Unknown attribute %s on <%s> element"),
 | 
			
		||||
                           "Unknown attribute %s on <%s> element",
 | 
			
		||||
                           name, "geometry");
 | 
			
		||||
              return;
 | 
			
		||||
            }
 | 
			
		||||
@@ -1454,7 +1462,7 @@ start_element_handler  (GMarkupParseContext *context,
 | 
			
		||||
      g_set_error (error,
 | 
			
		||||
                   G_MARKUP_ERROR,
 | 
			
		||||
                   G_MARKUP_ERROR_UNKNOWN_ELEMENT,
 | 
			
		||||
                   _("Unknown element %s"),
 | 
			
		||||
                   "Unknown element %s",
 | 
			
		||||
                   element_name);
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -37,36 +37,55 @@
 | 
			
		||||
#define META_STACK_TRACKER_H
 | 
			
		||||
 | 
			
		||||
#include <meta/screen.h>
 | 
			
		||||
#include <meta/window.h>
 | 
			
		||||
 | 
			
		||||
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,
 | 
			
		||||
						Window            window,
 | 
			
		||||
                                                gulong            serial);
 | 
			
		||||
void meta_stack_tracker_record_remove          (MetaStackTracker *tracker,
 | 
			
		||||
						Window            window,
 | 
			
		||||
                                                gulong            serial);
 | 
			
		||||
void meta_stack_tracker_record_restack_windows (MetaStackTracker *tracker,
 | 
			
		||||
						Window           *windows,
 | 
			
		||||
						int               n_windows,
 | 
			
		||||
                                                gulong            serial);
 | 
			
		||||
void meta_stack_tracker_record_raise_above     (MetaStackTracker *tracker,
 | 
			
		||||
						Window            window,
 | 
			
		||||
						Window            sibling,
 | 
			
		||||
                                                gulong            serial);
 | 
			
		||||
void meta_stack_tracker_record_lower_below    (MetaStackTracker *tracker,
 | 
			
		||||
						Window            window,
 | 
			
		||||
						Window            sibling,
 | 
			
		||||
                                                gulong            serial);
 | 
			
		||||
void meta_stack_tracker_record_lower           (MetaStackTracker *tracker,
 | 
			
		||||
						Window            window,
 | 
			
		||||
                                                gulong            serial);
 | 
			
		||||
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 */
 | 
			
		||||
@@ -79,9 +98,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,
 | 
			
		||||
                                    Window           **windows,
 | 
			
		||||
                                    int               *n_windows);
 | 
			
		||||
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);
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										527
									
								
								src/core/stack.c
									
									
									
									
									
								
							
							
						
						
									
										527
									
								
								src/core/stack.c
									
									
									
									
									
								
							@@ -52,7 +52,7 @@
 | 
			
		||||
 | 
			
		||||
#define WINDOW_IN_STACK(w) (w->stack_position >= 0)
 | 
			
		||||
 | 
			
		||||
static void stack_sync_to_server (MetaStack *stack);
 | 
			
		||||
static void stack_sync_to_xserver (MetaStack *stack);
 | 
			
		||||
static void meta_window_set_stack_position_no_sync (MetaWindow *window,
 | 
			
		||||
                                                    int         position);
 | 
			
		||||
static void stack_do_window_deletions (MetaStack *stack);
 | 
			
		||||
@@ -71,14 +71,14 @@ meta_stack_new (MetaScreen *screen)
 | 
			
		||||
  stack = g_new (MetaStack, 1);
 | 
			
		||||
 | 
			
		||||
  stack->screen = screen;
 | 
			
		||||
  stack->windows = g_array_new (FALSE, FALSE, sizeof (Window));
 | 
			
		||||
  stack->xwindows = g_array_new (FALSE, FALSE, sizeof (Window));
 | 
			
		||||
 | 
			
		||||
  stack->sorted = NULL;
 | 
			
		||||
  stack->added = NULL;
 | 
			
		||||
  stack->removed = NULL;
 | 
			
		||||
 | 
			
		||||
  stack->freeze_count = 0;
 | 
			
		||||
  stack->last_root_children_stacked = NULL;
 | 
			
		||||
  stack->last_all_root_children_stacked = NULL;
 | 
			
		||||
 | 
			
		||||
  stack->n_positions = 0;
 | 
			
		||||
 | 
			
		||||
@@ -89,17 +89,24 @@ 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)
 | 
			
		||||
{
 | 
			
		||||
  g_array_free (stack->windows, TRUE);
 | 
			
		||||
  g_array_free (stack->xwindows, TRUE);
 | 
			
		||||
 | 
			
		||||
  g_list_free (stack->sorted);
 | 
			
		||||
  g_list_free (stack->added);
 | 
			
		||||
  g_list_free (stack->removed);
 | 
			
		||||
 | 
			
		||||
  if (stack->last_root_children_stacked)
 | 
			
		||||
    g_array_free (stack->last_root_children_stacked, TRUE);
 | 
			
		||||
  if (stack->last_all_root_children_stacked)
 | 
			
		||||
    free_last_all_root_children_stacked_cache (stack);
 | 
			
		||||
  
 | 
			
		||||
  g_free (stack);
 | 
			
		||||
}
 | 
			
		||||
@@ -121,7 +128,7 @@ meta_stack_add (MetaStack  *stack,
 | 
			
		||||
              "Window %s has stack_position initialized to %d\n",
 | 
			
		||||
              window->desc, window->stack_position);
 | 
			
		||||
  
 | 
			
		||||
  stack_sync_to_server (stack);
 | 
			
		||||
  stack_sync_to_xserver (stack);
 | 
			
		||||
  meta_stack_update_window_tile_matches (stack, window->screen->active_workspace);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -157,7 +164,7 @@ meta_stack_remove (MetaStack  *stack,
 | 
			
		||||
    stack->removed = g_list_prepend (stack->removed,
 | 
			
		||||
                                     GUINT_TO_POINTER (window->frame->xwindow));
 | 
			
		||||
  
 | 
			
		||||
  stack_sync_to_server (stack);
 | 
			
		||||
  stack_sync_to_xserver (stack);
 | 
			
		||||
  meta_stack_update_window_tile_matches (stack, window->screen->active_workspace);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -167,7 +174,7 @@ meta_stack_update_layer (MetaStack  *stack,
 | 
			
		||||
{
 | 
			
		||||
  stack->need_relayer = TRUE;
 | 
			
		||||
  
 | 
			
		||||
  stack_sync_to_server (stack);
 | 
			
		||||
  stack_sync_to_xserver (stack);
 | 
			
		||||
  meta_stack_update_window_tile_matches (stack, window->screen->active_workspace);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -177,7 +184,7 @@ meta_stack_update_transient (MetaStack  *stack,
 | 
			
		||||
{
 | 
			
		||||
  stack->need_constrain = TRUE;
 | 
			
		||||
  
 | 
			
		||||
  stack_sync_to_server (stack);
 | 
			
		||||
  stack_sync_to_xserver (stack);
 | 
			
		||||
  meta_stack_update_window_tile_matches (stack, window->screen->active_workspace);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -206,7 +213,7 @@ meta_stack_raise (MetaStack  *stack,
 | 
			
		||||
 | 
			
		||||
  meta_window_set_stack_position_no_sync (window, max_stack_position);
 | 
			
		||||
 | 
			
		||||
  stack_sync_to_server (stack);
 | 
			
		||||
  stack_sync_to_xserver (stack);
 | 
			
		||||
  meta_stack_update_window_tile_matches (stack, window->screen->active_workspace);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -234,7 +241,7 @@ meta_stack_lower (MetaStack  *stack,
 | 
			
		||||
 | 
			
		||||
  meta_window_set_stack_position_no_sync (window, min_stack_position);
 | 
			
		||||
  
 | 
			
		||||
  stack_sync_to_server (stack);
 | 
			
		||||
  stack_sync_to_xserver (stack);
 | 
			
		||||
  meta_stack_update_window_tile_matches (stack, window->screen->active_workspace);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -250,7 +257,7 @@ meta_stack_thaw (MetaStack *stack)
 | 
			
		||||
  g_return_if_fail (stack->freeze_count > 0);
 | 
			
		||||
  
 | 
			
		||||
  stack->freeze_count -= 1;
 | 
			
		||||
  stack_sync_to_server (stack);
 | 
			
		||||
  stack_sync_to_xserver (stack);
 | 
			
		||||
  meta_stack_update_window_tile_matches (stack, NULL);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -829,7 +836,7 @@ stack_do_window_deletions (MetaStack *stack)
 | 
			
		||||
      /* We go from the end figuring removals are more
 | 
			
		||||
       * likely to be recent.
 | 
			
		||||
       */
 | 
			
		||||
      i = stack->windows->len;
 | 
			
		||||
      i = stack->xwindows->len;
 | 
			
		||||
      while (i > 0)
 | 
			
		||||
        {
 | 
			
		||||
          --i;
 | 
			
		||||
@@ -840,9 +847,9 @@ stack_do_window_deletions (MetaStack *stack)
 | 
			
		||||
           * both the window->xwindow and window->frame->xwindow
 | 
			
		||||
           * in the removal list.
 | 
			
		||||
           */
 | 
			
		||||
          if (xwindow == g_array_index (stack->windows, Window, i))
 | 
			
		||||
          if (xwindow == g_array_index (stack->xwindows, Window, i))
 | 
			
		||||
            {
 | 
			
		||||
              g_array_remove_index (stack->windows, i);
 | 
			
		||||
              g_array_remove_index (stack->xwindows, i);
 | 
			
		||||
              goto next;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
@@ -871,10 +878,10 @@ stack_do_window_additions (MetaStack *stack)
 | 
			
		||||
                  "Adding %d windows to sorted list\n",
 | 
			
		||||
                  n_added);
 | 
			
		||||
      
 | 
			
		||||
      old_size = stack->windows->len;
 | 
			
		||||
      g_array_set_size (stack->windows, old_size + n_added);
 | 
			
		||||
      old_size = stack->xwindows->len;
 | 
			
		||||
      g_array_set_size (stack->xwindows, old_size + n_added);
 | 
			
		||||
      
 | 
			
		||||
      end = &g_array_index (stack->windows, Window, old_size);
 | 
			
		||||
      end = &g_array_index (stack->xwindows, Window, old_size);
 | 
			
		||||
 | 
			
		||||
      /* stack->added has the most recent additions at the
 | 
			
		||||
       * front of the list, so we need to reverse it
 | 
			
		||||
@@ -1029,6 +1036,102 @@ 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:
 | 
			
		||||
 *
 | 
			
		||||
@@ -1053,84 +1156,74 @@ stack_ensure_sorted (MetaStack *stack)
 | 
			
		||||
 */
 | 
			
		||||
static void
 | 
			
		||||
raise_window_relative_to_managed_windows (MetaScreen *screen,
 | 
			
		||||
                                          Window      xwindow)
 | 
			
		||||
                                          const MetaStackWindow *window)
 | 
			
		||||
{
 | 
			
		||||
  gulong serial = 0;
 | 
			
		||||
  MetaStackWindow *sibling;
 | 
			
		||||
 | 
			
		||||
  Window *children;
 | 
			
		||||
  int n_children;
 | 
			
		||||
  int i;
 | 
			
		||||
 | 
			
		||||
  meta_stack_tracker_get_stack (screen->stack_tracker,
 | 
			
		||||
                                &children, &n_children);
 | 
			
		||||
 | 
			
		||||
  /* Children are in order from bottom to top. We want to
 | 
			
		||||
   * find the topmost managed child, then configure
 | 
			
		||||
   * our window to be above it.
 | 
			
		||||
   */
 | 
			
		||||
  i = n_children - 1;
 | 
			
		||||
  while (i >= 0)
 | 
			
		||||
  sibling = find_top_most_managed_window (screen, window);
 | 
			
		||||
  if (!sibling)
 | 
			
		||||
    {
 | 
			
		||||
      if (children[i] == xwindow)
 | 
			
		||||
      if (window->any.type == META_WINDOW_CLIENT_TYPE_X11)
 | 
			
		||||
        {
 | 
			
		||||
          /* 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.
 | 
			
		||||
           */
 | 
			
		||||
          serial = XNextRequest (screen->display->xdisplay);
 | 
			
		||||
          meta_error_trap_push (screen->display);
 | 
			
		||||
          XLowerWindow (screen->display->xdisplay,
 | 
			
		||||
                        window->x11.xwindow);
 | 
			
		||||
          meta_error_trap_pop (screen->display);
 | 
			
		||||
        }
 | 
			
		||||
      else
 | 
			
		||||
        {
 | 
			
		||||
          MetaWindow *other = meta_display_lookup_x_window (screen->display,
 | 
			
		||||
                                                            children[i]);
 | 
			
		||||
          if (other != NULL && !other->override_redirect)
 | 
			
		||||
            {
 | 
			
		||||
              XWindowChanges changes;
 | 
			
		||||
 | 
			
		||||
              /* children[i] is the topmost managed child */
 | 
			
		||||
      /* 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",
 | 
			
		||||
                          xwindow, children[i]);
 | 
			
		||||
              window->any.type == META_WINDOW_CLIENT_TYPE_X11 ? window->x11.xwindow: 0,
 | 
			
		||||
              sibling->any.type == META_WINDOW_CLIENT_TYPE_X11 ? sibling->x11.xwindow: 0);
 | 
			
		||||
 | 
			
		||||
              changes.sibling = children[i];
 | 
			
		||||
  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);
 | 
			
		||||
              meta_stack_tracker_record_raise_above (screen->stack_tracker,
 | 
			
		||||
                                                     xwindow,
 | 
			
		||||
                                                     children[i],
 | 
			
		||||
                                                     XNextRequest (screen->display->xdisplay));
 | 
			
		||||
              XConfigureWindow (screen->display->xdisplay,
 | 
			
		||||
                                xwindow,
 | 
			
		||||
                            window->x11.xwindow,
 | 
			
		||||
                                CWSibling | CWStackMode,
 | 
			
		||||
                                &changes);
 | 
			
		||||
              meta_error_trap_pop (screen->display);
 | 
			
		||||
 | 
			
		||||
              break;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      --i;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  if (i < 0)
 | 
			
		||||
      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);
 | 
			
		||||
      meta_stack_tracker_record_lower (screen->stack_tracker,
 | 
			
		||||
                                       xwindow,
 | 
			
		||||
                                       XNextRequest (screen->display->xdisplay));
 | 
			
		||||
      XLowerWindow (screen->display->xdisplay,
 | 
			
		||||
                    xwindow);
 | 
			
		||||
                        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:
 | 
			
		||||
 *
 | 
			
		||||
@@ -1145,13 +1238,16 @@ raise_window_relative_to_managed_windows (MetaScreen *screen,
 | 
			
		||||
 * job of computing the minimal set of stacking requests needed.
 | 
			
		||||
 */
 | 
			
		||||
static void
 | 
			
		||||
stack_sync_to_server (MetaStack *stack)
 | 
			
		||||
stack_sync_to_xserver (MetaStack *stack)
 | 
			
		||||
{
 | 
			
		||||
  GArray *stacked;
 | 
			
		||||
  GArray *root_children_stacked;
 | 
			
		||||
  GArray *x11_stacked;
 | 
			
		||||
  GArray *x11_root_children_stacked;
 | 
			
		||||
  GArray *all_root_children_stacked; /* wayland OR x11 */
 | 
			
		||||
  GList *tmp;
 | 
			
		||||
  GArray *all_hidden;
 | 
			
		||||
  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)
 | 
			
		||||
@@ -1166,13 +1262,17 @@ stack_sync_to_server (MetaStack *stack)
 | 
			
		||||
   * _NET hints, and "root_children_stacked" is in top-to-bottom
 | 
			
		||||
   * order for XRestackWindows()
 | 
			
		||||
   */
 | 
			
		||||
  stacked = g_array_new (FALSE, FALSE, sizeof (Window));
 | 
			
		||||
  root_children_stacked = g_array_new (FALSE, FALSE, sizeof (Window));
 | 
			
		||||
  all_hidden = g_array_new (FALSE, FALSE, sizeof (Window));
 | 
			
		||||
  x11_stacked = g_array_new (FALSE, FALSE, sizeof (Window));
 | 
			
		||||
 | 
			
		||||
  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 (all_hidden, stack->screen->guard_window);
 | 
			
		||||
  g_array_append_val (x11_hidden, stack->screen->guard_window);
 | 
			
		||||
 | 
			
		||||
  meta_topic (META_DEBUG_STACK, "Top to bottom: ");
 | 
			
		||||
  meta_push_no_msg_prefix ();
 | 
			
		||||
@@ -1181,6 +1281,9 @@ stack_sync_to_server (MetaStack *stack)
 | 
			
		||||
    {
 | 
			
		||||
      MetaWindow *w = tmp->data;
 | 
			
		||||
      Window top_level_window;
 | 
			
		||||
      MetaStackWindow stack_window;
 | 
			
		||||
 | 
			
		||||
      stack_window.any.type = w->client_type;
 | 
			
		||||
      
 | 
			
		||||
      meta_topic (META_DEBUG_STACK, "%u:%d - %s ",
 | 
			
		||||
		  w->layer, w->stack_position, w->desc);
 | 
			
		||||
@@ -1189,60 +1292,82 @@ stack_sync_to_server (MetaStack *stack)
 | 
			
		||||
      if (w->override_redirect)
 | 
			
		||||
	n_override_redirect++;
 | 
			
		||||
      else
 | 
			
		||||
	g_array_prepend_val (stacked, w->xwindow);
 | 
			
		||||
	g_array_prepend_val (x11_stacked, w->xwindow);
 | 
			
		||||
      
 | 
			
		||||
      if (w->frame)
 | 
			
		||||
	top_level_window = w->frame->xwindow;
 | 
			
		||||
      else
 | 
			
		||||
	top_level_window = w->xwindow;
 | 
			
		||||
 | 
			
		||||
      if (w->client_type == META_WINDOW_CLIENT_TYPE_X11)
 | 
			
		||||
        stack_window.x11.xwindow = top_level_window;
 | 
			
		||||
      else
 | 
			
		||||
        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
 | 
			
		||||
       * the screens fullscreen guard_window. */
 | 
			
		||||
      if (w->hidden)
 | 
			
		||||
	{
 | 
			
		||||
	  g_array_append_val (all_hidden, top_level_window);
 | 
			
		||||
          if (w->client_type == META_WINDOW_CLIENT_TYPE_X11)
 | 
			
		||||
            {
 | 
			
		||||
              MetaStackWindow stack_window;
 | 
			
		||||
 | 
			
		||||
              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_window);
 | 
			
		||||
 | 
			
		||||
      /* build XRestackWindows() array from top to bottom */
 | 
			
		||||
      g_array_append_val (root_children_stacked, top_level_window);
 | 
			
		||||
      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 ();
 | 
			
		||||
 | 
			
		||||
  /* All windows should be in some stacking order */
 | 
			
		||||
  if (stacked->len != stack->windows->len - n_override_redirect)
 | 
			
		||||
  /* 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",
 | 
			
		||||
              stacked->len, stack->windows->len);
 | 
			
		||||
              x11_stacked->len, stack->xwindows->len);
 | 
			
		||||
  
 | 
			
		||||
  /* Sync to server */
 | 
			
		||||
 | 
			
		||||
  meta_topic (META_DEBUG_STACK, "Restacking %u windows\n",
 | 
			
		||||
              root_children_stacked->len);
 | 
			
		||||
              all_root_children_stacked->len);
 | 
			
		||||
  
 | 
			
		||||
  meta_error_trap_push (stack->screen->display);
 | 
			
		||||
 | 
			
		||||
  if (stack->last_root_children_stacked == NULL)
 | 
			
		||||
  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 (root_children_stacked->len > 0)
 | 
			
		||||
      if (all_root_children_stacked->len > 1)
 | 
			
		||||
        {
 | 
			
		||||
          meta_stack_tracker_record_restack_windows (stack->screen->stack_tracker,
 | 
			
		||||
                                                     (Window *) root_children_stacked->data,
 | 
			
		||||
                                                     root_children_stacked->len,
 | 
			
		||||
                                                     XNextRequest (stack->screen->display->xdisplay));
 | 
			
		||||
          gulong serial = 0;
 | 
			
		||||
          if (x11_root_children_stacked->len > 1)
 | 
			
		||||
            {
 | 
			
		||||
              serial = XNextRequest (stack->screen->display->xdisplay);
 | 
			
		||||
          XRestackWindows (stack->screen->display->xdisplay,
 | 
			
		||||
                           (Window *) root_children_stacked->data,
 | 
			
		||||
                           root_children_stacked->len);
 | 
			
		||||
                               (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 (root_children_stacked->len > 0)
 | 
			
		||||
  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,
 | 
			
		||||
@@ -1250,28 +1375,34 @@ stack_sync_to_server (MetaStack *stack)
 | 
			
		||||
       * was saved, then we may have inefficiency, but I don't think things
 | 
			
		||||
       * break...
 | 
			
		||||
       */
 | 
			
		||||
      const Window *old_stack = (Window *) stack->last_root_children_stacked->data;
 | 
			
		||||
      const Window *new_stack = (Window *) root_children_stacked->data;
 | 
			
		||||
      const int old_len = stack->last_root_children_stacked->len;
 | 
			
		||||
      const int new_len = root_children_stacked->len;
 | 
			
		||||
      const Window *oldp = old_stack;
 | 
			
		||||
      const Window *newp = new_stack;
 | 
			
		||||
      const Window *old_end = old_stack + old_len;
 | 
			
		||||
      const Window *new_end = new_stack + new_len;
 | 
			
		||||
      Window last_window = None;
 | 
			
		||||
      
 | 
			
		||||
      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 (*oldp == *newp)
 | 
			
		||||
          if (meta_stack_window_equal (oldp, newp))
 | 
			
		||||
            {
 | 
			
		||||
              /* Stacks are the same here, move on */
 | 
			
		||||
              ++oldp;
 | 
			
		||||
              last_window = *newp;
 | 
			
		||||
              if (newp->any.type == META_WINDOW_CLIENT_TYPE_X11)
 | 
			
		||||
                last_xwindow = newp->x11.xwindow;
 | 
			
		||||
              last_window = newp;
 | 
			
		||||
              ++newp;
 | 
			
		||||
            }
 | 
			
		||||
          else if (meta_display_lookup_x_window (stack->screen->display,
 | 
			
		||||
                                                 *oldp) == NULL)
 | 
			
		||||
          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
 | 
			
		||||
@@ -1280,75 +1411,161 @@ stack_sync_to_server (MetaStack *stack)
 | 
			
		||||
            }
 | 
			
		||||
          else
 | 
			
		||||
            {
 | 
			
		||||
              /* Move *newp below last_window */
 | 
			
		||||
              if (last_window == None)
 | 
			
		||||
              /* 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);
 | 
			
		||||
                  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);
 | 
			
		||||
                  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
 | 
			
		||||
                {
 | 
			
		||||
                  /* This means that if last_window is dead, but not
 | 
			
		||||
                  gulong serial = 0;
 | 
			
		||||
 | 
			
		||||
                  /* This means that if last_xwindow is dead, but not
 | 
			
		||||
                   * *newp, then we fail to restack *newp; but on
 | 
			
		||||
                   * unmanaging last_window, we'll fix it up.
 | 
			
		||||
                   * unmanaging last_xwindow, we'll fix it up.
 | 
			
		||||
                   */
 | 
			
		||||
                  
 | 
			
		||||
                  XWindowChanges changes;
 | 
			
		||||
                  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);
 | 
			
		||||
 | 
			
		||||
                  changes.sibling = last_window;
 | 
			
		||||
                  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;
 | 
			
		||||
 | 
			
		||||
                  meta_topic (META_DEBUG_STACK, "Placing window 0x%lx below 0x%lx\n",
 | 
			
		||||
                              *newp, last_window);
 | 
			
		||||
 | 
			
		||||
                  meta_stack_tracker_record_lower_below (stack->screen->stack_tracker,
 | 
			
		||||
                                                         *newp, last_window,
 | 
			
		||||
                                                         XNextRequest (stack->screen->display->xdisplay));
 | 
			
		||||
                  XConfigureWindow (stack->screen->display->xdisplay,
 | 
			
		||||
                                    *newp,
 | 
			
		||||
                                        newp->x11.xwindow,
 | 
			
		||||
                                    CWSibling | CWStackMode,
 | 
			
		||||
                                    &changes);
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
              last_window = *newp;
 | 
			
		||||
                  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_stack;
 | 
			
		||||
                   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;
 | 
			
		||||
            newp = MIN (newp - 1, x_ref);
 | 
			
		||||
          meta_stack_tracker_record_restack_windows (stack->screen->stack_tracker,
 | 
			
		||||
                                                     (Window *) newp, new_end - newp,
 | 
			
		||||
                                                     XNextRequest (stack->screen->display->xdisplay));
 | 
			
		||||
          XRestackWindows (stack->screen->display->xdisplay,
 | 
			
		||||
                           (Window *) newp, new_end - newp);
 | 
			
		||||
                                                     newp, new_end - newp,
 | 
			
		||||
                                                     serial);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  /* Push hidden windows to the bottom of the stack under the guard window */
 | 
			
		||||
  /* 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,
 | 
			
		||||
                                   stack->screen->guard_window,
 | 
			
		||||
                                   &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,
 | 
			
		||||
                                             (Window *)all_hidden->data,
 | 
			
		||||
                                             all_hidden->len,
 | 
			
		||||
                                             (MetaStackWindow *)x11_hidden_stack_windows->data,
 | 
			
		||||
                                             x11_hidden_stack_windows->len,
 | 
			
		||||
                                             XNextRequest (stack->screen->display->xdisplay));
 | 
			
		||||
  XRestackWindows (stack->screen->display->xdisplay,
 | 
			
		||||
		   (Window *)all_hidden->data,
 | 
			
		||||
		   all_hidden->len);
 | 
			
		||||
  g_array_free (all_hidden, TRUE);
 | 
			
		||||
		   (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
 | 
			
		||||
@@ -1363,21 +1580,23 @@ stack_sync_to_server (MetaStack *stack)
 | 
			
		||||
                   stack->screen->display->atom__NET_CLIENT_LIST,
 | 
			
		||||
                   XA_WINDOW,
 | 
			
		||||
                   32, PropModeReplace,
 | 
			
		||||
                   (unsigned char *)stack->windows->data,
 | 
			
		||||
                   stack->windows->len);
 | 
			
		||||
                   (unsigned char *)stack->xwindows->data,
 | 
			
		||||
                   stack->xwindows->len);
 | 
			
		||||
  XChangeProperty (stack->screen->display->xdisplay,
 | 
			
		||||
                   stack->screen->xroot,
 | 
			
		||||
                   stack->screen->display->atom__NET_CLIENT_LIST_STACKING,
 | 
			
		||||
                   XA_WINDOW,
 | 
			
		||||
                   32, PropModeReplace,
 | 
			
		||||
                   (unsigned char *)stacked->data,
 | 
			
		||||
                   stacked->len);
 | 
			
		||||
                   (unsigned char *)x11_stacked->data,
 | 
			
		||||
                   x11_stacked->len);
 | 
			
		||||
 | 
			
		||||
  g_array_free (stacked, TRUE);
 | 
			
		||||
  g_array_free (x11_stacked, TRUE);
 | 
			
		||||
 | 
			
		||||
  if (stack->last_root_children_stacked)
 | 
			
		||||
    g_array_free (stack->last_root_children_stacked, TRUE);
 | 
			
		||||
  stack->last_root_children_stacked = root_children_stacked;
 | 
			
		||||
  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... */
 | 
			
		||||
}
 | 
			
		||||
@@ -1465,7 +1684,7 @@ window_contains_point (MetaWindow *window,
 | 
			
		||||
{
 | 
			
		||||
  MetaRectangle rect;
 | 
			
		||||
 | 
			
		||||
  meta_window_get_outer_rect (window, &rect);
 | 
			
		||||
  meta_window_get_frame_rect (window, &rect);
 | 
			
		||||
 | 
			
		||||
  return POINT_IN_RECT (root_x, root_y, rect);
 | 
			
		||||
}
 | 
			
		||||
@@ -1484,14 +1703,12 @@ get_default_focus_window (MetaStack     *stack,
 | 
			
		||||
   * or top window in same group as not_this_one.
 | 
			
		||||
   */
 | 
			
		||||
 | 
			
		||||
  MetaWindow *topmost_dock;
 | 
			
		||||
  MetaWindow *transient_parent;
 | 
			
		||||
  MetaWindow *topmost_in_group;
 | 
			
		||||
  MetaWindow *topmost_overall;
 | 
			
		||||
  MetaGroup *not_this_one_group;
 | 
			
		||||
  GList *link;
 | 
			
		||||
  
 | 
			
		||||
  topmost_dock = NULL;
 | 
			
		||||
  transient_parent = NULL;
 | 
			
		||||
  topmost_in_group = NULL;
 | 
			
		||||
  topmost_overall = NULL;
 | 
			
		||||
@@ -1517,10 +1734,6 @@ get_default_focus_window (MetaStack     *stack,
 | 
			
		||||
          (workspace == NULL ||
 | 
			
		||||
           meta_window_located_on_workspace (window, workspace)))
 | 
			
		||||
        {
 | 
			
		||||
          if (topmost_dock == NULL &&
 | 
			
		||||
              window->type == META_WINDOW_DOCK)
 | 
			
		||||
            topmost_dock = window;
 | 
			
		||||
 | 
			
		||||
          if (not_this_one != NULL)
 | 
			
		||||
            {
 | 
			
		||||
              if (transient_parent == NULL &&
 | 
			
		||||
@@ -1538,10 +1751,6 @@ get_default_focus_window (MetaStack     *stack,
 | 
			
		||||
                topmost_in_group = window;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
          /* Note that DESKTOP windows can be topmost_overall so
 | 
			
		||||
           * we prefer focusing desktop or other windows over
 | 
			
		||||
           * focusing dock, even though docks are stacked higher.
 | 
			
		||||
           */
 | 
			
		||||
          if (topmost_overall == NULL &&
 | 
			
		||||
              window->type != META_WINDOW_DOCK &&
 | 
			
		||||
              (!must_be_at_point ||
 | 
			
		||||
@@ -1563,7 +1772,7 @@ get_default_focus_window (MetaStack     *stack,
 | 
			
		||||
  else if (topmost_overall)
 | 
			
		||||
    return topmost_overall;
 | 
			
		||||
  else
 | 
			
		||||
    return topmost_dock;
 | 
			
		||||
    return NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
MetaWindow*
 | 
			
		||||
@@ -1738,7 +1947,7 @@ meta_stack_set_positions (MetaStack *stack,
 | 
			
		||||
  meta_topic (META_DEBUG_STACK,
 | 
			
		||||
              "Reset the stack positions of (nearly) all windows\n");
 | 
			
		||||
 | 
			
		||||
  stack_sync_to_server (stack);
 | 
			
		||||
  stack_sync_to_xserver (stack);
 | 
			
		||||
  meta_stack_update_window_tile_matches (stack, NULL);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -1801,7 +2010,7 @@ meta_window_set_stack_position (MetaWindow *window,
 | 
			
		||||
                                int         position)
 | 
			
		||||
{
 | 
			
		||||
  meta_window_set_stack_position_no_sync (window, position);
 | 
			
		||||
  stack_sync_to_server (window->screen->stack);
 | 
			
		||||
  stack_sync_to_xserver (window->screen->stack);
 | 
			
		||||
  meta_stack_update_window_tile_matches (window->screen->stack,
 | 
			
		||||
                                         window->screen->active_workspace);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -60,7 +60,7 @@ struct _MetaStack
 | 
			
		||||
   * A sequence of all the Windows (X handles, not MetaWindows) of the windows
 | 
			
		||||
   * we manage, sorted in order.  Suitable to be passed into _NET_CLIENT_LIST.
 | 
			
		||||
   */
 | 
			
		||||
  GArray *windows;
 | 
			
		||||
  GArray *xwindows;
 | 
			
		||||
 | 
			
		||||
  /** The MetaWindows of the windows we manage, sorted in order. */
 | 
			
		||||
  GList *sorted;
 | 
			
		||||
@@ -99,7 +99,7 @@ struct _MetaStack
 | 
			
		||||
   * The last-known stack of all windows, bottom to top.  We cache it here
 | 
			
		||||
   * so that subsequent times we'll be able to do incremental moves.
 | 
			
		||||
   */
 | 
			
		||||
  GArray *last_root_children_stacked;
 | 
			
		||||
  GArray *last_all_root_children_stacked;
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * Number of stack positions; same as the length of added, but
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										37
									
								
								src/core/util-private.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								src/core/util-private.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,37 @@
 | 
			
		||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
 | 
			
		||||
 | 
			
		||||
/* Mutter utilities */
 | 
			
		||||
 | 
			
		||||
/* 
 | 
			
		||||
 * Copyright (C) 2001 Havoc Pennington
 | 
			
		||||
 * Copyright (C) 2005 Elijah Newren
 | 
			
		||||
 * 
 | 
			
		||||
 * This program is free software; you can redistribute it and/or
 | 
			
		||||
 * modify it under the terms of the GNU General Public License as
 | 
			
		||||
 * published by the Free Software Foundation; either version 2 of the
 | 
			
		||||
 * License, or (at your option) any later version.
 | 
			
		||||
 *
 | 
			
		||||
 * This program is distributed in the hope that it will be useful, but
 | 
			
		||||
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 | 
			
		||||
 * General Public License for more details.
 | 
			
		||||
 * 
 | 
			
		||||
 * You should have received a copy of the GNU General Public License
 | 
			
		||||
 * along with this program; if not, write to the Free Software
 | 
			
		||||
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 | 
			
		||||
 * 02111-1307, USA.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef META_UTIL_PRIVATE_H
 | 
			
		||||
#define META_UTIL_PRIVATE_H
 | 
			
		||||
 | 
			
		||||
#include <meta/util.h>
 | 
			
		||||
#include <glib/gi18n-lib.h>
 | 
			
		||||
 | 
			
		||||
void     meta_set_verbose (gboolean setting);
 | 
			
		||||
void     meta_set_debugging (gboolean setting);
 | 
			
		||||
void     meta_set_syncing (gboolean setting);
 | 
			
		||||
void     meta_set_replace_current_wm (gboolean setting);
 | 
			
		||||
void     meta_set_is_wayland_compositor (gboolean setting);
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
@@ -31,7 +31,7 @@
 | 
			
		||||
 | 
			
		||||
#include <config.h>
 | 
			
		||||
#include <meta/common.h>
 | 
			
		||||
#include <meta/util.h>
 | 
			
		||||
#include "util-private.h"
 | 
			
		||||
#include <meta/main.h>
 | 
			
		||||
 | 
			
		||||
#include <clutter/clutter.h> /* For clutter_threads_add_repaint_func() */
 | 
			
		||||
@@ -55,6 +55,7 @@ static gint verbose_topics = 0;
 | 
			
		||||
static gboolean is_debugging = FALSE;
 | 
			
		||||
static gboolean replace_current = FALSE;
 | 
			
		||||
static int no_prefix = 0;
 | 
			
		||||
static gboolean is_wayland_compositor = FALSE;
 | 
			
		||||
 | 
			
		||||
#ifdef WITH_VERBOSE_MODE
 | 
			
		||||
static FILE* logfile = NULL;
 | 
			
		||||
@@ -81,7 +82,7 @@ ensure_logfile (void)
 | 
			
		||||
      
 | 
			
		||||
      if (err != NULL)
 | 
			
		||||
        {
 | 
			
		||||
          meta_warning (_("Failed to open debug log: %s\n"),
 | 
			
		||||
          meta_warning ("Failed to open debug log: %s\n",
 | 
			
		||||
                        err->message);
 | 
			
		||||
          g_error_free (err);
 | 
			
		||||
          return;
 | 
			
		||||
@@ -91,13 +92,13 @@ ensure_logfile (void)
 | 
			
		||||
      
 | 
			
		||||
      if (logfile == NULL)
 | 
			
		||||
        {
 | 
			
		||||
          meta_warning (_("Failed to fdopen() log file %s: %s\n"),
 | 
			
		||||
          meta_warning ("Failed to fdopen() log file %s: %s\n",
 | 
			
		||||
                        filename, strerror (errno));
 | 
			
		||||
          close (fd);
 | 
			
		||||
        }
 | 
			
		||||
      else
 | 
			
		||||
        {
 | 
			
		||||
          g_printerr (_("Opened log file %s\n"), filename);
 | 
			
		||||
          g_printerr ("Opened log file %s\n", filename);
 | 
			
		||||
        }
 | 
			
		||||
      
 | 
			
		||||
      g_free (filename);
 | 
			
		||||
@@ -194,6 +195,18 @@ meta_set_replace_current_wm (gboolean setting)
 | 
			
		||||
  replace_current = setting;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
gboolean
 | 
			
		||||
meta_is_wayland_compositor (void)
 | 
			
		||||
{
 | 
			
		||||
  return is_wayland_compositor;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
meta_set_is_wayland_compositor (gboolean value)
 | 
			
		||||
{
 | 
			
		||||
  is_wayland_compositor = value;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
char *
 | 
			
		||||
meta_g_utf8_strndup (const gchar *src,
 | 
			
		||||
                     gsize        n)
 | 
			
		||||
@@ -261,7 +274,7 @@ meta_debug_spew_real (const char *format, ...)
 | 
			
		||||
  out = logfile ? logfile : stderr;
 | 
			
		||||
  
 | 
			
		||||
  if (no_prefix == 0)
 | 
			
		||||
    utf8_fputs (_("Window manager: "), out);
 | 
			
		||||
    utf8_fputs ("Window manager: ", out);
 | 
			
		||||
  utf8_fputs (str, out);
 | 
			
		||||
 | 
			
		||||
  fflush (out);
 | 
			
		||||
@@ -411,7 +424,7 @@ meta_bug (const char *format, ...)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
  if (no_prefix == 0)
 | 
			
		||||
    utf8_fputs (_("Bug in window manager: "), out);
 | 
			
		||||
    utf8_fputs ("Bug in window manager: ", out);
 | 
			
		||||
  utf8_fputs (str, out);
 | 
			
		||||
 | 
			
		||||
  fflush (out);
 | 
			
		||||
@@ -442,7 +455,7 @@ meta_warning (const char *format, ...)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
  if (no_prefix == 0)
 | 
			
		||||
    utf8_fputs (_("Window manager warning: "), out);
 | 
			
		||||
    utf8_fputs ("Window manager warning: ", out);
 | 
			
		||||
  utf8_fputs (str, out);
 | 
			
		||||
 | 
			
		||||
  fflush (out);
 | 
			
		||||
@@ -470,7 +483,7 @@ meta_fatal (const char *format, ...)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
  if (no_prefix == 0)
 | 
			
		||||
    utf8_fputs (_("Window manager error: "), out);
 | 
			
		||||
    utf8_fputs ("Window manager error: ", out);
 | 
			
		||||
  utf8_fputs (str, out);
 | 
			
		||||
 | 
			
		||||
  fflush (out);
 | 
			
		||||
 
 | 
			
		||||
@@ -44,6 +44,8 @@
 | 
			
		||||
#include <X11/Xutil.h>
 | 
			
		||||
#include <cairo.h>
 | 
			
		||||
#include <gdk-pixbuf/gdk-pixbuf.h>
 | 
			
		||||
#include <clutter/clutter.h>
 | 
			
		||||
#include "meta-wayland-types.h"
 | 
			
		||||
 | 
			
		||||
typedef struct _MetaWindowQueue MetaWindowQueue;
 | 
			
		||||
 | 
			
		||||
@@ -69,6 +71,7 @@ typedef enum {
 | 
			
		||||
  _NET_WM_BYPASS_COMPOSITOR_HINT_OFF = 2,
 | 
			
		||||
} MetaBypassCompositorHintValue;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
struct _MetaWindow
 | 
			
		||||
{
 | 
			
		||||
  GObject parent_instance;
 | 
			
		||||
@@ -77,6 +80,10 @@ struct _MetaWindow
 | 
			
		||||
  MetaScreen *screen;
 | 
			
		||||
  const MetaMonitorInfo *monitor;
 | 
			
		||||
  MetaWorkspace *workspace;
 | 
			
		||||
  MetaWindowClientType client_type;
 | 
			
		||||
#ifdef HAVE_WAYLAND
 | 
			
		||||
  MetaWaylandSurface *surface;
 | 
			
		||||
#endif
 | 
			
		||||
  Window xwindow;
 | 
			
		||||
  /* may be NULL! not all windows get decorated */
 | 
			
		||||
  MetaFrame *frame;
 | 
			
		||||
@@ -95,7 +102,7 @@ struct _MetaWindow
 | 
			
		||||
  
 | 
			
		||||
  MetaWindowType type;
 | 
			
		||||
  Atom type_atom;
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  /* NOTE these five are not in UTF-8, we just treat them as random
 | 
			
		||||
   * binary data
 | 
			
		||||
   */
 | 
			
		||||
@@ -121,6 +128,7 @@ struct _MetaWindow
 | 
			
		||||
  Window xtransient_for;
 | 
			
		||||
  Window xgroup_leader;
 | 
			
		||||
  Window xclient_leader;
 | 
			
		||||
  MetaWindow *transient_for;
 | 
			
		||||
 | 
			
		||||
  /* Initial workspace property */
 | 
			
		||||
  int initial_workspace;  
 | 
			
		||||
@@ -325,9 +333,6 @@ struct _MetaWindow
 | 
			
		||||
  guint using_net_wm_icon_name         : 1; /* vs. plain wm_icon_name */
 | 
			
		||||
  guint using_net_wm_visible_icon_name : 1; /* tracked so we can clear it */
 | 
			
		||||
 | 
			
		||||
  /* has a shape mask */
 | 
			
		||||
  guint has_shape : 1;
 | 
			
		||||
 | 
			
		||||
  /* icon props have changed */
 | 
			
		||||
  guint need_reread_icon : 1;
 | 
			
		||||
  
 | 
			
		||||
@@ -346,12 +351,25 @@ struct _MetaWindow
 | 
			
		||||
  /* whether or not the window is from a program running on another machine */
 | 
			
		||||
  guint is_remote : 1;
 | 
			
		||||
 | 
			
		||||
  /* Used for Wayland -- surfaces can behave as if they were unmapped if
 | 
			
		||||
   * they have a NULL buffer attached... */
 | 
			
		||||
  guint surface_mapped;
 | 
			
		||||
 | 
			
		||||
  /* if non-NULL, the bounds of the window frame */
 | 
			
		||||
  cairo_region_t *frame_bounds;
 | 
			
		||||
 | 
			
		||||
  /* if non-NULL, the bounding shape region of the window */
 | 
			
		||||
  cairo_region_t *shape_region;
 | 
			
		||||
 | 
			
		||||
  /* if non-NULL, the opaque region _NET_WM_OPAQUE_REGION */
 | 
			
		||||
  cairo_region_t *opaque_region;
 | 
			
		||||
 | 
			
		||||
  /* the input shape region for picking */
 | 
			
		||||
  cairo_region_t *input_region;
 | 
			
		||||
 | 
			
		||||
  /* _NET_WM_WINDOW_OPACITY */
 | 
			
		||||
  guint opacity;
 | 
			
		||||
 | 
			
		||||
  /* if TRUE, the we have the new form of sync request counter which
 | 
			
		||||
   * also handles application frames */
 | 
			
		||||
  guint extended_sync_request_counter : 1;
 | 
			
		||||
@@ -394,6 +412,12 @@ struct _MetaWindow
 | 
			
		||||
   */
 | 
			
		||||
  MetaRectangle rect;
 | 
			
		||||
 | 
			
		||||
  /* The size and position we want the window to be (i.e. what we last asked
 | 
			
		||||
   * the client to configure).
 | 
			
		||||
   * This is only used for wayland clients.
 | 
			
		||||
   */
 | 
			
		||||
  MetaRectangle expected_rect;
 | 
			
		||||
 | 
			
		||||
  gboolean has_custom_frame_extents;
 | 
			
		||||
  GtkBorder custom_frame_extents;
 | 
			
		||||
 | 
			
		||||
@@ -445,6 +469,8 @@ struct _MetaWindow
 | 
			
		||||
 | 
			
		||||
  /* Bypass compositor hints */
 | 
			
		||||
  guint bypass_compositor;
 | 
			
		||||
 | 
			
		||||
  GSList *pending_pings;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct _MetaWindowClass
 | 
			
		||||
@@ -490,6 +516,8 @@ MetaWindow* meta_window_new_with_attrs     (MetaDisplay       *display,
 | 
			
		||||
                                            gboolean           must_be_viewable,
 | 
			
		||||
                                            MetaCompEffect     effect,
 | 
			
		||||
                                            XWindowAttributes *attrs);
 | 
			
		||||
MetaWindow *meta_window_new_for_wayland    (MetaDisplay        *display,
 | 
			
		||||
                                            MetaWaylandSurface *surface);
 | 
			
		||||
void        meta_window_unmanage           (MetaWindow  *window,
 | 
			
		||||
                                            guint32      timestamp);
 | 
			
		||||
void        meta_window_calc_showing       (MetaWindow  *window);
 | 
			
		||||
@@ -512,6 +540,7 @@ void        meta_window_update_fullscreen_monitors (MetaWindow    *window,
 | 
			
		||||
                                                    unsigned long  left,
 | 
			
		||||
                                                    unsigned long  right);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* args to move are window pos, not frame pos */
 | 
			
		||||
void        meta_window_move               (MetaWindow  *window,
 | 
			
		||||
                                            gboolean     user_op,
 | 
			
		||||
@@ -587,6 +616,11 @@ void     meta_window_move_resize_request(MetaWindow *window,
 | 
			
		||||
                                         int         y,
 | 
			
		||||
                                         int         width,
 | 
			
		||||
                                         int         height);
 | 
			
		||||
void     meta_window_move_resize_wayland (MetaWindow *window,
 | 
			
		||||
                                          int         width,
 | 
			
		||||
                                          int         height,
 | 
			
		||||
                                          int         dx,
 | 
			
		||||
                                          int         dy);
 | 
			
		||||
gboolean meta_window_configure_request (MetaWindow *window,
 | 
			
		||||
                                        XEvent     *event);
 | 
			
		||||
gboolean meta_window_property_notify   (MetaWindow *window,
 | 
			
		||||
@@ -617,8 +651,10 @@ void meta_window_update_sync_request_counter (MetaWindow *window,
 | 
			
		||||
                                              gint64      new_counter_value);
 | 
			
		||||
#endif /* HAVE_XSYNC */
 | 
			
		||||
 | 
			
		||||
void meta_window_handle_mouse_grab_op_event (MetaWindow *window,
 | 
			
		||||
                                             XIDeviceEvent *xev);
 | 
			
		||||
void meta_window_handle_mouse_grab_op_event  (MetaWindow         *window,
 | 
			
		||||
                                              const ClutterEvent *event);
 | 
			
		||||
void meta_window_handle_mouse_grab_op_xevent (MetaWindow         *window,
 | 
			
		||||
                                              XIDeviceEvent      *xevent);
 | 
			
		||||
 | 
			
		||||
GList* meta_window_get_workspaces (MetaWindow *window);
 | 
			
		||||
 | 
			
		||||
@@ -653,7 +689,11 @@ void meta_window_update_layer (MetaWindow *window);
 | 
			
		||||
 | 
			
		||||
void meta_window_recalc_features    (MetaWindow *window);
 | 
			
		||||
 | 
			
		||||
/* recalc_window_type is x11 only, wayland does its thing and then calls type_changed */
 | 
			
		||||
void meta_window_recalc_window_type (MetaWindow *window);
 | 
			
		||||
void meta_window_type_changed       (MetaWindow *window);
 | 
			
		||||
 | 
			
		||||
void meta_window_frame_size_changed (MetaWindow *window);
 | 
			
		||||
 | 
			
		||||
void meta_window_stack_just_below (MetaWindow *window,
 | 
			
		||||
                                   MetaWindow *below_this_one);
 | 
			
		||||
@@ -665,7 +705,6 @@ void meta_window_update_icon_now (MetaWindow *window);
 | 
			
		||||
 | 
			
		||||
void meta_window_update_role (MetaWindow *window);
 | 
			
		||||
void meta_window_update_net_wm_type (MetaWindow *window);
 | 
			
		||||
void meta_window_update_opaque_region (MetaWindow *window);
 | 
			
		||||
void meta_window_update_for_monitors_changed (MetaWindow *window);
 | 
			
		||||
void meta_window_update_on_all_workspaces (MetaWindow *window);
 | 
			
		||||
 | 
			
		||||
@@ -679,4 +718,48 @@ void meta_window_compute_tile_match (MetaWindow *window);
 | 
			
		||||
 | 
			
		||||
gboolean meta_window_updates_are_frozen (MetaWindow *window);
 | 
			
		||||
 | 
			
		||||
void meta_window_update_opaque_region_x11 (MetaWindow *window);
 | 
			
		||||
void meta_window_update_input_region_x11  (MetaWindow *window);
 | 
			
		||||
void meta_window_update_shape_region_x11  (MetaWindow *window);
 | 
			
		||||
 | 
			
		||||
void meta_window_set_title                (MetaWindow *window,
 | 
			
		||||
                                           const char *title);
 | 
			
		||||
void meta_window_set_wm_class             (MetaWindow *window,
 | 
			
		||||
                                           const char *wm_class,
 | 
			
		||||
                                           const char *wm_instance);
 | 
			
		||||
void meta_window_set_gtk_dbus_properties  (MetaWindow *window,
 | 
			
		||||
                                           const char *application_id,
 | 
			
		||||
                                           const char *unique_bus_name,
 | 
			
		||||
                                           const char *appmenu_path,
 | 
			
		||||
                                           const char *menubar_path,
 | 
			
		||||
                                           const char *application_object_path,
 | 
			
		||||
                                           const char *window_object_path);
 | 
			
		||||
 | 
			
		||||
void meta_window_set_transient_for        (MetaWindow *window,
 | 
			
		||||
                                           MetaWindow *parent);
 | 
			
		||||
 | 
			
		||||
void meta_window_set_opacity              (MetaWindow *window,
 | 
			
		||||
                                           guint       opacity);
 | 
			
		||||
 | 
			
		||||
void meta_window_handle_enter (MetaWindow  *window,
 | 
			
		||||
                               guint32      timestamp,
 | 
			
		||||
                               guint        root_x,
 | 
			
		||||
                               guint        root_y);
 | 
			
		||||
 | 
			
		||||
void meta_window_set_surface_mapped (MetaWindow *window,
 | 
			
		||||
                                     gboolean    surface_mapped);
 | 
			
		||||
 | 
			
		||||
typedef void (* MetaWindowPingFunc) (MetaWindow  *window,
 | 
			
		||||
				     guint32      timestamp,
 | 
			
		||||
				     gpointer     user_data);
 | 
			
		||||
 | 
			
		||||
void meta_window_ping (MetaWindow         *window,
 | 
			
		||||
                       guint32             timestamp,
 | 
			
		||||
                       MetaWindowPingFunc  ping_reply_func,
 | 
			
		||||
                       MetaWindowPingFunc  ping_timeout_func,
 | 
			
		||||
                       void               *user_data);
 | 
			
		||||
void meta_window_pong (MetaWindow *window,
 | 
			
		||||
                       guint32     timestamp);
 | 
			
		||||
Window meta_window_get_toplevel_xwindow (MetaWindow *window);
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -48,6 +48,7 @@
 | 
			
		||||
#include <X11/Xatom.h>
 | 
			
		||||
#include <unistd.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include "util-private.h"
 | 
			
		||||
 | 
			
		||||
#ifndef HOST_NAME_MAX
 | 
			
		||||
/* Solaris headers apparently don't define this so do so manually; #326745 */
 | 
			
		||||
@@ -316,6 +317,9 @@ reload_gtk_frame_extents (MetaWindow    *window,
 | 
			
		||||
    {
 | 
			
		||||
      window->has_custom_frame_extents = FALSE;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  if (!initial)
 | 
			
		||||
    meta_window_queue(window, META_QUEUE_MOVE_RESIZE);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
@@ -344,7 +348,7 @@ reload_net_wm_pid (MetaWindow    *window,
 | 
			
		||||
      gulong cardinal = (int) value->v.cardinal;
 | 
			
		||||
      
 | 
			
		||||
      if (cardinal <= 0)
 | 
			
		||||
        meta_warning (_("Application set a bogus _NET_WM_PID %lu\n"),
 | 
			
		||||
        meta_warning ("Application set a bogus _NET_WM_PID %lu\n",
 | 
			
		||||
                      cardinal);
 | 
			
		||||
      else
 | 
			
		||||
        {
 | 
			
		||||
@@ -489,28 +493,19 @@ static void
 | 
			
		||||
set_window_title (MetaWindow *window,
 | 
			
		||||
                  const char *title)
 | 
			
		||||
{
 | 
			
		||||
  char *str;
 | 
			
		||||
  char *new_title = NULL;
 | 
			
		||||
 
 | 
			
		||||
  gboolean modified =
 | 
			
		||||
    set_title_text (window,
 | 
			
		||||
                    window->using_net_wm_visible_name,
 | 
			
		||||
                    title,
 | 
			
		||||
                    window->display->atom__NET_WM_VISIBLE_NAME,
 | 
			
		||||
                    &window->title);
 | 
			
		||||
                    &new_title);
 | 
			
		||||
  window->using_net_wm_visible_name = modified;
 | 
			
		||||
  
 | 
			
		||||
  /* strndup is a hack since GNU libc has broken %.10s */
 | 
			
		||||
  str = g_strndup (window->title, 10);
 | 
			
		||||
  g_free (window->desc);
 | 
			
		||||
  window->desc = g_strdup_printf ("0x%lx (%s)", window->xwindow, str);
 | 
			
		||||
  g_free (str);
 | 
			
		||||
  meta_window_set_title (window, new_title);
 | 
			
		||||
 | 
			
		||||
  if (window->frame)
 | 
			
		||||
    meta_ui_set_frame_title (window->screen->ui,
 | 
			
		||||
                             window->frame->xwindow,
 | 
			
		||||
                             window->title);
 | 
			
		||||
 | 
			
		||||
  g_object_notify (G_OBJECT (window), "title");
 | 
			
		||||
  g_free (new_title);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
@@ -565,7 +560,7 @@ reload_opaque_region (MetaWindow    *window,
 | 
			
		||||
                      MetaPropValue *value,
 | 
			
		||||
                      gboolean       initial)
 | 
			
		||||
{
 | 
			
		||||
  meta_window_update_opaque_region (window);
 | 
			
		||||
  meta_window_update_opaque_region_x11 (window);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
@@ -875,23 +870,15 @@ reload_wm_class (MetaWindow    *window,
 | 
			
		||||
                 MetaPropValue *value,
 | 
			
		||||
                 gboolean       initial)
 | 
			
		||||
{
 | 
			
		||||
  if (window->res_class)
 | 
			
		||||
    g_free (window->res_class);
 | 
			
		||||
  if (window->res_name)
 | 
			
		||||
    g_free (window->res_name);
 | 
			
		||||
 | 
			
		||||
  window->res_class = NULL;
 | 
			
		||||
  window->res_name = NULL;
 | 
			
		||||
 | 
			
		||||
  if (value->type != META_PROP_VALUE_INVALID)
 | 
			
		||||
    { 
 | 
			
		||||
      if (value->v.class_hint.res_name)
 | 
			
		||||
        window->res_name = g_strdup (value->v.class_hint.res_name);
 | 
			
		||||
 | 
			
		||||
      if (value->v.class_hint.res_class)
 | 
			
		||||
        window->res_class = g_strdup (value->v.class_hint.res_class);
 | 
			
		||||
 | 
			
		||||
      g_object_notify (G_OBJECT (window), "wm-class");
 | 
			
		||||
    {
 | 
			
		||||
      meta_window_set_wm_class (window,
 | 
			
		||||
                                value->v.class_hint.res_class,
 | 
			
		||||
                                value->v.class_hint.res_name);
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    {
 | 
			
		||||
      meta_window_set_wm_class (window, NULL, NULL);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  meta_verbose ("Window %s class: '%s' name: '%s'\n",
 | 
			
		||||
@@ -1534,7 +1521,7 @@ reload_transient_for (MetaWindow    *window,
 | 
			
		||||
                      gboolean       initial)
 | 
			
		||||
{
 | 
			
		||||
  MetaWindow *parent = NULL;
 | 
			
		||||
  Window transient_for, old_transient_for;
 | 
			
		||||
  Window transient_for;
 | 
			
		||||
 | 
			
		||||
  if (value->type != META_PROP_VALUE_INVALID)
 | 
			
		||||
    {
 | 
			
		||||
@@ -1543,8 +1530,7 @@ reload_transient_for (MetaWindow    *window,
 | 
			
		||||
      parent = meta_display_lookup_x_window (window->display, transient_for);
 | 
			
		||||
      if (!parent)
 | 
			
		||||
        {
 | 
			
		||||
          meta_warning (_("Invalid WM_TRANSIENT_FOR window 0x%lx specified "
 | 
			
		||||
                          "for %s.\n"),
 | 
			
		||||
          meta_warning ("Invalid WM_TRANSIENT_FOR window 0x%lx specified for %s.\n",
 | 
			
		||||
                        transient_for, window->desc);
 | 
			
		||||
          transient_for = None;
 | 
			
		||||
        }
 | 
			
		||||
@@ -1554,8 +1540,7 @@ reload_transient_for (MetaWindow    *window,
 | 
			
		||||
        {
 | 
			
		||||
          if (parent == window)
 | 
			
		||||
            {
 | 
			
		||||
              meta_warning (_("WM_TRANSIENT_FOR window 0x%lx for %s "
 | 
			
		||||
                              "would create loop.\n"),
 | 
			
		||||
              meta_warning ("WM_TRANSIENT_FOR window 0x%lx for %s would create loop.\n",
 | 
			
		||||
                            transient_for, window->desc);
 | 
			
		||||
              transient_for = None;
 | 
			
		||||
              break;
 | 
			
		||||
@@ -1571,10 +1556,6 @@ reload_transient_for (MetaWindow    *window,
 | 
			
		||||
  if (transient_for == window->xtransient_for)
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  if (meta_window_appears_focused (window) && window->xtransient_for != None)
 | 
			
		||||
    meta_window_propagate_focus_appearance (window, FALSE);
 | 
			
		||||
 | 
			
		||||
  old_transient_for = window->xtransient_for;
 | 
			
		||||
  window->xtransient_for = transient_for;
 | 
			
		||||
 | 
			
		||||
  window->transient_parent_is_root_window =
 | 
			
		||||
@@ -1586,46 +1567,14 @@ reload_transient_for (MetaWindow    *window,
 | 
			
		||||
  else
 | 
			
		||||
    meta_verbose ("Window %s is not transient\n", window->desc);
 | 
			
		||||
 | 
			
		||||
  /* may now be a dialog */
 | 
			
		||||
  meta_window_recalc_window_type (window);
 | 
			
		||||
 | 
			
		||||
  if (!window->constructing)
 | 
			
		||||
  if (window->transient_parent_is_root_window || window->xtransient_for == None)
 | 
			
		||||
    meta_window_set_transient_for (window, NULL);
 | 
			
		||||
  else
 | 
			
		||||
    {
 | 
			
		||||
      /* If the window attaches, detaches, or changes attached
 | 
			
		||||
       * parents, we need to destroy the MetaWindow and let a new one
 | 
			
		||||
       * be created (which happens as a side effect of
 | 
			
		||||
       * meta_window_unmanage()). The condition below is correct
 | 
			
		||||
       * because we know window->xtransient_for has changed.
 | 
			
		||||
       */
 | 
			
		||||
      if (window->attached || meta_window_should_attach_to_parent (window))
 | 
			
		||||
        {
 | 
			
		||||
          guint32 timestamp;
 | 
			
		||||
 | 
			
		||||
          window->xtransient_for = old_transient_for;
 | 
			
		||||
          timestamp = meta_display_get_current_time_roundtrip (window->display);
 | 
			
		||||
          meta_window_unmanage (window, timestamp);
 | 
			
		||||
          return;
 | 
			
		||||
        }
 | 
			
		||||
      parent = meta_display_lookup_x_window (window->display,
 | 
			
		||||
                                             window->xtransient_for);
 | 
			
		||||
      meta_window_set_transient_for (window, parent);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  /* update stacking constraints */
 | 
			
		||||
  if (!window->override_redirect)
 | 
			
		||||
    meta_stack_update_transient (window->screen->stack, window);
 | 
			
		||||
 | 
			
		||||
  /* possibly change its group. We treat being a window's transient as
 | 
			
		||||
   * equivalent to making it your group leader, to work around shortcomings
 | 
			
		||||
   * in programs such as xmms-- see #328211.
 | 
			
		||||
   */
 | 
			
		||||
  if (window->xtransient_for != None &&
 | 
			
		||||
      window->xgroup_leader != None &&
 | 
			
		||||
      window->xtransient_for != window->xgroup_leader)
 | 
			
		||||
    meta_window_group_leader_changed (window);
 | 
			
		||||
 | 
			
		||||
  if (!window->constructing && !window->override_redirect)
 | 
			
		||||
    meta_window_queue (window, META_QUEUE_MOVE_RESIZE);
 | 
			
		||||
 | 
			
		||||
  if (meta_window_appears_focused (window) && window->xtransient_for != None)
 | 
			
		||||
    meta_window_propagate_focus_appearance (window, TRUE);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
@@ -1706,6 +1655,20 @@ reload_bypass_compositor (MetaWindow    *window,
 | 
			
		||||
  window->bypass_compositor = requested_value;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
reload_window_opacity (MetaWindow    *window,
 | 
			
		||||
                       MetaPropValue *value,
 | 
			
		||||
                       gboolean       initial)
 | 
			
		||||
 | 
			
		||||
{
 | 
			
		||||
  int requested_value = 0xFF;
 | 
			
		||||
 | 
			
		||||
  if (value->type != META_PROP_VALUE_INVALID)
 | 
			
		||||
    requested_value = (int) value->v.cardinal;
 | 
			
		||||
 | 
			
		||||
  meta_window_set_opacity (window, requested_value);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#define RELOAD_STRING(var_name, propname) \
 | 
			
		||||
  static void                                       \
 | 
			
		||||
  reload_ ## var_name (MetaWindow    *window,       \
 | 
			
		||||
@@ -1808,6 +1771,7 @@ meta_display_init_window_prop_hooks (MetaDisplay *display)
 | 
			
		||||
    { display->atom__NET_WM_STRUT,         META_PROP_VALUE_INVALID, reload_struts,            FALSE, FALSE },
 | 
			
		||||
    { display->atom__NET_WM_STRUT_PARTIAL, META_PROP_VALUE_INVALID, reload_struts,            FALSE, FALSE },
 | 
			
		||||
    { display->atom__NET_WM_BYPASS_COMPOSITOR, META_PROP_VALUE_CARDINAL,  reload_bypass_compositor, FALSE, FALSE },
 | 
			
		||||
    { display->atom__NET_WM_WINDOW_OPACITY, META_PROP_VALUE_CARDINAL, reload_window_opacity,  TRUE, TRUE },
 | 
			
		||||
    { 0 },
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2622
									
								
								src/core/window.c
									
									
									
									
									
								
							
							
						
						
									
										2622
									
								
								src/core/window.c
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -78,6 +78,7 @@ static void
 | 
			
		||||
meta_workspace_finalize (GObject *object)
 | 
			
		||||
{
 | 
			
		||||
  /* Actual freeing done in meta_workspace_remove() for now */
 | 
			
		||||
  G_OBJECT_CLASS (meta_workspace_parent_class)->finalize (object);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
 
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user