Compare commits
541 Commits
3.12.2
...
wip/surfac
Author | SHA1 | Date | |
---|---|---|---|
2210c30cba | |||
6b98ac3d1f | |||
13ddd366a9 | |||
17462c21e8 | |||
c964ef4e01 | |||
0dccc440b6 | |||
48f7232492 | |||
ff5867e4d3 | |||
a5d950f453 | |||
7615d17293 | |||
374e30043b | |||
f771bb88d6 | |||
7ef8d21e48 | |||
c251eb8ec0 | |||
1e6b3faa83 | |||
e62fe956fd | |||
24c5290d7f | |||
00c8d3c897 | |||
cc13f8f65e | |||
47f4c9db7b | |||
4c621cc30f | |||
756a412436 | |||
be16c2fe71 | |||
a364c2a96b | |||
414259a7f8 | |||
283a81eac0 | |||
2a145262c7 | |||
57728b4322 | |||
ef24fb6296 | |||
86f057a712 | |||
dcd628d289 | |||
6038877c4c | |||
4e6321c239 | |||
304a525744 | |||
f26de405dd | |||
ed18580118 | |||
b65649186d | |||
515dc08a97 | |||
2e7a56a28f | |||
c485637a61 | |||
f9f2a82e18 | |||
2f4563132a | |||
e3a0f2c546 | |||
d39baeb8ad | |||
f27f6aab78 | |||
a66060e21a | |||
11aa3c030b | |||
bd1bec5617 | |||
d9659d4b36 | |||
d043d9943b | |||
a0ef7c7142 | |||
4efe4483fb | |||
aec3edb1cc | |||
0c5a6ad775 | |||
2be5401b1e | |||
f16e9b2ee7 | |||
06380938d4 | |||
87b20d7f2a | |||
593db0baee | |||
6b66553493 | |||
ddaae9c923 | |||
0c7a7d7527 | |||
6561b53346 | |||
def5e86673 | |||
0c213c8fee | |||
912a0abd26 | |||
d694260ad2 | |||
8566566451 | |||
0ce64e46e8 | |||
a8336669a3 | |||
f6db756326 | |||
27ab516f41 | |||
9542b464bf | |||
1ebaaa1950 | |||
71efbf0330 | |||
a6539463be | |||
b8e096db82 | |||
3e98ffaf99 | |||
0a9754f305 | |||
965a784c8a | |||
2db9f55669 | |||
3e73babaf7 | |||
66c4555dc7 | |||
183ad75603 | |||
66fc32ee14 | |||
d6396cf2c4 | |||
c9b7104117 | |||
6bf1a66b7c | |||
7e7b671b8e | |||
e04a55d1a2 | |||
8905bd2280 | |||
b09e1399c0 | |||
59c8b949ad | |||
6dbb3fddce | |||
f166240225 | |||
91b789c707 | |||
14db280fab | |||
f7097e6f66 | |||
ff89f1e271 | |||
6a8a4bfdcd | |||
cd35982d4e | |||
2f6f0f252c | |||
13651949ed | |||
fdeb72224c | |||
92e36e7076 | |||
d74796ee80 | |||
3e35cac67a | |||
1f7a6bf845 | |||
365442c1ff | |||
c8d185fc74 | |||
9567fa9c6a | |||
7a8de0c0af | |||
10fead9ba1 | |||
d5d5c2167a | |||
b9755ea725 | |||
39fee9f5a2 | |||
d6282716b2 | |||
60d9bee3bf | |||
a09fa3b0e4 | |||
9edff6f250 | |||
7d3012fd67 | |||
225e20a898 | |||
1a62ac9276 | |||
45cb151443 | |||
55b18f9671 | |||
4f4b1bfc37 | |||
9348c9bd4b | |||
16de7f66fb | |||
799c27484d | |||
c3b0faec82 | |||
9c876722a0 | |||
96fc93d744 | |||
20545941fa | |||
59f79e8294 | |||
ac32b9ef95 | |||
ba484be754 | |||
a318198ab4 | |||
e6391c2896 | |||
7ea537fad7 | |||
03146c2967 | |||
0a81314337 | |||
fa7a5782c6 | |||
e3b64912b6 | |||
a0fe392665 | |||
0e5f365d55 | |||
bfc906cbc4 | |||
8e6f8087e8 | |||
56207ddb6a | |||
8cb9cfb7b8 | |||
be698b597b | |||
1d61a0f9b5 | |||
788bd59857 | |||
2391606cc5 | |||
7155d7e043 | |||
419dfd333a | |||
b4535f2622 | |||
9b21346427 | |||
7b15d21e40 | |||
7b597b8c62 | |||
7a4adce44f | |||
a5f0db5ecb | |||
577624adef | |||
af46ef3b96 | |||
39d26be941 | |||
7bfc9109f7 | |||
becbad56ef | |||
384a34c27d | |||
002c5b8f87 | |||
1d3dbea20c | |||
ebe6e3180e | |||
a3de799939 | |||
0caf7381bb | |||
a42305edab | |||
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 |
18
.gitignore
vendored
18
.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,16 +46,16 @@ 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
|
||||
m4/*
|
||||
mutter-grayscale
|
||||
mutter-mag
|
||||
mutter-message
|
||||
@ -78,6 +78,12 @@ 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-server-protocol.h
|
||||
src/wayland/xdg-shell-protocol.c
|
||||
src/wayland/xdg-shell-server-protocol.h
|
||||
src/wayland/xserver-protocol.c
|
||||
src/wayland/xserver-server-protocol.h
|
||||
doc/reference/*.args
|
||||
doc/reference/*.bak
|
||||
doc/reference/*.hierarchy
|
||||
|
@ -1,7 +1,5 @@
|
||||
|
||||
SUBDIRS=src po doc
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
|
||||
SUBDIRS=src protocol po doc
|
||||
|
||||
EXTRA_DIST = HACKING MAINTAINERS rationales.txt
|
||||
|
||||
|
201
NEWS
201
NEWS
@ -1,173 +1,83 @@
|
||||
3.12.2
|
||||
======
|
||||
* Fix in-fullscreen state when moving between monitors [Florian; #728395]
|
||||
* Fix crash when monitors change during suspend [Giovanni; #725637]
|
||||
* Misc. bug fixes [Florian, Giovanni; #728423, #729732]
|
||||
|
||||
Contributors:
|
||||
Giovanni Campagna, Florian Müllner
|
||||
|
||||
Translations:
|
||||
Christian Kirbach [de], Pau Iranzo [ca]
|
||||
|
||||
3.12.1
|
||||
======
|
||||
* Fix opacity values from _NET_WM_WINDOW_OPACITY [Nirbheek; #727874]
|
||||
* Misc. cleanups [Jasper; #720631]
|
||||
|
||||
Contributors:
|
||||
Nirbheek Chauhan, Jasper St. Pierre
|
||||
|
||||
Translations:
|
||||
Inaki Larranaga Murgoitio [eu], marablack3 [el]
|
||||
|
||||
3.12.0
|
||||
======
|
||||
|
||||
Translations:
|
||||
Ask H. Larsen [da], Мирослав Николић [sr, sr@latin], Andika Triwidada [id],
|
||||
Daniel Korostil [uk], Petr Kovar [cs]
|
||||
|
||||
3.11.92
|
||||
=======
|
||||
* Fix identification of CSD windows [Owen; #723029]
|
||||
* Add minimal handling of touch events [Carlos; #723552]
|
||||
* Misc bug fixes and cleanups [Owen, Adel, Jasper; #723580, #726352]
|
||||
|
||||
Contributors:
|
||||
Adel Gadllah, Carlos Garnacho, Rui Matos, Jasper St. Pierre, Owen W. Taylor
|
||||
|
||||
Translations:
|
||||
Changwoo Ryu [ko], Rūdolfs Mazurs [lv], Wylmer Wang [zh_CN],
|
||||
Chao-Hsiung Liao [zh_HK, zh_TW], Yuri Myasoedov [ru], Tiagosdot [pt],
|
||||
Claude Paroz [fr], Duarte Loreto [pt], A S Alam [pa]
|
||||
|
||||
3.11.91
|
||||
=======
|
||||
* Don't use keysym to match keybindings [Rui; #678001]
|
||||
* Fix message tray icons showing up blank (again) [Adel; #725180]
|
||||
* Improve keybinding lookups [Rui; #725588]
|
||||
* Fix dynamic updates of titlebar style properties [Owen; #725751]
|
||||
* Fix positioning of manually positioned windows [Owen; #724049]
|
||||
* Misc. bug fixes [Carlos, Giovanni, Florian, Jasper; #724969, #724402, #722266,
|
||||
#725338]
|
||||
|
||||
Contributors:
|
||||
Giovanni Campagna, Adel Gadllah, Carlos Garnacho, Rui Matos, Florian Müllner,
|
||||
Jasper St. Pierre
|
||||
|
||||
Translations:
|
||||
Aurimas Černius [lt], Milo Casagrande [it], Balázs Úr [hu],
|
||||
Matej Urbančič [sl], Enrico Nicoletto [pt_BR], Yosef Or Boczko [he],
|
||||
Piotr Drąg [pl], Fran Diéguez [gl]
|
||||
|
||||
3.11.90
|
||||
=======
|
||||
* Use correct output property for backlight control [Robert; #723606]
|
||||
* Fix double-scaling on high DPI resolutions [Adel; #723931]
|
||||
* Make tile previews a compositor effect [Stefano, Florian; #665758]
|
||||
* Misc. bug fixes and cleanups [Ryan, Giovanni, Jasper; #722530, #724257,
|
||||
#724258, #724364, #720631, #707851, #707897]
|
||||
|
||||
Contributors:
|
||||
Robert Ancell, Giovanni Campagna, Stefano Facchini, Adel Gadllah,
|
||||
Ryan Lortie, Florian Müllner, Jasper St. Pierre, Rico Tzschichholz
|
||||
|
||||
Translations:
|
||||
Shankar Prasad [kn], Khaled Hosny [ar], Marek Černocký [cs],
|
||||
Kjartan Maraas [nb], Daniel Korostil [uk]
|
||||
|
||||
3.11.5
|
||||
======
|
||||
* Fix CSD titlebars being placed off-screen [Jasper; #719772]
|
||||
* Add support for subsurfaces [Jonas; #705502]
|
||||
* Expose MetaWindow:skip-taskbar property [Florian; #723307]
|
||||
* Fix legacy tray icons showing up blank [Adel; #721596]
|
||||
* Fix configuration of cloned monitors [Adel; #710610]
|
||||
* Misc bug fixes and cleanups [Jasper, Adel, Jonas; #720631, #723468, #723563]
|
||||
* Misc bug fixes and cleanups [Jasper, Adel, Marek, Jonas; #720631, #723468,
|
||||
#720818, #723563, #723564]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl, Marek Ch, Adel Gadllah, Florian Müllner, Jasper St. Pierre
|
||||
|
||||
Translations:
|
||||
Rafael Ferreira [pt_BR], Enrico Nicoletto [pt_BR], Fran Diéguez [gl],
|
||||
Chao-Hsiung Liao [zh_HK, zh_TW]
|
||||
|
||||
3.11.4
|
||||
======
|
||||
* Don't leave focus on windows that are being unmanaged [Owen; #711618]
|
||||
* Reduce server grabs [Daniel Drake; #721345, #721709]
|
||||
* Improve heuristic to determine display output name [Cosimo Cecchi; #721674]
|
||||
* Atomically unmaximize both directions [Jasper; #722108]
|
||||
* Misc bug fixes [Debarshi, Andika; #721517, #721674]
|
||||
* Misc bug fixes [Debarshi, Andika, Florian; #721517, #721674, #722347]
|
||||
|
||||
Contributors:
|
||||
Cosimo Cecchi, Daniel Drake, Debarshi Ray, Jasper St. Pierre,
|
||||
Cosimo Cecchi, Daniel Drake, Florian Müllner, Debarshi Ray, Jasper St. Pierre,
|
||||
Andika Triwidada, Owen W. Taylor
|
||||
|
||||
Translations:
|
||||
Rafael Ferreira [pt_BR], Dimitris Spingos [el], Daniel Mustieles [es],
|
||||
Milo Casagrande [it], Yosef Or Boczko [he]
|
||||
|
||||
3.11.3
|
||||
======
|
||||
* xrandr: Use "hotplug_mode_update" property [Marc-André; #711216]
|
||||
* Fix position of attached dialogs for CSD windows [Giovanni, Owen; #707194]
|
||||
* Fix focus issues with external OSKs [Jasper; #715030]
|
||||
* 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, Jasper, Owen; #712833, #678989, #720106,
|
||||
#720417, #720630]
|
||||
* Misc. bug fixes and cleanups: [Rui, Colin, Lionel, Jasper, Owen; #712833,
|
||||
#719557, #719695, #719833, #678989, #720417, #720630]
|
||||
|
||||
Contributors:
|
||||
Robert Bragg, Giovanni Campagna, Marc-André Lureau, Rui Matos, Alberto Milone,
|
||||
Florian Müllner, Sindhu S, Jasper St. Pierre, Rico Tzschichholz,
|
||||
Owen W. Taylor
|
||||
|
||||
Translations:
|
||||
甘露(Gan Lu) [zh_CN], Khaled Hosny [ar]
|
||||
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]
|
||||
* Misc. fixes and cleanups [Jasper, Rico, Florian; #711731]
|
||||
* Fix position of attached modals for CSD windows [Giovanni, Owen; #707194]
|
||||
* Misc. bug fixes [Rui, Jasper, Neil, Florian; #712247, #711731]
|
||||
|
||||
Contributors:
|
||||
Lionel Landwerlin, Florian Müllner, Jasper St. Pierre, Rico Tzschichholz
|
||||
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
|
||||
======
|
||||
* Don't require at least one output device to be connected [Giovanni; #709009]
|
||||
* Name the guard window [Andrew; #710346]
|
||||
* 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]
|
||||
* Don't focus the no-focus-window for globally active windows [Jasper; #710296]
|
||||
* Misc. fixes and cleanups [Jasper, Rico, Olav, Magdalen; #709776]
|
||||
* Misc. bug fixes and cleanups [Jasper, Olav, Magdalen; #709776]
|
||||
|
||||
Contributors:
|
||||
Magdalen Berns, Giovanni Campagna, Asad Mehmood, Bastien Nocera,
|
||||
Jasper St. Pierre, Rico Tzschichholz, Olav Vitters, Andrew Walton
|
||||
|
||||
Translations:
|
||||
Reinout van Schouwen [nl]
|
||||
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]
|
||||
* Use nearest-pixel interpolation when possible [Hans; #708389]
|
||||
* Fix tile previews getting stuck on right click during drags [Lionel; #704759]
|
||||
* Misc bug fixes [Giovanni, Jasper; #708420]
|
||||
* Misc bug fixes [Dan, Giovanni, Jasper; #708813, #708420]
|
||||
|
||||
Contributors:
|
||||
Giovanni Campagna, Adel Gadllah, Lionel Landwerlin, Hans Petter Jansson,
|
||||
Giovanni Campagna, Adel Gadllah, Dan Horák, Hans Petter Jansson,
|
||||
Jasper St. Pierre
|
||||
|
||||
Translations:
|
||||
Khaled Hosny [ar], Reinout van Schouwen [nl], Carles Ferrando [ca@valencia]
|
||||
|
||||
3.10.0.1
|
||||
========
|
||||
* Fix bug when a window changed size twice in a single frame - this
|
||||
@ -178,24 +88,32 @@ Contributors:
|
||||
|
||||
3.10.0
|
||||
======
|
||||
|
||||
Translations:
|
||||
Ask H. Larsen [da], Gabor Kelemen [hu], Duarte Loreto [pt],
|
||||
Yosef Or Boczko [he]
|
||||
* Update dependencies [Giovanni; #708210]
|
||||
|
||||
3.9.92
|
||||
======
|
||||
* Don't create a dummy texture for the texture pipeline template [Neil; #707458]
|
||||
* Remove holes generated by disabling the laptop lid [Giovanni; #707473]
|
||||
* https://bugzilla.gnome.org/show_bug.cgi?id=707474 [Giovanni; #707474]
|
||||
* 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]
|
||||
* Misc bug fixes [Giovanni, Colin, Pavel; #707649, #707563, #708070]
|
||||
* Remove holes generated by disabling the laptop lid [Giovanni; #707473]
|
||||
* Misc bug fixes [Giovanni, Pavel, Adel; #707649, #706124, #707584, #707851, #707929,
|
||||
#708070]
|
||||
|
||||
Contributors:
|
||||
Giovanni Campagna, Adel Gadllah, Colin Guthrie, Neil Roberts,
|
||||
Jasper St. Pierre, Ray Strode, Pavel Vasin
|
||||
Adel Gadllah, Giovanni Campagna, Kalev Lember, Pavel Vasin
|
||||
|
||||
Translations:
|
||||
Мирослав Николић po/sr, sr@latin.po, Мирослав Николић [sr, sr@latin],
|
||||
@ -208,19 +126,30 @@ Translations:
|
||||
3.9.91
|
||||
======
|
||||
* Drop man pages for removed utilities [Kalev; #706579]
|
||||
* Add support for idle tracking [Giovanni; #706005]
|
||||
* 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]
|
||||
* Turn blending off when drawing entirely opaque regions [Jasper; #706930]
|
||||
* 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, #707250, #707267]
|
||||
#706787, #706729, #706825, #707081, #707090, #707267, #706982, #706289]
|
||||
|
||||
Contributors:
|
||||
Giovanni Campagna, Cosimo Cecchi, Adel Gadllah, Colin Guthrie, Kalev Lember,
|
||||
Tim Lunn, Jasper St. Pierre, Rico Tzschichholz, Seán de Búrca
|
||||
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],
|
||||
@ -229,6 +158,8 @@ Translations:
|
||||
|
||||
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]
|
||||
@ -243,8 +174,8 @@ Translations:
|
||||
|
||||
Contributors:
|
||||
Robert Bragg, Giovanni Campagna, Alban Crequy, Adel Gadllah,
|
||||
Alexander Larsson, Florian Müllner, Jasper St. Pierre, Rico Tzschichholz,
|
||||
Colin Walters
|
||||
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],
|
||||
|
@ -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) || {
|
||||
|
63
configure.ac
63
configure.ac
@ -2,8 +2,8 @@ AC_PREREQ(2.50)
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
m4_define([mutter_major_version], [3])
|
||||
m4_define([mutter_minor_version], [12])
|
||||
m4_define([mutter_micro_version], [2])
|
||||
m4_define([mutter_minor_version], [11])
|
||||
m4_define([mutter_micro_version], [5])
|
||||
|
||||
m4_define([mutter_version],
|
||||
[mutter_major_version.mutter_minor_version.mutter_micro_version])
|
||||
@ -13,14 +13,17 @@ m4_define([mutter_plugin_api_version], [3])
|
||||
AC_INIT([mutter], [mutter_version],
|
||||
[http://bugzilla.gnome.org/enter_bug.cgi?product=mutter])
|
||||
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
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
|
||||
@ -36,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])
|
||||
|
||||
@ -69,13 +72,13 @@ CANBERRA_GTK_VERSION=0.26
|
||||
CLUTTER_PACKAGE=clutter-1.0
|
||||
|
||||
MUTTER_PC_MODULES="
|
||||
gtk+-3.0 >= 3.9.11
|
||||
gtk+-3.0 >= 3.3.7
|
||||
gio-2.0 >= 2.25.10
|
||||
pango >= 1.2.0
|
||||
cairo >= 1.10.0
|
||||
gsettings-desktop-schemas >= 3.7.3
|
||||
xcomposite >= 0.2 xfixes xrender xdamage xi >= 1.6.0
|
||||
$CLUTTER_PACKAGE >= 1.15.90
|
||||
$CLUTTER_PACKAGE >= 1.17.1
|
||||
cogl-1.0 >= 1.17.1
|
||||
upower-glib >= 0.99.0
|
||||
gnome-desktop-3.0
|
||||
@ -117,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"
|
||||
@ -186,20 +210,15 @@ 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
|
||||
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],
|
||||
@ -437,9 +456,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
|
||||
])
|
||||
|
||||
@ -455,7 +474,7 @@ fi
|
||||
|
||||
dnl ==========================================================================
|
||||
echo "
|
||||
mutter-$VERSION
|
||||
mutter-wayland-$VERSION
|
||||
|
||||
prefix: ${prefix}
|
||||
source code location: ${srcdir}
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
2834
po/ca@valencia.po
2834
po/ca@valencia.po
File diff suppressed because it is too large
Load Diff
805
po/pt_BR.po
805
po/pt_BR.po
File diff suppressed because it is too large
Load Diff
417
po/sk.po
417
po/sk.po
@ -13,9 +13,9 @@ 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-08-21 17:41+0000\n"
|
||||
"PO-Revision-Date: 2013-08-02 14:46+0200\n"
|
||||
"Last-Translator: Ján Kyselica <kyselica.jan@gmail.com>\n"
|
||||
"POT-Creation-Date: 2013-05-24 21:44+0000\n"
|
||||
"PO-Revision-Date: 2013-05-18 16:53+0100\n"
|
||||
"Last-Translator: Jan Kyselica <kyselica.jan@gmail.com>\n"
|
||||
"Language-Team: Slovak <gnome-sk-list@gnome.org>\n"
|
||||
"Language: sk\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@ -87,8 +87,9 @@ msgstr "Prepnúť okná aplikácie"
|
||||
# PK: zisti co to robi
|
||||
# description
|
||||
#: ../src/50-mutter-navigation.xml.in.h:13
|
||||
#, fuzzy
|
||||
msgid "Switch system controls"
|
||||
msgstr "Prepnúť medzi ovládacími prvkami systému"
|
||||
msgstr "Prepnúť medzi systémovými ovládacími prvkami"
|
||||
|
||||
# description
|
||||
#: ../src/50-mutter-navigation.xml.in.h:14
|
||||
@ -103,8 +104,9 @@ msgstr "Prepnúť okná aplikácie priamo"
|
||||
# MČ: podobne ako vyššie: „cycle-panels“
|
||||
# description
|
||||
#: ../src/50-mutter-navigation.xml.in.h:16
|
||||
#, fuzzy
|
||||
msgid "Switch system controls directly"
|
||||
msgstr "Prepnúť medzi ovládacími prvkami systému priamo"
|
||||
msgstr "Prepnúť medzi systémovými ovládacími prvkami priamo"
|
||||
|
||||
# description
|
||||
#: ../src/50-mutter-navigation.xml.in.h:17
|
||||
@ -265,13 +267,13 @@ msgstr "Zobraziť rozdelenie napravo"
|
||||
# PK: je %i cislo obrazovky? ak ano tak "č. %i"
|
||||
#. 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:596
|
||||
#, c-format
|
||||
#: ../src/compositor/compositor.c:571
|
||||
#, fuzzy, c-format
|
||||
msgid ""
|
||||
"Another compositing manager is already running on screen %i on display \"%s"
|
||||
"\"."
|
||||
msgstr ""
|
||||
"Pre obrazovku č. %i na displeji „%s“ je spustený už iný správca rozloženia."
|
||||
"Pre obrazovku %i na displeji „%s“ je spustený už iný správca rozloženia."
|
||||
|
||||
#: ../src/compositor/meta-background.c:1076
|
||||
msgid "background texture could not be created from file"
|
||||
@ -311,18 +313,18 @@ msgstr "_Počkať"
|
||||
msgid "_Force Quit"
|
||||
msgstr "_Vynútiť ukončenie"
|
||||
|
||||
#: ../src/core/display.c:421
|
||||
#: ../src/core/display.c:401
|
||||
#, c-format
|
||||
msgid "Missing %s extension required for compositing"
|
||||
msgstr "Rozšírenie %s, potrebné pre kompozitné prostredie, chýba"
|
||||
|
||||
# X window system preloz, napr. system na spravu okien X
|
||||
#: ../src/core/display.c:513
|
||||
#: ../src/core/display.c:493
|
||||
#, c-format
|
||||
msgid "Failed to open X Window System display '%s'\n"
|
||||
msgstr "Zlyhalo otvorenie displeja systému na správu okien X „%s“\n"
|
||||
|
||||
#: ../src/core/keybindings.c:1136
|
||||
#: ../src/core/keybindings.c:970
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Some other program is already using the key %s with modifiers %x as a "
|
||||
@ -330,7 +332,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Iný program už používa kláves %s s modifikátormi %x ako klávesovú skratku\n"
|
||||
|
||||
#: ../src/core/keybindings.c:1333
|
||||
#: ../src/core/keybindings.c:1151
|
||||
#, c-format
|
||||
msgid "\"%s\" is not a valid accelerator\n"
|
||||
msgstr "„%s“ nie je platný akcelerátor\n"
|
||||
@ -376,20 +378,6 @@ msgid ""
|
||||
msgstr ""
|
||||
"Nepodarilo sa nájsť tému! Overte, že %s existuje a obsahuje obvyklé témy.\n"
|
||||
|
||||
#: ../src/core/monitor.c:702
|
||||
msgid "Built-in display"
|
||||
msgstr "Vstavaný 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:730
|
||||
#, c-format
|
||||
#| msgid "Unknown element %s"
|
||||
msgid "Unknown %s"
|
||||
msgstr "Neznámy %s"
|
||||
|
||||
#: ../src/core/mutter.c:40
|
||||
#, c-format
|
||||
msgid ""
|
||||
@ -415,7 +403,7 @@ msgstr "Zobrazí verziu"
|
||||
msgid "Mutter plugin to use"
|
||||
msgstr "Použije zásuvný modul Mutter"
|
||||
|
||||
#: ../src/core/prefs.c:1202
|
||||
#: ../src/core/prefs.c:1193
|
||||
msgid ""
|
||||
"Workarounds for broken applications disabled. Some applications may not "
|
||||
"behave properly.\n"
|
||||
@ -423,12 +411,12 @@ msgstr ""
|
||||
"Náhradné riešenia pre chybné aplikácie nie sú povolené. Niektoré aplikácie "
|
||||
"sa nemusia správať správne.\n"
|
||||
|
||||
#: ../src/core/prefs.c:1277
|
||||
#: ../src/core/prefs.c:1268
|
||||
#, c-format
|
||||
msgid "Could not parse font description \"%s\" from GSettings key %s\n"
|
||||
msgstr "Nepodarilo sa spracovať popis písma „%s“ z kľúča GSettings %s\n"
|
||||
|
||||
#: ../src/core/prefs.c:1343
|
||||
#: ../src/core/prefs.c:1334
|
||||
#, c-format
|
||||
msgid ""
|
||||
"\"%s\" found in configuration database is not a valid value for mouse button "
|
||||
@ -437,7 +425,7 @@ msgstr ""
|
||||
"V konfiguračnej databáze sa našlo „%s“, čo nie je platná hodnota pre "
|
||||
"modifikátor tlačidla myši\n"
|
||||
|
||||
#: ../src/core/prefs.c:1909
|
||||
#: ../src/core/prefs.c:1881
|
||||
#, c-format
|
||||
msgid ""
|
||||
"\"%s\" found in configuration database is not a valid value for keybinding "
|
||||
@ -446,17 +434,17 @@ msgstr ""
|
||||
"V konfiguračnej databáze sa našlo „%s“, čo nie je platná hodnota pre "
|
||||
"klávesovú skratku „%s“\n"
|
||||
|
||||
#: ../src/core/prefs.c:1999
|
||||
#: ../src/core/prefs.c:1945
|
||||
#, c-format
|
||||
msgid "Workspace %d"
|
||||
msgstr "Pracovný priestor č. %d"
|
||||
|
||||
#: ../src/core/screen.c:537
|
||||
#: ../src/core/screen.c:691
|
||||
#, c-format
|
||||
msgid "Screen %d on display '%s' is invalid\n"
|
||||
msgstr "Obrazovka č. %d na displeji „%s“ nie je platná\n"
|
||||
|
||||
#: ../src/core/screen.c:553
|
||||
#: ../src/core/screen.c:707
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Screen %d on display \"%s\" already has a window manager; try using the --"
|
||||
@ -465,7 +453,7 @@ msgstr ""
|
||||
"Obrazovka č. %d na displeji „%s“ už má správcu okien. Skúste použiť prepínač "
|
||||
"--replace, aby sa aktuálny správca nahradil.\n"
|
||||
|
||||
#: ../src/core/screen.c:580
|
||||
#: ../src/core/screen.c:734
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Could not acquire window manager selection on screen %d display \"%s\"\n"
|
||||
@ -473,12 +461,12 @@ msgstr ""
|
||||
"Nepodarilo sa získať výber správcu okien pre obrazovku č. %d na displeji "
|
||||
"„%s“\n"
|
||||
|
||||
#: ../src/core/screen.c:658
|
||||
#: ../src/core/screen.c:812
|
||||
#, c-format
|
||||
msgid "Screen %d on display \"%s\" already has a window manager\n"
|
||||
msgstr "Obrazovka č. %d na displeji „%s“ už má správcu okien\n"
|
||||
|
||||
#: ../src/core/screen.c:850
|
||||
#: ../src/core/screen.c:998
|
||||
#, c-format
|
||||
msgid "Could not release screen %d on display \"%s\"\n"
|
||||
msgstr "Nepodarilo sa uvoľniť obrazovku č. %d na displeji „%s“\n"
|
||||
@ -554,7 +542,8 @@ msgstr "Zlyhalo otvorenie súboru so záznamom pomocou fdopen() %s: %s\n"
|
||||
msgid "Opened log file %s\n"
|
||||
msgstr "Otvorený súbor so záznamom %s\n"
|
||||
|
||||
#: ../src/core/util.c:119
|
||||
#: ../src/core/util.c:119 ../src/tools/mutter-message.c:149
|
||||
#, c-format
|
||||
msgid "Mutter was compiled without support for verbose mode\n"
|
||||
msgstr "Mutter bol skompilovaný bez výpisu podrobností pri behu\n"
|
||||
|
||||
@ -562,20 +551,20 @@ msgstr "Mutter bol skompilovaný bez výpisu podrobností pri behu\n"
|
||||
msgid "Window manager: "
|
||||
msgstr "Správca okien: "
|
||||
|
||||
#: ../src/core/util.c:414
|
||||
#: ../src/core/util.c:412
|
||||
msgid "Bug in window manager: "
|
||||
msgstr "Chyba v správcovi okien: "
|
||||
|
||||
#: ../src/core/util.c:445
|
||||
#: ../src/core/util.c:443
|
||||
msgid "Window manager warning: "
|
||||
msgstr "Varovanie správcu okien: "
|
||||
|
||||
#: ../src/core/util.c:473
|
||||
#: ../src/core/util.c:471
|
||||
msgid "Window manager error: "
|
||||
msgstr "Chyba správcu okien: "
|
||||
|
||||
#. first time through
|
||||
#: ../src/core/window.c:7533
|
||||
#: ../src/core/window.c:7505
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Window %s sets SM_CLIENT_ID on itself, instead of on the WM_CLIENT_LEADER "
|
||||
@ -591,7 +580,7 @@ msgstr ""
|
||||
#. * MWM but not WM_NORMAL_HINTS are basically broken. We complain
|
||||
#. * about these apps but make them work.
|
||||
#.
|
||||
#: ../src/core/window.c:8257
|
||||
#: ../src/core/window.c:8229
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Window %s sets an MWM hint indicating it isn't resizable, but sets min size "
|
||||
@ -601,7 +590,7 @@ msgstr ""
|
||||
"nastavuje minimálnu veľkosť %d x %d a maximálnu veľkosť %d x %d. To nedáva "
|
||||
"zmysel.\n"
|
||||
|
||||
#: ../src/core/window-props.c:347
|
||||
#: ../src/core/window-props.c:318
|
||||
#, c-format
|
||||
msgid "Application set a bogus _NET_WM_PID %lu\n"
|
||||
msgstr "Aplikácia nastavila neplatné _NET_WM_PID %lu\n"
|
||||
@ -609,18 +598,18 @@ msgstr "Aplikácia nastavila neplatné _NET_WM_PID %lu\n"
|
||||
# PK: co je toto?
|
||||
# JK: nedokazem zistit
|
||||
# PM: vyžiadaj komentár od vývojárov, pomožeme aj ostatným prekladateľom
|
||||
#: ../src/core/window-props.c:463
|
||||
#: ../src/core/window-props.c:434
|
||||
#, fuzzy, c-format
|
||||
msgid "%s (on %s)"
|
||||
msgstr "%s (na %s)"
|
||||
|
||||
#: ../src/core/window-props.c:1546
|
||||
#: ../src/core/window-props.c:1517
|
||||
#, c-format
|
||||
msgid "Invalid WM_TRANSIENT_FOR window 0x%lx specified for %s.\n"
|
||||
msgstr "Neplatné WM_TRANSIENT_FOR okno 0x%lx nastavené pre %s.\n"
|
||||
|
||||
# MČ: zacykliť sa, alebo vytvoriť slučku.
|
||||
#: ../src/core/window-props.c:1557
|
||||
#: ../src/core/window-props.c:1528
|
||||
#, c-format
|
||||
msgid "WM_TRANSIENT_FOR window 0x%lx for %s would create loop.\n"
|
||||
msgstr "WM_TRANSIENT_FOR okno 0x%lx pre %s môže vytvoriť slučku.\n"
|
||||
@ -708,9 +697,9 @@ msgid ""
|
||||
"vertically and resizes them horizontally to cover half of the available "
|
||||
"area. Dropping windows on the top screen edge maximizes them completely."
|
||||
msgstr ""
|
||||
"Ak je povolené, upustenie okien pri zvislých okrajoch obrazovky ich zvislo "
|
||||
"maximalizuje a vodorovná veľkosť sa zmení na polovicu dostupnej plochy. "
|
||||
"Upustenie okien pri vrchnom okraji obrazovky ich maximalizuje úplne."
|
||||
"Ak je povolené, upustenie okien pri zvislých okrajoch obrazovky ich "
|
||||
"zvislo maximalizuje a vodorovná veľkosť sa zmení na polovicu dostupnej "
|
||||
"plochy. Upustenie okien pri vrchnom okraji obrazovky ich maximalizuje úplne."
|
||||
|
||||
# summary
|
||||
#: ../src/org.gnome.mutter.gschema.xml.in.h:7
|
||||
@ -746,8 +735,9 @@ msgstr ""
|
||||
# PM: ja by som dal Bez vyvovlávania tabulátorom
|
||||
# summary
|
||||
#: ../src/org.gnome.mutter.gschema.xml.in.h:11
|
||||
#, fuzzy
|
||||
msgid "No tab popup"
|
||||
msgstr "Bez vyvolávania tabulátorom"
|
||||
msgstr "Nepoužívať prekryvnú ponuku tabulátora"
|
||||
|
||||
# MČ: Neviem, čo to presne má robiť, ale popis som pochopil inak. „…či sa má používať rozbaľovacia ponuka a zvýraznenie rámikom sa má vypnúť…“
|
||||
# description
|
||||
@ -816,104 +806,109 @@ msgstr "Vybrať okno z rozbaľovacej ponuky tabulátoru"
|
||||
msgid "Cancel tab popup"
|
||||
msgstr "Zrušit rozbaľovaciu ponuku tabulátoru"
|
||||
|
||||
#: ../src/tools/mutter-message.c:123
|
||||
#, c-format
|
||||
msgid "Usage: %s\n"
|
||||
msgstr "Použitie: %s\n"
|
||||
|
||||
#. Translators: Translate this string the same way as you do in libwnck!
|
||||
#: ../src/ui/menu.c:67
|
||||
#: ../src/ui/menu.c:69
|
||||
msgid "Mi_nimize"
|
||||
msgstr "Mi_nimalizovať"
|
||||
|
||||
#. Translators: Translate this string the same way as you do in libwnck!
|
||||
#: ../src/ui/menu.c:69
|
||||
#: ../src/ui/menu.c:71
|
||||
msgid "Ma_ximize"
|
||||
msgstr "Ma_ximalizovať"
|
||||
|
||||
#. Translators: Translate this string the same way as you do in libwnck!
|
||||
#: ../src/ui/menu.c:71
|
||||
#: ../src/ui/menu.c:73
|
||||
msgid "Unma_ximize"
|
||||
msgstr "Zrušiť ma_ximalizáciu"
|
||||
|
||||
#. Translators: Translate this string the same way as you do in libwnck!
|
||||
#: ../src/ui/menu.c:73
|
||||
#: ../src/ui/menu.c:75
|
||||
msgid "Roll _Up"
|
||||
msgstr "_Zabaliť"
|
||||
|
||||
#. Translators: Translate this string the same way as you do in libwnck!
|
||||
#: ../src/ui/menu.c:75
|
||||
#: ../src/ui/menu.c:77
|
||||
msgid "_Unroll"
|
||||
msgstr "_Rozbaliť"
|
||||
|
||||
#. Translators: Translate this string the same way as you do in libwnck!
|
||||
#: ../src/ui/menu.c:77
|
||||
#: ../src/ui/menu.c:79
|
||||
msgid "_Move"
|
||||
msgstr "Pre_miestniť"
|
||||
|
||||
#. Translators: Translate this string the same way as you do in libwnck!
|
||||
#: ../src/ui/menu.c:79
|
||||
#: ../src/ui/menu.c:81
|
||||
msgid "_Resize"
|
||||
msgstr "Zmeniť veľko_sť"
|
||||
|
||||
#. Translators: Translate this string the same way as you do in libwnck!
|
||||
#: ../src/ui/menu.c:81
|
||||
#: ../src/ui/menu.c:83
|
||||
msgid "Move Titlebar On_screen"
|
||||
msgstr "Presunúť titulok na _obrazovku"
|
||||
|
||||
#. separator
|
||||
#. Translators: Translate this string the same way as you do in libwnck!
|
||||
#: ../src/ui/menu.c:84 ../src/ui/menu.c:86
|
||||
#: ../src/ui/menu.c:86 ../src/ui/menu.c:88
|
||||
msgid "Always on _Top"
|
||||
msgstr "Vždy na_vrchu"
|
||||
|
||||
#. Translators: Translate this string the same way as you do in libwnck!
|
||||
#: ../src/ui/menu.c:88
|
||||
#: ../src/ui/menu.c:90
|
||||
msgid "_Always on Visible Workspace"
|
||||
msgstr "Vž_dy na viditeľnom pracovnom priestore"
|
||||
|
||||
#. Translators: Translate this string the same way as you do in libwnck!
|
||||
#: ../src/ui/menu.c:90
|
||||
#: ../src/ui/menu.c:92
|
||||
msgid "_Only on This Workspace"
|
||||
msgstr "_Len na tomto pracovnom priestore"
|
||||
|
||||
#. Translators: Translate this string the same way as you do in libwnck!
|
||||
#: ../src/ui/menu.c:92
|
||||
#: ../src/ui/menu.c:94
|
||||
msgid "Move to Workspace _Left"
|
||||
msgstr "Presunúť na pracovný priestor vľav_o"
|
||||
|
||||
#. Translators: Translate this string the same way as you do in libwnck!
|
||||
#: ../src/ui/menu.c:94
|
||||
#: ../src/ui/menu.c:96
|
||||
msgid "Move to Workspace R_ight"
|
||||
msgstr "Presunúť na pracovný priestor v_pravo"
|
||||
|
||||
#. Translators: Translate this string the same way as you do in libwnck!
|
||||
#: ../src/ui/menu.c:96
|
||||
#: ../src/ui/menu.c:98
|
||||
msgid "Move to Workspace _Up"
|
||||
msgstr "Presunúť na pracovný priestor _hore"
|
||||
|
||||
#. Translators: Translate this string the same way as you do in libwnck!
|
||||
#: ../src/ui/menu.c:98
|
||||
#: ../src/ui/menu.c:100
|
||||
msgid "Move to Workspace _Down"
|
||||
msgstr "Presunúť na pracovný priestor _dole"
|
||||
|
||||
#. separator
|
||||
#. Translators: Translate this string the same way as you do in libwnck!
|
||||
#: ../src/ui/menu.c:102
|
||||
#: ../src/ui/menu.c:104
|
||||
msgid "_Close"
|
||||
msgstr "_Zavrieť"
|
||||
|
||||
#: ../src/ui/menu.c:202
|
||||
#: ../src/ui/menu.c:204
|
||||
#, c-format
|
||||
msgid "Workspace %d%n"
|
||||
msgstr "Pracovná priestor %d%n"
|
||||
|
||||
#: ../src/ui/menu.c:212
|
||||
#: ../src/ui/menu.c:214
|
||||
#, c-format
|
||||
msgid "Workspace 1_0"
|
||||
msgstr "Pracovný priestor 1_0"
|
||||
|
||||
#: ../src/ui/menu.c:214
|
||||
#: ../src/ui/menu.c:216
|
||||
#, c-format
|
||||
msgid "Workspace %s%d"
|
||||
msgstr "Pracovný priestor %s%d"
|
||||
|
||||
#: ../src/ui/menu.c:384
|
||||
#: ../src/ui/menu.c:397
|
||||
msgid "Move to Another _Workspace"
|
||||
msgstr "P_resunúť na iný pracovný priestor"
|
||||
|
||||
@ -1071,21 +1066,21 @@ msgstr ""
|
||||
# MČ: Preformuloval by som koniec: „platné sú len znaky A-Za-z0-9-_“
|
||||
# PK: color_name je asi nejaky atribut, to sa nepreklada, ked tak do zatvorky
|
||||
#: ../src/ui/theme.c:1219
|
||||
#, c-format
|
||||
#, fuzzy, c-format
|
||||
msgid ""
|
||||
"Invalid character '%c' in color_name parameter of gtk:custom, only A-Za-z0-9-"
|
||||
"_ are valid"
|
||||
msgstr ""
|
||||
"V parametri color_name (názov farby) pre gtk:custom je neplatný znak „%c“, platné sú len "
|
||||
"V parametri názov_farby pre gtk:custom je neplatný znak „%c“, platné sú len "
|
||||
"znaky A-Za-z0-9-_"
|
||||
|
||||
#: ../src/ui/theme.c:1233
|
||||
#, c-format
|
||||
#, fuzzy, c-format
|
||||
msgid ""
|
||||
"Gtk:custom format is \"gtk:custom(color_name,fallback)\", \"%s\" does not "
|
||||
"fit the format"
|
||||
msgstr ""
|
||||
"Formát Gtk:custom je „gtk:custom(color_name,fallback)“, „%s“ tomu "
|
||||
"Formát Gtk:custom je „gtk:custom(názov_farby,fallback)“, „%s“ tomu "
|
||||
"nezodpovedá"
|
||||
|
||||
#: ../src/ui/theme.c:1278
|
||||
@ -1271,20 +1266,20 @@ msgid ""
|
||||
"Missing <frame state=\"%s\" resize=\"%s\" focus=\"%s\" style=\"whatever\"/>"
|
||||
msgstr "Chýbajúce <frame state=„%s“ resize=„%s“ focus=„%s“ style=„whatever“/>"
|
||||
|
||||
#: ../src/ui/theme.c:5082
|
||||
#: ../src/ui/theme.c:5084
|
||||
#, c-format
|
||||
msgid "Failed to load theme \"%s\": %s\n"
|
||||
msgstr "Zlyhalo načítanie témy „%s“: %s\n"
|
||||
|
||||
# PK: prvok?
|
||||
# JK: XML značka (XML tag)
|
||||
#: ../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
|
||||
#: ../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
|
||||
#, c-format
|
||||
msgid "No <%s> set for theme \"%s\""
|
||||
msgstr "Pre tému „%s“ nie je nastavená <%s>"
|
||||
|
||||
#: ../src/ui/theme.c:5254
|
||||
#: ../src/ui/theme.c:5256
|
||||
#, c-format
|
||||
msgid ""
|
||||
"No frame style set for window type \"%s\" in theme \"%s\", add a <window "
|
||||
@ -1293,13 +1288,13 @@ msgstr ""
|
||||
"Pre typ okna „%s“ nie je sada štýlov v téme „%s“, pridajte prvok <window "
|
||||
"type=„%s“ style_set=„whatever“/>"
|
||||
|
||||
#: ../src/ui/theme.c:5661 ../src/ui/theme.c:5723 ../src/ui/theme.c:5786
|
||||
#: ../src/ui/theme.c:5663 ../src/ui/theme.c:5725 ../src/ui/theme.c:5788
|
||||
#, c-format
|
||||
msgid ""
|
||||
"User-defined constants must begin with a capital letter; \"%s\" does not"
|
||||
msgstr "Používateľské konštanty musia začínať veľkým písmenom, „%s“ nezačína"
|
||||
|
||||
#: ../src/ui/theme.c:5669 ../src/ui/theme.c:5731 ../src/ui/theme.c:5794
|
||||
#: ../src/ui/theme.c:5671 ../src/ui/theme.c:5733 ../src/ui/theme.c:5796
|
||||
#, c-format
|
||||
msgid "Constant \"%s\" has already been defined"
|
||||
msgstr "Konštanta „%s“ už je definovaná"
|
||||
@ -1402,7 +1397,7 @@ msgstr "<%s> musí uvádzať buď geometriu alebo rodiča, ktorý má geometriu"
|
||||
msgid "You must specify a background for an alpha value to be meaningful"
|
||||
msgstr "Ak má byť hodnota alpha zmysluplná, tak musíte vybrať nejaké pozadie"
|
||||
|
||||
# PM: asi atribút type
|
||||
# PM: asi atribút type
|
||||
# JK: https://bugzilla.gnome.org/show_bug.cgi?id=698123
|
||||
#: ../src/ui/theme-parser.c:1264
|
||||
#, fuzzy, c-format
|
||||
@ -1564,7 +1559,6 @@ msgid "\"%s\" is not a valid value for resize attribute"
|
||||
msgstr "„%s“ nie je platná hodnota pre atribút zmeny veľkosti"
|
||||
|
||||
# PK: shaded states? to zatvorky daj popis co je resize
|
||||
# PM: skôr "pre stavy maximized (maximalizovaný)/shaded (zatienený)"
|
||||
#: ../src/ui/theme-parser.c:3147
|
||||
#, fuzzy, c-format
|
||||
msgid ""
|
||||
@ -1706,172 +1700,221 @@ msgstr "<%s> uvedený dvakrát pre túto tému"
|
||||
msgid "Failed to find a valid file for theme %s\n"
|
||||
msgstr "Zlyhalo nájdenie platného súboru pre tému%s\n"
|
||||
|
||||
#~ msgid "Usage: %s\n"
|
||||
#~ msgstr "Použitie: %s\n"
|
||||
#: ../src/ui/theme-viewer.c:99
|
||||
msgid "_Windows"
|
||||
msgstr "_Okná"
|
||||
|
||||
#~ msgid "_Windows"
|
||||
#~ msgstr "_Okná"
|
||||
#: ../src/ui/theme-viewer.c:100
|
||||
msgid "_Dialog"
|
||||
msgstr "_Dialógové okno"
|
||||
|
||||
#~ msgid "_Dialog"
|
||||
#~ msgstr "_Dialógové okno"
|
||||
#: ../src/ui/theme-viewer.c:101
|
||||
msgid "_Modal dialog"
|
||||
msgstr "_Modálne dialógové okno"
|
||||
|
||||
#~ msgid "_Modal dialog"
|
||||
#~ msgstr "_Modálne dialógové okno"
|
||||
#: ../src/ui/theme-viewer.c:102
|
||||
msgid "_Utility"
|
||||
msgstr "_Nástroje"
|
||||
|
||||
#~ msgid "_Utility"
|
||||
#~ msgstr "_Nástroje"
|
||||
|
||||
#~ msgid "_Splashscreen"
|
||||
#~ msgstr "Ú_vodná obrazovka"
|
||||
#: ../src/ui/theme-viewer.c:103
|
||||
msgid "_Splashscreen"
|
||||
msgstr "Ú_vodná obrazovka"
|
||||
|
||||
# MČ: nie som si istý prekladom „dok“, nemal by to byť „panel“?
|
||||
#~ msgid "_Top dock"
|
||||
#~ msgstr "_Horný panel"
|
||||
#: ../src/ui/theme-viewer.c:104
|
||||
msgid "_Top dock"
|
||||
msgstr "_Horný panel"
|
||||
|
||||
#~ msgid "_Bottom dock"
|
||||
#~ msgstr "_Spodný panel"
|
||||
#: ../src/ui/theme-viewer.c:105
|
||||
msgid "_Bottom dock"
|
||||
msgstr "_Spodný panel"
|
||||
|
||||
#~ msgid "_Left dock"
|
||||
#~ msgstr "Ľ_avý panel"
|
||||
#: ../src/ui/theme-viewer.c:106
|
||||
msgid "_Left dock"
|
||||
msgstr "Ľ_avý panel"
|
||||
|
||||
#~ msgid "_Right dock"
|
||||
#~ msgstr "_Pravý panel"
|
||||
#: ../src/ui/theme-viewer.c:107
|
||||
msgid "_Right dock"
|
||||
msgstr "_Pravý panel"
|
||||
|
||||
#~ msgid "_All docks"
|
||||
#~ msgstr "_Všetky panely"
|
||||
#: ../src/ui/theme-viewer.c:108
|
||||
msgid "_All docks"
|
||||
msgstr "_Všetky panely"
|
||||
|
||||
#~ msgid "Des_ktop"
|
||||
#~ msgstr "P_racovná plocha"
|
||||
#: ../src/ui/theme-viewer.c:109
|
||||
msgid "Des_ktop"
|
||||
msgstr "P_racovná plocha"
|
||||
|
||||
# tooltip
|
||||
#~ msgid "Open another one of these windows"
|
||||
#~ msgstr "Otvorí ďalšie z týchto okien"
|
||||
#: ../src/ui/theme-viewer.c:115
|
||||
msgid "Open another one of these windows"
|
||||
msgstr "Otvorí ďalšie z týchto okien"
|
||||
|
||||
# PK: prekladat to v uvodzovkach? nahlas bug
|
||||
# tooltip
|
||||
# JK: https://bugzilla.gnome.org/show_bug.cgi?id=698123
|
||||
#: ../src/ui/theme-viewer.c:117
|
||||
#, fuzzy
|
||||
#~ msgid "This is a demo button with an 'open' icon"
|
||||
#~ msgstr "Toto je ukážkové tlačidlo s ikonou „open“"
|
||||
msgid "This is a demo button with an 'open' icon"
|
||||
msgstr "Toto je ukážkové tlačidlo s ikonou „open“"
|
||||
|
||||
# tooltip
|
||||
# JK: https://bugzilla.gnome.org/show_bug.cgi?id=698123
|
||||
#: ../src/ui/theme-viewer.c:119
|
||||
#, fuzzy
|
||||
#~ msgid "This is a demo button with a 'quit' icon"
|
||||
#~ msgstr "Toto je ukážkové tlačidlo s ikonou „quit“"
|
||||
msgid "This is a demo button with a 'quit' icon"
|
||||
msgstr "Toto je ukážkové tlačidlo s ikonou „quit“"
|
||||
|
||||
# label
|
||||
#~ msgid "This is a sample message in a sample dialog"
|
||||
#~ msgstr "Toto je ukážková správa v ukážkovom dialógovom okne"
|
||||
#: ../src/ui/theme-viewer.c:248
|
||||
msgid "This is a sample message in a sample dialog"
|
||||
msgstr "Toto je ukážková správa v ukážkovom dialógovom okne"
|
||||
|
||||
# PK: falosna
|
||||
#~ msgid "Fake menu item %d\n"
|
||||
#~ msgstr "Falošná položka ponuky č. %d\n"
|
||||
#: ../src/ui/theme-viewer.c:328
|
||||
#, c-format
|
||||
msgid "Fake menu item %d\n"
|
||||
msgstr "Falošná položka ponuky č. %d\n"
|
||||
|
||||
#~ msgid "Border-only window"
|
||||
#~ msgstr "Okno len s okrajom"
|
||||
#: ../src/ui/theme-viewer.c:363
|
||||
msgid "Border-only window"
|
||||
msgstr "Okno len s okrajom"
|
||||
|
||||
#~ msgid "Bar"
|
||||
#~ msgstr "Lišta"
|
||||
#: ../src/ui/theme-viewer.c:365
|
||||
msgid "Bar"
|
||||
msgstr "Lišta"
|
||||
|
||||
#~ msgid "Normal Application Window"
|
||||
#~ msgstr "Normálne aplikačné okno"
|
||||
#: ../src/ui/theme-viewer.c:382
|
||||
msgid "Normal Application Window"
|
||||
msgstr "Normálne aplikačné okno"
|
||||
|
||||
#~ msgid "Dialog Box"
|
||||
#~ msgstr "Dialógové okno"
|
||||
#: ../src/ui/theme-viewer.c:386
|
||||
msgid "Dialog Box"
|
||||
msgstr "Dialógové okno"
|
||||
|
||||
#~ msgid "Modal Dialog Box"
|
||||
#~ msgstr "Modálne dialógové okno"
|
||||
#: ../src/ui/theme-viewer.c:390
|
||||
msgid "Modal Dialog Box"
|
||||
msgstr "Modálne dialógové okno"
|
||||
|
||||
#~ msgid "Utility Palette"
|
||||
#~ msgstr "Paleta nástrojov"
|
||||
#: ../src/ui/theme-viewer.c:394
|
||||
msgid "Utility Palette"
|
||||
msgstr "Paleta nástrojov"
|
||||
|
||||
#~ msgid "Torn-off Menu"
|
||||
#~ msgstr "Vypnúť ponuku"
|
||||
#: ../src/ui/theme-viewer.c:398
|
||||
msgid "Torn-off Menu"
|
||||
msgstr "Vypnúť ponuku"
|
||||
|
||||
#~ msgid "Border"
|
||||
#~ msgstr "Okraj"
|
||||
#: ../src/ui/theme-viewer.c:402
|
||||
msgid "Border"
|
||||
msgstr "Okraj"
|
||||
|
||||
#~ msgid "Attached Modal Dialog"
|
||||
#~ msgstr "Pričlenené modálne okno"
|
||||
#: ../src/ui/theme-viewer.c:406
|
||||
msgid "Attached Modal Dialog"
|
||||
msgstr "Pričlenené modálne okno"
|
||||
|
||||
#~ msgid "Button layout test %d"
|
||||
#~ msgstr "Test rozloženia tlačidiel č. %d"
|
||||
#: ../src/ui/theme-viewer.c:737
|
||||
#, c-format
|
||||
msgid "Button layout test %d"
|
||||
msgstr "Test rozloženia tlačidiel č. %d"
|
||||
|
||||
# PK: plural forms
|
||||
# JK: https://bugzilla.gnome.org/show_bug.cgi?id=697987
|
||||
#, fuzzy
|
||||
#~ msgid "%g milliseconds to draw one window frame"
|
||||
#~ msgstr "%g milisekúnd pre vykreslenie jedného rámca okna"
|
||||
#: ../src/ui/theme-viewer.c:766
|
||||
#, fuzzy, c-format
|
||||
msgid "%g milliseconds to draw one window frame"
|
||||
msgstr "%g milisekúnd pre vykreslenie jedného rámca okna"
|
||||
|
||||
#~ msgid "Usage: metacity-theme-viewer [THEMENAME]\n"
|
||||
#~ msgstr "Použitie: metacity-theme-viewer [NÁZOVTÉMY]\n"
|
||||
#: ../src/ui/theme-viewer.c:811
|
||||
#, c-format
|
||||
msgid "Usage: metacity-theme-viewer [THEMENAME]\n"
|
||||
msgstr "Použitie: metacity-theme-viewer [NÁZOVTÉMY]\n"
|
||||
|
||||
#~ msgid "Error loading theme: %s\n"
|
||||
#~ msgstr "Chyba pri načítavaní témy: %s\n"
|
||||
#: ../src/ui/theme-viewer.c:818
|
||||
#, c-format
|
||||
msgid "Error loading theme: %s\n"
|
||||
msgstr "Chyba pri načítavaní témy: %s\n"
|
||||
|
||||
# PK: plural forms
|
||||
# JK: https://bugzilla.gnome.org/show_bug.cgi?id=697987
|
||||
#, fuzzy
|
||||
#~ msgid "Loaded theme \"%s\" in %g seconds\n"
|
||||
#~ msgstr "Téma „%s“ načítaná za %g sekúnd\n"
|
||||
#: ../src/ui/theme-viewer.c:824
|
||||
#, fuzzy, c-format
|
||||
msgid "Loaded theme \"%s\" in %g seconds\n"
|
||||
msgstr "Téma „%s“ načítaná za %g sekúnd\n"
|
||||
|
||||
# PK: inde titulku, aky je rozdiel
|
||||
#~ msgid "Normal Title Font"
|
||||
#~ msgstr "Obyčajné písmo titulku"
|
||||
#: ../src/ui/theme-viewer.c:869
|
||||
msgid "Normal Title Font"
|
||||
msgstr "Obyčajné písmo titulku"
|
||||
|
||||
#~ msgid "Small Title Font"
|
||||
#~ msgstr "Malé písmo titulku"
|
||||
#: ../src/ui/theme-viewer.c:875
|
||||
msgid "Small Title Font"
|
||||
msgstr "Malé písmo titulku"
|
||||
|
||||
#~ msgid "Large Title Font"
|
||||
#~ msgstr "Veľké písmo titulku"
|
||||
#: ../src/ui/theme-viewer.c:881
|
||||
msgid "Large Title Font"
|
||||
msgstr "Veľké písmo titulku"
|
||||
|
||||
#~ msgid "Button Layouts"
|
||||
#~ msgstr "Rozloženia tlačidiel"
|
||||
#: ../src/ui/theme-viewer.c:886
|
||||
msgid "Button Layouts"
|
||||
msgstr "Rozloženia tlačidiel"
|
||||
|
||||
#~ msgid "Benchmark"
|
||||
#~ msgstr "Test rýchlosti"
|
||||
#: ../src/ui/theme-viewer.c:891
|
||||
msgid "Benchmark"
|
||||
msgstr "Test rýchlosti"
|
||||
|
||||
#~ msgid "Window Title Goes Here"
|
||||
#~ msgstr "Sem príde názov okna"
|
||||
#: ../src/ui/theme-viewer.c:947
|
||||
msgid "Window Title Goes Here"
|
||||
msgstr "Sem príde názov okna"
|
||||
|
||||
# PK: plural forms
|
||||
# JK: https://bugzilla.gnome.org/show_bug.cgi?id=697987
|
||||
#, fuzzy
|
||||
#~ 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 ""
|
||||
#~ "Vykreslených %d rámcov za %g sekúnd na strane klienta (%g milisekúnd na "
|
||||
#~ "rámec) a %g sekúnd celkového času vrátane zdrojov servera X (%g "
|
||||
#~ "milisekúnd na rámec)\n"
|
||||
#: ../src/ui/theme-viewer.c:1053
|
||||
#, fuzzy, 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 ""
|
||||
"Vykreslených %d rámcov za %g sekúnd na strane klienta (%g milisekúnd na "
|
||||
"rámec) a %g sekúnd celkového času vrátane zdrojov servera X (%g milisekúnd "
|
||||
"na rámec)\n"
|
||||
|
||||
#~ msgid "position expression test returned TRUE but set error"
|
||||
#~ msgstr "test výrazu polohy vrátil TRUE, ale nastavil chybu"
|
||||
#: ../src/ui/theme-viewer.c:1273
|
||||
msgid "position expression test returned TRUE but set error"
|
||||
msgstr "test výrazu polohy vrátil TRUE, ale nastavil chybu"
|
||||
|
||||
#~ msgid "position expression test returned FALSE but didn't set error"
|
||||
#~ msgstr "test výrazu polohy vrátil FALSE, ale nenastavil chybu"
|
||||
#: ../src/ui/theme-viewer.c:1275
|
||||
msgid "position expression test returned FALSE but didn't set error"
|
||||
msgstr "test výrazu polohy vrátil FALSE, ale nenastavil chybu"
|
||||
|
||||
#~ msgid "Error was expected but none given"
|
||||
#~ msgstr "Bola očakávaná chyba, ale žiadna nenastala"
|
||||
#: ../src/ui/theme-viewer.c:1279
|
||||
msgid "Error was expected but none given"
|
||||
msgstr "Bola očakávaná chyba, ale žiadna nenastala"
|
||||
|
||||
#~ msgid "Error %d was expected but %d given"
|
||||
#~ msgstr "Bola očakávaná chyba %d, ale nastala %d"
|
||||
#: ../src/ui/theme-viewer.c:1281
|
||||
#, c-format
|
||||
msgid "Error %d was expected but %d given"
|
||||
msgstr "Bola očakávaná chyba %d, ale nastala %d"
|
||||
|
||||
#~ msgid "Error not expected but one was returned: %s"
|
||||
#~ msgstr "Chyba nebola očakávaná, ale bola vrátená: %s"
|
||||
#: ../src/ui/theme-viewer.c:1287
|
||||
#, c-format
|
||||
msgid "Error not expected but one was returned: %s"
|
||||
msgstr "Chyba nebola očakávaná, ale bola vrátená: %s"
|
||||
|
||||
#~ msgid "x value was %d, %d was expected"
|
||||
#~ msgstr "hodnota x bola %d, očakávaná bola %d"
|
||||
#: ../src/ui/theme-viewer.c:1291
|
||||
#, c-format
|
||||
msgid "x value was %d, %d was expected"
|
||||
msgstr "hodnota x bola %d, očakávaná bola %d"
|
||||
|
||||
#~ msgid "y value was %d, %d was expected"
|
||||
#~ msgstr "hodnota y bola %d, očakávaná bola %d"
|
||||
#: ../src/ui/theme-viewer.c:1294
|
||||
#, c-format
|
||||
msgid "y value was %d, %d was expected"
|
||||
msgstr "hodnota y bola %d, očakávaná bola %d"
|
||||
|
||||
# PK: plural forms
|
||||
# JK: https://bugzilla.gnome.org/show_bug.cgi?id=697987
|
||||
#, fuzzy
|
||||
#~ msgid ""
|
||||
#~ "%d coordinate expressions parsed in %g seconds (%g seconds average)\n"
|
||||
#~ msgstr ""
|
||||
#~ "%d výrazov pre súradnice analyzovaných za %g sekúnd (priemer %g sekúnd)\n"
|
||||
#: ../src/ui/theme-viewer.c:1359
|
||||
#, fuzzy, c-format
|
||||
msgid "%d coordinate expressions parsed in %g seconds (%g seconds average)\n"
|
||||
msgstr ""
|
||||
"%d výrazov pre súradnice analyzovaných za %g sekúnd (priemer %g sekúnd)\n"
|
||||
|
758
po/sr@latin.po
758
po/sr@latin.po
File diff suppressed because it is too large
Load Diff
1228
po/zh_CN.po
1228
po/zh_CN.po
File diff suppressed because it is too large
Load Diff
524
po/zh_HK.po
524
po/zh_HK.po
File diff suppressed because it is too large
Load Diff
524
po/zh_TW.po
524
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>
|
467
protocol/xdg-shell.xml
Normal file
467
protocol/xdg-shell.xml
Normal file
@ -0,0 +1,467 @@
|
||||
<?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="2" 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>
|
||||
|
||||
<event name="ping">
|
||||
<description summary="check if the client is alive">
|
||||
The ping event asks the client if it's still alive. Pass the
|
||||
serial specified in the event back to the compositor by sending
|
||||
a "pong" request back with the specified serial.
|
||||
|
||||
Compositors can use this to determine if the client is still
|
||||
alive. It's unspecified what will happen if the client doesn't
|
||||
respond to the ping request, or in what timeframe. Clients should
|
||||
try to respond in a reasonable amount of time.
|
||||
</description>
|
||||
<arg name="serial" type="uint" summary="pass this to the callback"/>
|
||||
</event>
|
||||
|
||||
<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>
|
||||
</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_margin">
|
||||
<description summary="set the visible frame boundaries">
|
||||
This tells the compositor what the visible size of the window
|
||||
should be, so it can use it to determine what borders to use for
|
||||
constrainment and alignment.
|
||||
|
||||
CSD often has invisible areas for decoration purposes, like drop
|
||||
shadows. These "shadow" drawings need to be subtracted out of the
|
||||
normal boundaries of the window when computing where to place
|
||||
windows (e.g. to set this window so it's centered on top of another,
|
||||
or to put it to the left or right of the screen.)
|
||||
|
||||
This value should change as little as possible at runtime, to
|
||||
prevent flicker.
|
||||
|
||||
This value is also ignored when the window is maximized or
|
||||
fullscreen, and assumed to be 0.
|
||||
|
||||
If never called, this value is assumed to be 0.
|
||||
</description>
|
||||
<arg name="left_margin" type="int"/>
|
||||
<arg name="right_margin" type="int"/>
|
||||
<arg name="top_margin" type="int"/>
|
||||
<arg name="bottom_margin" type="int"/>
|
||||
</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="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 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="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="activated">
|
||||
<description summary="surface was activated">
|
||||
The activated_set event is sent when this surface has been
|
||||
activated, which means that the surface has user attention.
|
||||
Window decorations should be updated accordingly. You should
|
||||
not use this event for anything but the style of decorations
|
||||
you display, use wl_keyboard.enter and wl_keyboard.leave for
|
||||
determining keyboard focus.
|
||||
</description>
|
||||
</event>
|
||||
|
||||
<event name="deactivated">
|
||||
<description summary="surface was deactivated">
|
||||
The deactivate event is sent when this surface has been
|
||||
deactivated, which means that the surface lost user attention.
|
||||
Window decorations should be updated accordingly. You should
|
||||
not use this event for anything but the style of decorations
|
||||
you display, use wl_keyboard.enter and wl_keyboard.leave for
|
||||
determining keyboard focus.
|
||||
</description>
|
||||
</event>
|
||||
|
||||
<event name="delete">
|
||||
<description summary="surface wants to be closed">
|
||||
The delete event is sent by the compositor when the user
|
||||
wants the surface to be closed. This should be equivalent to
|
||||
the user clicking the close button in client-side decorations,
|
||||
if your application has any...
|
||||
|
||||
This is only a request that the user intends to close your
|
||||
window. The client may choose to ignore this request, or show
|
||||
a dialog to ask the user to save their data...
|
||||
</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>
|
||||
|
||||
<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>
|
@ -29,18 +29,6 @@
|
||||
<KeyListEntry name="move-to-workspace-down"
|
||||
_description="Move window one workspace down" />
|
||||
|
||||
<KeyListEntry name="move-to-monitor-left"
|
||||
_description="Move window one monitor to the left" />
|
||||
|
||||
<KeyListEntry name="move-to-monitor-right"
|
||||
_description="Move window one monitor to the right" />
|
||||
|
||||
<KeyListEntry name="move-to-monitor-up"
|
||||
_description="Move window one monitor up" />
|
||||
|
||||
<KeyListEntry name="move-to-monitor-down"
|
||||
_description="Move window one monitor down" />
|
||||
|
||||
<KeyListEntry name="switch-applications"
|
||||
_description="Switch applications"/>
|
||||
|
||||
|
137
src/Makefile.am
137
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,13 +30,24 @@ INCLUDES= \
|
||||
-DMUTTER_PLUGIN_DIR=\"@MUTTER_PLUGIN_DIR@\" \
|
||||
-DGETTEXT_PACKAGE=\"$(GETTEXT_PACKAGE)\"
|
||||
|
||||
mutter_built_sources = \
|
||||
$(dbus_idle_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/xdg-shell-protocol.c \
|
||||
wayland/xdg-shell-server-protocol.h \
|
||||
wayland/xserver-protocol.c \
|
||||
wayland/xserver-server-protocol.h
|
||||
|
||||
libmutter_wayland_la_SOURCES = \
|
||||
core/async-getprop.c \
|
||||
core/async-getprop.h \
|
||||
core/barrier.c \
|
||||
@ -65,7 +77,13 @@ 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-shaped-texture-private.h \
|
||||
compositor/meta-surface-actor.c \
|
||||
compositor/meta-surface-actor.h \
|
||||
compositor/meta-surface-actor-x11.c \
|
||||
compositor/meta-surface-actor-x11.h \
|
||||
compositor/meta-surface-actor-wayland.c \
|
||||
compositor/meta-surface-actor-wayland.h \
|
||||
compositor/meta-texture-rectangle.c \
|
||||
compositor/meta-texture-rectangle.h \
|
||||
compositor/meta-texture-tower.c \
|
||||
@ -94,6 +112,8 @@ libmutter_la_SOURCES = \
|
||||
core/display.c \
|
||||
core/display-private.h \
|
||||
meta/display.h \
|
||||
ui/draw-workspace.c \
|
||||
ui/draw-workspace.h \
|
||||
core/edge-resistance.c \
|
||||
core/edge-resistance.h \
|
||||
core/edid-parse.c \
|
||||
@ -121,6 +141,7 @@ libmutter_la_SOURCES = \
|
||||
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 \
|
||||
@ -143,6 +164,8 @@ libmutter_la_SOURCES = \
|
||||
core/util-private.h \
|
||||
core/window-props.c \
|
||||
core/window-props.h \
|
||||
core/window-x11.c \
|
||||
core/window-x11.h \
|
||||
core/window.c \
|
||||
core/window-private.h \
|
||||
meta/window.h \
|
||||
@ -161,17 +184,41 @@ libmutter_la_SOURCES = \
|
||||
ui/metaaccellabel.h \
|
||||
ui/resizepopup.c \
|
||||
ui/resizepopup.h \
|
||||
ui/tabpopup.c \
|
||||
ui/tabpopup.h \
|
||||
ui/tile-preview.c \
|
||||
ui/tile-preview.h \
|
||||
ui/theme-parser.c \
|
||||
ui/theme.c \
|
||||
meta/theme.h \
|
||||
ui/theme-private.h \
|
||||
ui/ui.c
|
||||
ui/ui.c \
|
||||
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
|
||||
|
||||
nodist_libmutter_la_SOURCES = \
|
||||
nodist_libmutter_wayland_la_SOURCES = \
|
||||
$(mutter_built_sources)
|
||||
|
||||
libmutter_la_LDFLAGS = -no-undefined
|
||||
libmutter_la_LIBADD = $(MUTTER_LIBS)
|
||||
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
|
||||
@ -209,16 +256,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)
|
||||
@ -240,15 +298,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) $(nodist_libmutter_la_SOURCES))
|
||||
$(filter %.c,$(libmutter_wayland_la_SOURCES) $(nodist_libmutter_wayland_la_SOURCES))
|
||||
@META_GIR@_SCANNERFLAGS = --warn-all --warn-error
|
||||
|
||||
endif
|
||||
@ -259,22 +317,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 \
|
||||
@ -282,7 +335,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@
|
||||
|
||||
@ -290,9 +345,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) \
|
||||
@ -300,7 +356,7 @@ CLEANFILES = \
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
|
||||
pkgconfig_DATA = libmutter.pc mutter-plugins.pc
|
||||
pkgconfig_DATA = libmutter-wayland.pc
|
||||
|
||||
EXTRA_DIST=$(desktopfiles_files) \
|
||||
$(wmproperties_files) \
|
||||
@ -309,13 +365,12 @@ EXTRA_DIST=$(desktopfiles_files) \
|
||||
$(wmproperties_in_files) \
|
||||
$(xml_in_files) \
|
||||
org.gnome.mutter.gschema.xml.in \
|
||||
idle-monitor.xml \
|
||||
xrandr.xml \
|
||||
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
|
||||
@ -349,7 +404,6 @@ $(dbus_xrandr_built_sources) : Makefile.am xrandr.xml
|
||||
--generate-c-code meta-dbus-xrandr \
|
||||
$(srcdir)/xrandr.xml
|
||||
|
||||
dbus_idle_built_sources = meta-dbus-idle-monitor.c meta-dbus-idle-monitor.h
|
||||
|
||||
$(dbus_idle_built_sources) : Makefile.am idle-monitor.xml
|
||||
$(AM_V_GEN)gdbus-codegen \
|
||||
@ -358,3 +412,10 @@ $(dbus_idle_built_sources) : Makefile.am idle-monitor.xml
|
||||
--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 < $< > $@
|
||||
|
@ -76,6 +76,9 @@
|
||||
#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>
|
||||
|
||||
@ -137,19 +140,6 @@ meta_compositor_destroy (MetaCompositor *compositor)
|
||||
clutter_threads_remove_repaint_func (compositor->repaint_func_id);
|
||||
}
|
||||
|
||||
static void
|
||||
add_win (MetaWindow *window)
|
||||
{
|
||||
MetaScreen *screen = meta_window_get_screen (window);
|
||||
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
|
||||
|
||||
g_return_if_fail (info != NULL);
|
||||
|
||||
meta_window_actor_new (window);
|
||||
|
||||
sync_actor_stacking (info);
|
||||
}
|
||||
|
||||
static void
|
||||
process_damage (MetaCompositor *compositor,
|
||||
XDamageNotifyEvent *event,
|
||||
@ -164,7 +154,7 @@ process_damage (MetaCompositor *compositor,
|
||||
if (window_actor == NULL)
|
||||
return;
|
||||
|
||||
meta_window_actor_process_damage (window_actor, event);
|
||||
meta_window_actor_process_x11_damage (window_actor, event);
|
||||
}
|
||||
|
||||
static Window
|
||||
@ -275,19 +265,27 @@ 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);
|
||||
Window xstage = clutter_x11_get_stage_window (CLUTTER_STAGE (info->stage));
|
||||
|
||||
XFixesSetWindowShapeRegion (xdpy, xstage, ShapeInput, 0, 0, region);
|
||||
|
||||
/* It's generally a good heuristic that when a crossing event is generated because
|
||||
* we reshape the overlay, we don't want it to affect focus-follows-mouse focus -
|
||||
* it's not the user doing something, it's the environment changing under the user.
|
||||
/* 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.
|
||||
*/
|
||||
meta_display_add_ignored_crossing_serial (display, XNextRequest (xdpy));
|
||||
XFixesSetWindowShapeRegion (xdpy, info->output, ShapeInput, 0, 0, region);
|
||||
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);
|
||||
Window xstage = clutter_x11_get_stage_window (CLUTTER_STAGE (info->stage));
|
||||
|
||||
XFixesSetWindowShapeRegion (xdpy, xstage, ShapeInput, 0, 0, region);
|
||||
|
||||
/* It's generally a good heuristic that when a crossing event is generated because
|
||||
* we reshape the overlay, we don't want it to affect focus-follows-mouse focus -
|
||||
* it's not the user doing something, it's the environment changing under the user.
|
||||
*/
|
||||
meta_display_add_ignored_crossing_serial (display, XNextRequest (xdpy));
|
||||
XFixesSetWindowShapeRegion (xdpy, info->output, ShapeInput, 0, 0, region);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -318,63 +316,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,
|
||||
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;
|
||||
ClutterStage *stage;
|
||||
Window grab_window;
|
||||
Cursor cursor = None;
|
||||
gboolean pointer_grabbed = FALSE;
|
||||
gboolean keyboard_grabbed = FALSE;
|
||||
int result;
|
||||
|
||||
stage = CLUTTER_STAGE (meta_get_stage_for_screen (screen));
|
||||
if (!stage)
|
||||
return FALSE;
|
||||
|
||||
grab_window = clutter_x11_get_stage_window (stage);
|
||||
|
||||
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)
|
||||
{
|
||||
@ -424,14 +414,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:
|
||||
@ -443,6 +425,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,
|
||||
@ -454,8 +510,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;
|
||||
@ -494,6 +561,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
|
||||
@ -547,8 +617,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))
|
||||
@ -564,7 +635,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,
|
||||
@ -573,80 +693,41 @@ 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->output = get_output_window (screen);
|
||||
XReparentWindow (xdisplay, xwin, info->output, 0, 0);
|
||||
if (meta_is_wayland_compositor ())
|
||||
{
|
||||
/* 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);
|
||||
meta_empty_stage_input_region (screen);
|
||||
|
||||
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);
|
||||
|
||||
meta_empty_stage_input_region (screen);
|
||||
|
||||
/* 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);
|
||||
|
||||
/* 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);
|
||||
|
||||
@ -657,14 +738,17 @@ 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);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -738,13 +822,20 @@ meta_compositor_add_window (MetaCompositor *compositor,
|
||||
{
|
||||
MetaScreen *screen = meta_window_get_screen (window);
|
||||
MetaDisplay *display = meta_screen_get_display (screen);
|
||||
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
|
||||
|
||||
g_return_if_fail (info != NULL);
|
||||
|
||||
/* Window was already added previously, probably coming
|
||||
* back from hiding */
|
||||
if (window->compositor_private != NULL)
|
||||
return;
|
||||
|
||||
DEBUG_TRACE ("meta_compositor_add_window\n");
|
||||
meta_error_trap_push (display);
|
||||
|
||||
add_win (window);
|
||||
|
||||
meta_window_actor_new (window);
|
||||
meta_error_trap_pop (display);
|
||||
|
||||
sync_actor_stacking (info);
|
||||
}
|
||||
|
||||
void
|
||||
@ -851,18 +942,13 @@ meta_compositor_window_opacity_changed (MetaCompositor *compositor,
|
||||
* 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);
|
||||
|
||||
@ -871,19 +957,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:
|
||||
@ -940,7 +1029,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))
|
||||
{
|
||||
@ -952,7 +1041,8 @@ meta_compositor_process_event (MetaCompositor *compositor,
|
||||
}
|
||||
}
|
||||
|
||||
if (event->type == meta_display_get_damage_event_base (compositor->display) + XDamageNotify)
|
||||
if (!meta_is_wayland_compositor () &&
|
||||
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
|
||||
@ -969,7 +1059,7 @@ meta_compositor_process_event (MetaCompositor *compositor,
|
||||
|
||||
/* 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
|
||||
@ -1290,20 +1380,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
|
||||
@ -1587,31 +1695,3 @@ meta_compositor_monotonic_time_to_server_time (MetaDisplay *display,
|
||||
else
|
||||
return monotonic_time + compositor->server_time_offset;
|
||||
}
|
||||
|
||||
void
|
||||
meta_compositor_show_tile_preview (MetaCompositor *compositor,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
MetaRectangle *tile_rect,
|
||||
int tile_monitor_number)
|
||||
{
|
||||
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
|
||||
|
||||
if (!info->plugin_mgr)
|
||||
return;
|
||||
|
||||
meta_plugin_manager_show_tile_preview (info->plugin_mgr,
|
||||
window, tile_rect, tile_monitor_number);
|
||||
}
|
||||
|
||||
void
|
||||
meta_compositor_hide_tile_preview (MetaCompositor *compositor,
|
||||
MetaScreen *screen)
|
||||
{
|
||||
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
|
||||
|
||||
if (!info->plugin_mgr)
|
||||
return;
|
||||
|
||||
meta_plugin_manager_hide_tile_preview (info->plugin_mgr);
|
||||
}
|
||||
|
@ -324,44 +324,3 @@ meta_plugin_manager_confirm_display_change (MetaPluginManager *plugin_mgr)
|
||||
else
|
||||
return meta_plugin_complete_display_change (plugin, TRUE);
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_plugin_manager_show_tile_preview (MetaPluginManager *plugin_mgr,
|
||||
MetaWindow *window,
|
||||
MetaRectangle *tile_rect,
|
||||
int tile_monitor_number)
|
||||
{
|
||||
MetaPlugin *plugin = plugin_mgr->plugin;
|
||||
MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
|
||||
MetaDisplay *display = meta_screen_get_display (plugin_mgr->screen);
|
||||
|
||||
if (display->display_opening)
|
||||
return FALSE;
|
||||
|
||||
if (klass->show_tile_preview)
|
||||
{
|
||||
klass->show_tile_preview (plugin, window, tile_rect, tile_monitor_number);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_plugin_manager_hide_tile_preview (MetaPluginManager *plugin_mgr)
|
||||
{
|
||||
MetaPlugin *plugin = plugin_mgr->plugin;
|
||||
MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin);
|
||||
MetaDisplay *display = meta_screen_get_display (plugin_mgr->screen);
|
||||
|
||||
if (display->display_opening)
|
||||
return FALSE;
|
||||
|
||||
if (klass->hide_tile_preview)
|
||||
{
|
||||
klass->hide_tile_preview (plugin);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -75,9 +75,4 @@ gboolean _meta_plugin_xevent_filter (MetaPlugin *plugin,
|
||||
|
||||
void meta_plugin_manager_confirm_display_change (MetaPluginManager *mgr);
|
||||
|
||||
gboolean meta_plugin_manager_show_tile_preview (MetaPluginManager *mgr,
|
||||
MetaWindow *window,
|
||||
MetaRectangle *tile_rect,
|
||||
int tile_monitor_number);
|
||||
gboolean meta_plugin_manager_hide_tile_preview (MetaPluginManager *mgr);
|
||||
#endif
|
||||
|
@ -187,10 +187,20 @@ _meta_plugin_xevent_filter (MetaPlugin *plugin,
|
||||
{
|
||||
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
|
||||
else if (!meta_is_wayland_compositor ())
|
||||
return clutter_x11_handle_event (xev) != CLUTTER_X11_FILTER_CONTINUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -28,11 +28,11 @@
|
||||
#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 "meta-window-actor-private.h"
|
||||
|
||||
#include <clutter/clutter.h>
|
||||
#include <cogl/cogl.h>
|
||||
@ -42,8 +42,6 @@
|
||||
static void meta_shaped_texture_dispose (GObject *object);
|
||||
|
||||
static void meta_shaped_texture_paint (ClutterActor *actor);
|
||||
static void meta_shaped_texture_pick (ClutterActor *actor,
|
||||
const ClutterColor *color);
|
||||
|
||||
static void meta_shaped_texture_get_preferred_width (ClutterActor *self,
|
||||
gfloat for_height,
|
||||
@ -73,8 +71,6 @@ struct _MetaShapedTexturePrivate
|
||||
CoglTexture *texture;
|
||||
CoglTexture *mask_texture;
|
||||
|
||||
cairo_region_t *input_shape_region;
|
||||
|
||||
/* The region containing only fully opaque pixels */
|
||||
cairo_region_t *opaque_region;
|
||||
|
||||
@ -98,7 +94,6 @@ meta_shaped_texture_class_init (MetaShapedTextureClass *klass)
|
||||
actor_class->get_preferred_width = meta_shaped_texture_get_preferred_width;
|
||||
actor_class->get_preferred_height = meta_shaped_texture_get_preferred_height;
|
||||
actor_class->paint = meta_shaped_texture_paint;
|
||||
actor_class->pick = meta_shaped_texture_pick;
|
||||
actor_class->get_paint_volume = meta_shaped_texture_get_paint_volume;
|
||||
|
||||
g_type_class_add_private (klass, sizeof (MetaShapedTexturePrivate));
|
||||
@ -232,6 +227,54 @@ paint_clipped_rectangle (CoglFramebuffer *fb,
|
||||
&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)
|
||||
{
|
||||
@ -415,71 +458,6 @@ meta_shaped_texture_paint (ClutterActor *actor)
|
||||
cairo_region_destroy (blended_region);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_shaped_texture_pick (ClutterActor *actor,
|
||||
const ClutterColor *color)
|
||||
{
|
||||
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->input_shape_region == NULL)
|
||||
CLUTTER_ACTOR_CLASS (meta_shaped_texture_parent_class)->pick (actor, color);
|
||||
else
|
||||
{
|
||||
int n_rects;
|
||||
float *rectangles;
|
||||
int i;
|
||||
CoglPipeline *pipeline;
|
||||
CoglContext *ctx;
|
||||
CoglFramebuffer *fb;
|
||||
CoglColor cogl_color;
|
||||
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
n_rects = cairo_region_num_rectangles (priv->input_shape_region);
|
||||
rectangles = g_alloca (sizeof (float) * 4 * n_rects);
|
||||
|
||||
for (i = 0; i < n_rects; i++)
|
||||
{
|
||||
cairo_rectangle_int_t rect;
|
||||
int pos = i * 4;
|
||||
|
||||
cairo_region_get_rectangle (priv->input_shape_region, i, &rect);
|
||||
|
||||
rectangles[pos] = rect.x;
|
||||
rectangles[pos + 1] = rect.y;
|
||||
rectangles[pos + 2] = rect.x + rect.width;
|
||||
rectangles[pos + 3] = rect.y + rect.height;
|
||||
}
|
||||
|
||||
ctx = clutter_backend_get_cogl_context (clutter_get_default_backend ());
|
||||
fb = cogl_get_draw_framebuffer ();
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
meta_shaped_texture_get_preferred_width (ClutterActor *self,
|
||||
gfloat for_height,
|
||||
@ -598,18 +576,8 @@ static cairo_region_t *
|
||||
effective_unobscured_region (MetaShapedTexture *self)
|
||||
{
|
||||
MetaShapedTexturePrivate *priv = self->priv;
|
||||
ClutterActor *parent = clutter_actor_get_parent (CLUTTER_ACTOR (self));
|
||||
|
||||
if (clutter_actor_has_mapped_clones (CLUTTER_ACTOR (self)))
|
||||
return NULL;
|
||||
|
||||
while (parent && !META_IS_WINDOW_ACTOR (parent))
|
||||
parent = clutter_actor_get_parent (parent);
|
||||
|
||||
if (parent && clutter_actor_has_mapped_clones (parent))
|
||||
return NULL;
|
||||
|
||||
return priv->unobscured_region;
|
||||
return clutter_actor_has_mapped_clones (CLUTTER_ACTOR (self)) ? NULL : priv->unobscured_region;
|
||||
}
|
||||
|
||||
gboolean
|
||||
@ -699,53 +667,6 @@ meta_shaped_texture_update_area (MetaShapedTexture *stex,
|
||||
}
|
||||
}
|
||||
|
||||
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 != NULL)
|
||||
cogl_object_unref (priv->texture);
|
||||
|
||||
priv->texture = cogl_tex;
|
||||
|
||||
if (cogl_tex != NULL)
|
||||
{
|
||||
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 texture */
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_shaped_texture_set_texture:
|
||||
* @stex: The #MetaShapedTexture
|
||||
@ -773,41 +694,6 @@ meta_shaped_texture_get_texture (MetaShapedTexture *stex)
|
||||
return COGL_TEXTURE (stex->priv->texture);
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_shaped_texture_set_input_shape_region:
|
||||
* @stex: a #MetaShapedTexture
|
||||
* @shape_region: the region of the texture that should respond to
|
||||
* input.
|
||||
*
|
||||
* 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_input_shape_region (MetaShapedTexture *stex,
|
||||
cairo_region_t *shape_region)
|
||||
{
|
||||
MetaShapedTexturePrivate *priv;
|
||||
|
||||
g_return_if_fail (META_IS_SHAPED_TEXTURE (stex));
|
||||
|
||||
priv = stex->priv;
|
||||
|
||||
if (priv->input_shape_region != NULL)
|
||||
{
|
||||
cairo_region_destroy (priv->input_shape_region);
|
||||
priv->input_shape_region = NULL;
|
||||
}
|
||||
|
||||
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
|
||||
|
153
src/compositor/meta-surface-actor-wayland.c
Normal file
153
src/compositor/meta-surface-actor-wayland.c
Normal file
@ -0,0 +1,153 @@
|
||||
/* -*- 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:
|
||||
* Jasper St. Pierre <jstpierre@mecheye.net>
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "meta-surface-actor-wayland.h"
|
||||
|
||||
#include <cogl/cogl-wayland-server.h>
|
||||
#include "meta-shaped-texture-private.h"
|
||||
|
||||
struct _MetaSurfaceActorWaylandPrivate
|
||||
{
|
||||
MetaWaylandSurface *surface;
|
||||
MetaWaylandBuffer *buffer;
|
||||
};
|
||||
typedef struct _MetaSurfaceActorWaylandPrivate MetaSurfaceActorWaylandPrivate;
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (MetaSurfaceActorWayland, meta_surface_actor_wayland, META_TYPE_SURFACE_ACTOR)
|
||||
|
||||
static void
|
||||
meta_surface_actor_wayland_process_damage (MetaSurfaceActor *actor,
|
||||
int x, int y, int width, int height)
|
||||
{
|
||||
MetaSurfaceActorWayland *self = META_SURFACE_ACTOR_WAYLAND (actor);
|
||||
MetaSurfaceActorWaylandPrivate *priv = meta_surface_actor_wayland_get_instance_private (self);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
meta_surface_actor_update_area (META_SURFACE_ACTOR (self), x, y, width, height);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_surface_actor_wayland_pre_paint (MetaSurfaceActor *actor)
|
||||
{
|
||||
}
|
||||
|
||||
static gboolean
|
||||
meta_surface_actor_wayland_is_argb32 (MetaSurfaceActor *actor)
|
||||
{
|
||||
/* XXX -- look at the SHM buffer format. */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
meta_surface_actor_wayland_is_visible (MetaSurfaceActor *actor)
|
||||
{
|
||||
/* TODO: ensure that the buffer isn't NULL, implement
|
||||
* wayland mapping semantics */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
meta_surface_actor_wayland_should_unredirect (MetaSurfaceActor *actor)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_surface_actor_wayland_set_unredirected (MetaSurfaceActor *actor,
|
||||
gboolean unredirected)
|
||||
{
|
||||
/* Do nothing. In the future, we'll use KMS to set this
|
||||
* up as a hardware overlay or something. */
|
||||
}
|
||||
|
||||
static gboolean
|
||||
meta_surface_actor_wayland_is_unredirected (MetaSurfaceActor *actor)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_surface_actor_wayland_class_init (MetaSurfaceActorWaylandClass *klass)
|
||||
{
|
||||
MetaSurfaceActorClass *surface_actor_class = META_SURFACE_ACTOR_CLASS (klass);
|
||||
|
||||
surface_actor_class->process_damage = meta_surface_actor_wayland_process_damage;
|
||||
surface_actor_class->pre_paint = meta_surface_actor_wayland_pre_paint;
|
||||
surface_actor_class->is_argb32 = meta_surface_actor_wayland_is_argb32;
|
||||
surface_actor_class->is_visible = meta_surface_actor_wayland_is_visible;
|
||||
|
||||
surface_actor_class->should_unredirect = meta_surface_actor_wayland_should_unredirect;
|
||||
surface_actor_class->set_unredirected = meta_surface_actor_wayland_set_unredirected;
|
||||
surface_actor_class->is_unredirected = meta_surface_actor_wayland_is_unredirected;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_surface_actor_wayland_init (MetaSurfaceActorWayland *self)
|
||||
{
|
||||
}
|
||||
|
||||
MetaSurfaceActor *
|
||||
meta_surface_actor_wayland_new (MetaWaylandSurface *surface)
|
||||
{
|
||||
MetaSurfaceActorWayland *self = g_object_new (META_TYPE_SURFACE_ACTOR_WAYLAND, NULL);
|
||||
MetaSurfaceActorWaylandPrivate *priv = meta_surface_actor_wayland_get_instance_private (self);
|
||||
|
||||
g_assert (meta_is_wayland_compositor ());
|
||||
|
||||
priv->surface = surface;
|
||||
|
||||
return META_SURFACE_ACTOR (self);
|
||||
}
|
||||
|
||||
void
|
||||
meta_surface_actor_wayland_set_buffer (MetaSurfaceActorWayland *self,
|
||||
MetaWaylandBuffer *buffer)
|
||||
{
|
||||
MetaSurfaceActorWaylandPrivate *priv = meta_surface_actor_wayland_get_instance_private (self);
|
||||
MetaShapedTexture *stex = meta_surface_actor_get_texture (META_SURFACE_ACTOR (self));
|
||||
|
||||
priv->buffer = buffer;
|
||||
|
||||
if (buffer)
|
||||
meta_shaped_texture_set_texture (stex, buffer->texture);
|
||||
else
|
||||
meta_shaped_texture_set_texture (stex, NULL);
|
||||
}
|
||||
|
||||
MetaWaylandSurface *
|
||||
meta_surface_actor_wayland_get_surface (MetaSurfaceActorWayland *self)
|
||||
{
|
||||
MetaSurfaceActorWaylandPrivate *priv = meta_surface_actor_wayland_get_instance_private (self);
|
||||
return priv->surface;
|
||||
}
|
66
src/compositor/meta-surface-actor-wayland.h
Normal file
66
src/compositor/meta-surface-actor-wayland.h
Normal file
@ -0,0 +1,66 @@
|
||||
/* -*- 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:
|
||||
* Jasper St. Pierre <jstpierre@mecheye.net>
|
||||
*/
|
||||
|
||||
#ifndef __META_SURFACE_ACTOR_WAYLAND_H__
|
||||
#define __META_SURFACE_ACTOR_WAYLAND_H__
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
#include "meta-surface-actor.h"
|
||||
|
||||
#include "meta-wayland-private.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define META_TYPE_SURFACE_ACTOR_WAYLAND (meta_surface_actor_wayland_get_type ())
|
||||
#define META_SURFACE_ACTOR_WAYLAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_SURFACE_ACTOR_WAYLAND, MetaSurfaceActorWayland))
|
||||
#define META_SURFACE_ACTOR_WAYLAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_SURFACE_ACTOR_WAYLAND, MetaSurfaceActorWaylandClass))
|
||||
#define META_IS_SURFACE_ACTOR_WAYLAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_SURFACE_ACTOR_WAYLAND))
|
||||
#define META_IS_SURFACE_ACTOR_WAYLAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_SURFACE_ACTOR_WAYLAND))
|
||||
#define META_SURFACE_ACTOR_WAYLAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_SURFACE_ACTOR_WAYLAND, MetaSurfaceActorWaylandClass))
|
||||
|
||||
typedef struct _MetaSurfaceActorWayland MetaSurfaceActorWayland;
|
||||
typedef struct _MetaSurfaceActorWaylandClass MetaSurfaceActorWaylandClass;
|
||||
|
||||
struct _MetaSurfaceActorWayland
|
||||
{
|
||||
MetaSurfaceActor parent;
|
||||
};
|
||||
|
||||
struct _MetaSurfaceActorWaylandClass
|
||||
{
|
||||
MetaSurfaceActorClass parent_class;
|
||||
};
|
||||
|
||||
GType meta_surface_actor_wayland_get_type (void);
|
||||
|
||||
MetaSurfaceActor * meta_surface_actor_wayland_new (MetaWaylandSurface *surface);
|
||||
MetaWaylandSurface * meta_surface_actor_wayland_get_surface (MetaSurfaceActorWayland *self);
|
||||
|
||||
void meta_surface_actor_wayland_set_buffer (MetaSurfaceActorWayland *self,
|
||||
MetaWaylandBuffer *buffer);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __META_SURFACE_ACTOR_WAYLAND_H__ */
|
453
src/compositor/meta-surface-actor-x11.c
Normal file
453
src/compositor/meta-surface-actor-x11.c
Normal file
@ -0,0 +1,453 @@
|
||||
/* -*- 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>
|
||||
* Jasper St. Pierre <jstpierre@mecheye.net>
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "meta-surface-actor-x11.h"
|
||||
|
||||
#include <X11/extensions/Xcomposite.h>
|
||||
#include <X11/extensions/Xrender.h>
|
||||
#include <cogl/cogl-texture-pixmap-x11.h>
|
||||
|
||||
#include <meta/errors.h>
|
||||
#include "window-private.h"
|
||||
#include "meta-shaped-texture-private.h"
|
||||
#include "meta-cullable.h"
|
||||
|
||||
struct _MetaSurfaceActorX11Private
|
||||
{
|
||||
MetaWindow *window;
|
||||
|
||||
MetaDisplay *display;
|
||||
|
||||
CoglTexture *texture;
|
||||
Pixmap pixmap;
|
||||
Damage damage;
|
||||
|
||||
int last_width;
|
||||
int last_height;
|
||||
|
||||
/* This is used to detect fullscreen windows that need to be unredirected */
|
||||
guint full_damage_frames_count;
|
||||
guint does_full_damage : 1;
|
||||
|
||||
/* Other state... */
|
||||
guint argb32 : 1;
|
||||
guint received_damage : 1;
|
||||
guint size_changed : 1;
|
||||
|
||||
guint unredirected : 1;
|
||||
};
|
||||
typedef struct _MetaSurfaceActorX11Private MetaSurfaceActorX11Private;
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (MetaSurfaceActorX11, meta_surface_actor_x11, META_TYPE_SURFACE_ACTOR)
|
||||
|
||||
static void
|
||||
free_damage (MetaSurfaceActorX11 *self)
|
||||
{
|
||||
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
|
||||
MetaDisplay *display = priv->display;
|
||||
Display *xdisplay = meta_display_get_xdisplay (display);
|
||||
|
||||
if (priv->damage == None)
|
||||
return;
|
||||
|
||||
meta_error_trap_push (display);
|
||||
XDamageDestroy (xdisplay, priv->damage);
|
||||
priv->damage = None;
|
||||
meta_error_trap_pop (display);
|
||||
}
|
||||
|
||||
static void
|
||||
detach_pixmap (MetaSurfaceActorX11 *self)
|
||||
{
|
||||
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
|
||||
MetaDisplay *display = priv->display;
|
||||
Display *xdisplay = meta_display_get_xdisplay (display);
|
||||
MetaShapedTexture *stex = meta_surface_actor_get_texture (META_SURFACE_ACTOR (self));
|
||||
|
||||
if (priv->pixmap == None)
|
||||
return;
|
||||
|
||||
/* Get rid of all references to the pixmap before freeing it; it's unclear whether
|
||||
* you are supposed to be able to free a GLXPixmap after freeing the underlying
|
||||
* pixmap, but it certainly doesn't work with current DRI/Mesa
|
||||
*/
|
||||
meta_shaped_texture_set_texture (stex, NULL);
|
||||
cogl_flush ();
|
||||
|
||||
meta_error_trap_push (display);
|
||||
XFreePixmap (xdisplay, priv->pixmap);
|
||||
priv->pixmap = None;
|
||||
meta_error_trap_pop (display);
|
||||
|
||||
cogl_object_unref (priv->texture);
|
||||
priv->texture = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
set_pixmap (MetaSurfaceActorX11 *self,
|
||||
Pixmap pixmap)
|
||||
{
|
||||
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
|
||||
|
||||
CoglContext *ctx = clutter_backend_get_cogl_context (clutter_get_default_backend ());
|
||||
MetaShapedTexture *stex = meta_surface_actor_get_texture (META_SURFACE_ACTOR (self));
|
||||
CoglTexture *texture;
|
||||
|
||||
g_assert (priv->pixmap == None);
|
||||
priv->pixmap = pixmap;
|
||||
|
||||
texture = COGL_TEXTURE (cogl_texture_pixmap_x11_new (ctx, priv->pixmap, FALSE, NULL));
|
||||
|
||||
if (G_UNLIKELY (!cogl_texture_pixmap_x11_is_using_tfp_extension (COGL_TEXTURE_PIXMAP_X11 (texture))))
|
||||
g_warning ("NOTE: Not using GLX TFP!\n");
|
||||
|
||||
priv->texture = texture;
|
||||
meta_shaped_texture_set_texture (stex, texture);
|
||||
}
|
||||
|
||||
static void
|
||||
update_pixmap (MetaSurfaceActorX11 *self)
|
||||
{
|
||||
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
|
||||
MetaDisplay *display = priv->display;
|
||||
Display *xdisplay = meta_display_get_xdisplay (display);
|
||||
|
||||
if (priv->size_changed)
|
||||
{
|
||||
detach_pixmap (self);
|
||||
priv->size_changed = FALSE;
|
||||
}
|
||||
|
||||
if (priv->pixmap == None)
|
||||
{
|
||||
Pixmap new_pixmap;
|
||||
Window xwindow = meta_window_get_toplevel_xwindow (priv->window);
|
||||
|
||||
meta_error_trap_push (display);
|
||||
new_pixmap = XCompositeNameWindowPixmap (xdisplay, xwindow);
|
||||
|
||||
if (meta_error_trap_pop_with_return (display) != Success)
|
||||
{
|
||||
/* Probably a BadMatch if the window isn't viewable; we could
|
||||
* GrabServer/GetWindowAttributes/NameWindowPixmap/UngrabServer/Sync
|
||||
* to avoid this, but there's no reason to take two round trips
|
||||
* when one will do. (We need that Sync if we want to handle failures
|
||||
* for any reason other than !viewable. That's unlikely, but maybe
|
||||
* we'll BadAlloc or something.)
|
||||
*/
|
||||
new_pixmap = None;
|
||||
}
|
||||
|
||||
if (new_pixmap == None)
|
||||
{
|
||||
meta_verbose ("Unable to get named pixmap for %s\n",
|
||||
meta_window_get_description (priv->window));
|
||||
return;
|
||||
}
|
||||
|
||||
set_pixmap (self, new_pixmap);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_visible (MetaSurfaceActorX11 *self)
|
||||
{
|
||||
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
|
||||
return (priv->pixmap != None) && !priv->unredirected;
|
||||
}
|
||||
|
||||
static void
|
||||
damage_area (MetaSurfaceActorX11 *self,
|
||||
int x, int y, int width, int height)
|
||||
{
|
||||
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
|
||||
|
||||
if (!is_visible (self))
|
||||
return;
|
||||
|
||||
cogl_texture_pixmap_x11_update_area (priv->texture, x, y, width, height);
|
||||
meta_surface_actor_update_area (META_SURFACE_ACTOR (self), x, y, width, height);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_surface_actor_x11_process_damage (MetaSurfaceActor *actor,
|
||||
int x, int y, int width, int height)
|
||||
{
|
||||
MetaSurfaceActorX11 *self = META_SURFACE_ACTOR_X11 (actor);
|
||||
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
|
||||
|
||||
priv->received_damage = TRUE;
|
||||
|
||||
if (meta_window_is_fullscreen (priv->window) && !priv->unredirected && !priv->does_full_damage)
|
||||
{
|
||||
MetaRectangle window_rect;
|
||||
meta_window_get_frame_rect (priv->window, &window_rect);
|
||||
|
||||
if (window_rect.x == x &&
|
||||
window_rect.y == y &&
|
||||
window_rect.width == width &&
|
||||
window_rect.height == height)
|
||||
priv->full_damage_frames_count++;
|
||||
else
|
||||
priv->full_damage_frames_count = 0;
|
||||
|
||||
if (priv->full_damage_frames_count >= 100)
|
||||
priv->does_full_damage = TRUE;
|
||||
}
|
||||
|
||||
/* Drop damage event for unredirected windows */
|
||||
if (priv->unredirected)
|
||||
return;
|
||||
|
||||
damage_area (self, x, y, width, height);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_surface_actor_x11_pre_paint (MetaSurfaceActor *actor)
|
||||
{
|
||||
MetaSurfaceActorX11 *self = META_SURFACE_ACTOR_X11 (actor);
|
||||
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
|
||||
MetaDisplay *display = priv->display;
|
||||
Display *xdisplay = meta_display_get_xdisplay (display);
|
||||
|
||||
if (priv->received_damage)
|
||||
{
|
||||
meta_error_trap_push (display);
|
||||
XDamageSubtract (xdisplay, priv->damage, None, None);
|
||||
meta_error_trap_pop (display);
|
||||
|
||||
/* We need to make sure that any X drawing that happens before the
|
||||
* XDamageSubtract() above is visible to subsequent GL rendering;
|
||||
* the only standardized way to do this is EXT_x11_sync_object,
|
||||
* which isn't yet widely available. For now, we count on details
|
||||
* of Xorg and the open source drivers, and hope for the best
|
||||
* otherwise.
|
||||
*
|
||||
* Xorg and open source driver specifics:
|
||||
*
|
||||
* The X server makes sure to flush drawing to the kernel before
|
||||
* sending out damage events, but since we use DamageReportBoundingBox
|
||||
* there may be drawing between the last damage event and the
|
||||
* XDamageSubtract() that needs to be flushed as well.
|
||||
*
|
||||
* Xorg always makes sure that drawing is flushed to the kernel
|
||||
* before writing events or responses to the client, so any round trip
|
||||
* request at this point is sufficient to flush the GLX buffers.
|
||||
*/
|
||||
XSync (xdisplay, False);
|
||||
|
||||
priv->received_damage = FALSE;
|
||||
}
|
||||
|
||||
update_pixmap (self);
|
||||
}
|
||||
|
||||
static void
|
||||
update_is_argb32 (MetaSurfaceActorX11 *self)
|
||||
{
|
||||
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
|
||||
MetaDisplay *display = priv->display;
|
||||
Display *xdisplay = meta_display_get_xdisplay (display);
|
||||
|
||||
XRenderPictFormat *format;
|
||||
format = XRenderFindVisualFormat (xdisplay, priv->window->xvisual);
|
||||
|
||||
priv->argb32 = (format && format->type == PictTypeDirect && format->direct.alphaMask);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
meta_surface_actor_x11_is_argb32 (MetaSurfaceActor *actor)
|
||||
{
|
||||
MetaSurfaceActorX11 *self = META_SURFACE_ACTOR_X11 (actor);
|
||||
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
|
||||
|
||||
return priv->argb32;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
meta_surface_actor_x11_is_visible (MetaSurfaceActor *actor)
|
||||
{
|
||||
MetaSurfaceActorX11 *self = META_SURFACE_ACTOR_X11 (actor);
|
||||
return is_visible (self);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
meta_surface_actor_x11_should_unredirect (MetaSurfaceActor *actor)
|
||||
{
|
||||
MetaSurfaceActorX11 *self = META_SURFACE_ACTOR_X11 (actor);
|
||||
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
|
||||
|
||||
MetaWindow *window = priv->window;
|
||||
|
||||
if (meta_window_requested_dont_bypass_compositor (window))
|
||||
return FALSE;
|
||||
|
||||
if (window->opacity != 0xFF)
|
||||
return FALSE;
|
||||
|
||||
if (window->shape_region != NULL)
|
||||
return FALSE;
|
||||
|
||||
if (priv->argb32 && !meta_window_requested_bypass_compositor (window))
|
||||
return FALSE;
|
||||
|
||||
if (!meta_window_is_monitor_sized (window))
|
||||
return FALSE;
|
||||
|
||||
if (meta_window_requested_bypass_compositor (window))
|
||||
return TRUE;
|
||||
|
||||
if (meta_window_is_override_redirect (window))
|
||||
return TRUE;
|
||||
|
||||
if (priv->does_full_damage)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
sync_unredirected (MetaSurfaceActorX11 *self)
|
||||
{
|
||||
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
|
||||
MetaDisplay *display = priv->display;
|
||||
Display *xdisplay = meta_display_get_xdisplay (display);
|
||||
Window xwindow = meta_window_get_toplevel_xwindow (priv->window);
|
||||
|
||||
meta_error_trap_push (display);
|
||||
|
||||
if (priv->unredirected)
|
||||
{
|
||||
detach_pixmap (self);
|
||||
XCompositeUnredirectWindow (xdisplay, xwindow, CompositeRedirectManual);
|
||||
}
|
||||
else
|
||||
{
|
||||
XCompositeRedirectWindow (xdisplay, xwindow, CompositeRedirectManual);
|
||||
}
|
||||
|
||||
meta_error_trap_pop (display);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_surface_actor_x11_set_unredirected (MetaSurfaceActor *actor,
|
||||
gboolean unredirected)
|
||||
{
|
||||
MetaSurfaceActorX11 *self = META_SURFACE_ACTOR_X11 (actor);
|
||||
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
|
||||
|
||||
if (priv->unredirected == unredirected)
|
||||
return;
|
||||
|
||||
priv->unredirected = unredirected;
|
||||
sync_unredirected (self);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
meta_surface_actor_x11_is_unredirected (MetaSurfaceActor *actor)
|
||||
{
|
||||
MetaSurfaceActorX11 *self = META_SURFACE_ACTOR_X11 (actor);
|
||||
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
|
||||
|
||||
return priv->unredirected;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_surface_actor_x11_dispose (GObject *object)
|
||||
{
|
||||
MetaSurfaceActorX11 *self = META_SURFACE_ACTOR_X11 (object);
|
||||
|
||||
detach_pixmap (self);
|
||||
free_damage (self);
|
||||
|
||||
G_OBJECT_CLASS (meta_surface_actor_x11_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_surface_actor_x11_class_init (MetaSurfaceActorX11Class *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
MetaSurfaceActorClass *surface_actor_class = META_SURFACE_ACTOR_CLASS (klass);
|
||||
|
||||
object_class->dispose = meta_surface_actor_x11_dispose;
|
||||
|
||||
surface_actor_class->process_damage = meta_surface_actor_x11_process_damage;
|
||||
surface_actor_class->pre_paint = meta_surface_actor_x11_pre_paint;
|
||||
surface_actor_class->is_argb32 = meta_surface_actor_x11_is_argb32;
|
||||
surface_actor_class->is_visible = meta_surface_actor_x11_is_visible;
|
||||
|
||||
surface_actor_class->should_unredirect = meta_surface_actor_x11_should_unredirect;
|
||||
surface_actor_class->set_unredirected = meta_surface_actor_x11_set_unredirected;
|
||||
surface_actor_class->is_unredirected = meta_surface_actor_x11_is_unredirected;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_surface_actor_x11_init (MetaSurfaceActorX11 *self)
|
||||
{
|
||||
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
|
||||
|
||||
priv->last_width = -1;
|
||||
priv->last_height = -1;
|
||||
}
|
||||
|
||||
MetaSurfaceActor *
|
||||
meta_surface_actor_x11_new (MetaWindow *window)
|
||||
{
|
||||
MetaSurfaceActorX11 *self = g_object_new (META_TYPE_SURFACE_ACTOR_X11, NULL);
|
||||
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
|
||||
MetaDisplay *display = meta_window_get_display (window);
|
||||
Display *xdisplay = meta_display_get_xdisplay (display);
|
||||
Window xwindow = meta_window_get_toplevel_xwindow (window);
|
||||
|
||||
g_assert (!meta_is_wayland_compositor ());
|
||||
|
||||
priv->window = window;
|
||||
priv->display = display;
|
||||
|
||||
priv->damage = XDamageCreate (xdisplay, xwindow, XDamageReportBoundingBox);
|
||||
update_is_argb32 (self);
|
||||
|
||||
priv->unredirected = FALSE;
|
||||
sync_unredirected (self);
|
||||
|
||||
return META_SURFACE_ACTOR (self);
|
||||
}
|
||||
|
||||
void
|
||||
meta_surface_actor_x11_set_size (MetaSurfaceActorX11 *self,
|
||||
int width, int height)
|
||||
{
|
||||
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
|
||||
|
||||
if (priv->last_width == width &&
|
||||
priv->last_height == height)
|
||||
return;
|
||||
|
||||
priv->size_changed = TRUE;
|
||||
priv->last_width = width;
|
||||
priv->last_height = height;
|
||||
}
|
69
src/compositor/meta-surface-actor-x11.h
Normal file
69
src/compositor/meta-surface-actor-x11.h
Normal file
@ -0,0 +1,69 @@
|
||||
/* -*- 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>
|
||||
* Jasper St. Pierre <jstpierre@mecheye.net>
|
||||
*/
|
||||
|
||||
#ifndef __META_SURFACE_ACTOR_X11_H__
|
||||
#define __META_SURFACE_ACTOR_X11_H__
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
#include "meta-surface-actor.h"
|
||||
|
||||
#include <X11/extensions/Xdamage.h>
|
||||
|
||||
#include <meta/display.h>
|
||||
#include <meta/window.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define META_TYPE_SURFACE_ACTOR_X11 (meta_surface_actor_x11_get_type ())
|
||||
#define META_SURFACE_ACTOR_X11(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_SURFACE_ACTOR_X11, MetaSurfaceActorX11))
|
||||
#define META_SURFACE_ACTOR_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_SURFACE_ACTOR_X11, MetaSurfaceActorX11Class))
|
||||
#define META_IS_SURFACE_ACTOR_X11(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_SURFACE_ACTOR_X11))
|
||||
#define META_IS_SURFACE_ACTOR_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_SURFACE_ACTOR_X11))
|
||||
#define META_SURFACE_ACTOR_X11_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_SURFACE_ACTOR_X11, MetaSurfaceActorX11Class))
|
||||
|
||||
typedef struct _MetaSurfaceActorX11 MetaSurfaceActorX11;
|
||||
typedef struct _MetaSurfaceActorX11Class MetaSurfaceActorX11Class;
|
||||
|
||||
struct _MetaSurfaceActorX11
|
||||
{
|
||||
MetaSurfaceActor parent;
|
||||
};
|
||||
|
||||
struct _MetaSurfaceActorX11Class
|
||||
{
|
||||
MetaSurfaceActorClass parent_class;
|
||||
};
|
||||
|
||||
GType meta_surface_actor_x11_get_type (void);
|
||||
|
||||
MetaSurfaceActor * meta_surface_actor_x11_new (MetaWindow *window);
|
||||
|
||||
void meta_surface_actor_x11_set_size (MetaSurfaceActorX11 *self,
|
||||
int width, int height);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __META_SURFACE_ACTOR_X11_H__ */
|
315
src/compositor/meta-surface-actor.c
Normal file
315
src/compositor/meta-surface-actor.c
Normal file
@ -0,0 +1,315 @@
|
||||
/* -*- 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 "meta-surface-actor.h"
|
||||
|
||||
#include <clutter/clutter.h>
|
||||
#include <meta/meta-shaped-texture.h>
|
||||
#include "meta-wayland-private.h"
|
||||
#include "meta-cullable.h"
|
||||
#include "meta-shaped-texture-private.h"
|
||||
|
||||
struct _MetaSurfaceActorPrivate
|
||||
{
|
||||
MetaShapedTexture *texture;
|
||||
|
||||
cairo_region_t *input_region;
|
||||
|
||||
/* Freeze/thaw accounting */
|
||||
guint freeze_count;
|
||||
guint needs_damage_all : 1;
|
||||
};
|
||||
|
||||
static void cullable_iface_init (MetaCullableInterface *iface);
|
||||
|
||||
G_DEFINE_ABSTRACT_TYPE_WITH_CODE (MetaSurfaceActor, meta_surface_actor, CLUTTER_TYPE_ACTOR,
|
||||
G_IMPLEMENT_INTERFACE (META_TYPE_CULLABLE, cullable_iface_init));
|
||||
|
||||
gboolean
|
||||
meta_surface_actor_get_unobscured_bounds (MetaSurfaceActor *self,
|
||||
cairo_rectangle_int_t *unobscured_bounds)
|
||||
{
|
||||
MetaSurfaceActorPrivate *priv = self->priv;
|
||||
return meta_shaped_texture_get_unobscured_bounds (priv->texture, unobscured_bounds);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_surface_actor_pick (ClutterActor *actor,
|
||||
const ClutterColor *color)
|
||||
{
|
||||
MetaSurfaceActor *self = META_SURFACE_ACTOR (actor);
|
||||
MetaSurfaceActorPrivate *priv = self->priv;
|
||||
|
||||
if (!clutter_actor_should_pick_paint (actor))
|
||||
return;
|
||||
|
||||
/* If there is no region then use the regular pick */
|
||||
if (priv->input_region == NULL)
|
||||
CLUTTER_ACTOR_CLASS (meta_surface_actor_parent_class)->pick (actor, color);
|
||||
else
|
||||
{
|
||||
int n_rects;
|
||||
float *rectangles;
|
||||
int i;
|
||||
CoglPipeline *pipeline;
|
||||
CoglContext *ctx;
|
||||
CoglFramebuffer *fb;
|
||||
CoglColor cogl_color;
|
||||
|
||||
n_rects = cairo_region_num_rectangles (priv->input_region);
|
||||
rectangles = g_alloca (sizeof (float) * 4 * n_rects);
|
||||
|
||||
for (i = 0; i < n_rects; i++)
|
||||
{
|
||||
cairo_rectangle_int_t rect;
|
||||
int pos = i * 4;
|
||||
|
||||
cairo_region_get_rectangle (priv->input_region, i, &rect);
|
||||
|
||||
rectangles[pos + 0] = rect.x;
|
||||
rectangles[pos + 1] = rect.y;
|
||||
rectangles[pos + 2] = rect.x + rect.width;
|
||||
rectangles[pos + 3] = rect.y + rect.height;
|
||||
}
|
||||
|
||||
ctx = clutter_backend_get_cogl_context (clutter_get_default_backend ());
|
||||
fb = cogl_get_draw_framebuffer ();
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
meta_surface_actor_dispose (GObject *object)
|
||||
{
|
||||
MetaSurfaceActor *self = META_SURFACE_ACTOR (object);
|
||||
MetaSurfaceActorPrivate *priv = self->priv;
|
||||
|
||||
g_clear_pointer (&priv->input_region, cairo_region_destroy);
|
||||
|
||||
G_OBJECT_CLASS (meta_surface_actor_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_surface_actor_class_init (MetaSurfaceActorClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass);
|
||||
|
||||
object_class->dispose = meta_surface_actor_dispose;
|
||||
actor_class->pick = meta_surface_actor_pick;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_surface_actor_update_area (MetaSurfaceActor *self,
|
||||
int x, int y, int width, int height)
|
||||
{
|
||||
MetaSurfaceActorPrivate *priv = self->priv;
|
||||
return meta_shaped_texture_update_area (priv->texture, x, y, width, height);
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_surface_actor_is_obscured (MetaSurfaceActor *self)
|
||||
{
|
||||
MetaSurfaceActorPrivate *priv = self->priv;
|
||||
return meta_shaped_texture_is_obscured (priv->texture);
|
||||
}
|
||||
|
||||
void
|
||||
meta_surface_actor_set_input_region (MetaSurfaceActor *self,
|
||||
cairo_region_t *region)
|
||||
{
|
||||
MetaSurfaceActorPrivate *priv = self->priv;
|
||||
|
||||
if (priv->input_region)
|
||||
cairo_region_destroy (priv->input_region);
|
||||
|
||||
if (region)
|
||||
priv->input_region = cairo_region_reference (region);
|
||||
else
|
||||
priv->input_region = NULL;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_frozen (MetaSurfaceActor *self)
|
||||
{
|
||||
MetaSurfaceActorPrivate *priv = self->priv;
|
||||
return (priv->freeze_count > 0);
|
||||
}
|
||||
|
||||
void
|
||||
meta_surface_actor_process_damage (MetaSurfaceActor *self,
|
||||
int x, int y, int width, int height)
|
||||
{
|
||||
MetaSurfaceActorPrivate *priv = self->priv;
|
||||
|
||||
if (is_frozen (self))
|
||||
{
|
||||
/* The window is frozen due to an effect in progress: we ignore damage
|
||||
* here on the off chance that this will stop the corresponding
|
||||
* texture_from_pixmap from being update.
|
||||
*
|
||||
* needs_damage_all tracks that some unknown damage happened while the
|
||||
* window was frozen so that when the window becomes unfrozen we can
|
||||
* issue a full window update to cover any lost damage.
|
||||
*
|
||||
* It should be noted that this is an unreliable mechanism since it's
|
||||
* quite likely that drivers will aim to provide a zero-copy
|
||||
* implementation of the texture_from_pixmap extension and in those cases
|
||||
* any drawing done to the window is always immediately reflected in the
|
||||
* texture regardless of damage event handling.
|
||||
*/
|
||||
priv->needs_damage_all = TRUE;
|
||||
return;
|
||||
}
|
||||
|
||||
META_SURFACE_ACTOR_GET_CLASS (self)->process_damage (self, x, y, width, height);
|
||||
}
|
||||
|
||||
void
|
||||
meta_surface_actor_pre_paint (MetaSurfaceActor *self)
|
||||
{
|
||||
META_SURFACE_ACTOR_GET_CLASS (self)->pre_paint (self);
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_surface_actor_is_argb32 (MetaSurfaceActor *self)
|
||||
{
|
||||
return META_SURFACE_ACTOR_GET_CLASS (self)->is_argb32 (self);
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_surface_actor_is_visible (MetaSurfaceActor *self)
|
||||
{
|
||||
return META_SURFACE_ACTOR_GET_CLASS (self)->is_visible (self);
|
||||
}
|
||||
|
||||
void
|
||||
meta_surface_actor_freeze (MetaSurfaceActor *self)
|
||||
{
|
||||
MetaSurfaceActorPrivate *priv = self->priv;
|
||||
|
||||
priv->freeze_count ++;
|
||||
}
|
||||
|
||||
void
|
||||
meta_surface_actor_thaw (MetaSurfaceActor *self)
|
||||
{
|
||||
MetaSurfaceActorPrivate *priv = self->priv;
|
||||
|
||||
if (priv->freeze_count == 0)
|
||||
{
|
||||
g_critical ("Error in freeze/thaw accounting.");
|
||||
return;
|
||||
}
|
||||
|
||||
priv->freeze_count --;
|
||||
|
||||
/* Since we ignore damage events while a window is frozen for certain effects
|
||||
* we may need to issue an update_area() covering the whole pixmap if we
|
||||
* don't know what real damage has happened. */
|
||||
if (priv->needs_damage_all)
|
||||
{
|
||||
meta_surface_actor_process_damage (self, 0, 0,
|
||||
clutter_actor_get_width (CLUTTER_ACTOR (priv->texture)),
|
||||
clutter_actor_get_height (CLUTTER_ACTOR (priv->texture)));
|
||||
priv->needs_damage_all = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_surface_actor_is_frozen (MetaSurfaceActor *self)
|
||||
{
|
||||
return is_frozen (self);
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_surface_actor_should_unredirect (MetaSurfaceActor *self)
|
||||
{
|
||||
return META_SURFACE_ACTOR_GET_CLASS (self)->should_unredirect (self);
|
||||
}
|
||||
|
||||
void
|
||||
meta_surface_actor_set_unredirected (MetaSurfaceActor *self,
|
||||
gboolean unredirected)
|
||||
{
|
||||
META_SURFACE_ACTOR_GET_CLASS (self)->set_unredirected (self, unredirected);
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_surface_actor_is_unredirected (MetaSurfaceActor *self)
|
||||
{
|
||||
return META_SURFACE_ACTOR_GET_CLASS (self)->is_unredirected (self);
|
||||
}
|
83
src/compositor/meta-surface-actor.h
Normal file
83
src/compositor/meta-surface-actor.h
Normal file
@ -0,0 +1,83 @@
|
||||
/* -*- 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>
|
||||
|
||||
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;
|
||||
|
||||
void (* process_damage) (MetaSurfaceActor *actor,
|
||||
int x, int y, int width, int height);
|
||||
void (* pre_paint) (MetaSurfaceActor *actor);
|
||||
gboolean (* is_argb32) (MetaSurfaceActor *actor);
|
||||
gboolean (* is_visible) (MetaSurfaceActor *actor);
|
||||
|
||||
gboolean (* should_unredirect) (MetaSurfaceActor *actor);
|
||||
void (* set_unredirected) (MetaSurfaceActor *actor,
|
||||
gboolean unredirected);
|
||||
gboolean (* is_unredirected) (MetaSurfaceActor *actor);
|
||||
};
|
||||
|
||||
struct _MetaSurfaceActor
|
||||
{
|
||||
ClutterActor parent;
|
||||
|
||||
MetaSurfaceActorPrivate *priv;
|
||||
};
|
||||
|
||||
GType meta_surface_actor_get_type (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_is_obscured (MetaSurfaceActor *self);
|
||||
gboolean meta_surface_actor_get_unobscured_bounds (MetaSurfaceActor *self,
|
||||
cairo_rectangle_int_t *unobscured_bounds);
|
||||
|
||||
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);
|
||||
|
||||
gboolean meta_surface_actor_update_area (MetaSurfaceActor *actor,
|
||||
int x, int y, int width, int height);
|
||||
|
||||
void meta_surface_actor_process_damage (MetaSurfaceActor *actor,
|
||||
int x, int y, int width, int height);
|
||||
void meta_surface_actor_pre_paint (MetaSurfaceActor *actor);
|
||||
gboolean meta_surface_actor_is_argb32 (MetaSurfaceActor *actor);
|
||||
gboolean meta_surface_actor_is_visible (MetaSurfaceActor *actor);
|
||||
|
||||
void meta_surface_actor_freeze (MetaSurfaceActor *actor);
|
||||
void meta_surface_actor_thaw (MetaSurfaceActor *actor);
|
||||
gboolean meta_surface_actor_is_frozen (MetaSurfaceActor *actor);
|
||||
|
||||
gboolean meta_surface_actor_should_unredirect (MetaSurfaceActor *actor);
|
||||
void meta_surface_actor_set_unredirected (MetaSurfaceActor *actor,
|
||||
gboolean unredirected);
|
||||
gboolean meta_surface_actor_is_unredirected (MetaSurfaceActor *actor);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* META_SURFACE_ACTOR_PRIVATE_H */
|
@ -60,7 +60,6 @@ struct _MetaTextureTower
|
||||
CoglTexture *textures[MAX_TEXTURE_LEVELS];
|
||||
CoglOffscreen *fbos[MAX_TEXTURE_LEVELS];
|
||||
Box invalid[MAX_TEXTURE_LEVELS];
|
||||
CoglPipeline *pipeline_template;
|
||||
};
|
||||
|
||||
/**
|
||||
@ -92,9 +91,6 @@ meta_texture_tower_free (MetaTextureTower *tower)
|
||||
{
|
||||
g_return_if_fail (tower != NULL);
|
||||
|
||||
if (tower->pipeline_template != NULL)
|
||||
cogl_object_unref (tower->pipeline_template);
|
||||
|
||||
meta_texture_tower_set_base_texture (tower, NULL);
|
||||
|
||||
g_slice_free (MetaTextureTower, tower);
|
||||
@ -377,7 +373,7 @@ texture_tower_create_texture (MetaTextureTower *tower,
|
||||
tower->invalid[level].y2 = height;
|
||||
}
|
||||
|
||||
static void
|
||||
static gboolean
|
||||
texture_tower_revalidate_fbo (MetaTextureTower *tower,
|
||||
int level)
|
||||
{
|
||||
@ -388,50 +384,174 @@ texture_tower_revalidate_fbo (MetaTextureTower *tower,
|
||||
int dest_texture_width = cogl_texture_get_width (dest_texture);
|
||||
int dest_texture_height = cogl_texture_get_height (dest_texture);
|
||||
Box *invalid = &tower->invalid[level];
|
||||
CoglFramebuffer *fb;
|
||||
CoglError *catch_error = NULL;
|
||||
CoglPipeline *pipeline;
|
||||
CoglMatrix modelview;
|
||||
|
||||
if (tower->fbos[level] == NULL)
|
||||
tower->fbos[level] = cogl_offscreen_new_with_texture (dest_texture);
|
||||
tower->fbos[level] = cogl_offscreen_new_to_texture (dest_texture);
|
||||
|
||||
fb = COGL_FRAMEBUFFER (tower->fbos[level]);
|
||||
if (tower->fbos[level] == NULL)
|
||||
return FALSE;
|
||||
|
||||
if (!cogl_framebuffer_allocate (fb, &catch_error))
|
||||
cogl_push_framebuffer (COGL_FRAMEBUFFER (tower->fbos[level]));
|
||||
|
||||
cogl_ortho (0, dest_texture_width, dest_texture_height, 0, -1., 1.);
|
||||
|
||||
cogl_matrix_init_identity (&modelview);
|
||||
cogl_set_modelview_matrix (&modelview);
|
||||
|
||||
cogl_set_source_texture (tower->textures[level - 1]);
|
||||
cogl_rectangle_with_texture_coords (invalid->x1, invalid->y1,
|
||||
invalid->x2, invalid->y2,
|
||||
(2. * invalid->x1) / source_texture_width,
|
||||
(2. * invalid->y1) / source_texture_height,
|
||||
(2. * invalid->x2) / source_texture_width,
|
||||
(2. * invalid->y2) / source_texture_height);
|
||||
|
||||
cogl_pop_framebuffer ();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
fill_copy (guchar *buf,
|
||||
const guchar *source,
|
||||
int width)
|
||||
{
|
||||
memcpy (buf, source, width * 4);
|
||||
}
|
||||
|
||||
static void
|
||||
fill_scale_down (guchar *buf,
|
||||
const guchar *source,
|
||||
int width)
|
||||
{
|
||||
while (width > 1)
|
||||
{
|
||||
cogl_error_free (catch_error);
|
||||
return;
|
||||
buf[0] = (source[0] + source[4]) / 2;
|
||||
buf[1] = (source[1] + source[5]) / 2;
|
||||
buf[2] = (source[2] + source[6]) / 2;
|
||||
buf[3] = (source[3] + source[7]) / 2;
|
||||
|
||||
buf += 4;
|
||||
source += 8;
|
||||
width -= 2;
|
||||
}
|
||||
|
||||
cogl_framebuffer_orthographic (fb, 0, 0, dest_texture_width, dest_texture_height, -1., 1.);
|
||||
|
||||
if (!tower->pipeline_template)
|
||||
if (width > 0)
|
||||
{
|
||||
CoglContext *ctx =
|
||||
clutter_backend_get_cogl_context (clutter_get_default_backend ());
|
||||
tower->pipeline_template = cogl_pipeline_new (ctx);
|
||||
cogl_pipeline_set_blend (tower->pipeline_template, "RGBA = ADD (SRC_COLOR, 0)", NULL);
|
||||
buf[0] = source[0] / 2;
|
||||
buf[1] = source[1] / 2;
|
||||
buf[2] = source[2] / 2;
|
||||
buf[3] = source[3] / 2;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
texture_tower_revalidate_client (MetaTextureTower *tower,
|
||||
int level)
|
||||
{
|
||||
CoglTexture *source_texture = tower->textures[level - 1];
|
||||
int source_texture_width = cogl_texture_get_width (source_texture);
|
||||
int source_texture_height = cogl_texture_get_height (source_texture);
|
||||
guint source_rowstride;
|
||||
guchar *source_data;
|
||||
CoglTexture *dest_texture = tower->textures[level];
|
||||
int dest_texture_width = cogl_texture_get_width (dest_texture);
|
||||
int dest_texture_height = cogl_texture_get_height (dest_texture);
|
||||
int dest_x = tower->invalid[level].x1;
|
||||
int dest_y = tower->invalid[level].y1;
|
||||
int dest_width = tower->invalid[level].x2 - tower->invalid[level].x1;
|
||||
int dest_height = tower->invalid[level].y2 - tower->invalid[level].y1;
|
||||
guchar *dest_data;
|
||||
guchar *source_tmp1 = NULL, *source_tmp2 = NULL;
|
||||
int i, j;
|
||||
|
||||
source_rowstride = source_texture_width * 4;
|
||||
|
||||
source_data = g_malloc (source_texture_height * source_rowstride);
|
||||
cogl_texture_get_data (source_texture, TEXTURE_FORMAT, source_rowstride,
|
||||
source_data);
|
||||
|
||||
dest_data = g_malloc (dest_height * dest_width * 4);
|
||||
|
||||
if (dest_texture_height < source_texture_height)
|
||||
{
|
||||
source_tmp1 = g_malloc (dest_width * 4);
|
||||
source_tmp2 = g_malloc (dest_width * 4);
|
||||
}
|
||||
|
||||
pipeline = cogl_pipeline_copy (tower->pipeline_template);
|
||||
cogl_pipeline_set_layer_texture (pipeline, 0, tower->textures[level - 1]);
|
||||
for (i = 0; i < dest_height; i++)
|
||||
{
|
||||
guchar *dest_row = dest_data + i * dest_width * 4;
|
||||
if (dest_texture_height < source_texture_height)
|
||||
{
|
||||
guchar *source1, *source2;
|
||||
guchar *dest;
|
||||
|
||||
cogl_framebuffer_draw_textured_rectangle (fb, pipeline,
|
||||
invalid->x1, invalid->y1,
|
||||
invalid->x2, invalid->y2,
|
||||
(2. * invalid->x1) / source_texture_width,
|
||||
(2. * invalid->y1) / source_texture_height,
|
||||
(2. * invalid->x2) / source_texture_width,
|
||||
(2. * invalid->y2) / source_texture_height);
|
||||
if (dest_texture_width < source_texture_width)
|
||||
{
|
||||
fill_scale_down (source_tmp1,
|
||||
source_data + ((i + dest_y) * 2) * source_rowstride + dest_x * 2 * 4,
|
||||
dest_width * 2);
|
||||
fill_scale_down (source_tmp2,
|
||||
source_data + ((i + dest_y) * 2 + 1) * source_rowstride + dest_x * 2 * 4,
|
||||
dest_width * 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
fill_copy (source_tmp1,
|
||||
source_data + ((i + dest_y) * 2) * source_rowstride + dest_x * 4,
|
||||
dest_width);
|
||||
fill_copy (source_tmp2,
|
||||
source_data + ((i + dest_y) * 2 + 1) * source_rowstride + dest_x * 4,
|
||||
dest_width);
|
||||
}
|
||||
|
||||
cogl_object_unref (pipeline);
|
||||
source1 = source_tmp1;
|
||||
source2 = source_tmp2;
|
||||
|
||||
dest = dest_row;
|
||||
for (j = 0; j < dest_width * 4; j++)
|
||||
*(dest++) = (*(source1++) + *(source2++)) / 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dest_texture_width < source_texture_width)
|
||||
fill_scale_down (dest_row,
|
||||
source_data + (i + dest_y) * source_rowstride + dest_x * 2 * 4,
|
||||
dest_width * 2);
|
||||
else
|
||||
fill_copy (dest_row,
|
||||
source_data + (i + dest_y) * source_rowstride,
|
||||
dest_width);
|
||||
}
|
||||
}
|
||||
|
||||
cogl_texture_set_region (dest_texture,
|
||||
0, 0,
|
||||
dest_x, dest_y,
|
||||
dest_width, dest_height,
|
||||
dest_width, dest_height,
|
||||
TEXTURE_FORMAT,
|
||||
4 * dest_width,
|
||||
dest_data);
|
||||
|
||||
if (dest_texture_height < source_texture_height)
|
||||
{
|
||||
g_free (source_tmp1);
|
||||
g_free (source_tmp2);
|
||||
}
|
||||
|
||||
g_free (source_data);
|
||||
g_free (dest_data);
|
||||
}
|
||||
|
||||
static void
|
||||
texture_tower_revalidate (MetaTextureTower *tower,
|
||||
int level)
|
||||
{
|
||||
texture_tower_revalidate_fbo (tower, level);
|
||||
if (!texture_tower_revalidate_fbo (tower, level))
|
||||
texture_tower_revalidate_client (tower, level);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
@ -58,4 +62,6 @@ void meta_window_actor_queue_frame_drawn (MetaWindowActor *self,
|
||||
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
@ -122,7 +122,6 @@ meta_window_group_paint (ClutterActor *actor)
|
||||
|
||||
MetaWindowGroup *window_group = META_WINDOW_GROUP (actor);
|
||||
ClutterActor *stage = clutter_actor_get_stage (actor);
|
||||
MetaCompScreen *info = meta_screen_get_compositor_data (window_group->screen);
|
||||
|
||||
/* 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
|
||||
@ -165,15 +164,6 @@ meta_window_group_paint (ClutterActor *actor)
|
||||
paint_y_offset = paint_y_origin - actor_y_origin;
|
||||
cairo_region_translate (clip_region, -paint_x_offset, -paint_y_offset);
|
||||
|
||||
if (info->unredirected_window != NULL)
|
||||
{
|
||||
cairo_rectangle_int_t unredirected_rect;
|
||||
|
||||
meta_window_get_frame_rect (info->unredirected_window, (MetaRectangle *)&unredirected_rect);
|
||||
cairo_region_subtract_rectangle (unobscured_region, &unredirected_rect);
|
||||
cairo_region_subtract_rectangle (clip_region, &unredirected_rect);
|
||||
}
|
||||
|
||||
meta_cullable_cull_out (META_CULLABLE (window_group), unobscured_region, clip_region);
|
||||
|
||||
cairo_region_destroy (unobscured_region);
|
||||
|
@ -32,14 +32,13 @@
|
||||
#include <gmodule.h>
|
||||
#include <string.h>
|
||||
|
||||
#define DESTROY_TIMEOUT 250
|
||||
#define DESTROY_TIMEOUT 100
|
||||
#define MINIMIZE_TIMEOUT 250
|
||||
#define MAXIMIZE_TIMEOUT 250
|
||||
#define MAP_TIMEOUT 250
|
||||
#define SWITCH_TIMEOUT 500
|
||||
|
||||
#define ACTOR_DATA_KEY "MCCP-Default-actor-data"
|
||||
#define SCREEN_TILE_PREVIEW_DATA_KEY "MCCP-Default-screen-tile-preview-data"
|
||||
|
||||
#define META_TYPE_DEFAULT_PLUGIN (meta_default_plugin_get_type ())
|
||||
#define META_DEFAULT_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_DEFAULT_PLUGIN, MetaDefaultPlugin))
|
||||
@ -68,7 +67,6 @@ struct _MetaDefaultPluginClass
|
||||
};
|
||||
|
||||
static GQuark actor_data_quark = 0;
|
||||
static GQuark screen_tile_preview_data_quark = 0;
|
||||
|
||||
static void start (MetaPlugin *plugin);
|
||||
static void minimize (MetaPlugin *plugin,
|
||||
@ -99,12 +97,6 @@ static void kill_window_effects (MetaPlugin *plugin,
|
||||
MetaWindowActor *actor);
|
||||
static void kill_switch_workspace (MetaPlugin *plugin);
|
||||
|
||||
static void show_tile_preview (MetaPlugin *plugin,
|
||||
MetaWindow *window,
|
||||
MetaRectangle *tile_rect,
|
||||
int tile_monitor_number);
|
||||
static void hide_tile_preview (MetaPlugin *plugin);
|
||||
|
||||
static void confirm_display_change (MetaPlugin *plugin);
|
||||
|
||||
static const MetaPluginInfo * plugin_info (MetaPlugin *plugin);
|
||||
@ -151,15 +143,6 @@ typedef struct
|
||||
} EffectCompleteData;
|
||||
|
||||
|
||||
typedef struct _ScreenTilePreview
|
||||
{
|
||||
ClutterActor *actor;
|
||||
|
||||
GdkRGBA *preview_color;
|
||||
|
||||
MetaRectangle tile_rect;
|
||||
} ScreenTilePreview;
|
||||
|
||||
static void
|
||||
meta_default_plugin_dispose (GObject *object)
|
||||
{
|
||||
@ -220,8 +203,6 @@ meta_default_plugin_class_init (MetaDefaultPluginClass *klass)
|
||||
plugin_class->unmaximize = unmaximize;
|
||||
plugin_class->destroy = destroy;
|
||||
plugin_class->switch_workspace = switch_workspace;
|
||||
plugin_class->show_tile_preview = show_tile_preview;
|
||||
plugin_class->hide_tile_preview = hide_tile_preview;
|
||||
plugin_class->plugin_info = plugin_info;
|
||||
plugin_class->kill_window_effects = kill_window_effects;
|
||||
plugin_class->kill_switch_workspace = kill_switch_workspace;
|
||||
@ -488,8 +469,6 @@ on_minimize_effect_complete (ClutterTimeline *timeline, EffectCompleteData *data
|
||||
/* FIXME - we shouldn't assume the original scale, it should be saved
|
||||
* at the start of the effect */
|
||||
clutter_actor_set_scale (data->actor, 1.0, 1.0);
|
||||
clutter_actor_move_anchor_point_from_gravity (data->actor,
|
||||
CLUTTER_GRAVITY_NORTH_WEST);
|
||||
|
||||
/* Now notify the manager that we are done with this effect */
|
||||
meta_plugin_minimize_completed (plugin, window_actor);
|
||||
@ -526,9 +505,6 @@ minimize (MetaPlugin *plugin, MetaWindowActor *window_actor)
|
||||
|
||||
apriv->is_minimized = TRUE;
|
||||
|
||||
clutter_actor_move_anchor_point_from_gravity (actor,
|
||||
CLUTTER_GRAVITY_CENTER);
|
||||
|
||||
animation = clutter_actor_animate (actor,
|
||||
CLUTTER_EASE_IN_SINE,
|
||||
MINIMIZE_TIMEOUT,
|
||||
@ -567,8 +543,6 @@ on_maximize_effect_complete (ClutterTimeline *timeline, EffectCompleteData *data
|
||||
|
||||
/* FIXME - don't assume the original scale was 1.0 */
|
||||
clutter_actor_set_scale (data->actor, 1.0, 1.0);
|
||||
clutter_actor_move_anchor_point_from_gravity (data->actor,
|
||||
CLUTTER_GRAVITY_NORTH_WEST);
|
||||
|
||||
/* Now notify the manager that we are done with this effect */
|
||||
meta_plugin_maximize_completed (plugin, window_actor);
|
||||
@ -593,10 +567,8 @@ maximize (MetaPlugin *plugin,
|
||||
ClutterActor *actor = CLUTTER_ACTOR (window_actor);
|
||||
MetaWindow *meta_window = meta_window_actor_get_meta_window (window_actor);
|
||||
|
||||
gdouble scale_x = 1.0;
|
||||
gdouble scale_y = 1.0;
|
||||
gfloat anchor_x = 0;
|
||||
gfloat anchor_y = 0;
|
||||
gdouble scale_x = 1.0;
|
||||
gdouble scale_y = 1.0;
|
||||
|
||||
type = meta_window_get_window_type (meta_window);
|
||||
|
||||
@ -620,13 +592,6 @@ maximize (MetaPlugin *plugin,
|
||||
scale_x = (gdouble)end_width / (gdouble) width;
|
||||
scale_y = (gdouble)end_height / (gdouble) height;
|
||||
|
||||
anchor_x = (gdouble)(x - end_x)*(gdouble)width /
|
||||
((gdouble)(end_width - width));
|
||||
anchor_y = (gdouble)(y - end_y)*(gdouble)height /
|
||||
((gdouble)(end_height - height));
|
||||
|
||||
clutter_actor_move_anchor_point (actor, anchor_x, anchor_y);
|
||||
|
||||
animation = clutter_actor_animate (actor,
|
||||
CLUTTER_EASE_IN_SINE,
|
||||
MAXIMIZE_TIMEOUT,
|
||||
@ -681,9 +646,6 @@ on_map_effect_complete (ClutterTimeline *timeline, EffectCompleteData *data)
|
||||
|
||||
apriv->tml_map = NULL;
|
||||
|
||||
clutter_actor_move_anchor_point_from_gravity (data->actor,
|
||||
CLUTTER_GRAVITY_NORTH_WEST);
|
||||
|
||||
/* Now notify the manager that we are done with this effect */
|
||||
meta_plugin_map_completed (plugin, window_actor);
|
||||
|
||||
@ -769,14 +731,12 @@ destroy (MetaPlugin *plugin, MetaWindowActor *window_actor)
|
||||
EffectCompleteData *data = g_new0 (EffectCompleteData, 1);
|
||||
ActorPrivate *apriv = get_actor_private (window_actor);
|
||||
|
||||
clutter_actor_move_anchor_point_from_gravity (actor,
|
||||
CLUTTER_GRAVITY_CENTER);
|
||||
|
||||
animation = clutter_actor_animate (actor,
|
||||
CLUTTER_EASE_IN_SINE,
|
||||
CLUTTER_EASE_OUT_QUAD,
|
||||
DESTROY_TIMEOUT,
|
||||
"scale-x", 0.0,
|
||||
"scale-y", 1.0,
|
||||
"opacity", 0,
|
||||
"scale-x", 0.8,
|
||||
"scale-y", 0.8,
|
||||
NULL);
|
||||
apriv->tml_destroy = clutter_animation_get_timeline (animation);
|
||||
data->plugin = plugin;
|
||||
@ -789,82 +749,6 @@ destroy (MetaPlugin *plugin, MetaWindowActor *window_actor)
|
||||
meta_plugin_destroy_completed (plugin, window_actor);
|
||||
}
|
||||
|
||||
/*
|
||||
* Tile preview private data accessor
|
||||
*/
|
||||
static void
|
||||
free_screen_tile_preview (gpointer data)
|
||||
{
|
||||
ScreenTilePreview *preview = data;
|
||||
|
||||
if (G_LIKELY (preview != NULL)) {
|
||||
clutter_actor_destroy (preview->actor);
|
||||
g_slice_free (ScreenTilePreview, preview);
|
||||
}
|
||||
}
|
||||
|
||||
static ScreenTilePreview *
|
||||
get_screen_tile_preview (MetaScreen *screen)
|
||||
{
|
||||
ScreenTilePreview *preview = g_object_get_qdata (G_OBJECT (screen), screen_tile_preview_data_quark);
|
||||
|
||||
if (G_UNLIKELY (screen_tile_preview_data_quark == 0))
|
||||
screen_tile_preview_data_quark = g_quark_from_static_string (SCREEN_TILE_PREVIEW_DATA_KEY);
|
||||
|
||||
if (G_UNLIKELY (!preview))
|
||||
{
|
||||
preview = g_slice_new0 (ScreenTilePreview);
|
||||
|
||||
preview->actor = clutter_actor_new ();
|
||||
clutter_actor_set_background_color (preview->actor, CLUTTER_COLOR_Blue);
|
||||
clutter_actor_set_opacity (preview->actor, 100);
|
||||
|
||||
clutter_actor_add_child (meta_get_window_group_for_screen (screen), preview->actor);
|
||||
g_object_set_qdata_full (G_OBJECT (screen),
|
||||
screen_tile_preview_data_quark, preview,
|
||||
free_screen_tile_preview);
|
||||
}
|
||||
|
||||
return preview;
|
||||
}
|
||||
|
||||
static void
|
||||
show_tile_preview (MetaPlugin *plugin,
|
||||
MetaWindow *window,
|
||||
MetaRectangle *tile_rect,
|
||||
int tile_monitor_number)
|
||||
{
|
||||
MetaScreen *screen = meta_plugin_get_screen (plugin);
|
||||
ScreenTilePreview *preview = get_screen_tile_preview (screen);
|
||||
ClutterActor *window_actor;
|
||||
|
||||
if (CLUTTER_ACTOR_IS_VISIBLE (preview->actor)
|
||||
&& preview->tile_rect.x == tile_rect->x
|
||||
&& preview->tile_rect.y == tile_rect->y
|
||||
&& preview->tile_rect.width == tile_rect->width
|
||||
&& preview->tile_rect.height == tile_rect->height)
|
||||
return; /* nothing to do */
|
||||
|
||||
clutter_actor_set_position (preview->actor, tile_rect->x, tile_rect->y);
|
||||
clutter_actor_set_size (preview->actor, tile_rect->width, tile_rect->height);
|
||||
|
||||
clutter_actor_show (preview->actor);
|
||||
|
||||
window_actor = CLUTTER_ACTOR (meta_window_get_compositor_private (window));
|
||||
clutter_actor_lower (preview->actor, window_actor);
|
||||
|
||||
preview->tile_rect = *tile_rect;
|
||||
}
|
||||
|
||||
static void
|
||||
hide_tile_preview (MetaPlugin *plugin)
|
||||
{
|
||||
MetaScreen *screen = meta_plugin_get_screen (plugin);
|
||||
ScreenTilePreview *preview = get_screen_tile_preview (screen);
|
||||
|
||||
clutter_actor_hide (preview->actor);
|
||||
}
|
||||
|
||||
static void
|
||||
kill_switch_workspace (MetaPlugin *plugin)
|
||||
{
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -426,7 +426,7 @@ setup_constraint_info (ConstraintInfo *info,
|
||||
*/
|
||||
if (meta_prefs_get_force_fullscreen() &&
|
||||
!window->hide_titlebar_when_maximized &&
|
||||
(window->decorated || !meta_window_is_client_decorated (window)) &&
|
||||
window->decorated &&
|
||||
meta_rectangle_equal (new, &monitor_info->rect) &&
|
||||
window->has_fullscreen_func &&
|
||||
!window->fullscreen)
|
||||
@ -491,17 +491,12 @@ place_window_if_needed(MetaWindow *window,
|
||||
!window->minimized &&
|
||||
!window->fullscreen)
|
||||
{
|
||||
MetaRectangle orig_rect;
|
||||
MetaRectangle placed_rect;
|
||||
MetaWorkspace *cur_workspace;
|
||||
const MetaMonitorInfo *monitor_info;
|
||||
|
||||
meta_window_get_frame_rect (window, &placed_rect);
|
||||
|
||||
orig_rect = info->orig;
|
||||
extend_by_frame (window, &orig_rect);
|
||||
|
||||
meta_window_place (window, orig_rect.x, orig_rect.y,
|
||||
meta_window_place (window, info->orig.x, info->orig.y,
|
||||
&placed_rect.x, &placed_rect.y);
|
||||
did_placement = TRUE;
|
||||
|
||||
|
@ -33,7 +33,8 @@ 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,
|
||||
|
@ -153,7 +153,7 @@ 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);
|
||||
@ -270,6 +270,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);
|
||||
@ -281,9 +283,13 @@ meta_core_lower_beneath_grab_window (Display *xdisplay,
|
||||
changes.stack_mode = Below;
|
||||
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);
|
||||
@ -322,7 +328,8 @@ meta_core_maximize (Display *xdisplay,
|
||||
if (meta_prefs_get_raise_on_click ())
|
||||
meta_window_raise (window);
|
||||
|
||||
meta_window_maximize (window, META_MAXIMIZE_BOTH);
|
||||
meta_window_maximize (window,
|
||||
META_MAXIMIZE_HORIZONTAL | META_MAXIMIZE_VERTICAL);
|
||||
}
|
||||
|
||||
void
|
||||
@ -335,9 +342,11 @@ meta_core_toggle_maximize_vertically (Display *xdisplay,
|
||||
meta_window_raise (window);
|
||||
|
||||
if (META_WINDOW_MAXIMIZED_VERTICALLY (window))
|
||||
meta_window_unmaximize (window, META_MAXIMIZE_VERTICAL);
|
||||
meta_window_unmaximize (window,
|
||||
META_MAXIMIZE_VERTICAL);
|
||||
else
|
||||
meta_window_maximize (window, META_MAXIMIZE_VERTICAL);
|
||||
meta_window_maximize (window,
|
||||
META_MAXIMIZE_VERTICAL);
|
||||
}
|
||||
|
||||
void
|
||||
@ -350,9 +359,11 @@ meta_core_toggle_maximize_horizontally (Display *xdisplay,
|
||||
meta_window_raise (window);
|
||||
|
||||
if (META_WINDOW_MAXIMIZED_HORIZONTALLY (window))
|
||||
meta_window_unmaximize (window, META_MAXIMIZE_HORIZONTAL);
|
||||
meta_window_unmaximize (window,
|
||||
META_MAXIMIZE_HORIZONTAL);
|
||||
else
|
||||
meta_window_maximize (window, META_MAXIMIZE_HORIZONTAL);
|
||||
meta_window_maximize (window,
|
||||
META_MAXIMIZE_HORIZONTAL);
|
||||
}
|
||||
|
||||
void
|
||||
@ -365,9 +376,11 @@ meta_core_toggle_maximize (Display *xdisplay,
|
||||
meta_window_raise (window);
|
||||
|
||||
if (META_WINDOW_MAXIMIZED (window))
|
||||
meta_window_unmaximize (window, META_MAXIMIZE_BOTH);
|
||||
meta_window_unmaximize (window,
|
||||
META_MAXIMIZE_HORIZONTAL | META_MAXIMIZE_VERTICAL);
|
||||
else
|
||||
meta_window_maximize (window, META_MAXIMIZE_BOTH);
|
||||
meta_window_maximize (window,
|
||||
META_MAXIMIZE_HORIZONTAL | META_MAXIMIZE_VERTICAL);
|
||||
}
|
||||
|
||||
void
|
||||
@ -379,7 +392,8 @@ meta_core_unmaximize (Display *xdisplay,
|
||||
if (meta_prefs_get_raise_on_click ())
|
||||
meta_window_raise (window);
|
||||
|
||||
meta_window_unmaximize (window, META_MAXIMIZE_BOTH);
|
||||
meta_window_unmaximize (window,
|
||||
META_MAXIMIZE_HORIZONTAL | META_MAXIMIZE_VERTICAL);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -37,18 +37,17 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "meta-wayland-surface.h"
|
||||
|
||||
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 */
|
||||
}
|
||||
@ -66,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;
|
||||
@ -135,36 +132,42 @@ void
|
||||
meta_window_check_alive (MetaWindow *window,
|
||||
guint32 timestamp)
|
||||
{
|
||||
meta_display_ping_window (window->display,
|
||||
window,
|
||||
meta_display_ping_window (window,
|
||||
timestamp,
|
||||
delete_ping_reply_func,
|
||||
delete_ping_timeout_func,
|
||||
window);
|
||||
NULL);
|
||||
}
|
||||
|
||||
void
|
||||
meta_window_delete (MetaWindow *window,
|
||||
guint32 timestamp)
|
||||
{
|
||||
meta_error_trap_push (window->display);
|
||||
if (window->delete_window)
|
||||
if (window->client_type == META_WINDOW_CLIENT_TYPE_X11)
|
||||
{
|
||||
meta_topic (META_DEBUG_WINDOW_OPS,
|
||||
"Deleting %s with delete_window request\n",
|
||||
window->desc);
|
||||
meta_window_send_icccm_message (window,
|
||||
window->display->atom_WM_DELETE_WINDOW,
|
||||
timestamp);
|
||||
meta_error_trap_push (window->display);
|
||||
if (window->delete_window)
|
||||
{
|
||||
meta_topic (META_DEBUG_WINDOW_OPS,
|
||||
"Deleting %s with delete_window request\n",
|
||||
window->desc);
|
||||
meta_window_send_icccm_message (window,
|
||||
window->display->atom_WM_DELETE_WINDOW,
|
||||
timestamp);
|
||||
}
|
||||
else
|
||||
{
|
||||
meta_topic (META_DEBUG_WINDOW_OPS,
|
||||
"Deleting %s with explicit kill\n",
|
||||
window->desc);
|
||||
XKillClient (window->display->xdisplay, window->xwindow);
|
||||
}
|
||||
meta_error_trap_pop (window->display);
|
||||
}
|
||||
else
|
||||
{
|
||||
meta_topic (META_DEBUG_WINDOW_OPS,
|
||||
"Deleting %s with explicit kill\n",
|
||||
window->desc);
|
||||
XKillClient (window->display->xdisplay, window->xwindow);
|
||||
meta_wayland_surface_delete (window->surface);
|
||||
}
|
||||
meta_error_trap_pop (window->display);
|
||||
|
||||
meta_window_check_alive (window, timestamp);
|
||||
|
||||
|
@ -37,6 +37,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>
|
||||
@ -54,10 +55,9 @@ typedef struct _MetaWindowPropHooks MetaWindowPropHooks;
|
||||
|
||||
typedef struct MetaEdgeResistanceData MetaEdgeResistanceData;
|
||||
|
||||
typedef void (* MetaWindowPingFunc) (MetaDisplay *display,
|
||||
Window xwindow,
|
||||
guint32 timestamp,
|
||||
gpointer user_data);
|
||||
typedef void (* MetaWindowPingFunc) (MetaWindow *window,
|
||||
guint32 timestamp,
|
||||
gpointer user_data);
|
||||
|
||||
typedef enum {
|
||||
META_LIST_DEFAULT = 0, /* normal windows */
|
||||
@ -84,6 +84,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;
|
||||
@ -91,6 +99,8 @@ struct _MetaDisplay
|
||||
char *name;
|
||||
Display *xdisplay;
|
||||
|
||||
int clutter_event_filter;
|
||||
|
||||
Window leader_window;
|
||||
Window timestamp_pinging_window;
|
||||
|
||||
@ -115,6 +125,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;
|
||||
@ -151,6 +162,7 @@ struct _MetaDisplay
|
||||
GSList *screens;
|
||||
MetaScreen *active_screen;
|
||||
GHashTable *xids;
|
||||
GHashTable *wayland_windows;
|
||||
int error_traps;
|
||||
int (* error_trap_handler) (Display *display,
|
||||
XErrorEvent *error);
|
||||
@ -185,7 +197,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;
|
||||
@ -230,8 +242,8 @@ struct _MetaDisplay
|
||||
int grab_resize_timeout_id;
|
||||
|
||||
/* Keybindings stuff */
|
||||
GHashTable *key_bindings;
|
||||
GHashTable *key_bindings_index;
|
||||
MetaKeyBinding *key_bindings;
|
||||
int n_key_bindings;
|
||||
int min_keycode;
|
||||
int max_keycode;
|
||||
KeySym *keymap;
|
||||
@ -377,6 +389,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);
|
||||
@ -436,14 +453,13 @@ 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,
|
||||
void meta_display_ping_window (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);
|
||||
void meta_display_pong_for_serial (MetaDisplay *display,
|
||||
guint32 serial);
|
||||
|
||||
int meta_resize_gravity_from_grab_op (MetaGrabOp op);
|
||||
|
||||
@ -464,23 +480,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
|
||||
|
2806
src/core/display.c
2806
src/core/display.c
File diff suppressed because it is too large
Load Diff
@ -45,6 +45,7 @@ meta_window_ensure_frame (MetaWindow *window)
|
||||
XSetWindowAttributes attrs;
|
||||
Visual *visual;
|
||||
gulong create_serial;
|
||||
MetaStackWindow stack_window;
|
||||
|
||||
if (window->frame)
|
||||
return;
|
||||
@ -100,8 +101,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);
|
||||
@ -125,8 +128,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,
|
||||
@ -161,6 +165,7 @@ meta_window_destroy_frame (MetaWindow *window)
|
||||
{
|
||||
MetaFrame *frame;
|
||||
MetaFrameBorders borders;
|
||||
MetaStackWindow stack_window;
|
||||
|
||||
if (window->frame == NULL)
|
||||
return;
|
||||
@ -187,8 +192,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,
|
||||
|
@ -30,7 +30,6 @@
|
||||
#include <gio/gio.h>
|
||||
#include <meta/keybindings.h>
|
||||
|
||||
typedef struct _MetaKeyHandler MetaKeyHandler;
|
||||
struct _MetaKeyHandler
|
||||
{
|
||||
char *name;
|
||||
@ -48,48 +47,9 @@ struct _MetaKeyBinding
|
||||
KeyCode keycode;
|
||||
unsigned int mask;
|
||||
MetaVirtualModifier modifiers;
|
||||
gint flags;
|
||||
MetaKeyHandler *handler;
|
||||
};
|
||||
|
||||
/**
|
||||
* MetaKeyCombo:
|
||||
* @keysym: keysym
|
||||
* @keycode: keycode
|
||||
* @modifiers: modifiers
|
||||
*/
|
||||
typedef struct _MetaKeyCombo MetaKeyCombo;
|
||||
struct _MetaKeyCombo
|
||||
{
|
||||
unsigned int keysym;
|
||||
unsigned int keycode;
|
||||
MetaVirtualModifier modifiers;
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *name;
|
||||
GSettings *settings;
|
||||
|
||||
MetaKeyBindingAction action;
|
||||
|
||||
/*
|
||||
* A list of MetaKeyCombos. Each of them is bound to
|
||||
* this keypref. If one has keysym==modifiers==0, it is
|
||||
* ignored.
|
||||
*/
|
||||
GSList *combos;
|
||||
|
||||
/* for keybindings that can have shift or not like Alt+Tab */
|
||||
gboolean add_shift:1;
|
||||
|
||||
/* for keybindings that apply only to a window */
|
||||
gboolean per_window:1;
|
||||
|
||||
/* for keybindings not added with meta_display_add_keybinding() */
|
||||
gboolean builtin:1;
|
||||
} MetaKeyPref;
|
||||
|
||||
void meta_display_init_keys (MetaDisplay *display);
|
||||
void meta_display_shutdown_keys (MetaDisplay *display);
|
||||
void meta_screen_grab_keys (MetaScreen *screen);
|
||||
@ -104,9 +64,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);
|
||||
|
||||
@ -117,12 +77,5 @@ gboolean meta_prefs_add_keybinding (const char *name,
|
||||
|
||||
gboolean meta_prefs_remove_keybinding (const char *name);
|
||||
|
||||
GList *meta_prefs_get_keybindings (void);
|
||||
void meta_prefs_get_overlay_binding (MetaKeyCombo *combo);
|
||||
const char *meta_prefs_get_iso_next_group_option (void);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
106
src/core/main.c
106
src/core/main.c
@ -42,7 +42,7 @@
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
#define _XOPEN_SOURCE /* for putenv() and some signal-related functions */
|
||||
#define _SVID_SOURCE /* for putenv() and some signal-related functions */
|
||||
|
||||
#include <config.h>
|
||||
#include <meta/main.h>
|
||||
@ -53,8 +53,10 @@
|
||||
#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>
|
||||
@ -187,6 +189,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[] = {
|
||||
{
|
||||
@ -224,6 +227,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,9 +256,6 @@ meta_get_option_context (void)
|
||||
|
||||
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 ());
|
||||
g_option_context_add_group (ctx, cogl_get_option_group ());
|
||||
|
||||
return ctx;
|
||||
}
|
||||
|
||||
@ -328,16 +334,17 @@ meta_clutter_init (void)
|
||||
* also is %NULL, use the default - :0.0
|
||||
*/
|
||||
static void
|
||||
meta_select_display (gchar *display_name)
|
||||
meta_select_display (char *display_arg)
|
||||
{
|
||||
gchar *envVar = "";
|
||||
const char *display_name;
|
||||
|
||||
if (display_arg)
|
||||
display_name = (const char *) display_arg;
|
||||
else
|
||||
display_name = g_getenv ("MUTTER_DISPLAY");
|
||||
|
||||
if (display_name)
|
||||
envVar = g_strconcat ("DISPLAY=", display_name, NULL);
|
||||
else if (g_getenv ("MUTTER_DISPLAY"))
|
||||
envVar = g_strconcat ("DISPLAY=",
|
||||
g_getenv ("MUTTER_DISPLAY"), NULL);
|
||||
/* DO NOT FREE envVar, putenv() sucks */
|
||||
putenv (envVar);
|
||||
g_setenv ("DISPLAY", display_name, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -348,28 +355,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;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -383,9 +379,8 @@ meta_init (void)
|
||||
{
|
||||
struct sigaction act;
|
||||
sigset_t empty_mask;
|
||||
GIOChannel *channel;
|
||||
ClutterSettings *clutter_settings;
|
||||
|
||||
|
||||
sigemptyset (&empty_mask);
|
||||
act.sa_handler = SIG_IGN;
|
||||
act.sa_mask = empty_mask;
|
||||
@ -399,26 +394,19 @@ 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);
|
||||
|
||||
/* We consider running from mutter-launch equivalent to running from bare metal. */
|
||||
if (getenv ("WESTON_LAUNCHER_SOCK"))
|
||||
clutter_set_windowing_backend (CLUTTER_WINDOWING_EGL);
|
||||
|
||||
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",
|
||||
@ -430,9 +418,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,13 +436,20 @@ meta_init (void)
|
||||
meta_fatal ("Can't specify both SM save file and SM client id\n");
|
||||
|
||||
meta_main_loop = g_main_loop_new (NULL, FALSE);
|
||||
|
||||
|
||||
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 ();
|
||||
}
|
||||
|
||||
/*
|
||||
* XXX: We cannot handle high dpi scaling yet, so fix the scale to 1
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2013 Red Hat, Inc.
|
||||
* 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
|
||||
@ -23,10 +23,24 @@
|
||||
#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_root_cursor (MetaCursorTracker *tracker,
|
||||
MetaCursor cursor);
|
||||
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
|
||||
|
@ -22,19 +22,23 @@
|
||||
/**
|
||||
* SECTION:cursor-tracker
|
||||
* @title: MetaCursorTracker
|
||||
* @short_description: Mutter cursor tracking helper
|
||||
* @short_description: Mutter cursor tracking helper. Originally only
|
||||
* tracking the cursor image, now more of a "core
|
||||
* pointer abstraction"
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <string.h>
|
||||
#include <meta/main.h>
|
||||
#include <meta/util.h>
|
||||
#include <meta/errors.h>
|
||||
|
||||
#include <cogl/cogl.h>
|
||||
#include <cogl/cogl-wayland-server.h>
|
||||
#include <clutter/clutter.h>
|
||||
#include <gbm.h>
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
#include <gdk/gdkx.h>
|
||||
|
||||
#include <X11/cursorfont.h>
|
||||
#include <X11/extensions/Xfixes.h>
|
||||
@ -42,19 +46,64 @@
|
||||
|
||||
#include "meta-cursor-tracker-private.h"
|
||||
#include "screen-private.h"
|
||||
#include "meta-wayland-private.h"
|
||||
#include "monitor-private.h"
|
||||
|
||||
#define META_WAYLAND_DEFAULT_CURSOR_HOTSPOT_X 7
|
||||
#define META_WAYLAND_DEFAULT_CURSOR_HOTSPOT_Y 4
|
||||
|
||||
typedef struct {
|
||||
CoglTexture2D *texture;
|
||||
struct gbm_bo *bo;
|
||||
int hot_x, hot_y;
|
||||
|
||||
int ref_count;
|
||||
} MetaCursorReference;
|
||||
|
||||
struct _MetaCursorTracker {
|
||||
GObject parent_instance;
|
||||
|
||||
MetaScreen *screen;
|
||||
|
||||
gboolean is_showing;
|
||||
gboolean has_hw_cursor;
|
||||
|
||||
CoglTexture2D *sprite;
|
||||
int hot_x, hot_y;
|
||||
/* The cursor tracker stores the cursor for the current grab
|
||||
* operation, the cursor for the window with pointer focus, and
|
||||
* the cursor for the root window, which contains either the
|
||||
* default arrow cursor or the 'busy' hourglass if we're launching
|
||||
* an app.
|
||||
*
|
||||
* We choose the first one available -- if there's a grab cursor,
|
||||
* we choose that cursor, if there's window cursor, we choose that,
|
||||
* otherwise we choose the root cursor.
|
||||
*
|
||||
* The displayed_cursor contains the chosen cursor.
|
||||
*/
|
||||
MetaCursorReference *displayed_cursor;
|
||||
|
||||
MetaCursorReference *grab_cursor;
|
||||
|
||||
/* Wayland clients can set a NULL buffer as their cursor
|
||||
* explicitly, which means that we shouldn't display anything.
|
||||
* So, we can't simply store a NULL in window_cursor to
|
||||
* determine an unset window cursor; we need an extra boolean.
|
||||
*/
|
||||
gboolean has_window_cursor;
|
||||
MetaCursorReference *window_cursor;
|
||||
|
||||
MetaCursorReference *root_cursor;
|
||||
|
||||
MetaCursorReference *default_cursors[META_CURSOR_LAST];
|
||||
|
||||
int current_x, current_y;
|
||||
MetaRectangle current_rect;
|
||||
MetaRectangle previous_rect;
|
||||
gboolean previous_is_valid;
|
||||
|
||||
CoglPipeline *pipeline;
|
||||
int drm_fd;
|
||||
struct gbm_device *gbm;
|
||||
};
|
||||
|
||||
struct _MetaCursorTrackerClass {
|
||||
@ -70,6 +119,35 @@ enum {
|
||||
|
||||
static guint signals[LAST_SIGNAL];
|
||||
|
||||
static void meta_cursor_tracker_set_crtc_has_hw_cursor (MetaCursorTracker *tracker,
|
||||
MetaCRTC *crtc,
|
||||
gboolean has_hw_cursor);
|
||||
static void sync_cursor (MetaCursorTracker *tracker);
|
||||
|
||||
static MetaCursorReference *
|
||||
meta_cursor_reference_ref (MetaCursorReference *self)
|
||||
{
|
||||
g_assert (self->ref_count > 0);
|
||||
self->ref_count++;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_cursor_reference_unref (MetaCursorReference *self)
|
||||
{
|
||||
self->ref_count--;
|
||||
|
||||
if (self->ref_count == 0)
|
||||
{
|
||||
cogl_object_unref (self->texture);
|
||||
if (self->bo)
|
||||
gbm_bo_destroy (self->bo);
|
||||
|
||||
g_slice_free (MetaCursorReference, self);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
translate_meta_cursor (MetaCursor cursor,
|
||||
guint *glyph_out,
|
||||
@ -170,14 +248,244 @@ meta_display_create_x_cursor (MetaDisplay *display,
|
||||
return load_cursor_on_server (display, cursor);
|
||||
}
|
||||
|
||||
static XcursorImage *
|
||||
load_cursor_on_client (MetaDisplay *display,
|
||||
MetaCursor cursor)
|
||||
{
|
||||
XcursorImage *image;
|
||||
guint glyph;
|
||||
const char *name;
|
||||
const char *theme = XcursorGetTheme (display->xdisplay);
|
||||
int size = XcursorGetDefaultSize (display->xdisplay);
|
||||
|
||||
translate_meta_cursor (cursor, &glyph, &name);
|
||||
|
||||
if (name != NULL)
|
||||
image = XcursorLibraryLoadImage (name, theme, size);
|
||||
else
|
||||
image = XcursorShapeLoadImage (glyph, theme, size);
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
static MetaCursorReference *
|
||||
meta_cursor_reference_from_theme (MetaCursorTracker *tracker,
|
||||
MetaCursor cursor)
|
||||
{
|
||||
XcursorImage *image;
|
||||
int width, height, rowstride;
|
||||
CoglPixelFormat cogl_format;
|
||||
uint32_t gbm_format;
|
||||
ClutterBackend *clutter_backend;
|
||||
CoglContext *cogl_context;
|
||||
MetaCursorReference *self;
|
||||
|
||||
image = load_cursor_on_client (tracker->screen->display, cursor);
|
||||
if (!image)
|
||||
return NULL;
|
||||
|
||||
width = image->width;
|
||||
height = image->height;
|
||||
rowstride = width * 4;
|
||||
|
||||
gbm_format = GBM_FORMAT_ARGB8888;
|
||||
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
|
||||
cogl_format = COGL_PIXEL_FORMAT_BGRA_8888;
|
||||
#else
|
||||
cogl_format = COGL_PIXEL_FORMAT_ARGB_8888;
|
||||
#endif
|
||||
|
||||
self = g_slice_new0 (MetaCursorReference);
|
||||
self->ref_count = 1;
|
||||
self->hot_x = image->xhot;
|
||||
self->hot_y = image->yhot;
|
||||
|
||||
clutter_backend = clutter_get_default_backend ();
|
||||
cogl_context = clutter_backend_get_cogl_context (clutter_backend);
|
||||
self->texture = cogl_texture_2d_new_from_data (cogl_context,
|
||||
width, height,
|
||||
cogl_format,
|
||||
rowstride,
|
||||
(uint8_t*)image->pixels,
|
||||
NULL);
|
||||
|
||||
if (tracker->gbm)
|
||||
{
|
||||
if (width > 64 || height > 64)
|
||||
{
|
||||
meta_warning ("Invalid theme cursor size (must be at most 64x64)\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (gbm_device_is_format_supported (tracker->gbm, gbm_format,
|
||||
GBM_BO_USE_CURSOR_64X64 | GBM_BO_USE_WRITE))
|
||||
{
|
||||
uint32_t buf[64 * 64];
|
||||
int i;
|
||||
|
||||
self->bo = gbm_bo_create (tracker->gbm, 64, 64,
|
||||
gbm_format, GBM_BO_USE_CURSOR_64X64 | GBM_BO_USE_WRITE);
|
||||
|
||||
memset (buf, 0, sizeof(buf));
|
||||
for (i = 0; i < height; i++)
|
||||
memcpy (buf + i * 64, image->pixels + i * width, width * 4);
|
||||
|
||||
gbm_bo_write (self->bo, buf, 64 * 64 * 4);
|
||||
}
|
||||
else
|
||||
meta_warning ("HW cursor for format %d not supported\n", gbm_format);
|
||||
}
|
||||
|
||||
out:
|
||||
XcursorImageDestroy (image);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static MetaCursorReference *
|
||||
meta_cursor_reference_take_texture (CoglTexture2D *texture)
|
||||
{
|
||||
MetaCursorReference *self;
|
||||
|
||||
self = g_slice_new0 (MetaCursorReference);
|
||||
self->ref_count = 1;
|
||||
|
||||
self->texture = texture;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static MetaCursorReference *
|
||||
meta_cursor_reference_from_buffer (MetaCursorTracker *tracker,
|
||||
struct wl_resource *buffer,
|
||||
int hot_x,
|
||||
int hot_y)
|
||||
{
|
||||
ClutterBackend *backend;
|
||||
CoglContext *cogl_context;
|
||||
MetaCursorReference *self;
|
||||
CoglPixelFormat cogl_format;
|
||||
struct wl_shm_buffer *shm_buffer;
|
||||
uint32_t gbm_format;
|
||||
|
||||
self = g_slice_new0 (MetaCursorReference);
|
||||
self->ref_count = 1;
|
||||
self->hot_x = hot_x;
|
||||
self->hot_y = hot_y;
|
||||
|
||||
backend = clutter_get_default_backend ();
|
||||
cogl_context = clutter_backend_get_cogl_context (backend);
|
||||
|
||||
shm_buffer = wl_shm_buffer_get (buffer);
|
||||
if (shm_buffer)
|
||||
{
|
||||
int rowstride = wl_shm_buffer_get_stride (shm_buffer);
|
||||
int width = wl_shm_buffer_get_width (shm_buffer);
|
||||
int height = wl_shm_buffer_get_height (shm_buffer);
|
||||
|
||||
switch (wl_shm_buffer_get_format (shm_buffer))
|
||||
{
|
||||
#if G_BYTE_ORDER == G_BIG_ENDIAN
|
||||
case WL_SHM_FORMAT_ARGB8888:
|
||||
cogl_format = COGL_PIXEL_FORMAT_ARGB_8888_PRE;
|
||||
gbm_format = GBM_FORMAT_ARGB8888;
|
||||
break;
|
||||
case WL_SHM_FORMAT_XRGB8888:
|
||||
cogl_format = COGL_PIXEL_FORMAT_ARGB_8888;
|
||||
gbm_format = GBM_FORMAT_XRGB8888;
|
||||
break;
|
||||
#else
|
||||
case WL_SHM_FORMAT_ARGB8888:
|
||||
cogl_format = COGL_PIXEL_FORMAT_BGRA_8888_PRE;
|
||||
gbm_format = GBM_FORMAT_ARGB8888;
|
||||
break;
|
||||
case WL_SHM_FORMAT_XRGB8888:
|
||||
cogl_format = COGL_PIXEL_FORMAT_BGRA_8888;
|
||||
gbm_format = GBM_FORMAT_XRGB8888;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
g_warn_if_reached ();
|
||||
cogl_format = COGL_PIXEL_FORMAT_ARGB_8888;
|
||||
gbm_format = GBM_FORMAT_ARGB8888;
|
||||
}
|
||||
|
||||
self->texture = cogl_texture_2d_new_from_data (cogl_context,
|
||||
width, height,
|
||||
cogl_format,
|
||||
rowstride,
|
||||
wl_shm_buffer_get_data (shm_buffer),
|
||||
NULL);
|
||||
|
||||
if (width > 64 || height > 64)
|
||||
{
|
||||
meta_warning ("Invalid cursor size (must be at most 64x64), falling back to software (GL) cursors\n");
|
||||
return self;
|
||||
}
|
||||
|
||||
if (tracker->gbm)
|
||||
{
|
||||
if (gbm_device_is_format_supported (tracker->gbm, gbm_format,
|
||||
GBM_BO_USE_CURSOR_64X64 | GBM_BO_USE_WRITE))
|
||||
{
|
||||
uint8_t *data;
|
||||
uint8_t buf[4 * 64 * 64];
|
||||
int i;
|
||||
|
||||
self->bo = gbm_bo_create (tracker->gbm, 64, 64,
|
||||
gbm_format, GBM_BO_USE_CURSOR_64X64 | GBM_BO_USE_WRITE);
|
||||
|
||||
data = wl_shm_buffer_get_data (shm_buffer);
|
||||
memset (buf, 0, sizeof(buf));
|
||||
for (i = 0; i < height; i++)
|
||||
memcpy (buf + i * 4 * 64, data + i * rowstride, 4 * width);
|
||||
|
||||
gbm_bo_write (self->bo, buf, 64 * 64 * 4);
|
||||
}
|
||||
else
|
||||
meta_warning ("HW cursor for format %d not supported\n", gbm_format);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int width, height;
|
||||
|
||||
self->texture = cogl_wayland_texture_2d_new_from_buffer (cogl_context, buffer, NULL);
|
||||
width = cogl_texture_get_width (COGL_TEXTURE (self->texture));
|
||||
height = cogl_texture_get_height (COGL_TEXTURE (self->texture));
|
||||
|
||||
/* HW cursors must be 64x64, but 64x64 is huge, and no cursor theme actually uses
|
||||
that, so themed cursors must be padded with transparent pixels to fill the
|
||||
overlay. This is trivial if we have CPU access to the data, but it's not
|
||||
possible if the buffer is in GPU memory (and possibly tiled too), so if we
|
||||
don't get the right size, we fallback to GL.
|
||||
*/
|
||||
if (width != 64 || height != 64)
|
||||
{
|
||||
meta_warning ("Invalid cursor size (must be 64x64), falling back to software (GL) cursors\n");
|
||||
return self;
|
||||
}
|
||||
|
||||
if (tracker->gbm)
|
||||
{
|
||||
self->bo = gbm_bo_import (tracker->gbm, GBM_BO_IMPORT_WL_BUFFER,
|
||||
buffer, GBM_BO_USE_CURSOR_64X64);
|
||||
if (!self->bo)
|
||||
meta_warning ("Importing HW cursor from wl_buffer failed\n");
|
||||
}
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_cursor_tracker_init (MetaCursorTracker *self)
|
||||
{
|
||||
/* (JS) Best (?) that can be assumed since XFixes doesn't provide a way of
|
||||
* detecting if the system mouse cursor is showing or not.
|
||||
*
|
||||
* On wayland we start with the cursor showing
|
||||
*/
|
||||
detecting if the system mouse cursor is showing or not.
|
||||
|
||||
On wayland we start with the cursor showing
|
||||
*/
|
||||
self->is_showing = TRUE;
|
||||
}
|
||||
|
||||
@ -185,9 +493,21 @@ static void
|
||||
meta_cursor_tracker_finalize (GObject *object)
|
||||
{
|
||||
MetaCursorTracker *self = META_CURSOR_TRACKER (object);
|
||||
int i;
|
||||
|
||||
if (self->sprite)
|
||||
cogl_object_unref (self->sprite);
|
||||
if (self->displayed_cursor)
|
||||
meta_cursor_reference_unref (self->displayed_cursor);
|
||||
if (self->root_cursor)
|
||||
meta_cursor_reference_unref (self->root_cursor);
|
||||
|
||||
for (i = 0; i < META_CURSOR_LAST; i++)
|
||||
if (self->default_cursors[i])
|
||||
meta_cursor_reference_unref (self->default_cursors[i]);
|
||||
|
||||
if (self->pipeline)
|
||||
cogl_object_unref (self->pipeline);
|
||||
if (self->gbm)
|
||||
gbm_device_destroy (self->gbm);
|
||||
|
||||
G_OBJECT_CLASS (meta_cursor_tracker_parent_class)->finalize (object);
|
||||
}
|
||||
@ -207,6 +527,65 @@ meta_cursor_tracker_class_init (MetaCursorTrackerClass *klass)
|
||||
G_TYPE_NONE, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
on_monitors_changed (MetaMonitorManager *monitors,
|
||||
MetaCursorTracker *tracker)
|
||||
{
|
||||
MetaCRTC *crtcs;
|
||||
unsigned int i, n_crtcs;
|
||||
|
||||
if (!tracker->has_hw_cursor)
|
||||
return;
|
||||
|
||||
/* Go through the new list of monitors, find out where the cursor is */
|
||||
meta_monitor_manager_get_resources (monitors, NULL, NULL, &crtcs, &n_crtcs, NULL, NULL);
|
||||
|
||||
for (i = 0; i < n_crtcs; i++)
|
||||
{
|
||||
MetaRectangle *rect = &crtcs[i].rect;
|
||||
gboolean has;
|
||||
|
||||
has = meta_rectangle_overlap (&tracker->current_rect, rect);
|
||||
|
||||
/* Need to do it unconditionally here, our tracking is
|
||||
wrong because we reloaded the CRTCs */
|
||||
meta_cursor_tracker_set_crtc_has_hw_cursor (tracker, &crtcs[i], has);
|
||||
}
|
||||
}
|
||||
|
||||
static MetaCursorTracker *
|
||||
make_wayland_cursor_tracker (MetaScreen *screen)
|
||||
{
|
||||
MetaWaylandCompositor *compositor;
|
||||
CoglContext *ctx;
|
||||
MetaMonitorManager *monitors;
|
||||
MetaCursorTracker *self;
|
||||
|
||||
self = g_object_new (META_TYPE_CURSOR_TRACKER, NULL);
|
||||
self->screen = screen;
|
||||
|
||||
ctx = clutter_backend_get_cogl_context (clutter_get_default_backend ());
|
||||
self->pipeline = cogl_pipeline_new (ctx);
|
||||
|
||||
compositor = meta_wayland_compositor_get_default ();
|
||||
compositor->seat->cursor_tracker = self;
|
||||
|
||||
#if defined(CLUTTER_WINDOWING_EGL)
|
||||
if (clutter_check_windowing_backend (CLUTTER_WINDOWING_EGL))
|
||||
{
|
||||
CoglRenderer *cogl_renderer = cogl_display_get_renderer (cogl_context_get_display (ctx));
|
||||
self->drm_fd = cogl_kms_renderer_get_kms_fd (cogl_renderer);
|
||||
self->gbm = gbm_create_device (self->drm_fd);
|
||||
}
|
||||
#endif
|
||||
|
||||
monitors = meta_monitor_manager_get ();
|
||||
g_signal_connect_object (monitors, "monitors-changed",
|
||||
G_CALLBACK (on_monitors_changed), self, 0);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
static MetaCursorTracker *
|
||||
make_x11_cursor_tracker (MetaScreen *screen)
|
||||
{
|
||||
@ -236,18 +615,36 @@ meta_cursor_tracker_get_for_screen (MetaScreen *screen)
|
||||
if (screen->cursor_tracker)
|
||||
return screen->cursor_tracker;
|
||||
|
||||
self = make_x11_cursor_tracker (screen);
|
||||
if (meta_is_wayland_compositor ())
|
||||
self = make_wayland_cursor_tracker (screen);
|
||||
else
|
||||
self = make_x11_cursor_tracker (screen);
|
||||
|
||||
screen->cursor_tracker = self;
|
||||
return self;
|
||||
}
|
||||
|
||||
static void
|
||||
set_window_cursor (MetaCursorTracker *tracker,
|
||||
gboolean has_cursor,
|
||||
MetaCursorReference *cursor)
|
||||
{
|
||||
g_clear_pointer (&tracker->window_cursor, meta_cursor_reference_unref);
|
||||
if (cursor)
|
||||
tracker->window_cursor = meta_cursor_reference_ref (cursor);
|
||||
tracker->has_window_cursor = has_cursor;
|
||||
sync_cursor (tracker);
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_cursor_tracker_handle_xevent (MetaCursorTracker *tracker,
|
||||
XEvent *xevent)
|
||||
{
|
||||
XFixesCursorNotifyEvent *notify_event;
|
||||
|
||||
if (meta_is_wayland_compositor ())
|
||||
return FALSE;
|
||||
|
||||
if (xevent->xany.type != tracker->screen->display->xfixes_event_base + XFixesCursorNotify)
|
||||
return FALSE;
|
||||
|
||||
@ -255,8 +652,7 @@ meta_cursor_tracker_handle_xevent (MetaCursorTracker *tracker,
|
||||
if (notify_event->subtype != XFixesDisplayCursorNotify)
|
||||
return FALSE;
|
||||
|
||||
g_clear_pointer (&tracker->sprite, cogl_object_unref);
|
||||
g_signal_emit (tracker, signals[CURSOR_CHANGED], 0);
|
||||
set_window_cursor (tracker, FALSE, NULL);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -270,7 +666,7 @@ ensure_xfixes_cursor (MetaCursorTracker *tracker)
|
||||
gboolean free_cursor_data;
|
||||
CoglContext *ctx;
|
||||
|
||||
if (tracker->sprite)
|
||||
if (tracker->has_window_cursor)
|
||||
return;
|
||||
|
||||
cursor_image = XFixesGetCursorImage (tracker->screen->display->xdisplay);
|
||||
@ -317,9 +713,11 @@ ensure_xfixes_cursor (MetaCursorTracker *tracker)
|
||||
|
||||
if (sprite != NULL)
|
||||
{
|
||||
tracker->sprite = sprite;
|
||||
tracker->hot_x = cursor_image->xhot;
|
||||
tracker->hot_y = cursor_image->yhot;
|
||||
MetaCursorReference *cursor = meta_cursor_reference_take_texture (sprite);
|
||||
cursor->hot_x = cursor_image->xhot;
|
||||
cursor->hot_y = cursor_image->yhot;
|
||||
|
||||
set_window_cursor (tracker, TRUE, cursor);
|
||||
}
|
||||
XFree (cursor_image);
|
||||
}
|
||||
@ -334,9 +732,13 @@ meta_cursor_tracker_get_sprite (MetaCursorTracker *tracker)
|
||||
{
|
||||
g_return_val_if_fail (META_IS_CURSOR_TRACKER (tracker), NULL);
|
||||
|
||||
ensure_xfixes_cursor (tracker);
|
||||
if (!meta_is_wayland_compositor ())
|
||||
ensure_xfixes_cursor (tracker);
|
||||
|
||||
return COGL_TEXTURE (tracker->sprite);
|
||||
if (tracker->displayed_cursor)
|
||||
return COGL_TEXTURE (tracker->displayed_cursor->texture);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -353,12 +755,70 @@ meta_cursor_tracker_get_hot (MetaCursorTracker *tracker,
|
||||
{
|
||||
g_return_if_fail (META_IS_CURSOR_TRACKER (tracker));
|
||||
|
||||
ensure_xfixes_cursor (tracker);
|
||||
if (!meta_is_wayland_compositor ())
|
||||
ensure_xfixes_cursor (tracker);
|
||||
|
||||
if (x)
|
||||
*x = tracker->hot_x;
|
||||
if (y)
|
||||
*y = tracker->hot_y;
|
||||
if (tracker->displayed_cursor)
|
||||
{
|
||||
MetaCursorReference *displayed_cursor = tracker->displayed_cursor;
|
||||
if (x)
|
||||
*x = displayed_cursor->hot_x;
|
||||
if (y)
|
||||
*y = displayed_cursor->hot_y;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (x)
|
||||
*x = 0;
|
||||
if (y)
|
||||
*y = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static MetaCursorReference *
|
||||
ensure_wayland_cursor (MetaCursorTracker *tracker,
|
||||
MetaCursor cursor)
|
||||
{
|
||||
if (!tracker->default_cursors[cursor])
|
||||
{
|
||||
tracker->default_cursors[cursor] = meta_cursor_reference_from_theme (tracker, cursor);
|
||||
if (!tracker->default_cursors[cursor])
|
||||
meta_warning ("Failed to load cursor from theme\n");
|
||||
}
|
||||
|
||||
return meta_cursor_reference_ref (tracker->default_cursors[cursor]);
|
||||
}
|
||||
|
||||
void
|
||||
meta_cursor_tracker_set_grab_cursor (MetaCursorTracker *tracker,
|
||||
MetaCursor cursor)
|
||||
{
|
||||
g_clear_pointer (&tracker->grab_cursor, meta_cursor_reference_unref);
|
||||
if (cursor != META_CURSOR_DEFAULT)
|
||||
tracker->grab_cursor = ensure_wayland_cursor (tracker, cursor);
|
||||
sync_cursor (tracker);
|
||||
}
|
||||
|
||||
void
|
||||
meta_cursor_tracker_set_window_cursor (MetaCursorTracker *tracker,
|
||||
struct wl_resource *buffer,
|
||||
int hot_x,
|
||||
int hot_y)
|
||||
{
|
||||
MetaCursorReference *cursor;
|
||||
|
||||
if (buffer)
|
||||
cursor = meta_cursor_reference_from_buffer (tracker, buffer, hot_x, hot_y);
|
||||
else
|
||||
cursor = NULL;
|
||||
|
||||
set_window_cursor (tracker, TRUE, cursor);
|
||||
}
|
||||
|
||||
void
|
||||
meta_cursor_tracker_unset_window_cursor (MetaCursorTracker *tracker)
|
||||
{
|
||||
set_window_cursor (tracker, FALSE, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
@ -374,6 +834,270 @@ meta_cursor_tracker_set_root_cursor (MetaCursorTracker *tracker,
|
||||
XDefineCursor (display->xdisplay, tracker->screen->xroot, xcursor);
|
||||
XFlush (display->xdisplay);
|
||||
XFreeCursor (display->xdisplay, xcursor);
|
||||
|
||||
/* Now update the real root cursor */
|
||||
if (meta_is_wayland_compositor ())
|
||||
{
|
||||
g_clear_pointer (&tracker->root_cursor, meta_cursor_reference_unref);
|
||||
tracker->root_cursor = ensure_wayland_cursor (tracker, cursor);
|
||||
sync_cursor (tracker);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
update_hw_cursor (MetaCursorTracker *tracker)
|
||||
{
|
||||
MetaMonitorManager *monitors;
|
||||
MetaCRTC *crtcs;
|
||||
unsigned int i, n_crtcs;
|
||||
gboolean enabled;
|
||||
|
||||
enabled = tracker->displayed_cursor && tracker->displayed_cursor->bo != NULL;
|
||||
tracker->has_hw_cursor = enabled;
|
||||
|
||||
monitors = meta_monitor_manager_get ();
|
||||
meta_monitor_manager_get_resources (monitors, NULL, NULL, &crtcs, &n_crtcs, NULL, NULL);
|
||||
|
||||
for (i = 0; i < n_crtcs; i++)
|
||||
{
|
||||
MetaRectangle *rect = &crtcs[i].rect;
|
||||
gboolean has;
|
||||
|
||||
has = enabled && meta_rectangle_overlap (&tracker->current_rect, rect);
|
||||
|
||||
if (has || crtcs[i].has_hw_cursor)
|
||||
meta_cursor_tracker_set_crtc_has_hw_cursor (tracker, &crtcs[i], has);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
move_hw_cursor (MetaCursorTracker *tracker)
|
||||
{
|
||||
MetaMonitorManager *monitors;
|
||||
MetaCRTC *crtcs;
|
||||
unsigned int i, n_crtcs;
|
||||
|
||||
monitors = meta_monitor_manager_get ();
|
||||
meta_monitor_manager_get_resources (monitors, NULL, NULL, &crtcs, &n_crtcs, NULL, NULL);
|
||||
|
||||
g_assert (tracker->has_hw_cursor);
|
||||
|
||||
for (i = 0; i < n_crtcs; i++)
|
||||
{
|
||||
MetaRectangle *rect = &crtcs[i].rect;
|
||||
gboolean has;
|
||||
|
||||
has = meta_rectangle_overlap (&tracker->current_rect, rect);
|
||||
|
||||
if (has != crtcs[i].has_hw_cursor)
|
||||
meta_cursor_tracker_set_crtc_has_hw_cursor (tracker, &crtcs[i], has);
|
||||
if (has)
|
||||
drmModeMoveCursor (tracker->drm_fd, crtcs[i].crtc_id,
|
||||
tracker->current_rect.x - rect->x,
|
||||
tracker->current_rect.y - rect->y);
|
||||
}
|
||||
}
|
||||
|
||||
static MetaCursorReference *
|
||||
get_displayed_cursor (MetaCursorTracker *tracker)
|
||||
{
|
||||
if (!tracker->is_showing)
|
||||
return NULL;
|
||||
|
||||
if (tracker->grab_cursor)
|
||||
return tracker->grab_cursor;
|
||||
|
||||
if (tracker->has_window_cursor)
|
||||
return tracker->window_cursor;
|
||||
|
||||
return tracker->root_cursor;
|
||||
}
|
||||
|
||||
static void
|
||||
sync_displayed_cursor (MetaCursorTracker *tracker)
|
||||
{
|
||||
MetaCursorReference *displayed_cursor = get_displayed_cursor (tracker);
|
||||
|
||||
if (tracker->displayed_cursor == displayed_cursor)
|
||||
return;
|
||||
|
||||
g_clear_pointer (&tracker->displayed_cursor, meta_cursor_reference_unref);
|
||||
if (displayed_cursor)
|
||||
tracker->displayed_cursor = meta_cursor_reference_ref (displayed_cursor);
|
||||
|
||||
if (meta_is_wayland_compositor ())
|
||||
{
|
||||
if (displayed_cursor)
|
||||
cogl_pipeline_set_layer_texture (tracker->pipeline, 0, COGL_TEXTURE (displayed_cursor->texture));
|
||||
else
|
||||
cogl_pipeline_set_layer_texture (tracker->pipeline, 0, NULL);
|
||||
|
||||
update_hw_cursor (tracker);
|
||||
}
|
||||
|
||||
g_signal_emit (tracker, signals[CURSOR_CHANGED], 0);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_cursor_tracker_queue_redraw (MetaCursorTracker *tracker)
|
||||
{
|
||||
MetaWaylandCompositor *compositor = meta_wayland_compositor_get_default ();
|
||||
ClutterActor *stage = compositor->stage;
|
||||
cairo_rectangle_int_t clip;
|
||||
|
||||
g_assert (meta_is_wayland_compositor ());
|
||||
|
||||
if (tracker->previous_is_valid)
|
||||
{
|
||||
cairo_rectangle_int_t clip = {
|
||||
.x = tracker->previous_rect.x,
|
||||
.y = tracker->previous_rect.y,
|
||||
.width = tracker->previous_rect.width,
|
||||
.height = tracker->previous_rect.height
|
||||
};
|
||||
clutter_actor_queue_redraw_with_clip (stage, &clip);
|
||||
tracker->previous_is_valid = FALSE;
|
||||
}
|
||||
|
||||
if (tracker->has_hw_cursor || !tracker->displayed_cursor)
|
||||
return;
|
||||
|
||||
clip.x = tracker->current_rect.x;
|
||||
clip.y = tracker->current_rect.y;
|
||||
clip.width = tracker->current_rect.width;
|
||||
clip.height = tracker->current_rect.height;
|
||||
clutter_actor_queue_redraw_with_clip (stage, &clip);
|
||||
}
|
||||
|
||||
static void
|
||||
sync_cursor (MetaCursorTracker *tracker)
|
||||
{
|
||||
MetaCursorReference *displayed_cursor;
|
||||
|
||||
sync_displayed_cursor (tracker);
|
||||
displayed_cursor = tracker->displayed_cursor;
|
||||
|
||||
if (displayed_cursor)
|
||||
{
|
||||
tracker->current_rect.x = tracker->current_x - displayed_cursor->hot_x;
|
||||
tracker->current_rect.y = tracker->current_y - displayed_cursor->hot_y;
|
||||
tracker->current_rect.width = cogl_texture_get_width (COGL_TEXTURE (displayed_cursor->texture));
|
||||
tracker->current_rect.height = cogl_texture_get_height (COGL_TEXTURE (displayed_cursor->texture));
|
||||
}
|
||||
else
|
||||
{
|
||||
tracker->current_rect.x = 0;
|
||||
tracker->current_rect.y = 0;
|
||||
tracker->current_rect.width = 0;
|
||||
tracker->current_rect.height = 0;
|
||||
}
|
||||
|
||||
if (meta_is_wayland_compositor ())
|
||||
{
|
||||
if (tracker->has_hw_cursor)
|
||||
move_hw_cursor (tracker);
|
||||
else
|
||||
meta_cursor_tracker_queue_redraw (tracker);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
meta_cursor_tracker_update_position (MetaCursorTracker *tracker,
|
||||
int new_x,
|
||||
int new_y)
|
||||
{
|
||||
g_assert (meta_is_wayland_compositor ());
|
||||
|
||||
tracker->current_x = new_x;
|
||||
tracker->current_y = new_y;
|
||||
|
||||
sync_cursor (tracker);
|
||||
}
|
||||
|
||||
void
|
||||
meta_cursor_tracker_paint (MetaCursorTracker *tracker)
|
||||
{
|
||||
g_assert (meta_is_wayland_compositor ());
|
||||
|
||||
if (tracker->has_hw_cursor || !tracker->displayed_cursor)
|
||||
return;
|
||||
|
||||
cogl_framebuffer_draw_rectangle (cogl_get_draw_framebuffer (),
|
||||
tracker->pipeline,
|
||||
tracker->current_rect.x,
|
||||
tracker->current_rect.y,
|
||||
tracker->current_rect.x +
|
||||
tracker->current_rect.width,
|
||||
tracker->current_rect.y +
|
||||
tracker->current_rect.height);
|
||||
|
||||
tracker->previous_rect = tracker->current_rect;
|
||||
tracker->previous_is_valid = TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_cursor_tracker_set_crtc_has_hw_cursor (MetaCursorTracker *tracker,
|
||||
MetaCRTC *crtc,
|
||||
gboolean has)
|
||||
{
|
||||
if (has)
|
||||
{
|
||||
MetaCursorReference *displayed_cursor = tracker->displayed_cursor;
|
||||
union gbm_bo_handle handle;
|
||||
int width, height;
|
||||
int hot_x, hot_y;
|
||||
|
||||
handle = gbm_bo_get_handle (displayed_cursor->bo);
|
||||
width = gbm_bo_get_width (displayed_cursor->bo);
|
||||
height = gbm_bo_get_height (displayed_cursor->bo);
|
||||
hot_x = displayed_cursor->hot_x;
|
||||
hot_y = displayed_cursor->hot_y;
|
||||
|
||||
drmModeSetCursor2 (tracker->drm_fd, crtc->crtc_id, handle.u32,
|
||||
width, height, hot_x, hot_y);
|
||||
crtc->has_hw_cursor = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
drmModeSetCursor2 (tracker->drm_fd, crtc->crtc_id, 0, 0, 0, 0, 0);
|
||||
crtc->has_hw_cursor = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
get_pointer_position_gdk (int *x,
|
||||
int *y,
|
||||
int *mods)
|
||||
{
|
||||
GdkDeviceManager *gmanager;
|
||||
GdkDevice *gdevice;
|
||||
GdkScreen *gscreen;
|
||||
|
||||
gmanager = gdk_display_get_device_manager (gdk_display_get_default ());
|
||||
gdevice = gdk_device_manager_get_client_pointer (gmanager);
|
||||
|
||||
gdk_device_get_position (gdevice, &gscreen, x, y);
|
||||
gdk_device_get_state (gdevice,
|
||||
gdk_screen_get_root_window (gscreen),
|
||||
NULL, (GdkModifierType*)mods);
|
||||
}
|
||||
|
||||
static void
|
||||
get_pointer_position_clutter (int *x,
|
||||
int *y,
|
||||
int *mods)
|
||||
{
|
||||
ClutterDeviceManager *cmanager;
|
||||
ClutterInputDevice *cdevice;
|
||||
ClutterPoint point;
|
||||
|
||||
cmanager = clutter_device_manager_get_default ();
|
||||
cdevice = clutter_device_manager_get_core_device (cmanager, CLUTTER_POINTER_DEVICE);
|
||||
|
||||
clutter_input_device_get_coords (cdevice, NULL, &point);
|
||||
*x = point.x;
|
||||
*y = point.y;
|
||||
*mods = clutter_input_device_get_modifier_state (cdevice);
|
||||
}
|
||||
|
||||
void
|
||||
@ -382,17 +1106,15 @@ meta_cursor_tracker_get_pointer (MetaCursorTracker *tracker,
|
||||
int *y,
|
||||
ClutterModifierType *mods)
|
||||
{
|
||||
GdkDeviceManager *gmanager;
|
||||
GdkDevice *gdevice;
|
||||
GdkScreen *gscreen;
|
||||
|
||||
gmanager = gdk_display_get_device_manager (gdk_display_get_default ());
|
||||
gdevice = gdk_x11_device_manager_lookup (gmanager, META_VIRTUAL_CORE_POINTER_ID);
|
||||
|
||||
gdk_device_get_position (gdevice, &gscreen, x, y);
|
||||
gdk_device_get_state (gdevice,
|
||||
gdk_screen_get_root_window (gscreen),
|
||||
NULL, (GdkModifierType*)mods);
|
||||
/* We can't use the clutter interface when not running as a wayland compositor,
|
||||
because we need to query the server, rather than using the last cached value.
|
||||
OTOH, on wayland we can't use GDK, because that only sees the events
|
||||
we forward to xwayland.
|
||||
*/
|
||||
if (meta_is_wayland_compositor ())
|
||||
get_pointer_position_clutter (x, y, (int*)mods);
|
||||
else
|
||||
get_pointer_position_gdk (x, y, (int*)mods);
|
||||
}
|
||||
|
||||
void
|
||||
@ -403,10 +1125,17 @@ meta_cursor_tracker_set_pointer_visible (MetaCursorTracker *tracker,
|
||||
return;
|
||||
tracker->is_showing = visible;
|
||||
|
||||
if (visible)
|
||||
XFixesShowCursor (tracker->screen->display->xdisplay,
|
||||
tracker->screen->xroot);
|
||||
if (meta_is_wayland_compositor ())
|
||||
{
|
||||
sync_cursor (tracker);
|
||||
}
|
||||
else
|
||||
XFixesHideCursor (tracker->screen->display->xdisplay,
|
||||
tracker->screen->xroot);
|
||||
{
|
||||
if (visible)
|
||||
XFixesShowCursor (tracker->screen->display->xdisplay,
|
||||
tracker->screen->xroot);
|
||||
else
|
||||
XFixesHideCursor (tracker->screen->display->xdisplay,
|
||||
tracker->screen->xroot);
|
||||
}
|
||||
}
|
||||
|
@ -24,5 +24,6 @@
|
||||
|
||||
void meta_idle_monitor_handle_xevent_all (XEvent *xevent);
|
||||
|
||||
void meta_idle_monitor_reset_idletime (MetaIdleMonitor *monitor);
|
||||
|
||||
void meta_idle_monitor_init_dbus (void);
|
||||
|
@ -55,6 +55,9 @@ struct _MetaIdleMonitor
|
||||
int sync_event_base;
|
||||
XSyncCounter counter;
|
||||
XSyncAlarm user_active_alarm;
|
||||
|
||||
/* Wayland implementation */
|
||||
guint64 last_event_time;
|
||||
};
|
||||
|
||||
struct _MetaIdleMonitorClass
|
||||
@ -74,6 +77,9 @@ typedef struct
|
||||
/* x11 */
|
||||
XSyncAlarm xalarm;
|
||||
int idle_source_id;
|
||||
|
||||
/* wayland */
|
||||
GSource *timeout_source;
|
||||
} MetaIdleMonitorWatch;
|
||||
|
||||
enum
|
||||
@ -303,6 +309,9 @@ idle_monitor_watch_free (MetaIdleMonitorWatch *watch)
|
||||
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);
|
||||
}
|
||||
@ -382,8 +391,11 @@ meta_idle_monitor_constructed (GObject *object)
|
||||
{
|
||||
MetaIdleMonitor *monitor = META_IDLE_MONITOR (object);
|
||||
|
||||
monitor->display = meta_get_display ()->xdisplay;
|
||||
init_xsync (monitor);
|
||||
if (!meta_is_wayland_compositor ())
|
||||
{
|
||||
monitor->display = meta_get_display ()->xdisplay;
|
||||
init_xsync (monitor);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@ -462,6 +474,25 @@ meta_idle_monitor_get_for_device (int 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)
|
||||
{
|
||||
@ -490,20 +521,37 @@ make_watch (MetaIdleMonitor *monitor,
|
||||
watch->notify = notify;
|
||||
watch->timeout_msec = timeout_msec;
|
||||
|
||||
if (timeout_msec != 0)
|
||||
if (meta_is_wayland_compositor ())
|
||||
{
|
||||
watch->xalarm = _xsync_alarm_set (monitor, XSyncPositiveTransition, timeout_msec, TRUE);
|
||||
if (timeout_msec != 0)
|
||||
{
|
||||
GSource *source = g_source_new (&wayland_source_funcs, sizeof (GSource));
|
||||
|
||||
g_hash_table_add (monitor->alarms, (gpointer) watch->xalarm);
|
||||
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);
|
||||
|
||||
if (meta_idle_monitor_get_idletime (monitor) > (gint64)timeout_msec)
|
||||
watch->idle_source_id = g_idle_add (fire_watch_idle, watch);
|
||||
watch->timeout_source = source;
|
||||
}
|
||||
}
|
||||
else if (monitor->user_active_alarm != None)
|
||||
{
|
||||
watch->xalarm = monitor->user_active_alarm;
|
||||
if (timeout_msec != 0)
|
||||
{
|
||||
watch->xalarm = _xsync_alarm_set (monitor, XSyncPositiveTransition, timeout_msec, TRUE);
|
||||
|
||||
set_alarm_enabled (monitor->display, monitor->user_active_alarm, 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,
|
||||
@ -605,10 +653,8 @@ meta_idle_monitor_remove_watch (MetaIdleMonitor *monitor,
|
||||
{
|
||||
g_return_if_fail (META_IS_IDLE_MONITOR (monitor));
|
||||
|
||||
g_object_ref (monitor);
|
||||
g_hash_table_remove (monitor->watches,
|
||||
GUINT_TO_POINTER (id));
|
||||
g_object_unref (monitor);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -622,10 +668,69 @@ meta_idle_monitor_get_idletime (MetaIdleMonitor *monitor)
|
||||
{
|
||||
XSyncValue value;
|
||||
|
||||
if (!XSyncQueryCounter (monitor->display, monitor->counter, &value))
|
||||
return -1;
|
||||
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);
|
||||
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
|
||||
@ -778,9 +883,6 @@ create_monitor_skeleton (GDBusObjectManagerServer *manager,
|
||||
meta_dbus_object_skeleton_set_idle_monitor (object, skeleton);
|
||||
|
||||
g_dbus_object_manager_server_export (manager, G_DBUS_OBJECT_SKELETON (object));
|
||||
|
||||
g_object_unref (skeleton);
|
||||
g_object_unref (object);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -77,7 +77,6 @@ struct _MetaMonitorConfig {
|
||||
GHashTable *configs;
|
||||
MetaConfiguration *current;
|
||||
gboolean current_is_stored;
|
||||
gboolean current_is_for_laptop_lid;
|
||||
MetaConfiguration *previous;
|
||||
|
||||
GFile *file;
|
||||
@ -840,9 +839,6 @@ meta_monitor_config_get_stored (MetaMonitorConfig *self,
|
||||
MetaConfiguration key;
|
||||
MetaConfiguration *stored;
|
||||
|
||||
if (n_outputs == 0)
|
||||
return NULL;
|
||||
|
||||
make_config_key (&key, outputs, n_outputs, -1);
|
||||
stored = g_hash_table_lookup (self->configs, &key);
|
||||
|
||||
@ -877,8 +873,7 @@ apply_configuration (MetaMonitorConfig *self,
|
||||
|
||||
/* Stored (persistent) configurations override the previous one always.
|
||||
Also, we clear the previous configuration if the current one (which is
|
||||
about to become previous) is stored, or if the current one has
|
||||
different outputs.
|
||||
about to become previous) is stored.
|
||||
*/
|
||||
if (stored ||
|
||||
(self->current && self->current_is_stored))
|
||||
@ -889,27 +884,11 @@ apply_configuration (MetaMonitorConfig *self,
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Despite the name, config_equal() only checks the set of outputs,
|
||||
not their modes
|
||||
*/
|
||||
if (self->current && config_equal (self->current, config))
|
||||
{
|
||||
self->previous = self->current;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (self->current)
|
||||
config_free (self->current);
|
||||
self->previous = NULL;
|
||||
}
|
||||
self->previous = self->current;
|
||||
}
|
||||
|
||||
self->current = config;
|
||||
self->current_is_stored = stored;
|
||||
/* If true, we'll be overridden at the end of this call
|
||||
inside turn_off_laptop_display()
|
||||
*/
|
||||
self->current_is_for_laptop_lid = FALSE;
|
||||
|
||||
if (self->current == self->previous)
|
||||
self->previous = NULL;
|
||||
@ -1026,16 +1005,8 @@ meta_monitor_config_apply_stored (MetaMonitorConfig *self,
|
||||
if (self->lid_is_closed &&
|
||||
stored->n_outputs > 1 &&
|
||||
laptop_display_is_on (stored))
|
||||
{
|
||||
if (apply_configuration (self, make_laptop_lid_config (stored),
|
||||
manager, FALSE))
|
||||
{
|
||||
self->current_is_for_laptop_lid = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
return apply_configuration (self, make_laptop_lid_config (stored),
|
||||
manager, FALSE);
|
||||
else
|
||||
return apply_configuration (self, stored, manager, TRUE);
|
||||
}
|
||||
@ -1275,12 +1246,6 @@ meta_monitor_config_make_default (MetaMonitorConfig *self,
|
||||
outputs = meta_monitor_manager_get_outputs (manager, &n_outputs);
|
||||
meta_monitor_manager_get_screen_limits (manager, &max_width, &max_height);
|
||||
|
||||
if (n_outputs == 0)
|
||||
{
|
||||
meta_verbose ("No output connected, not applying configuration\n");
|
||||
return;
|
||||
}
|
||||
|
||||
default_config = make_default_config (self, outputs, n_outputs, max_width, max_height);
|
||||
|
||||
if (default_config != NULL)
|
||||
@ -1382,7 +1347,6 @@ turn_off_laptop_display (MetaMonitorConfig *self,
|
||||
|
||||
new = make_laptop_lid_config (self->current);
|
||||
apply_configuration (self, new, manager, FALSE);
|
||||
self->current_is_for_laptop_lid = TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1402,7 +1366,7 @@ power_client_changed_cb (UpClient *client,
|
||||
|
||||
if (is_closed)
|
||||
turn_off_laptop_display (self, manager);
|
||||
else if (self->current_is_for_laptop_lid)
|
||||
else
|
||||
meta_monitor_config_restore_previous (self, manager);
|
||||
}
|
||||
}
|
||||
|
938
src/core/monitor-kms.c
Normal file
938
src/core/monitor-kms.c
Normal file
@ -0,0 +1,938 @@
|
||||
/* -*- 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 < 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;
|
||||
}
|
||||
|
@ -42,9 +42,7 @@
|
||||
#include <meta/screen.h>
|
||||
#include "stack-tracker.h"
|
||||
#include "ui.h"
|
||||
#ifdef HAVE_WAYLAND
|
||||
#include <wayland-server.h>
|
||||
#endif
|
||||
#include "meta-xrandr-shared.h"
|
||||
|
||||
#include "meta-dbus-xrandr.h"
|
||||
@ -54,19 +52,6 @@ typedef struct _MetaMonitorManager MetaMonitorManager;
|
||||
typedef struct _MetaMonitorConfigClass MetaMonitorConfigClass;
|
||||
typedef struct _MetaMonitorConfig MetaMonitorConfig;
|
||||
|
||||
#ifndef HAVE_WAYLAND
|
||||
enum wl_output_transform {
|
||||
WL_OUTPUT_TRANSFORM_NORMAL,
|
||||
WL_OUTPUT_TRANSFORM_90,
|
||||
WL_OUTPUT_TRANSFORM_180,
|
||||
WL_OUTPUT_TRANSFORM_270,
|
||||
WL_OUTPUT_TRANSFORM_FLIPPED,
|
||||
WL_OUTPUT_TRANSFORM_FLIPPED_90,
|
||||
WL_OUTPUT_TRANSFORM_FLIPPED_180,
|
||||
WL_OUTPUT_TRANSFORM_FLIPPED_270
|
||||
};
|
||||
#endif
|
||||
|
||||
typedef struct _MetaOutput MetaOutput;
|
||||
typedef struct _MetaCRTC MetaCRTC;
|
||||
typedef struct _MetaMonitorMode MetaMonitorMode;
|
||||
@ -115,6 +100,9 @@ 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;
|
||||
};
|
||||
@ -134,16 +122,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;
|
||||
};
|
||||
|
||||
/**
|
||||
@ -352,6 +347,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))
|
||||
@ -384,6 +391,8 @@ 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
|
||||
|
@ -185,7 +185,7 @@ output_get_backlight_xrandr (MetaMonitorManagerXrandr *manager_xrandr,
|
||||
|
||||
XRRGetOutputProperty (manager_xrandr->xdisplay,
|
||||
(XID)output->output_id,
|
||||
display->atom_Backlight,
|
||||
display->atom_BACKLIGHT,
|
||||
0, G_MAXLONG, False, False, XA_INTEGER,
|
||||
&actual_type, &actual_format,
|
||||
&nitems, &bytes_after, &buffer);
|
||||
@ -210,7 +210,7 @@ output_get_backlight_limits_xrandr (MetaMonitorManagerXrandr *manager_xrandr,
|
||||
meta_error_trap_push (display);
|
||||
info = XRRQueryOutputProperty (manager_xrandr->xdisplay,
|
||||
(XID)output->output_id,
|
||||
display->atom_Backlight);
|
||||
display->atom_BACKLIGHT);
|
||||
meta_error_trap_pop (display);
|
||||
|
||||
if (info == NULL)
|
||||
@ -676,13 +676,11 @@ output_set_presentation_xrandr (MetaMonitorManagerXrandr *manager_xrandr,
|
||||
MetaDisplay *display = meta_get_display ();
|
||||
int value = presentation;
|
||||
|
||||
meta_error_trap_push (display);
|
||||
XRRChangeOutputProperty (manager_xrandr->xdisplay,
|
||||
(XID)output->output_id,
|
||||
display->atom__MUTTER_PRESENTATION_OUTPUT,
|
||||
XA_CARDINAL, 32, PropModeReplace,
|
||||
(unsigned char*) &value, 1);
|
||||
meta_error_trap_pop (display);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -948,7 +946,7 @@ meta_monitor_manager_xrandr_change_backlight (MetaMonitorManager *manager,
|
||||
meta_error_trap_push (display);
|
||||
XRRChangeOutputProperty (manager_xrandr->xdisplay,
|
||||
(XID)output->output_id,
|
||||
display->atom_Backlight,
|
||||
display->atom_BACKLIGHT,
|
||||
XA_INTEGER, 32, PropModeReplace,
|
||||
(unsigned char *) &hw_value, 1);
|
||||
meta_error_trap_pop (display);
|
||||
@ -1017,7 +1015,7 @@ meta_monitor_manager_xrandr_handle_xevent (MetaMonitorManager *manager,
|
||||
MetaOutput *old_outputs;
|
||||
MetaCRTC *old_crtcs;
|
||||
MetaMonitorMode *old_modes;
|
||||
int n_old_outputs;
|
||||
unsigned int n_old_outputs, n_old_modes;
|
||||
gboolean new_config;
|
||||
|
||||
if ((event->type - manager_xrandr->rr_event_base) != RRScreenChangeNotify)
|
||||
@ -1029,6 +1027,7 @@ meta_monitor_manager_xrandr_handle_xevent (MetaMonitorManager *manager,
|
||||
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++;
|
||||
@ -1068,7 +1067,7 @@ meta_monitor_manager_xrandr_handle_xevent (MetaMonitorManager *manager,
|
||||
}
|
||||
|
||||
meta_monitor_manager_free_output_array (old_outputs, n_old_outputs);
|
||||
g_free (old_modes);
|
||||
meta_monitor_manager_free_mode_array (old_modes, n_old_modes);
|
||||
g_free (old_crtcs);
|
||||
|
||||
return TRUE;
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include "util-private.h"
|
||||
#include <meta/errors.h>
|
||||
#include "monitor-private.h"
|
||||
#include "meta-wayland-private.h"
|
||||
|
||||
#include "meta-dbus-xrandr.h"
|
||||
|
||||
@ -62,59 +63,23 @@ 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;
|
||||
@ -125,111 +90,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
|
||||
@ -469,6 +353,40 @@ make_logical_config (MetaMonitorManager *manager)
|
||||
manager->monitor_infos = (void*)g_array_free (monitor_infos, FALSE);
|
||||
}
|
||||
|
||||
static GType
|
||||
get_default_backend (void)
|
||||
{
|
||||
#if defined(CLUTTER_WINDOWING_EGL)
|
||||
if (clutter_check_windowing_backend (CLUTTER_WINDOWING_EGL))
|
||||
return META_TYPE_MONITOR_MANAGER_KMS;
|
||||
#endif
|
||||
|
||||
#if defined(CLUTTER_WINDOWING_X11)
|
||||
if (clutter_check_windowing_backend (CLUTTER_WINDOWING_X11))
|
||||
{
|
||||
/* If we're a Wayland compositor using the X11 backend,
|
||||
* we're a nested configuration, so return the dummy
|
||||
* monitor setup. */
|
||||
if (meta_is_wayland_compositor ())
|
||||
return META_TYPE_MONITOR_MANAGER;
|
||||
else
|
||||
return META_TYPE_MONITOR_MANAGER_XRANDR;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CLUTTER_WINDOWING_WAYLAND)
|
||||
if (clutter_check_windowing_backend (CLUTTER_WINDOWING_WAYLAND))
|
||||
{
|
||||
/* Use the dummy implementation on Wayland for now.
|
||||
* In the future, we should support wl_fullscreen_output
|
||||
* which will have CRTC management in the protocol. */
|
||||
return META_TYPE_MONITOR_MANAGER;
|
||||
}
|
||||
#endif
|
||||
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
static MetaMonitorManager *
|
||||
meta_monitor_manager_new (void)
|
||||
{
|
||||
@ -478,7 +396,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
|
||||
@ -513,17 +431,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);
|
||||
|
||||
meta_monitor_manager_free_output_array (old_outputs, n_old_outputs);
|
||||
g_free (old_modes);
|
||||
meta_monitor_manager_free_mode_array (old_modes, n_old_modes);
|
||||
g_free (old_crtcs);
|
||||
}
|
||||
|
||||
@ -565,19 +484,39 @@ meta_monitor_manager_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);
|
||||
|
||||
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);
|
||||
@ -770,13 +709,13 @@ meta_monitor_manager_handle_get_resources (MetaDBusDisplayConfig *skeleton,
|
||||
|
||||
g_variant_builder_add (&crtc_builder, "(uxiiiiiuaua{sv})",
|
||||
i, /* ID */
|
||||
(gint64)crtc->crtc_id,
|
||||
crtc->crtc_id,
|
||||
(int)crtc->rect.x,
|
||||
(int)crtc->rect.y,
|
||||
(int)crtc->rect.width,
|
||||
(int)crtc->rect.height,
|
||||
(int)(crtc->current_mode ? crtc->current_mode - manager->modes : -1),
|
||||
(guint32)crtc->transform,
|
||||
crtc->transform,
|
||||
&transforms,
|
||||
NULL /* properties */);
|
||||
}
|
||||
@ -847,7 +786,7 @@ meta_monitor_manager_handle_get_resources (MetaDBusDisplayConfig *skeleton,
|
||||
|
||||
g_variant_builder_add (&output_builder, "(uxiausauaua{sv})",
|
||||
i, /* ID */
|
||||
(gint64)output->output_id,
|
||||
output->output_id,
|
||||
(int)(output->crtc ? output->crtc - manager->crtcs : -1),
|
||||
&crtcs,
|
||||
output->name,
|
||||
@ -862,9 +801,9 @@ meta_monitor_manager_handle_get_resources (MetaDBusDisplayConfig *skeleton,
|
||||
|
||||
g_variant_builder_add (&mode_builder, "(uxuud)",
|
||||
i, /* ID */
|
||||
(gint64)mode->mode_id,
|
||||
(guint32)mode->width,
|
||||
(guint32)mode->height,
|
||||
mode->mode_id,
|
||||
mode->width,
|
||||
mode->height,
|
||||
(double)mode->refresh_rate);
|
||||
}
|
||||
|
||||
@ -1453,12 +1392,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
|
||||
|
@ -75,7 +75,6 @@ main (int argc, char **argv)
|
||||
g_printerr ("mutter: %s\n", error->message);
|
||||
exit (1);
|
||||
}
|
||||
g_option_context_free (ctx);
|
||||
|
||||
if (plugin)
|
||||
meta_plugin_manager_load (plugin);
|
||||
|
@ -57,6 +57,7 @@
|
||||
|
||||
#define KEY_OVERLAY_KEY "overlay-key"
|
||||
#define KEY_WORKSPACES_ONLY_ON_PRIMARY "workspaces-only-on-primary"
|
||||
#define KEY_NO_TAB_POPUP "no-tab-popup"
|
||||
|
||||
/* These are the different schemas we are keeping
|
||||
* a GSettings instance for */
|
||||
@ -111,6 +112,8 @@ static char **workspace_names = NULL;
|
||||
|
||||
static gboolean workspaces_only_on_primary = FALSE;
|
||||
|
||||
static gboolean no_tab_popup = FALSE;
|
||||
|
||||
static char *iso_next_group_option = NULL;
|
||||
|
||||
static void handle_preference_update_enum (GSettings *settings,
|
||||
@ -362,6 +365,13 @@ static MetaBoolPreference preferences_bool[] =
|
||||
},
|
||||
&workspaces_only_on_primary,
|
||||
},
|
||||
{
|
||||
{ KEY_NO_TAB_POPUP,
|
||||
SCHEMA_MUTTER,
|
||||
META_PREF_NO_TAB_POPUP,
|
||||
},
|
||||
&no_tab_popup,
|
||||
},
|
||||
{
|
||||
{ "auto-maximize",
|
||||
SCHEMA_MUTTER,
|
||||
@ -1187,8 +1197,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");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1262,8 +1272,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;
|
||||
@ -1328,8 +1338,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;
|
||||
@ -1803,6 +1813,9 @@ meta_preference_to_string (MetaPreference pref)
|
||||
case META_PREF_WORKSPACES_ONLY_ON_PRIMARY:
|
||||
return "WORKSPACES_ONLY_ON_PRIMARY";
|
||||
|
||||
case META_PREF_NO_TAB_POPUP:
|
||||
return "NO_TAB_POPUP";
|
||||
|
||||
case META_PREF_DRAGGABLE_BORDER_WIDTH:
|
||||
return "DRAGGABLE_BORDER_WIDTH";
|
||||
|
||||
@ -1856,7 +1869,7 @@ init_bindings (void)
|
||||
pref = g_new0 (MetaKeyPref, 1);
|
||||
pref->name = g_strdup ("overlay-key");
|
||||
pref->action = META_KEYBINDING_ACTION_OVERLAY_KEY;
|
||||
pref->combos = g_slist_prepend (pref->combos, &overlay_key_combo);
|
||||
pref->bindings = g_slist_prepend (pref->bindings, &overlay_key_combo);
|
||||
pref->builtin = 1;
|
||||
|
||||
g_hash_table_insert (key_bindings, g_strdup ("overlay-key"), pref);
|
||||
@ -1866,7 +1879,7 @@ static gboolean
|
||||
update_binding (MetaKeyPref *binding,
|
||||
gchar **strokes)
|
||||
{
|
||||
GSList *old_combos, *a, *b;
|
||||
GSList *old_bindings, *a, *b;
|
||||
gboolean changed;
|
||||
unsigned int keysym;
|
||||
unsigned int keycode;
|
||||
@ -1878,8 +1891,8 @@ update_binding (MetaKeyPref *binding,
|
||||
"Binding \"%s\" has new GSettings value\n",
|
||||
binding->name);
|
||||
|
||||
old_combos = binding->combos;
|
||||
binding->combos = NULL;
|
||||
old_bindings = binding->bindings;
|
||||
binding->bindings = NULL;
|
||||
|
||||
for (i = 0; strokes && strokes[i]; i++)
|
||||
{
|
||||
@ -1891,7 +1904,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.
|
||||
@ -1920,17 +1933,17 @@ update_binding (MetaKeyPref *binding,
|
||||
combo->keysym = keysym;
|
||||
combo->keycode = keycode;
|
||||
combo->modifiers = mods;
|
||||
binding->combos = g_slist_prepend (binding->combos, combo);
|
||||
binding->bindings = g_slist_prepend (binding->bindings, combo);
|
||||
|
||||
meta_topic (META_DEBUG_KEYBINDINGS,
|
||||
"New keybinding for \"%s\" is keysym = 0x%x keycode = 0x%x mods = 0x%x\n",
|
||||
binding->name, keysym, keycode, mods);
|
||||
}
|
||||
|
||||
binding->combos = g_slist_reverse (binding->combos);
|
||||
binding->bindings = g_slist_reverse (binding->bindings);
|
||||
|
||||
a = old_combos;
|
||||
b = binding->combos;
|
||||
a = old_bindings;
|
||||
b = binding->bindings;
|
||||
while (TRUE)
|
||||
{
|
||||
if ((!a && b) || (a && !b))
|
||||
@ -1955,7 +1968,7 @@ update_binding (MetaKeyPref *binding,
|
||||
}
|
||||
}
|
||||
|
||||
g_slist_free_full (old_combos, g_free);
|
||||
g_slist_free_full (old_bindings, g_free);
|
||||
|
||||
return changed;
|
||||
}
|
||||
@ -2090,7 +2103,7 @@ meta_prefs_add_keybinding (const char *name,
|
||||
pref->name = g_strdup (name);
|
||||
pref->settings = g_object_ref (settings);
|
||||
pref->action = action;
|
||||
pref->combos = NULL;
|
||||
pref->bindings = NULL;
|
||||
pref->add_shift = (flags & META_KEY_BINDING_REVERSES) != 0;
|
||||
pref->per_window = (flags & META_KEY_BINDING_PER_WINDOW) != 0;
|
||||
pref->builtin = (flags & META_KEY_BINDING_BUILTIN) != 0;
|
||||
@ -2154,6 +2167,11 @@ meta_prefs_remove_keybinding (const char *name)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_prefs_get_keybindings:
|
||||
*
|
||||
* Returns: (element-type MetaKeyPref) (transfer container):
|
||||
*/
|
||||
GList *
|
||||
meta_prefs_get_keybindings ()
|
||||
{
|
||||
@ -2254,7 +2272,7 @@ meta_prefs_get_window_binding (const char *name,
|
||||
|
||||
if (pref->per_window)
|
||||
{
|
||||
GSList *s = pref->combos;
|
||||
GSList *s = pref->bindings;
|
||||
|
||||
while (s)
|
||||
{
|
||||
@ -2302,6 +2320,25 @@ meta_prefs_get_workspaces_only_on_primary (void)
|
||||
return workspaces_only_on_primary;
|
||||
}
|
||||
|
||||
|
||||
gboolean
|
||||
meta_prefs_get_no_tab_popup (void)
|
||||
{
|
||||
return no_tab_popup;
|
||||
}
|
||||
|
||||
void
|
||||
meta_prefs_set_no_tab_popup (gboolean whether)
|
||||
{
|
||||
MetaBasePreference *pref;
|
||||
|
||||
if (find_pref (preferences_bool, sizeof(MetaBoolPreference),
|
||||
KEY_NO_TAB_POPUP, &pref))
|
||||
{
|
||||
g_settings_set_boolean (SETTINGS (pref->schema), KEY_NO_TAB_POPUP, whether);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
meta_prefs_get_draggable_border_width (void)
|
||||
{
|
||||
|
@ -64,6 +64,8 @@ struct _MetaScreen
|
||||
Visual *default_xvisual;
|
||||
MetaRectangle rect; /* Size of screen; rect.x & rect.y are always 0 */
|
||||
MetaUI *ui;
|
||||
MetaTabPopup *tab_popup, *ws_popup;
|
||||
MetaTilePreview *tile_preview;
|
||||
|
||||
guint tile_preview_timeout_id;
|
||||
|
||||
@ -149,9 +151,25 @@ void meta_screen_foreach_window (MetaScreen *scree
|
||||
|
||||
void meta_screen_update_cursor (MetaScreen *screen);
|
||||
|
||||
void meta_screen_update_tile_preview (MetaScreen *screen,
|
||||
void meta_screen_tab_popup_create (MetaScreen *screen,
|
||||
MetaTabList list_type,
|
||||
MetaTabShowType show_type,
|
||||
MetaWindow *initial_window);
|
||||
void meta_screen_tab_popup_forward (MetaScreen *screen);
|
||||
void meta_screen_tab_popup_backward (MetaScreen *screen);
|
||||
MetaWindow* meta_screen_tab_popup_get_selected (MetaScreen *screen);
|
||||
void meta_screen_tab_popup_destroy (MetaScreen *screen);
|
||||
|
||||
void meta_screen_workspace_popup_create (MetaScreen *screen,
|
||||
MetaWorkspace *initial_selection);
|
||||
void meta_screen_workspace_popup_select (MetaScreen *screen,
|
||||
MetaWorkspace *workspace);
|
||||
MetaWorkspace*meta_screen_workspace_popup_get_selected (MetaScreen *screen);
|
||||
void meta_screen_workspace_popup_destroy (MetaScreen *screen);
|
||||
|
||||
void meta_screen_tile_preview_update (MetaScreen *screen,
|
||||
gboolean delay);
|
||||
void meta_screen_hide_tile_preview (MetaScreen *screen);
|
||||
void meta_screen_tile_preview_hide (MetaScreen *screen);
|
||||
|
||||
MetaWindow* meta_screen_get_mouse_window (MetaScreen *screen,
|
||||
MetaWindow *not_this_one);
|
||||
@ -223,12 +241,14 @@ void meta_screen_workspace_switched (MetaScreen *screen,
|
||||
|
||||
void meta_screen_set_active_workspace_hint (MetaScreen *screen);
|
||||
|
||||
void meta_screen_create_guard_window (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,
|
||||
int index);
|
||||
|
||||
gboolean meta_screen_handle_xevent (MetaScreen *screen,
|
||||
XEvent *xevent);
|
||||
|
||||
#endif
|
||||
|
@ -43,6 +43,7 @@
|
||||
#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>
|
||||
@ -307,8 +308,6 @@ set_supported_hint (MetaScreen *screen)
|
||||
#include <meta/atomnames.h>
|
||||
#undef item
|
||||
#undef EWMH_ATOMS_ONLY
|
||||
|
||||
screen->display->atom__GTK_FRAME_EXTENTS,
|
||||
};
|
||||
|
||||
XChangeProperty (screen->display->xdisplay, screen->xroot,
|
||||
@ -454,6 +453,7 @@ create_guard_window (Display *xdisplay, MetaScreen *screen)
|
||||
XSetWindowAttributes attributes;
|
||||
Window guard_window;
|
||||
gulong create_serial;
|
||||
MetaStackWindow stack_window;
|
||||
|
||||
attributes.event_mask = NoEventMask;
|
||||
attributes.override_redirect = True;
|
||||
@ -475,9 +475,6 @@ create_guard_window (Display *xdisplay, MetaScreen *screen)
|
||||
CWEventMask|CWOverrideRedirect,
|
||||
&attributes);
|
||||
|
||||
/* https://bugzilla.gnome.org/show_bug.cgi?id=710346 */
|
||||
XStoreName (xdisplay, guard_window, "mutter guard window");
|
||||
|
||||
{
|
||||
unsigned char mask_bits[XIMaskLen (XI_LASTEVENT)] = { 0 };
|
||||
XIEventMask mask = { XIAllMasterDevices, sizeof (mask_bits), mask_bits };
|
||||
@ -488,12 +485,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);
|
||||
@ -579,7 +578,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);
|
||||
@ -674,8 +673,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",
|
||||
@ -760,6 +760,10 @@ meta_screen_new (MetaDisplay *display,
|
||||
screen->ui = meta_ui_new (screen->display->xdisplay,
|
||||
screen->xscreen);
|
||||
|
||||
screen->tab_popup = NULL;
|
||||
screen->ws_popup = NULL;
|
||||
screen->tile_preview = NULL;
|
||||
|
||||
screen->tile_preview_timeout_id = 0;
|
||||
|
||||
screen->stack = meta_stack_new (screen);
|
||||
@ -845,7 +849,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);
|
||||
@ -864,6 +868,9 @@ meta_screen_free (MetaScreen *screen,
|
||||
if (screen->tile_preview_timeout_id)
|
||||
g_source_remove (screen->tile_preview_timeout_id);
|
||||
|
||||
if (screen->tile_preview)
|
||||
meta_tile_preview_free (screen->tile_preview);
|
||||
|
||||
g_free (screen->screen_name);
|
||||
|
||||
g_object_unref (screen);
|
||||
@ -872,27 +879,30 @@ meta_screen_free (MetaScreen *screen,
|
||||
meta_display_ungrab (display);
|
||||
}
|
||||
|
||||
void
|
||||
meta_screen_create_guard_window (MetaScreen *screen)
|
||||
{
|
||||
if (screen->guard_window == None)
|
||||
screen->guard_window = create_guard_window (screen->display->xdisplay, screen);
|
||||
}
|
||||
|
||||
void
|
||||
meta_screen_manage_all_windows (MetaScreen *screen)
|
||||
{
|
||||
Window *_children;
|
||||
Window *children;
|
||||
MetaStackWindow *_children;
|
||||
MetaStackWindow *children;
|
||||
int n_children, i;
|
||||
|
||||
if (screen->guard_window == None)
|
||||
screen->guard_window = create_guard_window (screen->display->xdisplay,
|
||||
screen);
|
||||
|
||||
meta_stack_freeze (screen->stack);
|
||||
meta_stack_tracker_get_stack (screen->stack_tracker, &_children, &n_children);
|
||||
|
||||
/* Copy the stack as it will be modified as part of the loop */
|
||||
children = g_memdup (_children, sizeof (Window) * n_children);
|
||||
children = g_memdup (_children, sizeof (MetaStackWindow) * n_children);
|
||||
|
||||
for (i = 0; i < n_children; ++i)
|
||||
{
|
||||
meta_window_new (screen->display, children[i], TRUE,
|
||||
META_COMP_EFFECT_NONE);
|
||||
meta_window_x11_new (screen->display, children[i].x11.xwindow, TRUE,
|
||||
META_COMP_EFFECT_NONE);
|
||||
}
|
||||
|
||||
g_free (children);
|
||||
@ -1422,8 +1432,255 @@ meta_screen_update_cursor (MetaScreen *screen)
|
||||
screen->current_cursor);
|
||||
}
|
||||
|
||||
void
|
||||
meta_screen_tab_popup_create (MetaScreen *screen,
|
||||
MetaTabList list_type,
|
||||
MetaTabShowType show_type,
|
||||
MetaWindow *initial_selection)
|
||||
{
|
||||
MetaTabEntry *entries;
|
||||
GList *tab_list;
|
||||
GList *tmp;
|
||||
int len;
|
||||
int i;
|
||||
|
||||
if (screen->tab_popup)
|
||||
return;
|
||||
|
||||
tab_list = meta_display_get_tab_list (screen->display,
|
||||
list_type,
|
||||
screen,
|
||||
screen->active_workspace);
|
||||
|
||||
len = g_list_length (tab_list);
|
||||
|
||||
entries = g_new (MetaTabEntry, len + 1);
|
||||
entries[len].key = NULL;
|
||||
entries[len].title = NULL;
|
||||
entries[len].icon = NULL;
|
||||
|
||||
i = 0;
|
||||
tmp = tab_list;
|
||||
while (i < len)
|
||||
{
|
||||
MetaWindow *window;
|
||||
MetaRectangle r;
|
||||
|
||||
window = tmp->data;
|
||||
|
||||
entries[i].key = (MetaTabEntryKey) window;
|
||||
entries[i].title = window->title;
|
||||
entries[i].icon = g_object_ref (window->icon);
|
||||
entries[i].blank = FALSE;
|
||||
entries[i].hidden = !meta_window_showing_on_its_workspace (window);
|
||||
entries[i].demands_attention = window->wm_state_demands_attention;
|
||||
|
||||
if (show_type == META_TAB_SHOW_INSTANTLY ||
|
||||
!entries[i].hidden ||
|
||||
!meta_window_get_icon_geometry (window, &r))
|
||||
meta_window_get_frame_rect (window, &r);
|
||||
|
||||
entries[i].rect = r;
|
||||
|
||||
/* Find inside of highlight rectangle to be used when window is
|
||||
* outlined for tabbing. This should be the size of the
|
||||
* east/west frame, and the size of the south frame, on those
|
||||
* sides. On the top it should be the size of the south frame
|
||||
* edge.
|
||||
*/
|
||||
#define OUTLINE_WIDTH 5
|
||||
/* Top side */
|
||||
if (!entries[i].hidden &&
|
||||
window->frame && window->frame->bottom_height > 0 &&
|
||||
window->frame->child_y >= window->frame->bottom_height)
|
||||
entries[i].inner_rect.y = window->frame->bottom_height;
|
||||
else
|
||||
entries[i].inner_rect.y = OUTLINE_WIDTH;
|
||||
|
||||
/* Bottom side */
|
||||
if (!entries[i].hidden &&
|
||||
window->frame && window->frame->bottom_height != 0)
|
||||
entries[i].inner_rect.height = r.height
|
||||
- entries[i].inner_rect.y - window->frame->bottom_height;
|
||||
else
|
||||
entries[i].inner_rect.height = r.height
|
||||
- entries[i].inner_rect.y - OUTLINE_WIDTH;
|
||||
|
||||
/* Left side */
|
||||
if (!entries[i].hidden && window->frame && window->frame->child_x != 0)
|
||||
entries[i].inner_rect.x = window->frame->child_x;
|
||||
else
|
||||
entries[i].inner_rect.x = OUTLINE_WIDTH;
|
||||
|
||||
/* Right side */
|
||||
if (!entries[i].hidden &&
|
||||
window->frame && window->frame->right_width != 0)
|
||||
entries[i].inner_rect.width = r.width
|
||||
- entries[i].inner_rect.x - window->frame->right_width;
|
||||
else
|
||||
entries[i].inner_rect.width = r.width
|
||||
- entries[i].inner_rect.x - OUTLINE_WIDTH;
|
||||
|
||||
++i;
|
||||
tmp = tmp->next;
|
||||
}
|
||||
|
||||
if (!meta_prefs_get_no_tab_popup ())
|
||||
screen->tab_popup = meta_ui_tab_popup_new (entries,
|
||||
screen->number,
|
||||
len,
|
||||
5, /* FIXME */
|
||||
TRUE);
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
g_object_unref (entries[i].icon);
|
||||
|
||||
g_free (entries);
|
||||
|
||||
g_list_free (tab_list);
|
||||
|
||||
meta_ui_tab_popup_select (screen->tab_popup,
|
||||
(MetaTabEntryKey) initial_selection);
|
||||
|
||||
if (show_type != META_TAB_SHOW_INSTANTLY)
|
||||
meta_ui_tab_popup_set_showing (screen->tab_popup, TRUE);
|
||||
}
|
||||
|
||||
void
|
||||
meta_screen_tab_popup_forward (MetaScreen *screen)
|
||||
{
|
||||
g_return_if_fail (screen->tab_popup != NULL);
|
||||
|
||||
meta_ui_tab_popup_forward (screen->tab_popup);
|
||||
}
|
||||
|
||||
void
|
||||
meta_screen_tab_popup_backward (MetaScreen *screen)
|
||||
{
|
||||
g_return_if_fail (screen->tab_popup != NULL);
|
||||
|
||||
meta_ui_tab_popup_backward (screen->tab_popup);
|
||||
}
|
||||
|
||||
MetaWindow *
|
||||
meta_screen_tab_popup_get_selected (MetaScreen *screen)
|
||||
{
|
||||
g_return_val_if_fail (screen->tab_popup != NULL, NULL);
|
||||
|
||||
return (MetaWindow *) meta_ui_tab_popup_get_selected (screen->tab_popup);
|
||||
}
|
||||
|
||||
void
|
||||
meta_screen_tab_popup_destroy (MetaScreen *screen)
|
||||
{
|
||||
if (screen->tab_popup)
|
||||
{
|
||||
meta_ui_tab_popup_free (screen->tab_popup);
|
||||
screen->tab_popup = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
meta_screen_workspace_popup_create (MetaScreen *screen,
|
||||
MetaWorkspace *initial_selection)
|
||||
{
|
||||
MetaTabEntry *entries;
|
||||
int len;
|
||||
int i;
|
||||
MetaWorkspaceLayout layout;
|
||||
int n_workspaces;
|
||||
int current_workspace;
|
||||
|
||||
if (screen->ws_popup || meta_prefs_get_no_tab_popup ())
|
||||
return;
|
||||
|
||||
current_workspace = meta_workspace_index (screen->active_workspace);
|
||||
n_workspaces = meta_screen_get_n_workspaces (screen);
|
||||
|
||||
meta_screen_calc_workspace_layout (screen, n_workspaces,
|
||||
current_workspace, &layout);
|
||||
|
||||
len = layout.grid_area;
|
||||
|
||||
entries = g_new (MetaTabEntry, len + 1);
|
||||
entries[len].key = NULL;
|
||||
entries[len].title = NULL;
|
||||
entries[len].icon = NULL;
|
||||
|
||||
i = 0;
|
||||
while (i < len)
|
||||
{
|
||||
if (layout.grid[i] >= 0)
|
||||
{
|
||||
MetaWorkspace *workspace;
|
||||
|
||||
workspace = meta_screen_get_workspace_by_index (screen,
|
||||
layout.grid[i]);
|
||||
|
||||
entries[i].key = (MetaTabEntryKey) workspace;
|
||||
entries[i].title = meta_workspace_get_name (workspace);
|
||||
entries[i].icon = NULL;
|
||||
entries[i].blank = FALSE;
|
||||
|
||||
g_assert (entries[i].title != NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
entries[i].key = NULL;
|
||||
entries[i].title = NULL;
|
||||
entries[i].icon = NULL;
|
||||
entries[i].blank = TRUE;
|
||||
}
|
||||
entries[i].hidden = FALSE;
|
||||
entries[i].demands_attention = FALSE;
|
||||
|
||||
++i;
|
||||
}
|
||||
|
||||
screen->ws_popup = meta_ui_tab_popup_new (entries,
|
||||
screen->number,
|
||||
len,
|
||||
layout.cols,
|
||||
FALSE);
|
||||
|
||||
g_free (entries);
|
||||
meta_screen_free_workspace_layout (&layout);
|
||||
|
||||
meta_ui_tab_popup_select (screen->ws_popup,
|
||||
(MetaTabEntryKey) initial_selection);
|
||||
meta_ui_tab_popup_set_showing (screen->ws_popup, TRUE);
|
||||
}
|
||||
|
||||
void
|
||||
meta_screen_workspace_popup_select (MetaScreen *screen,
|
||||
MetaWorkspace *workspace)
|
||||
{
|
||||
g_return_if_fail (screen->ws_popup != NULL);
|
||||
|
||||
meta_ui_tab_popup_select (screen->ws_popup,
|
||||
(MetaTabEntryKey) workspace);
|
||||
}
|
||||
|
||||
MetaWorkspace *
|
||||
meta_screen_workspace_popup_get_selected (MetaScreen *screen)
|
||||
{
|
||||
g_return_val_if_fail (screen->ws_popup != NULL, NULL);
|
||||
|
||||
return (MetaWorkspace *) meta_ui_tab_popup_get_selected (screen->ws_popup);
|
||||
}
|
||||
|
||||
void
|
||||
meta_screen_workspace_popup_destroy (MetaScreen *screen)
|
||||
{
|
||||
if (screen->ws_popup)
|
||||
{
|
||||
meta_ui_tab_popup_free (screen->ws_popup);
|
||||
screen->ws_popup = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
meta_screen_update_tile_preview_timeout (gpointer data)
|
||||
meta_screen_tile_preview_update_timeout (gpointer data)
|
||||
{
|
||||
MetaScreen *screen = data;
|
||||
MetaWindow *window = screen->display->grab_window;
|
||||
@ -1431,6 +1688,22 @@ meta_screen_update_tile_preview_timeout (gpointer data)
|
||||
|
||||
screen->tile_preview_timeout_id = 0;
|
||||
|
||||
if (!screen->tile_preview)
|
||||
{
|
||||
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,
|
||||
&stack_window,
|
||||
create_serial);
|
||||
}
|
||||
|
||||
if (window)
|
||||
{
|
||||
switch (window->tile_mode)
|
||||
@ -1455,16 +1728,12 @@ meta_screen_update_tile_preview_timeout (gpointer data)
|
||||
if (needs_preview)
|
||||
{
|
||||
MetaRectangle tile_rect;
|
||||
int monitor;
|
||||
|
||||
monitor = meta_window_get_current_tile_monitor_number (window);
|
||||
meta_window_get_current_tile_area (window, &tile_rect);
|
||||
meta_compositor_show_tile_preview (screen->display->compositor,
|
||||
screen, window, &tile_rect, monitor);
|
||||
meta_tile_preview_show (screen->tile_preview, &tile_rect);
|
||||
}
|
||||
else
|
||||
meta_compositor_hide_tile_preview (screen->display->compositor,
|
||||
screen);
|
||||
meta_tile_preview_hide (screen->tile_preview);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@ -1472,7 +1741,7 @@ meta_screen_update_tile_preview_timeout (gpointer data)
|
||||
#define TILE_PREVIEW_TIMEOUT_MS 200
|
||||
|
||||
void
|
||||
meta_screen_update_tile_preview (MetaScreen *screen,
|
||||
meta_screen_tile_preview_update (MetaScreen *screen,
|
||||
gboolean delay)
|
||||
{
|
||||
if (delay)
|
||||
@ -1482,7 +1751,7 @@ meta_screen_update_tile_preview (MetaScreen *screen,
|
||||
|
||||
screen->tile_preview_timeout_id =
|
||||
g_timeout_add (TILE_PREVIEW_TIMEOUT_MS,
|
||||
meta_screen_update_tile_preview_timeout,
|
||||
meta_screen_tile_preview_update_timeout,
|
||||
screen);
|
||||
}
|
||||
else
|
||||
@ -1490,18 +1759,18 @@ meta_screen_update_tile_preview (MetaScreen *screen,
|
||||
if (screen->tile_preview_timeout_id > 0)
|
||||
g_source_remove (screen->tile_preview_timeout_id);
|
||||
|
||||
meta_screen_update_tile_preview_timeout ((gpointer)screen);
|
||||
meta_screen_tile_preview_update_timeout ((gpointer)screen);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
meta_screen_hide_tile_preview (MetaScreen *screen)
|
||||
meta_screen_tile_preview_hide (MetaScreen *screen)
|
||||
{
|
||||
if (screen->tile_preview_timeout_id > 0)
|
||||
g_source_remove (screen->tile_preview_timeout_id);
|
||||
|
||||
meta_compositor_hide_tile_preview (screen->display->compositor,
|
||||
screen);
|
||||
if (screen->tile_preview)
|
||||
meta_tile_preview_hide (screen->tile_preview);
|
||||
}
|
||||
|
||||
MetaWindow*
|
||||
@ -3373,10 +3642,6 @@ gboolean
|
||||
meta_screen_handle_xevent (MetaScreen *screen,
|
||||
XEvent *xevent)
|
||||
{
|
||||
/* Go through our helpers and see if they want this event.
|
||||
Currently, only MetaCursorTracker.
|
||||
*/
|
||||
|
||||
if (meta_cursor_tracker_handle_xevent (screen->cursor_tracker, xevent))
|
||||
return TRUE;
|
||||
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include <config.h>
|
||||
|
||||
#include "util-private.h"
|
||||
#include <meta/main.h>
|
||||
#include "session.h"
|
||||
#include <X11/Xatom.h>
|
||||
|
||||
@ -530,6 +531,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
|
||||
@ -839,14 +846,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));
|
||||
}
|
||||
|
||||
@ -856,7 +863,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;
|
||||
}
|
||||
@ -997,12 +1004,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));
|
||||
}
|
||||
}
|
||||
@ -1132,7 +1139,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);
|
||||
|
||||
@ -1181,7 +1188,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;
|
||||
}
|
||||
|
||||
@ -1194,7 +1201,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;
|
||||
}
|
||||
@ -1211,7 +1218,7 @@ start_element_handler (GMarkupParseContext *context,
|
||||
g_set_error (error,
|
||||
G_MARKUP_ERROR,
|
||||
G_MARKUP_ERROR_PARSE,
|
||||
_("nested <window> tag"));
|
||||
"nested <window> tag");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1269,7 +1276,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;
|
||||
@ -1301,7 +1308,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;
|
||||
@ -1373,7 +1380,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;
|
||||
}
|
||||
@ -1433,7 +1440,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;
|
||||
}
|
||||
@ -1453,7 +1460,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
@ -35,36 +35,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 */
|
||||
@ -77,9 +96,9 @@ void meta_stack_tracker_reparent_event (MetaStackTracker *tracker,
|
||||
void meta_stack_tracker_configure_event (MetaStackTracker *tracker,
|
||||
XConfigureEvent *event);
|
||||
|
||||
void meta_stack_tracker_get_stack (MetaStackTracker *tracker,
|
||||
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);
|
||||
|
513
src/core/stack.c
513
src/core/stack.c
@ -50,7 +50,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);
|
||||
@ -69,14 +69,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;
|
||||
|
||||
@ -87,17 +87,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);
|
||||
}
|
||||
@ -119,7 +126,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);
|
||||
}
|
||||
|
||||
@ -155,7 +162,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);
|
||||
}
|
||||
|
||||
@ -165,7 +172,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);
|
||||
}
|
||||
|
||||
@ -175,7 +182,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);
|
||||
}
|
||||
|
||||
@ -204,7 +211,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);
|
||||
}
|
||||
|
||||
@ -232,7 +239,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);
|
||||
}
|
||||
|
||||
@ -248,7 +255,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);
|
||||
}
|
||||
|
||||
@ -827,7 +834,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;
|
||||
@ -838,9 +845,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;
|
||||
}
|
||||
}
|
||||
@ -869,10 +876,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
|
||||
@ -1027,6 +1034,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:
|
||||
*
|
||||
@ -1051,84 +1154,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:
|
||||
*
|
||||
@ -1143,13 +1236,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)
|
||||
@ -1164,13 +1260,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 ();
|
||||
@ -1179,6 +1279,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);
|
||||
@ -1187,60 +1290,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,
|
||||
@ -1248,28 +1373,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
|
||||
@ -1278,75 +1409,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
|
||||
@ -1361,21 +1578,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... */
|
||||
}
|
||||
@ -1726,7 +1945,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);
|
||||
}
|
||||
|
||||
@ -1789,7 +2008,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);
|
||||
}
|
||||
|
@ -58,7 +58,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;
|
||||
@ -97,7 +97,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
|
||||
|
@ -32,5 +32,6 @@ 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
|
||||
|
@ -53,6 +53,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;
|
||||
@ -79,7 +80,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;
|
||||
@ -89,13 +90,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);
|
||||
@ -192,6 +193,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)
|
||||
@ -259,7 +272,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);
|
||||
@ -409,7 +422,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);
|
||||
@ -440,7 +453,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);
|
||||
@ -468,7 +481,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);
|
||||
|
@ -42,6 +42,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;
|
||||
|
||||
@ -67,6 +69,7 @@ typedef enum {
|
||||
_NET_WM_BYPASS_COMPOSITOR_HINT_OFF = 2,
|
||||
} MetaBypassCompositorHintValue;
|
||||
|
||||
|
||||
struct _MetaWindow
|
||||
{
|
||||
GObject parent_instance;
|
||||
@ -75,6 +78,8 @@ struct _MetaWindow
|
||||
MetaScreen *screen;
|
||||
const MetaMonitorInfo *monitor;
|
||||
MetaWorkspace *workspace;
|
||||
MetaWindowClientType client_type;
|
||||
MetaWaylandSurface *surface;
|
||||
Window xwindow;
|
||||
/* may be NULL! not all windows get decorated */
|
||||
MetaFrame *frame;
|
||||
@ -93,7 +98,7 @@ struct _MetaWindow
|
||||
|
||||
MetaWindowType type;
|
||||
Atom type_atom;
|
||||
|
||||
|
||||
/* NOTE these five are not in UTF-8, we just treat them as random
|
||||
* binary data
|
||||
*/
|
||||
@ -119,6 +124,7 @@ struct _MetaWindow
|
||||
Window xtransient_for;
|
||||
Window xgroup_leader;
|
||||
Window xclient_leader;
|
||||
MetaWindow *transient_for;
|
||||
|
||||
/* Initial workspace property */
|
||||
int initial_workspace;
|
||||
@ -232,7 +238,7 @@ struct _MetaWindow
|
||||
/* These are the flags from WM_PROTOCOLS */
|
||||
guint take_focus : 1;
|
||||
guint delete_window : 1;
|
||||
guint net_wm_ping : 1;
|
||||
guint can_ping : 1;
|
||||
/* Globally active / No input */
|
||||
guint input : 1;
|
||||
|
||||
@ -341,6 +347,10 @@ 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;
|
||||
|
||||
@ -398,6 +408,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;
|
||||
|
||||
@ -486,10 +502,22 @@ struct _MetaWindowClass
|
||||
#define META_WINDOW_ALLOWS_HORIZONTAL_RESIZE(w) (META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS (w) && (w)->size_hints.min_width < (w)->size_hints.max_width)
|
||||
#define META_WINDOW_ALLOWS_VERTICAL_RESIZE(w) (META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS (w) && (w)->size_hints.min_height < (w)->size_hints.max_height)
|
||||
|
||||
MetaWindow* meta_window_new (MetaDisplay *display,
|
||||
Window xwindow,
|
||||
gboolean must_be_viewable,
|
||||
MetaCompEffect effect);
|
||||
MetaWindow * _meta_window_shared_new (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindowClientType client_type,
|
||||
MetaWaylandSurface *surface,
|
||||
Window xwindow,
|
||||
gulong existing_wm_state,
|
||||
MetaCompEffect effect,
|
||||
XWindowAttributes *attrs);
|
||||
|
||||
MetaWindow * meta_window_x11_new (MetaDisplay *display,
|
||||
Window xwindow,
|
||||
gboolean must_be_viewable,
|
||||
MetaCompEffect effect);
|
||||
MetaWindow * meta_window_wayland_new (MetaDisplay *display,
|
||||
MetaWaylandSurface *surface);
|
||||
|
||||
void meta_window_unmanage (MetaWindow *window,
|
||||
guint32 timestamp);
|
||||
void meta_window_calc_showing (MetaWindow *window);
|
||||
@ -588,12 +616,11 @@ void meta_window_move_resize_request(MetaWindow *window,
|
||||
int y,
|
||||
int width,
|
||||
int height);
|
||||
gboolean meta_window_configure_request (MetaWindow *window,
|
||||
XEvent *event);
|
||||
gboolean meta_window_property_notify (MetaWindow *window,
|
||||
XEvent *event);
|
||||
gboolean meta_window_client_message (MetaWindow *window,
|
||||
XEvent *event);
|
||||
void meta_window_move_resize_wayland (MetaWindow *window,
|
||||
int width,
|
||||
int height,
|
||||
int dx,
|
||||
int dy);
|
||||
void meta_window_set_focused_internal (MetaWindow *window,
|
||||
gboolean focused);
|
||||
|
||||
@ -607,6 +634,9 @@ void meta_window_show_menu (MetaWindow *window,
|
||||
int button,
|
||||
guint32 timestamp);
|
||||
|
||||
gboolean meta_window_titlebar_is_onscreen (MetaWindow *window);
|
||||
void meta_window_shove_titlebar_onscreen (MetaWindow *window);
|
||||
|
||||
void meta_window_set_gravity (MetaWindow *window,
|
||||
int gravity);
|
||||
|
||||
@ -615,12 +645,13 @@ 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);
|
||||
|
||||
int meta_window_get_current_tile_monitor_number (MetaWindow *window);
|
||||
void meta_window_get_current_tile_area (MetaWindow *window,
|
||||
MetaRectangle *tile_area);
|
||||
|
||||
@ -652,7 +683,9 @@ 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);
|
||||
|
||||
@ -664,8 +697,6 @@ void meta_window_set_user_time (MetaWindow *window,
|
||||
|
||||
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_for_monitors_changed (MetaWindow *window);
|
||||
void meta_window_update_on_all_workspaces (MetaWindow *window);
|
||||
|
||||
@ -679,18 +710,41 @@ 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_set_custom_frame_extents (MetaWindow *window,
|
||||
GtkBorder *extents);
|
||||
|
||||
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);
|
||||
|
||||
Window meta_window_get_toplevel_xwindow (MetaWindow *window);
|
||||
|
||||
void meta_window_get_client_area_rect (const MetaWindow *window,
|
||||
cairo_rectangle_int_t *rect);
|
||||
|
||||
gboolean meta_window_is_client_decorated (MetaWindow *window);
|
||||
void meta_window_activate_full (MetaWindow *window,
|
||||
guint32 timestamp,
|
||||
MetaClientType source_indication,
|
||||
MetaWorkspace *workspace);
|
||||
|
||||
#endif
|
||||
|
@ -35,10 +35,11 @@
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
#define _XOPEN_SOURCE 500 /* for gethostname() */
|
||||
#define _SVID_SOURCE /* for gethostname() */
|
||||
|
||||
#include <config.h>
|
||||
#include "window-props.h"
|
||||
#include "window-x11.h"
|
||||
#include <meta/errors.h>
|
||||
#include "xprops.h"
|
||||
#include "frame.h"
|
||||
@ -229,7 +230,7 @@ reload_net_wm_window_type (MetaWindow *window,
|
||||
MetaPropValue *value,
|
||||
gboolean initial)
|
||||
{
|
||||
meta_window_update_net_wm_type (window);
|
||||
meta_window_x11_update_net_wm_type (window);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -302,22 +303,18 @@ reload_gtk_frame_extents (MetaWindow *window,
|
||||
}
|
||||
else
|
||||
{
|
||||
GtkBorder *extents = &window->custom_frame_extents;
|
||||
|
||||
window->has_custom_frame_extents = TRUE;
|
||||
extents->left = (int)value->v.cardinal_list.cardinals[0];
|
||||
extents->right = (int)value->v.cardinal_list.cardinals[1];
|
||||
extents->top = (int)value->v.cardinal_list.cardinals[2];
|
||||
extents->bottom = (int)value->v.cardinal_list.cardinals[3];
|
||||
GtkBorder extents;
|
||||
extents.left = (int)value->v.cardinal_list.cardinals[0];
|
||||
extents.right = (int)value->v.cardinal_list.cardinals[1];
|
||||
extents.top = (int)value->v.cardinal_list.cardinals[2];
|
||||
extents.bottom = (int)value->v.cardinal_list.cardinals[3];
|
||||
meta_window_set_custom_frame_extents (window, &extents);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
window->has_custom_frame_extents = FALSE;
|
||||
meta_window_set_custom_frame_extents (window, NULL);
|
||||
}
|
||||
|
||||
if (!initial)
|
||||
meta_window_queue(window, META_QUEUE_MOVE_RESIZE);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -333,7 +330,7 @@ reload_wm_window_role (MetaWindow *window,
|
||||
MetaPropValue *value,
|
||||
gboolean initial)
|
||||
{
|
||||
meta_window_update_role (window);
|
||||
meta_window_x11_update_role (window);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -346,7 +343,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
|
||||
{
|
||||
@ -491,28 +488,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
|
||||
@ -567,7 +555,7 @@ reload_opaque_region (MetaWindow *window,
|
||||
MetaPropValue *value,
|
||||
gboolean initial)
|
||||
{
|
||||
meta_window_update_opaque_region_x11 (window);
|
||||
meta_window_x11_update_opaque_region (window);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -854,7 +842,7 @@ reload_mwm_hints (MetaWindow *window,
|
||||
|
||||
meta_window_recalc_features (window);
|
||||
|
||||
/* We do all this anyhow at the end of meta_window_new() */
|
||||
/* We do all this anyhow at the end of meta_window_x11_new() */
|
||||
if (!window->constructing)
|
||||
{
|
||||
if (window->decorated)
|
||||
@ -877,23 +865,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",
|
||||
@ -1427,7 +1407,7 @@ reload_wm_protocols (MetaWindow *window,
|
||||
|
||||
window->take_focus = FALSE;
|
||||
window->delete_window = FALSE;
|
||||
window->net_wm_ping = FALSE;
|
||||
window->can_ping = FALSE;
|
||||
|
||||
if (value->type == META_PROP_VALUE_INVALID)
|
||||
return;
|
||||
@ -1443,7 +1423,7 @@ reload_wm_protocols (MetaWindow *window,
|
||||
window->delete_window = TRUE;
|
||||
else if (value->v.atom_list.atoms[i] ==
|
||||
window->display->atom__NET_WM_PING)
|
||||
window->net_wm_ping = TRUE;
|
||||
window->can_ping = TRUE;
|
||||
++i;
|
||||
}
|
||||
|
||||
@ -1536,7 +1516,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)
|
||||
{
|
||||
@ -1545,8 +1525,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;
|
||||
}
|
||||
@ -1556,8 +1535,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;
|
||||
@ -1573,10 +1551,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 =
|
||||
@ -1588,46 +1562,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
|
||||
@ -1714,12 +1656,12 @@ reload_window_opacity (MetaWindow *window,
|
||||
gboolean initial)
|
||||
|
||||
{
|
||||
guint8 opacity = 0xFF;
|
||||
int requested_value = 0xFF;
|
||||
|
||||
if (value->type != META_PROP_VALUE_INVALID)
|
||||
opacity = (guint8)((gfloat)value->v.cardinal * 255.0 / ((gfloat)0xffffffff));
|
||||
requested_value = (int) value->v.cardinal;
|
||||
|
||||
meta_window_set_opacity (window, opacity);
|
||||
meta_window_set_opacity (window, requested_value);
|
||||
}
|
||||
|
||||
#define RELOAD_STRING(var_name, propname) \
|
||||
@ -1819,8 +1761,8 @@ meta_display_init_window_prop_hooks (MetaDisplay *display)
|
||||
{ display->atom__NET_WM_ICON_GEOMETRY, META_PROP_VALUE_CARDINAL_LIST, reload_icon_geometry, FALSE, FALSE },
|
||||
{ display->atom_WM_CLIENT_LEADER, META_PROP_VALUE_INVALID, complain_about_broken_client, FALSE, FALSE },
|
||||
{ display->atom_SM_CLIENT_ID, META_PROP_VALUE_INVALID, complain_about_broken_client, FALSE, FALSE },
|
||||
{ display->atom_WM_WINDOW_ROLE, META_PROP_VALUE_INVALID, reload_wm_window_role, FALSE, FALSE },
|
||||
{ display->atom__NET_WM_WINDOW_TYPE, META_PROP_VALUE_INVALID, reload_net_wm_window_type, FALSE, TRUE },
|
||||
{ display->atom_WM_WINDOW_ROLE, META_PROP_VALUE_INVALID, reload_wm_window_role, TRUE, FALSE },
|
||||
{ display->atom__NET_WM_WINDOW_TYPE, META_PROP_VALUE_INVALID, reload_net_wm_window_type, TRUE, TRUE },
|
||||
{ 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 },
|
||||
|
1503
src/core/window-x11.c
Normal file
1503
src/core/window-x11.c
Normal file
File diff suppressed because it is too large
Load Diff
45
src/core/window-x11.h
Normal file
45
src/core/window-x11.h
Normal file
@ -0,0 +1,45 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2001 Havoc Pennington
|
||||
* Copyright (C) 2002 Red Hat, Inc.
|
||||
* Copyright (C) 2003, 2004 Rob Adams
|
||||
* Copyright (C) 2004-2006 Elijah Newren
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef META_WINDOW_X11_H
|
||||
#define META_WINDOW_X11_H
|
||||
|
||||
#include <meta/window.h>
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
void meta_window_x11_set_net_wm_state (MetaWindow *window);
|
||||
void meta_window_x11_set_wm_state (MetaWindow *window);
|
||||
|
||||
void meta_window_x11_update_role (MetaWindow *window);
|
||||
void meta_window_x11_update_net_wm_type (MetaWindow *window);
|
||||
void meta_window_x11_update_opaque_region (MetaWindow *window);
|
||||
void meta_window_x11_update_input_region (MetaWindow *window);
|
||||
void meta_window_x11_update_shape_region (MetaWindow *window);
|
||||
|
||||
gboolean meta_window_x11_configure_request (MetaWindow *window,
|
||||
XEvent *event);
|
||||
gboolean meta_window_x11_property_notify (MetaWindow *window,
|
||||
XEvent *event);
|
||||
gboolean meta_window_x11_client_message (MetaWindow *window,
|
||||
XEvent *event);
|
||||
|
||||
#endif
|
3170
src/core/window.c
3170
src/core/window.c
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user