Compare commits
379 Commits
METACITY_2
...
METACITY_2
Author | SHA1 | Date | |
---|---|---|---|
![]() |
3e55c138f1 | ||
![]() |
81256ebe48 | ||
![]() |
8722c60a28 | ||
![]() |
8f09a12069 | ||
![]() |
c68c26b7f8 | ||
![]() |
d419955ddc | ||
![]() |
af593aa5c5 | ||
![]() |
191baa3c76 | ||
![]() |
c8c666f855 | ||
![]() |
edea47d113 | ||
![]() |
b164d11b90 | ||
![]() |
0cc7e939ab | ||
![]() |
2276f91162 | ||
![]() |
63ea328ea8 | ||
![]() |
fe34523949 | ||
![]() |
d79a571d0a | ||
![]() |
a34944d341 | ||
![]() |
b569dddc17 | ||
![]() |
5d33a1bbb8 | ||
![]() |
9da34955f7 | ||
![]() |
536bb240ef | ||
![]() |
ef1c6e9214 | ||
![]() |
90359a5346 | ||
![]() |
9e341dd4d8 | ||
![]() |
2168cd3eb7 | ||
![]() |
25910508ae | ||
![]() |
c4fa0d118c | ||
![]() |
ca3ed6a1eb | ||
![]() |
0201fcfc6c | ||
![]() |
07e4cacf14 | ||
![]() |
79eb53bd53 | ||
![]() |
b694312f1c | ||
![]() |
3cca3f3ee9 | ||
![]() |
b01408f358 | ||
![]() |
4fc6a7ce65 | ||
![]() |
e657ef87ab | ||
![]() |
3bc5cc1ce7 | ||
![]() |
49971fc1ef | ||
![]() |
569ff8a34c | ||
![]() |
2d73af1530 | ||
![]() |
470dc30174 | ||
![]() |
7dd25001ce | ||
![]() |
9b0ba2f274 | ||
![]() |
8938ea3fa1 | ||
![]() |
df93236627 | ||
![]() |
5c587726ae | ||
![]() |
87100b64d9 | ||
![]() |
def5a12ff0 | ||
![]() |
31f0853ca8 | ||
![]() |
fb41e2bc8d | ||
![]() |
aa077d95c0 | ||
![]() |
b004ef4e15 | ||
![]() |
7c58ecb657 | ||
![]() |
8144a962e7 | ||
![]() |
8c3bce3f98 | ||
![]() |
3b0478776d | ||
![]() |
c53538b1c2 | ||
![]() |
2ba196b310 | ||
![]() |
4beb9df364 | ||
![]() |
6fb90bc723 | ||
![]() |
dd86330ff8 | ||
![]() |
f9772ac685 | ||
![]() |
312454150b | ||
![]() |
3fac671fc8 | ||
![]() |
dc5dff7e9a | ||
![]() |
199e2b6988 | ||
![]() |
d3f1996655 | ||
![]() |
277236f730 | ||
![]() |
0d06471910 | ||
![]() |
4de104f9cf | ||
![]() |
189c8b9b11 | ||
![]() |
555d7dc90c | ||
![]() |
2ab4a35c53 | ||
![]() |
b62aba4401 | ||
![]() |
3800dac492 | ||
![]() |
bba4df7187 | ||
![]() |
c808195eef | ||
![]() |
cb595266fd | ||
![]() |
3ba437d508 | ||
![]() |
28ae1b40df | ||
![]() |
b2352cf9e2 | ||
![]() |
3d62fedfa2 | ||
![]() |
6c6d871abc | ||
![]() |
39b7e2ed79 | ||
![]() |
dc856f0fdb | ||
![]() |
39cb0ee987 | ||
![]() |
78634dd4b8 | ||
![]() |
7c8f91a3a9 | ||
![]() |
e199b946ee | ||
![]() |
6b8a3a1af5 | ||
![]() |
445e982894 | ||
![]() |
d80721697d | ||
![]() |
d818e18d81 | ||
![]() |
f89973dbfc | ||
![]() |
c35fbb3f5f | ||
![]() |
d9b4fdd845 | ||
![]() |
0484ecd355 | ||
![]() |
277af5e783 | ||
![]() |
3274df7df1 | ||
![]() |
7a68a53322 | ||
![]() |
c7c4efa1c1 | ||
![]() |
e38609f4a2 | ||
![]() |
9d320ba435 | ||
![]() |
18107f5f36 | ||
![]() |
88b9efd0b7 | ||
![]() |
b42e848986 | ||
![]() |
7489dbc34e | ||
![]() |
4c96afba71 | ||
![]() |
7ea55a1e54 | ||
![]() |
77a207c9cc | ||
![]() |
1bea8254ba | ||
![]() |
1f5130dc93 | ||
![]() |
1d92dcdadd | ||
![]() |
e7b08814ec | ||
![]() |
69e245b237 | ||
![]() |
9ad9fd4290 | ||
![]() |
c47e425527 | ||
![]() |
9051b70d40 | ||
![]() |
43b5985c20 | ||
![]() |
0ec2133e81 | ||
![]() |
9fe845581b | ||
![]() |
fc23f9b22f | ||
![]() |
cbd0312605 | ||
![]() |
57bedc42a4 | ||
![]() |
acc6c97997 | ||
![]() |
dcef402d68 | ||
![]() |
d4973e8d1b | ||
![]() |
1dd78e38ff | ||
![]() |
adc46fc970 | ||
![]() |
3917d818f5 | ||
![]() |
cc5def1021 | ||
![]() |
77a331a1e3 | ||
![]() |
c12dc9de3c | ||
![]() |
ab7f789cb0 | ||
![]() |
ae86fcd5b2 | ||
![]() |
74d4768b8e | ||
![]() |
fe74d5da13 | ||
![]() |
1fec6583ff | ||
![]() |
bf6da74e6a | ||
![]() |
e8fb842aad | ||
![]() |
76e4fd8a07 | ||
![]() |
3cca3381ba | ||
![]() |
7d8087f3e8 | ||
![]() |
419e063a24 | ||
![]() |
05323ef21a | ||
![]() |
6e4d6da191 | ||
![]() |
9c75b95146 | ||
![]() |
edfaf1a6bc | ||
![]() |
1538ffa04c | ||
![]() |
3d661f9bc7 | ||
![]() |
34662a6a3a | ||
![]() |
92dff14d55 | ||
![]() |
61e1bb57e7 | ||
![]() |
5e85bf7210 | ||
![]() |
85f9c499fb | ||
![]() |
42dd771506 | ||
![]() |
8afa1da3a7 | ||
![]() |
f0c5312b6e | ||
![]() |
af8e3c0d93 | ||
![]() |
69f1a9d3bd | ||
![]() |
b126f61eed | ||
![]() |
b1ba1cbad0 | ||
![]() |
a58ea99379 | ||
![]() |
cb38ccc57f | ||
![]() |
41ae99000b | ||
![]() |
0f05948c95 | ||
![]() |
5744f08056 | ||
![]() |
6681725dcd | ||
![]() |
a99a2ab14c | ||
![]() |
616bffdeef | ||
![]() |
a067105a14 | ||
![]() |
76291d31b7 | ||
![]() |
bcbdfbe177 | ||
![]() |
5eaf79f6fa | ||
![]() |
1cabbfef25 | ||
![]() |
454638fd0c | ||
![]() |
4a06163710 | ||
![]() |
83f82e5f28 | ||
![]() |
db87abfb19 | ||
![]() |
35b47b59ab | ||
![]() |
a8f382019a | ||
![]() |
a1324af018 | ||
![]() |
ed37bcc258 | ||
![]() |
cb84bc3e1d | ||
![]() |
76dff49a3e | ||
![]() |
5af52e9fe1 | ||
![]() |
6dfb56cc77 | ||
![]() |
ab1adf6c06 | ||
![]() |
0ca0bca0d0 | ||
![]() |
3ae4e25162 | ||
![]() |
7535f0f58a | ||
![]() |
ca3236f76c | ||
![]() |
7d2f0bf1fe | ||
![]() |
3f4e194c8f | ||
![]() |
22bc36eb3b | ||
![]() |
7592470dab | ||
![]() |
179987132c | ||
![]() |
1e64cf4a8b | ||
![]() |
7859b69a88 | ||
![]() |
3e5b9776c6 | ||
![]() |
cdb94d7e57 | ||
![]() |
3e394580da | ||
![]() |
23a5f5bb58 | ||
![]() |
78826fd35c | ||
![]() |
616ce23a9a | ||
![]() |
3c24269ceb | ||
![]() |
ac606c6223 | ||
![]() |
1a16108310 | ||
![]() |
3cb72d338c | ||
![]() |
51ade19ae9 | ||
![]() |
fb3b5c92f8 | ||
![]() |
ff87e70e8d | ||
![]() |
34cb1840cf | ||
![]() |
9f21db5366 | ||
![]() |
0dcc85e79a | ||
![]() |
acb5e483a9 | ||
![]() |
5750974d5d | ||
![]() |
b62dd8d130 | ||
![]() |
e9c8fd8527 | ||
![]() |
addc04f463 | ||
![]() |
411fd3db44 | ||
![]() |
451c990dd5 | ||
![]() |
3a6dd75f63 | ||
![]() |
975130ff70 | ||
![]() |
abde6fc359 | ||
![]() |
10f3ce3de0 | ||
![]() |
618d282893 | ||
![]() |
ba1e888cba | ||
![]() |
7e78d707ea | ||
![]() |
12d5978268 | ||
![]() |
d769484f35 | ||
![]() |
a524fb9c9c | ||
![]() |
239cf4a060 | ||
![]() |
984154e011 | ||
![]() |
14f120f131 | ||
![]() |
c118c50117 | ||
![]() |
89f01eb73a | ||
![]() |
ae85a33614 | ||
![]() |
fe47d4436d | ||
![]() |
fee1fb094a | ||
![]() |
83d21b97c4 | ||
![]() |
f908d78e4b | ||
![]() |
e2ea1cf722 | ||
![]() |
10f0cfd2dc | ||
![]() |
7e2d5185a0 | ||
![]() |
5bf3e39ef6 | ||
![]() |
a03e78210f | ||
![]() |
ecf75915b9 | ||
![]() |
2214fd75d9 | ||
![]() |
1dea155c8c | ||
![]() |
694a4352bc | ||
![]() |
4cbe4e7558 | ||
![]() |
4f99d7e17f | ||
![]() |
3d4717c8e1 | ||
![]() |
bf4172dc7c | ||
![]() |
4d097fbc18 | ||
![]() |
13cdd8ad3d | ||
![]() |
c7c9f0ee52 | ||
![]() |
ea50cc7239 | ||
![]() |
59d99fb9d1 | ||
![]() |
4b683fdbf2 | ||
![]() |
4730cb57bd | ||
![]() |
c2b4a65e75 | ||
![]() |
793c1d7a43 | ||
![]() |
123684d80b | ||
![]() |
8674051c58 | ||
![]() |
cb109b9637 | ||
![]() |
6445d16fd5 | ||
![]() |
21d5a43c29 | ||
![]() |
f7a202eb81 | ||
![]() |
eb102ab37f | ||
![]() |
aaafd14124 | ||
![]() |
3bf211c89f | ||
![]() |
127a89886b | ||
![]() |
82a6c99485 | ||
![]() |
d0564def9c | ||
![]() |
1f7446cd88 | ||
![]() |
cf3deef6ea | ||
![]() |
28aeacb247 | ||
![]() |
d75c170fef | ||
![]() |
ea1568c720 | ||
![]() |
9b6aeeef12 | ||
![]() |
25923105e4 | ||
![]() |
09a5c23585 | ||
![]() |
8f59776087 | ||
![]() |
905b4e8e0d | ||
![]() |
b11ac45352 | ||
![]() |
fd1e1c76e8 | ||
![]() |
c5d4cbd742 | ||
![]() |
fc7a246074 | ||
![]() |
bdb60c4e72 | ||
![]() |
d07fccc8b1 | ||
![]() |
543f85a1db | ||
![]() |
ab176cf831 | ||
![]() |
ef47c243c5 | ||
![]() |
01cd31f7f4 | ||
![]() |
ad2c7c6ce3 | ||
![]() |
4d6ee9ea49 | ||
![]() |
a401b82089 | ||
![]() |
54751db00a | ||
![]() |
16de3b603b | ||
![]() |
5f30265879 | ||
![]() |
0b5f11ae5a | ||
![]() |
6ef997d3ad | ||
![]() |
369ab5bc2b | ||
![]() |
188bc50a35 | ||
![]() |
042f5e3e6b | ||
![]() |
82a3cad018 | ||
![]() |
c910286c02 | ||
![]() |
07ef2db60c | ||
![]() |
5f3b961989 | ||
![]() |
3393f4707c | ||
![]() |
77b8ed579a | ||
![]() |
d02815b364 | ||
![]() |
9cfa08d4f4 | ||
![]() |
77440097e1 | ||
![]() |
985195858d | ||
![]() |
d161ddcff8 | ||
![]() |
e27bebc49b | ||
![]() |
9ac0eab5c3 | ||
![]() |
4d220adc32 | ||
![]() |
7750026603 | ||
![]() |
92ac98ef47 | ||
![]() |
1161cfdeba | ||
![]() |
8d0a3358c7 | ||
![]() |
20c9efaf82 | ||
![]() |
192943640e | ||
![]() |
46bdc87e94 | ||
![]() |
35674ae862 | ||
![]() |
04433e5b9d | ||
![]() |
f8cd8ae75f | ||
![]() |
94d4d039c2 | ||
![]() |
3c6b291641 | ||
![]() |
8c2a5dbc19 | ||
![]() |
92971d6377 | ||
![]() |
add8531eb4 | ||
![]() |
eed6f29b30 | ||
![]() |
832968ddd6 | ||
![]() |
7a8e3c94fd | ||
![]() |
4d0d192761 | ||
![]() |
c3ed3a3090 | ||
![]() |
b7c040be26 | ||
![]() |
e92403441a | ||
![]() |
9232b75ef4 | ||
![]() |
1b7d0fbc87 | ||
![]() |
0a1a7e523c | ||
![]() |
d3e27ed02a | ||
![]() |
3e01e149eb | ||
![]() |
04a4f7c363 | ||
![]() |
6a08faf99b | ||
![]() |
a3e7c9c222 | ||
![]() |
1a430825c3 | ||
![]() |
82664c5d76 | ||
![]() |
f8f6016970 | ||
![]() |
b1847959b1 | ||
![]() |
e4cf87c985 | ||
![]() |
928364e915 | ||
![]() |
78ce6d6a60 | ||
![]() |
a6b60a2024 | ||
![]() |
f5fdb07165 | ||
![]() |
f127b2bc98 | ||
![]() |
5352caac31 | ||
![]() |
d24fa066a4 | ||
![]() |
d010bbb5ed | ||
![]() |
636da5ebff | ||
![]() |
a42e4dac42 | ||
![]() |
f966ab041b | ||
![]() |
9e17747f3c | ||
![]() |
5a85bf18fe | ||
![]() |
833fc11c47 | ||
![]() |
8215a35993 | ||
![]() |
f3ade45b96 | ||
![]() |
71b27c6228 | ||
![]() |
053759fad6 | ||
![]() |
f6738a930c | ||
![]() |
0f48ff448c | ||
![]() |
ca539199b2 | ||
![]() |
c348794431 | ||
![]() |
0610f92f0f |
@@ -29,3 +29,7 @@ COPYING
|
||||
intltool-*
|
||||
metacity.spec
|
||||
autom4te.cache
|
||||
compile
|
||||
depcomp
|
||||
omf.make
|
||||
xmldocs.make
|
||||
|
54
HACKING
54
HACKING
@@ -11,6 +11,7 @@ is nonetheless useful.
|
||||
|
||||
Overview
|
||||
Administrative issues
|
||||
Minimal Building/Testing Environment
|
||||
Relevant standards and X properties
|
||||
Debugging and testing
|
||||
Debugging logs
|
||||
@@ -34,6 +35,32 @@ Administrative issues
|
||||
instructions is that the minor version number of a Metacity release
|
||||
should always be a number from the Fibonacci sequence.
|
||||
|
||||
Minimal Building/Testing Environment
|
||||
You do not need to _install_ a development version of Metacity to
|
||||
build, run and test it; you can run it from some temporary
|
||||
directory. Also, you do not need to build all of Gnome in order to
|
||||
build a development version of Metacity -- odds are, you may be able
|
||||
to build metacity from CVS without building any other modules.
|
||||
|
||||
As long as you have gtk+ >= 2.10 with your distro (gtk+ >= 2.6 if
|
||||
you manually revert the change from bug 348633), you should be able
|
||||
to install your distro's development packages (e.g. gtk2-devel,
|
||||
GConf2-devel, startup-notification-devel on Fedora; also, remember
|
||||
to install the gnome-common package which is needed for building cvs
|
||||
versions of Gnome modules like Metacity) as well as the standard
|
||||
development tools (gcc, autoconf, automake, pkg-config, intltool,
|
||||
and libtool) and be ready to build and test Metacity. Steps to do
|
||||
so:
|
||||
|
||||
$ cvs -q -z3 -d :pserver:anonymous@anoncvs.gnome.org:/cvs/gnome \
|
||||
checkout metacity
|
||||
$ cd metacity
|
||||
$ ./autogen.sh --prefix /usr
|
||||
$ make
|
||||
$ ./src/metacity --replace
|
||||
|
||||
Again, note that you do not need to run 'make install'.
|
||||
|
||||
Relevant standards and X properties
|
||||
There are two documents that describe some basics about how window
|
||||
managers should behave: the ICCCM (Inter-Client Communication Conventions
|
||||
@@ -197,11 +224,30 @@ Debugging information
|
||||
of window without launching a full desktop.
|
||||
|
||||
Technical gotchas to keep in mind
|
||||
Files that include gdk.h or gtk.h are not supposed to include display.h
|
||||
or window.h or other core files.
|
||||
Files that include gdk.h or gtk.h are not supposed to include
|
||||
display.h or window.h or other core files. Files in the core
|
||||
(display.[hc], window.[hc]) are not supposed to include gdk.h or
|
||||
gtk.h. Reasons:
|
||||
|
||||
Files in the core (display.[hc], window.[hc]) are not supposed to include
|
||||
gdk.h or gtk.h.
|
||||
"Basically you don't want GDK most of the time. It adds
|
||||
abstractions that cause problems, because they aren't designed to
|
||||
be used in a WM where we do weird stuff (display grabs, and just
|
||||
being the WM). At best GDK adds inefficiency, at worst it breaks
|
||||
things in weird ways where you have to be a GDK guru to figure
|
||||
them out. Owen also told me that they didn't want to start adding
|
||||
a lot of hacks to GDK to let a WM use it; we both agreed back in
|
||||
the mists of time that metacity would only use it for the "UI"
|
||||
bits as it does.
|
||||
|
||||
Having the split in the source code contains and makes very clear
|
||||
the interface between the WM and GDK/GTK. This keeps people from
|
||||
introducing extra GDK/GTK usage when it isn't needed or
|
||||
appropriate. Also, it speeds up the compilation a bit, though this
|
||||
was perhaps more relevant 5 years ago than it is now.
|
||||
|
||||
There was also a very old worry that the GDK stuff might have to
|
||||
be in a separate process to work right; that turned out to be
|
||||
untrue. Though who knows what issues the CM will introduce."
|
||||
|
||||
Remember that strings stored in X properties are not in UTF-8, and they
|
||||
have to end up in UTF-8 before we try putting them through Pango.
|
||||
|
14
MAINTAINERS
Normal file
14
MAINTAINERS
Normal file
@@ -0,0 +1,14 @@
|
||||
Currently active maintainers
|
||||
----------------------------
|
||||
|
||||
Havoc Pennington
|
||||
E-mail: hp@redhat.com
|
||||
|
||||
Elijah Newren
|
||||
E-mail: newren@gmail.com
|
||||
|
||||
Søren Sandmann
|
||||
E-mail: sandmann@redhat.com
|
||||
|
||||
Thomas Thurman
|
||||
E-mail: thomas@thurman.org.uk
|
@@ -4,4 +4,4 @@ SUBDIRS=src po doc
|
||||
EXTRA_DIST=HACKING rationales.txt \
|
||||
intltool-extract.in intltool-merge.in intltool-update.in
|
||||
|
||||
DISTCLEANFILES = intltool-extract intltool-merge intltool-update
|
||||
DISTCLEANFILES = intltool-extract intltool-merge intltool-update po/stamp-it po/.intltool-merge-cache
|
||||
|
478
NEWS
478
NEWS
@@ -1,3 +1,411 @@
|
||||
2.17.2
|
||||
======
|
||||
|
||||
Thanks to Priit Laes, Bruno Boaventura, Kjartan Maraas, Justin Mason,
|
||||
Elijah Newren and Dan Mick for improvements in this release.
|
||||
|
||||
- implement handle_move_to_{side|corner}_* to allow the user to flip a
|
||||
window to the side or corner of the screen. (Justin) [#317884]
|
||||
- fix strict focus mode by picking up on res_class (Dan) [#361054]
|
||||
- remove deprecated gtk stuff (Priit, Bruno)
|
||||
- string fixes (Kjartan) [#363354, #363355]
|
||||
|
||||
Translations
|
||||
Jakub Friedl (cs), Francisco Javier F. Serrador (es), Ilkka Tuohela (fi),
|
||||
Christophe Merlet (RedFox) (fr), Kjartan Maraas (nb)
|
||||
|
||||
2.17.1
|
||||
======
|
||||
|
||||
Thanks to Bruno Boaventura and Carlo Wood for improvements in this
|
||||
release.
|
||||
|
||||
- sync metacity workspace previous with libwnck (Bruno) [#341893]
|
||||
- fix cases when titlebar is allowed offscreen and shouldn't be, and
|
||||
vice-versa (Carlo) [#333995]
|
||||
|
||||
Translations
|
||||
Ilkka Tuohela (fi)
|
||||
|
||||
2.17.0
|
||||
======
|
||||
|
||||
Thanks to Elijah Newren, Jens Granseuer, Bruno Boaventura, Carlo Wood,
|
||||
and Thomas Thurman for changes in this release.
|
||||
|
||||
- version 2 of theme format: stick, shade and above buttons on titlebar,
|
||||
variable rounding on corners, variable transparency on window
|
||||
backgrounds, stock icons in themes, can remove all titlebar buttons
|
||||
from certain classes of window, and more (Thomas) [#102547 and
|
||||
dependencies]
|
||||
- improve "Force Quit" dialog (Bruno) [#121936]
|
||||
- ignore edge resistance when resizing with keyboard (Elijah) [#346782]
|
||||
- maintain window size and placement across restarts (Carlo) [#358042]
|
||||
- prevent crash when closing certain remote apps (Elijah) [#358514]
|
||||
- longstanding mouse-focus bug fixed which affected firefox's
|
||||
autocompletion (Elijah) [#357695]
|
||||
- ignore maximum size constraints when maximising (Elijah) [#327543]
|
||||
- warn translators to keep translations in sync with libwnck (Bruno)
|
||||
[#355620]
|
||||
- fixes for compilation warnings, etc (Elijah, Jens) [#348067, #356631]
|
||||
|
||||
Translators
|
||||
Ivar Smolin (et), Gabor Kelemen (hu), Luca Ferretti (it),
|
||||
Runa Bhattacharjee (bn_IN)
|
||||
|
||||
2.16.2
|
||||
======
|
||||
|
||||
Thanks to Eljah Newren, Maik Beckmann, Christian Hamar, Thomas Andersen,
|
||||
and Bruno Boaventura de Oliveira for changes in this release.
|
||||
|
||||
- partial audit to fix timestamp usage (Elijah) [part of #355180]
|
||||
- remove compilation warnings (Maik) [#355876]; (Bruno) [#355490,
|
||||
#355489]
|
||||
- automatic detection of stable/unstable in configure script
|
||||
(Christian/Elijah) [#356122]
|
||||
- make windows be stacked correctly before showing them (Thomas)
|
||||
[#332385]
|
||||
- use guint32 for timestamps (Elijah) [#348305]
|
||||
|
||||
Translators
|
||||
Wouter Bolsterlee (nl), Matic Žgur (sl), Francisco Javier F. Serrador (es),
|
||||
Vladimir Petkov (bg), Jordi Mallach (ca), Ilkka Tuohela (fi),
|
||||
Rajesh Ranjan (hi), Woodman Tuen (zh_HK, zh_TW), Ani Peter (ml),
|
||||
Felix (ta), Ankit Patel (gu), Mohammad DAMT (id)
|
||||
|
||||
2.16.1
|
||||
======
|
||||
|
||||
Thanks to Elijah Newren, Colin Watson, and Bruno Boaventura de Oliveira
|
||||
Lacerda for changes in this release.
|
||||
|
||||
- fix stuck grab, letting focus be transferred between windows (Elijah)
|
||||
[#354422 partial]
|
||||
- windows returning from fullscreen are constrained to be onscreen
|
||||
(Elijah) [#353699]
|
||||
- Clear the transient_for flag of a window after emitting a warning
|
||||
(Colin)
|
||||
- Replace copy_of_gdk_x11_window_set_user_time() with the real thing
|
||||
(Bruno) [#352293]
|
||||
|
||||
Translators
|
||||
David Lodge (en_GB), Ivar Smolin (et), Matic Žgur (sl),
|
||||
Vasiliy Faronov (ru)
|
||||
|
||||
2.16.0
|
||||
==
|
||||
|
||||
Thanks to Jens Granseuer for changes in this release.
|
||||
|
||||
- Fix the build with c89/gcc 2.95.
|
||||
|
||||
Translators
|
||||
Rahul Bhalerao (mr), Runa Bhattacharjee (bn_IN), Woodman Tuen
|
||||
(zh_HK, zh_TW), Kostas Papadimas (el), Ani Peter (ml),
|
||||
Jonathan Ernst (fr), Горан Ракић (sr, Gabor Kelemen (hu),
|
||||
Maxim Dziumanenko (uk), Duarte Loreto (pt), Jordi Mallach (ca),
|
||||
Gintautas Miliauskas (lt)
|
||||
|
||||
2.15.34
|
||||
==
|
||||
|
||||
Thanks to Stéphane Rosi, Vytautus Liuolia, Will Walker, Baptiste
|
||||
Mille-Mathias, Elijah Newren, Ed Catmur, and Thomas Andersen for fixes
|
||||
in this release.
|
||||
|
||||
- allow moving maximized windows between xineramas again (Stéphane)
|
||||
[#338660]
|
||||
- fix an uninitialized-usage bug with net_wm_user_time that breaks
|
||||
focus with new windows (Vytautus)
|
||||
- re-fix accessibility events for the alt-tab popup (Will) [#350624]
|
||||
- update the close pixmap to fit better with the other pixmaps of the
|
||||
menu (Baptiste) [#345498]
|
||||
- fix several fullscreen handling bugs I introduced, causing
|
||||
fullscreen windows to not actually be shown fullscreen (Elijah)
|
||||
[#343115]
|
||||
- fix keybindings with hex-values, coming from special extended
|
||||
keyboard keys (Ed) [#140448]
|
||||
- fix metacity-dialog handling of arguments (Thomas) [#340690]
|
||||
|
||||
Translators
|
||||
Vladimir Petkov (bg), Jordi Mallach (ca), Gabor Kelemen (hu),
|
||||
Mohammad DAMT (id), Wouter Bolsterlee (nl), Daniel Nylander (sv),
|
||||
Funda Wang (zh_CN)
|
||||
|
||||
2.15.21
|
||||
==
|
||||
|
||||
Thanks to Vincent Untz, Jens Granseuer, Björn Lindqvist, Dmitry
|
||||
Timoshkov, Thomas Thurman, Vytautas Liuolia, Thomas Andersen, Chris
|
||||
Ball, and Elijah Newren for fixes in this release.
|
||||
|
||||
- kill usage of libegg (Vincent) [#348633]
|
||||
- fix another C89 vs. C99 issue (Jens) [#347621]
|
||||
- make it so maximized windows do not have rounded corners (Björn)
|
||||
[#336850]
|
||||
- fix the heuristic for determining if windows can be made
|
||||
fullscreen, needed for WINE and possible also some legacy
|
||||
applications (Dmitry) [#346927]
|
||||
- make sure window features get recalculated when the screen is
|
||||
resized via XRandR (Dmitry) [#346927]
|
||||
- fitts' law fixes for titlebar buttons on maximized windows (Thomas
|
||||
Thurman) [#97703]
|
||||
- react to _NET_STARTUP_ID changes, as proposed for the new
|
||||
startup-notification/EWMH spec (Vytautas) [#347515]
|
||||
- return the window to maximized state if the window was "shaken
|
||||
loose" from maximized state during a resize but the resize is later
|
||||
aborted (Thomas Andersen) [#346719]
|
||||
- fix button lighting with dragged clicks (Björn) [#321474]
|
||||
- don't minimize in response to double clicks on the titlebar when
|
||||
minimiziation should not be allowed (Chris) [#347377]
|
||||
- fix some titlebar-not-on-screen constraint issues (Elijah)
|
||||
[#333328, #345522]
|
||||
|
||||
Translators
|
||||
Mahay Alam Khan (bn_IN), Jakub Friedl (cs), Iñaki Larrañaga
|
||||
Murgoitio (eu), Yuval Tanny (he), Rajesh Ranjan (hi), Jovan
|
||||
Naumovski (mk) Kjartan Maraas (nb), Leonid Kanter (ru)
|
||||
|
||||
2.15.13
|
||||
==
|
||||
|
||||
Thanks to Björn Lindqvist and Thomas Thurman for improvements in this
|
||||
release.
|
||||
|
||||
- grab alt+shift+button1 when trying to snap-move windows (Björn)
|
||||
- avoid a case where memory is written after it's freed (Thomas)
|
||||
|
||||
Translators
|
||||
Hendrik Richter (de), Kostas Papadimas (el), Jonathan Ernst (fr),
|
||||
Satoru SATOH (ja)
|
||||
|
||||
2.15.8
|
||||
==
|
||||
|
||||
Known as the "Elijah sucks for not reviewing a couple dozen patches"
|
||||
release. And for not getting on IRC soon enough to catch Marnanel and
|
||||
show him how to do the release. So, just translations this time.
|
||||
|
||||
Translations
|
||||
|
||||
Mahay Alam Khan (bn_IN), Rhys Jones (cy), Francisco Javier
|
||||
F. Serrador (es), Ilkka Tuohela (fi), Rajesh Ranjan (hi), Changwoo
|
||||
Ryu (ko), Fano Rajaonarisoa (mg), Sanlig Badral (mn), Слободан Д.
|
||||
Средојевић (sr), Funda Wang (zh_CN)
|
||||
|
||||
2.15.5
|
||||
==
|
||||
|
||||
Thanks to Björn Lindqvist, Søren Sandmann, Adam Jackson, Elijah
|
||||
Newren, and Aidan Delaney for improvements in this release.
|
||||
|
||||
- code cleanup in resizepopup.c (Björn) [#341648]
|
||||
- fix a logic bug so that the whole titlebar becomes sensitive to
|
||||
mouse clicks (Björn) [#336320]
|
||||
- make mouse cursor when moving windows become a hand (Björn) [#337376]
|
||||
- lots and lots of compositor improvements -- beginning of a new
|
||||
layer to abstract transition effects, shrinking and minimizing and
|
||||
exploding effects, fading in and out, unminimize animation that
|
||||
reverses minimize one, translucent menus, bounce on window focus,
|
||||
and all kinds of stuff I don't understand and can't summarize well
|
||||
(Søren, Adam)
|
||||
- Fix a crash on exit/logout from assuming a compositor would always
|
||||
exist (Elijah) [#342166]
|
||||
- code cleanup in tabpopup.c (Aidan Delaney) [#166890]
|
||||
|
||||
Translations
|
||||
Pema Geyleg (dz), Iñaki Larrañaga Murgoitio (eu), Theppitak
|
||||
Karoonboonyanan (th), Clytie Siddall (vi)
|
||||
|
||||
2.15.3
|
||||
==
|
||||
|
||||
Thanks to Søren Sandmann, Elijah Newren, Paolo Borelli, Björn
|
||||
Lindqvist, jylefort at FreeBSD org,
|
||||
|
||||
- various code cleanups (Søren)
|
||||
- prevent long titles from "sticking" in the tasklist (Elijah) [#330671]
|
||||
- handle sync counter notifications in the compositor (Søren)
|
||||
- notes/documentation updates (Elijah)
|
||||
- plug a small leak (Paolo)
|
||||
- remove a lot of dead code obsoleted by the new edge-resistance
|
||||
stuff (Björn) [#341561]
|
||||
- prevent a crash when changing resolution (jylefort) [#340847]
|
||||
- revert an accessibility module loading workaround from Gnome 2.6
|
||||
that has long since been fixed for us in gtk+ (Elijah) [#123372]
|
||||
|
||||
Translations
|
||||
Francisco Javier F. Serrador (es), Ignacio Casal Quinteiro (gl),
|
||||
Raivis Dejus (lv), Kjartan Maraas (nb), Funda Wang (zh_CN), Woodman
|
||||
Tuen (zh_HK), Woodman Tuen (zh_TW)
|
||||
|
||||
2.15.2
|
||||
==
|
||||
|
||||
Here's hoping that "third time's a charm." ;-) This release just
|
||||
fixes the translations-not-included issue. See
|
||||
http://mail.gnome.org/archives/desktop-devel-list/2006-April/msg00483.html
|
||||
for more details.
|
||||
|
||||
- Use gnome-autogen.sh like most other modules (Rodney)
|
||||
|
||||
2.15.1
|
||||
==
|
||||
|
||||
This release just fixes the control-center build (which depends upon
|
||||
libmetacity-private). Thanks to Vincent for catching the problem.
|
||||
|
||||
- Include boxes.h in the includes dir (Elijah) [#339708]
|
||||
|
||||
2.15.0
|
||||
==
|
||||
|
||||
Thanks to Thomas Thurman, Elijah Newren, Havoc Pennington, Björn
|
||||
Lindqvist, Gora Mohanty, Alejandro Andres, Andy Morum, Dan Sanders,
|
||||
Thomas Andersen, Brian Pepple, and Søren Sandmann for improvements in
|
||||
this release. (Note that "Thomas" below refers to Thomas Thurman if
|
||||
last name isn't specified)
|
||||
|
||||
- An endless array of compositor updates, not all of which are well
|
||||
explained in the ChangeLog. ;-) Includes an ability to enable and
|
||||
disable the compositor at runtime, fixed up wobbling effect and new
|
||||
explosion effect, special magnification handling, different opacity
|
||||
for different window types like menus, a way of scaling windows,
|
||||
handling of foreign displays, improved handling of window
|
||||
moving/resizing, various code restructuring, special runtime checks
|
||||
for correct extensions and other compositors, lots of bug fixes,
|
||||
and possibly other stuff I'm missing or not understanding (Søren)
|
||||
- Removed "move to another workspace" menu when there are exactly two
|
||||
workspaces (Thomas) [#151183]
|
||||
- fix type for compositing_manager schema entry (Elijah) [#335901]
|
||||
- Port more properties to our async system for code cleanliness and
|
||||
speed improvements (Havoc, Thomas)
|
||||
- Lots of code cleanup, even more code cleanup, wow our code was
|
||||
messy (Björn) [#335177, #337507, #336890, #338359]
|
||||
- Abstract out the functions for setting/unsetting demands attention
|
||||
hint and avoid doing it when the window isn't obscured (Thomas)
|
||||
[#305882]
|
||||
- Change strings to make them more readable, and more
|
||||
translatable (Gora) [#335720]
|
||||
- Reduce compiling warnings -- add a number of casts and change
|
||||
signedness on a number of variables (Björn) [#336032]
|
||||
- Fixed broken links in README (Alejandro) [#333303]
|
||||
- Add a tabbing function, bound to alt-f6 by default, to cycle
|
||||
through the windows of the current application (Thomas) [#94682]
|
||||
- Fix the build with --disable-xsync (Andy) [#336605]
|
||||
- Raise windows on maximize/unmaximize (Dan) [#335076]
|
||||
- Don't have confirmation windows make applications appear to be
|
||||
locked when closing via the window list (Dan) [#334899]
|
||||
- Allow any keybinding pref to be specified either with <foo>, a
|
||||
string, or <foo>_list, a list of strings, or both (Thomas)
|
||||
[#164831]
|
||||
- warn and ignore if transient_for is set to a non-top-level window
|
||||
(Thomas Andersen) [#335524]
|
||||
- Use po/LINGUAS for listing supported languages (Brian) [#337951]
|
||||
|
||||
Translations
|
||||
Vladimir Petkov (bg), Jordi Mallach (ca), Miloslav Trmac (cs), Rhys
|
||||
Jones (cy), Lasse Bang Mikkelsen (da), Frank Arnold (de), Kostas
|
||||
Papadimas (el), Francisco Javier F. Serrador (es), Ivar Smolin (et), Iñaki
|
||||
Larrañaga (eu), Farzaneh Sarafraz (fa), Ilkka Tuohela (fi), Ignacio Casal
|
||||
Quinteiro (gl), Ankit Patel (gu), Rajesh Ranjan (hi), Gabor Kelemen (hu),
|
||||
Satoru SATOH (ja), Alexander Didebulidze (ka), Žygimantas Beručka (lt),
|
||||
Kjartan Maraas (nb), Michiel Sikkes (nl), Åsmund Skjæveland (nn), Gora
|
||||
Mohanty (or), Raphael Higino (pt_BR), Duarte Loreto (pt), Mugurel Tudor (ro),
|
||||
Leonid Kanter (ru), Steve Murphy (rw), Laurent Dhima (sq), Слободан Д.
|
||||
Средојевић (sr), Daniel Nylander (sv), Theppitak Karoonboonyanan (th), Maxim
|
||||
Dziumanenko (uk), Clytie Siddall (vi), Funda Wang (zh_CN)
|
||||
|
||||
2.14.3
|
||||
==
|
||||
|
||||
This release just reverts the widely hated new focus behavior of Metacity
|
||||
2.14.x to the behavior found in 2.12.x. Patch came from Ron Yorston.
|
||||
See http://blogs.gnome.org/view/newren/2006/04/13/0 and
|
||||
http://mail.gnome.org/archives/release-team/2006-April/msg00025.html for
|
||||
more details.
|
||||
|
||||
- Add a focus_new_windows gconf key, change the default to 'smart' (2.12
|
||||
behavior) and add a 'strict' option to get 2.14 behavior. (Ron)
|
||||
[#326159]
|
||||
|
||||
Translations
|
||||
Vladimir Petkov (bg), Miloslav Trmac (cs), Frank Arnold (de), Francisco
|
||||
Javier F. Serrador (es), Ilkka Tuohela (fi), Tino Meinen (nl), Åsmund
|
||||
Skjæveland (nn), Raphael Higino (pt_BR), Daniel Nylander (sv)
|
||||
|
||||
2.14.2
|
||||
==
|
||||
|
||||
Thanks to Thomas Thurman, Paolo Borelli, Björn Lindqvist, and
|
||||
Elijah Newren for fixes in this release.
|
||||
|
||||
- Fix constraints bug causing negative width windows and crashes
|
||||
(Elijah) [#336651]
|
||||
- Fix window grouping with parent/child windows (Björn) [#336184]
|
||||
- use g_str_has_prefix instead of a local copy of the function
|
||||
(Paolo) [#334643]
|
||||
- Make sure pager can refresh when window is minimized on a different
|
||||
workspace (Thomas) [#315142]
|
||||
- Add debugging information for edge resistance (Elijah)
|
||||
|
||||
Translations
|
||||
|
||||
Vladimir Petkov (bg), tangi.bzh (br), Jordi Mallach (ca), Miloslav
|
||||
Trmac (cs), Rhys Jones (cy), Lasse Bang Mikkelsen (da), Frank
|
||||
Arnold (de), Mindu Dorji (dz), Kostas Papadimas (el), Francisco
|
||||
Javier F. Serrador (es), Ivar Smolin (et), Iñaki Larrañaga
|
||||
Murgoitio (eu), Elnaz Sarbar (fa), Ilkka Tuohela (fi),
|
||||
Ignacio Casal Quinteiro (gl), Ankit Patel (gu), Rajesh Ranjan (hi)
|
||||
Gabor Kelemen (hu), Luca Ferretti (it), Satoru SATOH (ja), Vladimer
|
||||
Sichinava (ka), Žygimantas Beručka (lt), Kjartan Maraas (nb),
|
||||
Tino Meinen (nl), Kjartan Maraas (no), Gora Mohanty (or), Gnome PL
|
||||
Team (pl), Evandro Fernandes Giovanini (pt_BR), Duarte Loreto (pt),
|
||||
Mugurel Tudor (ro), Leonid Kanter (ru), Laurent Dhima (sq),
|
||||
Слободан Д. Средојевић (sr), Daniel Nylander (sv), Theppitak
|
||||
Karoonboonyanan (th), Maxim Dziumanenko (uk), Clytie Siddall (vi),
|
||||
Funda Wang (zh_CN)
|
||||
|
||||
2.14.1
|
||||
==
|
||||
|
||||
The only change since 2.14.0 is to remove the "This is the UNSTABLE
|
||||
branch" warning from configure for those compiling Metacity from
|
||||
source.
|
||||
|
||||
2.14.0
|
||||
==
|
||||
|
||||
Thanks to Ryan Lortie and Thomas Thurman for fixes in this release.
|
||||
|
||||
- Mark the app-running-remotely-window-title string for translation
|
||||
(Thomas) [#334332]
|
||||
- Only unmaximise window before freeing if the window is actually
|
||||
maximised (Ryan) [#333563]
|
||||
|
||||
Translations
|
||||
Jordi Mallach (ca), Frank Arnold (de), Luca Ferretti (it), Evandro
|
||||
Fernandes Giovanini (pt_BR), Theppitak Karoonboonyanan (th)
|
||||
|
||||
2.13.144
|
||||
==
|
||||
|
||||
Thanks to Jens Granseuer, Kristian, Søren Sandmann, Sylvain
|
||||
Bertrand, and Thomas Thurman for improvements in this release.
|
||||
|
||||
- Fix build with gcc 2.95 (Jens) [#331166]
|
||||
- Compositor improvements [remember, still off by default]: add
|
||||
unused wobbly (un)minimize animation (Kristian), add support for
|
||||
turning updates on and off (Søren), use sync counter to make
|
||||
composited resizing tear free (Søren), add ability to unmanage
|
||||
the screen (Søren),
|
||||
- Fix build issue with library search order (Sylvain) [#330695]
|
||||
- Work around buggy application grouping with transient windows
|
||||
(Thomas) [#328211]
|
||||
- Prevent setting cycle_windows to keybindings that won't work.
|
||||
(Thomas) [#329676]
|
||||
|
||||
2.13.89
|
||||
==
|
||||
|
||||
@@ -46,18 +454,18 @@ Translations
|
||||
2.13.34
|
||||
==
|
||||
|
||||
Thanks to Damien Carbery, Havoc Pennington, S<EFBFBD>ren Sandmann,
|
||||
Bj<EFBFBD>rn Lindqvist, Kjartan Maraas, Elijah Newren for improvements in
|
||||
Thanks to Damien Carbery, Havoc Pennington, Søren Sandmann,
|
||||
Björn Lindqvist, Kjartan Maraas, Elijah Newren for improvements in
|
||||
this release.
|
||||
|
||||
- manually define HOST_NAME_MAX if not already defined to fix Solaris
|
||||
compilation issue (Damien, Havoc) [#326745]
|
||||
- compositor improvements: port to changes in libcm, do it again, fix
|
||||
unrefing, make minimize animation update again (all done by S<EFBFBD>ren)
|
||||
unrefing, make minimize animation update again (all done by Søren)
|
||||
- make sure an outline border is shown even if a window decoration's
|
||||
width is 0 (Bj<EFBFBD>rn) [#98340]
|
||||
width is 0 (Björn) [#98340]
|
||||
- correctly handle window alt-tab outlines in showing desktop mode
|
||||
(Bj<EFBFBD>rn) [#98340]
|
||||
(Björn) [#98340]
|
||||
- fix lots of tiny issues spotted by the intel compiler (Kjartan)
|
||||
[#321439]
|
||||
- prevent rapidly repeated visual bells from hanging metacity
|
||||
@@ -67,9 +475,9 @@ this release.
|
||||
- fix various initialization and default issues, especially for
|
||||
running with --disable-gconf. Make --disable-gconf actually work.
|
||||
(Elijah) [#326661]
|
||||
- fix some reading-from-free'd-data errors (S<EFBFBD>ren) [#327575]
|
||||
- fix some reading-from-free'd-data errors (Søren) [#327575]
|
||||
- fix an unitialized value problem when in raise-on-click mode
|
||||
(S<EFBFBD>ren) [#327572]
|
||||
(Søren) [#327572]
|
||||
- avoid flashing original-sized window when closing a maximized
|
||||
window (Elijah) [#317254]
|
||||
- prevent windows from sometimes getting shoved and smashed by
|
||||
@@ -82,17 +490,17 @@ Translations
|
||||
2.13.21
|
||||
==
|
||||
|
||||
Thanks to Damien Carbery, Ray Strode, S<EFBFBD>ren Sandmann, Elijah
|
||||
Thanks to Damien Carbery, Ray Strode, Søren Sandmann, Elijah
|
||||
Newren, Jens Granseuer, and Kyle Ambroff for improvements in this
|
||||
release.
|
||||
|
||||
- Fix Solaris compilation issues (Ray, Damien) [#326281, #326746]
|
||||
- Merge compositor work from branches to get the beginnings of an openGL
|
||||
based compositor. Still not ready and thus disabled by default.
|
||||
(S<EFBFBD>ren)
|
||||
- Composite fixes: Only update composite on damage events (S<EFBFBD>ren), get
|
||||
(Søren)
|
||||
- Composite fixes: Only update composite on damage events (Søren), get
|
||||
non-composite compilation working again (Elijah), Really turn off
|
||||
draw-in-a-loop (S<EFBFBD>ren)
|
||||
draw-in-a-loop (Søren)
|
||||
- Don't dereference a NULL string (Elijah) [#327013]
|
||||
- GCC 2.95 fix; remove more C99 style variable initiailizations (Jens)
|
||||
[#327050]
|
||||
@@ -110,11 +518,11 @@ Translations
|
||||
2.13.13
|
||||
==
|
||||
|
||||
Thanks to Jens Granseuer, Bj<EFBFBD>rn Lindqvist, and Elijah Newren for
|
||||
Thanks to Jens Granseuer, Björn Lindqvist, and Elijah Newren for
|
||||
improvements in this release.
|
||||
|
||||
- Remove C99 style variable initiailization (Jens) [#322622]
|
||||
- Fix a logic error (Bj<EFBFBD>rn) [#322149]
|
||||
- Fix a logic error (Björn) [#322149]
|
||||
- Plug a few leaks (Elijah) [#309178]
|
||||
- Allow edge resistance at both sides of a window and also when edges
|
||||
don't overlap but are a single pixel away from doing so (Elijah)
|
||||
@@ -164,10 +572,10 @@ Translations
|
||||
2.13.5
|
||||
==
|
||||
|
||||
Thanks to Davyd Madeley, Kjartan Maraas, and Bj<EFBFBD>rn Lindqvist for
|
||||
Thanks to Davyd Madeley, Kjartan Maraas, and Björn Lindqvist for
|
||||
improvements in this release.
|
||||
|
||||
- Make a debugging message actually correspond to the code (Bj<EFBFBD>rn)
|
||||
- Make a debugging message actually correspond to the code (Björn)
|
||||
[#322051]
|
||||
- Make the wireframe a bit slimmer (Kjartan) [#320051]
|
||||
- Display hostname in titlebar for remote X clients (Davyd) [#322202]
|
||||
@@ -341,16 +749,16 @@ Translations
|
||||
2.13.0
|
||||
==
|
||||
|
||||
Thanks to Bj<EFBFBD>rn Lindqvist, Kjartan Maraas, S<EFBFBD>ren Sandmann,
|
||||
Thanks to Björn Lindqvist, Kjartan Maraas, Søren Sandmann,
|
||||
Elijah Newren, Ross Cohen, and Muktha for improvements in this release
|
||||
since 2.12.1.
|
||||
|
||||
- Mave ancestors come along with the transient when moving the window from
|
||||
one workspace to another (Bj<EFBFBD>rn) [#314977]
|
||||
one workspace to another (Björn) [#314977]
|
||||
- Fix the workspace switcher tabpopup to display the right windows and to
|
||||
fix the pick-a-new-window-to-focus algorithm in order to not select
|
||||
windows that aren't showing (Bj<EFBFBD>rn) [#170475]
|
||||
- Fix a couple memory leaks (Kjartan, S<EFBFBD>ren, Elijah) [#313030]
|
||||
windows that aren't showing (Björn) [#170475]
|
||||
- Fix a couple memory leaks (Kjartan, Søren, Elijah) [#313030]
|
||||
- Make alt-esc (the "switch between windows immediately" keybinding)
|
||||
actually show minimized windows too (Ross) [#107072]
|
||||
- Make alt-esc consistent with alt-tab by leaving stacking of unselected
|
||||
@@ -381,7 +789,7 @@ improvements in this release.
|
||||
|
||||
Translations
|
||||
Mahay Alam Khan (bn), Francisco Javier F. Serrador (es), Ivar Smolin (et),
|
||||
I<EFBFBD>aki Larra<EFBFBD>aga Murgoitio (eu), Luca Ferretti (it), Christian Rose (sv),
|
||||
Iñaki Larrañaga Murgoitio (eu), Luca Ferretti (it), Christian Rose (sv),
|
||||
Clytie Siddall (vi), Funda Wang (zh_CN)
|
||||
|
||||
2.12.0
|
||||
@@ -394,16 +802,16 @@ Thanks to Brent Smith for finding the crasher in the release candidate!
|
||||
Translations
|
||||
Bryn Salisbury (cy), Hendrik Richter (de), Christophe Merlet (RedFox) (fr),
|
||||
Ignacio Casal Quinteiro (gl), Norayr Chilingaryan (hy), Young-Ho Cha (ko),
|
||||
<EFBFBD>ygimantas Berucka (lt), Michiel Sikkes (nl), Leonid Kanter (ru), Danilo
|
||||
<1B>egan(sr), Baris Cicek (tr)
|
||||
Žygimantas Berucka (lt), Michiel Sikkes (nl), Leonid Kanter (ru), Danilo
|
||||
Šegan (sr), Baris Cicek (tr)
|
||||
|
||||
2.11.3
|
||||
==
|
||||
|
||||
Thanks to Bj<EFBFBD>rn Lindqvist and Elijah Newren for improvements in
|
||||
Thanks to Björn Lindqvist and Elijah Newren for improvements in
|
||||
this release.
|
||||
|
||||
- Check for the right versions of glib and gtk+ (Bj<EFBFBD>rn) [#314116]
|
||||
- Check for the right versions of glib and gtk+ (Björn) [#314116]
|
||||
- Avoid obscuring centered-on-desktop windows which are denied focus
|
||||
(Elijah) [#313234]
|
||||
|
||||
@@ -471,13 +879,13 @@ Translations
|
||||
|
||||
This release contains all fixes up to Metacity 2.10.2 plus some new goodies.
|
||||
|
||||
Thanks to Matthias Clasen, Aivars Kalvans, Bj<EFBFBD>rn Lindqvist, and
|
||||
Thanks to Matthias Clasen, Aivars Kalvans, Björn Lindqvist, and
|
||||
Andrew Johnson for improvements in this release.
|
||||
|
||||
- React to cursor theme changes (Matthias) [#308106]
|
||||
- Plug a small leak with xinerama information (Aivars) [#307884]
|
||||
- Split up main() into more manageable chunks and make use of GOpt
|
||||
(Bj<EFBFBD>rn) [#305331]
|
||||
(Björn) [#305331]
|
||||
- Speed up vertical gradients (Andrew) [#169982]
|
||||
|
||||
Translations
|
||||
@@ -538,8 +946,8 @@ The only difference between this version and 2.9.34 is some
|
||||
translation updates.
|
||||
|
||||
Translations
|
||||
Vladimir Petkov (bg), Gabor Kelemen (hu), <EFBFBD>ygimantas Berucka (lt),
|
||||
Reinout van Schouwen (nl), Mugurel Tudor (ro), Danilo <EFBFBD>egan (sr),
|
||||
Vladimir Petkov (bg), Gabor Kelemen (hu), Žygimantas Berucka (lt),
|
||||
Reinout van Schouwen (nl), Mugurel Tudor (ro), Danilo Šegan (sr),
|
||||
Woodman Tuen (zh_TW)
|
||||
|
||||
2.9.34
|
||||
@@ -604,7 +1012,7 @@ Marcus Clarke for fixes in this release.
|
||||
Translations
|
||||
Jordi Mallach (ca), Martin Willemoes Hansen (da),
|
||||
Kostas Papadimas (el), David Lodge (en_GB),
|
||||
Francisco Javier F. Serrador (es), T<EFBFBD>ivo Leedj<EFBFBD>rv (et),
|
||||
Francisco Javier F. Serrador (es), Tõivo Leedjärv (et),
|
||||
Christophe Merlet (RedFox) (fr), Takeshi AIHANA (ja),
|
||||
Young-Ho, Cha (ko), Kjartan Maraas (nb), Michiel Sikkes (nl),
|
||||
Kjartan Maraas (no), Duarte Loreto (pt), Leonid Kanter (ru),
|
||||
@@ -672,7 +1080,7 @@ Translations
|
||||
Vladimir Petkov (bg), Miloslav Trmac (cs), Frank Arnold (de),
|
||||
Adam Weinberger (en_CA), David Lodge (en_GB),
|
||||
Francisco Javier F. Serrador (es), Pauli Virtanen (fi),
|
||||
Young-Ho, Changwoo Ryu (ko), <EFBFBD>ygimantas Berucka (lt),
|
||||
Young-Ho, Changwoo Ryu (ko), Žygimantas Berucka (lt),
|
||||
Kjartan Maraas (nb), Kjartan Maraas (no), Duarte Loreto (pt),
|
||||
Marcel Telka (sk), Christian Rose (sv),
|
||||
Theppitak Karoonboonyanan (th)
|
||||
@@ -779,7 +1187,7 @@ Vincent Untz for fixes/features in this release.
|
||||
|
||||
Translations
|
||||
da (Martin Willemoes Hansen), fr(Christophe Merlet, Baptiste
|
||||
Mille-Mathias), lt(<EFBFBD>ygimantas Berucka), ja(Takeshi AIHANA)
|
||||
Mille-Mathias), lt(Žygimantas Berucka), ja(Takeshi AIHANA)
|
||||
|
||||
2.9.0
|
||||
==
|
||||
@@ -810,7 +1218,7 @@ and Vincent Untz for fixes and features in this release.
|
||||
- Re-enable focus stealing prevention (Elijah)
|
||||
|
||||
Translations
|
||||
es(Francisco Javier F. Serrador), sq(Laurent Dhima), sr(Danilo <EFBFBD>egan),
|
||||
es(Francisco Javier F. Serrador), sq(Laurent Dhima), sr(Danilo Šegan),
|
||||
cs(Miloslav Trmac), en_CA(Adam Weinberger), en_GB(David Lodge)
|
||||
|
||||
2.8.6
|
||||
@@ -845,7 +1253,7 @@ Translations
|
||||
|
||||
* ar(Abdulaziz Al-Arfaj), cs(Miloslav Trmac), cy(Dafydd Harries),
|
||||
en_GB(David Lodge), fr(Christophe Merlet (RedFox)),
|
||||
nn(<EFBFBD>smund Skj<EFBFBD>veland), or(Gora Mohanty),
|
||||
nn(Åsmund Skjæveland), or(Gora Mohanty),
|
||||
pr_BR(Gustavo Noronha Silva), ro(Mugurel Tudor),
|
||||
th(Paisa Seeluangsawat), tr(Baris Cicek), zh_TW(Woodman Tuen)
|
||||
|
||||
@@ -883,7 +1291,7 @@ Fixes
|
||||
Translations
|
||||
* az(Metin Amiroff), bs(Kemal Sanjta), ca(Jordi Mallach),
|
||||
el(Kostas Papadimas), es(Francisco Javier F. Serrador),
|
||||
eu(I<EFBFBD><EFBFBD>aki Larra<EFBFBD><EFBFBD>aga Murgoitio), fi(Pauli Virtanen),
|
||||
eu(Iñaki Larrañaga Murgoitio), fi(Pauli Virtanen),
|
||||
nb(Kjartan Maraas), sq(Laurent Dhima), uk(Maxim Dziumanenko)
|
||||
|
||||
|
||||
@@ -911,7 +1319,7 @@ Fixes
|
||||
|
||||
Translations
|
||||
* fi (Pauli Virtanen), ja (Takeshi AIHANA), ko (Young-Ho, Cha),
|
||||
pl (Gnome PL Team), ru (Dmitry G. Mastrukov), sr (Danilo <EFBFBD>Ł<EFBFBD>egan),
|
||||
pl (Gnome PL Team), ru (Dmitry G. Mastrukov), sr (Danilo Šegan),
|
||||
tk (Gurban M. Tewekgeli), zh_CN (Funda Wang)
|
||||
|
||||
2.8.2
|
||||
|
11
README
11
README
@@ -6,10 +6,11 @@ on UNIX keyboards.
|
||||
The first release of Metacity was version 2.3. Metacity has no need for
|
||||
your petty hangups about version numbers.
|
||||
|
||||
The stable releases so far are 2.4.x, 2.6.x, 2.8.[01], 2.8.1.x, 2.8.5-, 2.10.x,
|
||||
2.12.x.
|
||||
The stable releases so far are 2.4.x, 2.6.x, 2.8.[01], 2.8.1.x, 2.8.5-,
|
||||
2.10.x, 2.12.x, 2.14.x, 2.16.x.
|
||||
|
||||
Unstable branches are 2.3.x, 2.5.x, 2.8.2-4, 2.9.x, 2.11.x, 2.13.x
|
||||
Unstable branches are 2.3.x, 2.5.x, 2.8.2-4, 2.9.x, 2.11.x, 2.13.x,
|
||||
2.15.x, 2.17.x.
|
||||
|
||||
COMPILING METACITY
|
||||
===
|
||||
@@ -315,8 +316,8 @@ A: Metacity only stores sizes/positions for apps that are session
|
||||
archaic than twm - and you should flame them. ;-)
|
||||
|
||||
Docs on session management:
|
||||
ftp://ftp.x.org/pub/R6.4/xc/doc/hardcopy/SM/xsmp.PS.gz
|
||||
ftp://ftp.x.org:21/pub/R6.4/xc/doc/hardcopy/SM/SMlib.PS.gz
|
||||
http://www.fifi.org/doc/xspecs/xsmp.txt.gz
|
||||
http://www.fifi.org/doc/xspecs/SMlib.txt.gz
|
||||
|
||||
See also the ICCCM section on SM. For GNOME apps, use the
|
||||
GnomeClient object. For a simple example of using libSM directly,
|
||||
|
144
autogen.sh
144
autogen.sh
@@ -4,140 +4,18 @@
|
||||
srcdir=`dirname $0`
|
||||
test -z "$srcdir" && srcdir=.
|
||||
|
||||
ORIGDIR=`pwd`
|
||||
cd $srcdir
|
||||
PROJECT=metacity
|
||||
TEST_TYPE=-f
|
||||
FILE=src/display.c
|
||||
PKG_NAME="metacity"
|
||||
REQUIRED_AUTOMAKE_VERSION=1.7
|
||||
|
||||
DIE=0
|
||||
|
||||
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
|
||||
echo
|
||||
echo "You must have autoconf installed to compile $PROJECT."
|
||||
echo "Download the appropriate package for your distribution,"
|
||||
echo "or get the source tarball at http://ftp.gnu.org/gnu/autoconf/"
|
||||
DIE=1
|
||||
(test -f $srcdir/configure.in \
|
||||
&& test -d $srcdir/src) || {
|
||||
echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
|
||||
echo " top-level metacity directory"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if automake-1.9 --version < /dev/null > /dev/null 2>&1; then
|
||||
AUTOMAKE=automake-1.9
|
||||
ACLOCAL=aclocal-1.9
|
||||
elif automake-1.8 --version < /dev/null > /dev/null 2>&1; then
|
||||
AUTOMAKE=automake-1.8
|
||||
ACLOCAL=aclocal-1.8
|
||||
elif automake-1.7 --version < /dev/null > /dev/null 2>&1; then
|
||||
AUTOMAKE=automake-1.7
|
||||
ACLOCAL=aclocal-1.7
|
||||
else
|
||||
echo
|
||||
echo "You must have automake >= 1.7 installed to compile $PROJECT."
|
||||
echo "Get http://ftp.gnu.org/gnu/automake/automake-1.9.3.tar.bz2"
|
||||
echo "(or a newer version if it is available)"
|
||||
DIE=1
|
||||
fi
|
||||
|
||||
(grep "^AM_PROG_LIBTOOL" configure.in >/dev/null) && {
|
||||
(libtool --version) < /dev/null > /dev/null 2>&1 || {
|
||||
echo
|
||||
echo "**Error**: You must have \`libtool' installed to compile $PROJECT."
|
||||
echo "Get http://ftp.gnu.org/gnu/libtool/libtool-1.5.10.tar.gz"
|
||||
echo "(or a newer version if it is available)"
|
||||
DIE=1
|
||||
}
|
||||
which gnome-autogen.sh || {
|
||||
echo "You need to install gnome-common from the GNOME CVS"
|
||||
exit 1
|
||||
}
|
||||
|
||||
CONFIGURE=configure.in
|
||||
if grep "^AM_[A-Z0-9_]\{1,\}_GETTEXT" "$CONFIGURE" >/dev/null; then
|
||||
if grep "sed.*POTFILES" "$CONFIGURE" >/dev/null; then
|
||||
GETTEXTIZE=""
|
||||
else
|
||||
if grep "^AM_GLIB_GNU_GETTEXT" "$CONFIGURE" >/dev/null; then
|
||||
GETTEXTIZE="glib-gettextize"
|
||||
GETTEXTIZE_URL="ftp://ftp.gtk.org/pub/gtk/v2.0/glib-2.0.0.tar.gz"
|
||||
else
|
||||
GETTEXTIZE="gettextize"
|
||||
GETTEXTIZE_URL="ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
|
||||
fi
|
||||
|
||||
$GETTEXTIZE --version < /dev/null > /dev/null 2>&1
|
||||
if test $? -ne 0; then
|
||||
echo
|
||||
echo "**Error**: You must have \`$GETTEXTIZE' installed to compile $PKG_NAME."
|
||||
echo "Get $GETTEXTIZE_URL"
|
||||
echo "(or a newer version if it is available)"
|
||||
DIE=1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$DIE" -eq 1; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
test $TEST_TYPE $FILE || {
|
||||
echo "You must run this script in the top-level $PROJECT directory"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if test -z "$*"; then
|
||||
echo "I am going to run ./configure with no arguments - if you wish "
|
||||
echo "to pass any to it, please specify them on the $0 command line."
|
||||
fi
|
||||
|
||||
topdir=`pwd`
|
||||
for coin in .
|
||||
do
|
||||
dr=`dirname $coin`
|
||||
if test -f $dr/NO-AUTO-GEN; then
|
||||
echo skipping $dr -- flagged as no auto-gen
|
||||
else
|
||||
echo processing $dr
|
||||
cd $dr
|
||||
if grep "^AM_GLIB_GNU_GETTEXT" configure.in >/dev/null; then
|
||||
if grep "sed.*POTFILES" configure.in >/dev/null; then
|
||||
: do nothing -- we still have an old unmodified configure.in
|
||||
else
|
||||
echo "Creating $dr/aclocal.m4 ..."
|
||||
test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
|
||||
echo "Running glib-gettextize... Ignore non-fatal messages."
|
||||
echo "no" | glib-gettextize --force --copy || exit $?
|
||||
echo "Making $dr/aclocal.m4 writable ..."
|
||||
test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
|
||||
fi
|
||||
fi
|
||||
if grep "^AC_PROG_INTLTOOL" configure.in >/dev/null; then
|
||||
echo "Running intltoolize..."
|
||||
intltoolize --force --copy --automake || exit $?
|
||||
fi
|
||||
if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
|
||||
echo "Running libtoolize..."
|
||||
libtoolize --force --copy || exit $?
|
||||
fi
|
||||
|
||||
echo "Running $ACLOCAL $ACLOCAL_FLAGS ..."
|
||||
$ACLOCAL $ACLOCAL_FLAGS || exit $?
|
||||
echo "Running autoconf ..."
|
||||
autoconf || exit $?
|
||||
if grep "^AC_CONFIG_HEADERS" configure.in >/dev/null; then
|
||||
echo "Running autoheader..."
|
||||
autoheader || exit $?
|
||||
fi
|
||||
echo "Running $AUTOMAKE..."
|
||||
$AUTOMAKE --add-missing --force --gnu || exit $?
|
||||
|
||||
cd $topdir
|
||||
fi
|
||||
done
|
||||
|
||||
conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
|
||||
|
||||
cd "$ORIGDIR"
|
||||
|
||||
if test x$NOCONFIGURE = x; then
|
||||
echo Running $srcdir/configure $conf_flags "$@" ...
|
||||
$srcdir/configure $conf_flags "$@" \
|
||||
&& echo Now type \`make\' to compile $PROJECT || exit $?
|
||||
else
|
||||
echo Skipping configure process.
|
||||
fi
|
||||
USE_GNOME2_MACROS=1 USE_COMMON_DOC_BUILD=yes . gnome-autogen.sh
|
||||
|
40
configure.in
40
configure.in
@@ -1,8 +1,14 @@
|
||||
AC_PREREQ(2.50)
|
||||
|
||||
m4_define([metacity_major_version], [2])
|
||||
m4_define([metacity_minor_version], [17])
|
||||
# Fibonacci sequence for micro version numbering:
|
||||
# 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987
|
||||
AC_INIT([metacity], [2.13.89],
|
||||
m4_define([metacity_micro_version], [2])
|
||||
|
||||
m4_define([metacity_version],
|
||||
[metacity_major_version.metacity_minor_version.metacity_micro_version])
|
||||
AC_INIT([metacity], [metacity_version],
|
||||
[http://bugzilla.gnome.org/enter_bug.cgi?product=metacity])
|
||||
|
||||
AC_CONFIG_SRCDIR(src/display.c)
|
||||
@@ -18,7 +24,7 @@ GETTEXT_PACKAGE=metacity
|
||||
AC_SUBST(GETTEXT_PACKAGE)
|
||||
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Name of default gettext domain])
|
||||
|
||||
AC_PROG_INTLTOOL([0.21])
|
||||
IT_PROG_INTLTOOL([0.34.90])
|
||||
AC_PROG_CC
|
||||
AC_ISC_POSIX
|
||||
AC_HEADER_STDC
|
||||
@@ -101,7 +107,7 @@ if test "x$GCC" = "xyes"; then
|
||||
fi
|
||||
changequote([,])dnl
|
||||
|
||||
METACITY_PC_MODULES='gtk+-2.0 >= 2.2.0 pango >= 1.2.0'
|
||||
METACITY_PC_MODULES='gtk+-2.0 >= 2.10.0 pango >= 1.2.0'
|
||||
|
||||
AC_ARG_ENABLE(gconf,
|
||||
AC_HELP_STRING([--disable-gconf],
|
||||
@@ -155,7 +161,6 @@ AC_ARG_ENABLE(shape,
|
||||
## try definining HAVE_BACKTRACE
|
||||
AC_CHECK_HEADERS(execinfo.h, [AC_CHECK_FUNCS(backtrace)])
|
||||
|
||||
ALL_LINGUAS="am ar az be bg bn bs ca cs cy da de el en_CA en_GB es et eu fa fi fr ga gl gu he hi hr hu hy id is it ja ko ku lt lv mk ml mn ms nb ne nl nn no or pa pl pt pt_BR ro ru rw sl sk sq sr sr@Latn sv ta th tk tr uk vi wa xh zh_CN zh_TW"
|
||||
AM_GLIB_GNU_GETTEXT
|
||||
|
||||
## here we get the flags we'll actually use
|
||||
@@ -404,10 +409,10 @@ if test "x$found_xsync" = "xyes"; then
|
||||
AC_DEFINE(HAVE_XSYNC, , [Have the Xsync extension library])
|
||||
fi
|
||||
|
||||
METACITY_LIBS="$XSYNC_LIBS $RANDR_LIBS $SHAPE_LIBS $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $METACITY_LIBS"
|
||||
METACITY_MESSAGE_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $METACITY_MESSAGE_LIBS"
|
||||
METACITY_WINDOW_DEMO_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $METACITY_WINDOW_DEMO_LIBS"
|
||||
METACITY_PROPS_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $METACITY_PROPS_LIBS"
|
||||
METACITY_LIBS="$METACITY_LIBS $XSYNC_LIBS $RANDR_LIBS $SHAPE_LIBS $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
|
||||
METACITY_MESSAGE_LIBS="$METACITY_MESSAGE_LIBS $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
|
||||
METACITY_WINDOW_DEMO_LIBS="$METACITY_WINDOW_DEMO_LIBS $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
|
||||
METACITY_PROPS_LIBS="$METACITY_PROPS_LIBS $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
|
||||
|
||||
found_sm=no
|
||||
case "$METACITY_LIBS" in
|
||||
@@ -484,11 +489,8 @@ AC_OUTPUT
|
||||
|
||||
if test x$enable_gconf = xno; then
|
||||
echo "*** WARNING WARNING WARNING WARNING WARNING"
|
||||
echo "*** Building without GConf"
|
||||
echo "*** This means there's no way to change prefs except"
|
||||
echo "*** hacking source code, at least for now."
|
||||
echo "*** Also, some prefs may have broken defaults."
|
||||
echo "*** Patches needed for a simple no-gconf config file."
|
||||
echo "*** Building without GConf. This means there's no"
|
||||
echo "*** way to change prefs except hacking source code."
|
||||
echo "*** This is intended for embedded systems etc., not for normal use."
|
||||
fi
|
||||
|
||||
@@ -520,5 +522,13 @@ metacity-$VERSION:
|
||||
Render: ${have_xrender}
|
||||
Xcursor: ${have_xcursor}
|
||||
"
|
||||
echo "This is the UNSTABLE branch of metacity"
|
||||
echo "Use 2.12.x for stable (gnome-2-12 branch in CVS)"
|
||||
|
||||
METACITY_MINOR_VERSION=metacity_minor_version
|
||||
if test $(( $(echo $METACITY_MINOR_VERSION) %2)) == "1"; then
|
||||
stable_version=$(( ($METACITY_MINOR_VERSION / 2) * 2))
|
||||
echo "This is the UNSTABLE branch of metacity"
|
||||
echo -n "Use 2.$stable_version.x for stable "
|
||||
echo "(gnome-2-$stable_version branch in CVS)"
|
||||
else
|
||||
echo "This is the stable branch of metacity"
|
||||
fi
|
||||
|
@@ -9,7 +9,8 @@ basics are easy:
|
||||
Focus method Behavior
|
||||
click When a user clicks on a window, focus it
|
||||
sloppy When an EnterNotify is received, focus the window
|
||||
mouse Same as sloppy, but also defocus on LeaveNotify
|
||||
mouse Same as sloppy, but also defocus when mouse enters DESKTOP
|
||||
window
|
||||
|
||||
Note that these choices (along with the choice that clicking on a
|
||||
window raises it for the click focus method) introduces the following
|
||||
@@ -20,8 +21,9 @@ Focus method Invariant
|
||||
sloppy If the mouse is in a window, then it is focused; if the
|
||||
mouse is not in a window, then the most recently used
|
||||
window is focused.
|
||||
mouse If the mouse is in a window, then it is focused; otherwise,
|
||||
the designated "no_focus_window" is focused
|
||||
|
||||
mouse If the mouse is in a non-DESKTOP window, then it is focused;
|
||||
otherwise, the designated "no_focus_window" is focused
|
||||
|
||||
However, there are a number of cases where the current focus window
|
||||
becomes invalid and another should be chosen. Some examples are when
|
||||
@@ -34,8 +36,10 @@ Focus method Behavior
|
||||
on top)
|
||||
sloppy Focus the window containing the pointer if there is such
|
||||
a window, otherwise focus the most recently used window.
|
||||
mouse Focus the window containing the pointer if there is one,
|
||||
otherwise focus the designated "no_focus_window".
|
||||
|
||||
mouse Focus the non-DESKTOP window containing the pointer if
|
||||
there is one, otherwise focus the designated
|
||||
"no_focus_window".
|
||||
|
||||
Note that "most recently used window", as used here, has a slightly
|
||||
different connotation than "most recent to have keyboard focus". This
|
||||
@@ -123,6 +127,7 @@ To read more about the bugs that inspired these choices:
|
||||
- Mousenav vs. Keynav in mouse and sloppy focus modes
|
||||
http://bugzilla.gnome.org/show_bug.cgi?id=167545
|
||||
http://bugzilla.gnome.org/show_bug.cgi?id=101190
|
||||
http://bugzilla.gnome.org/show_bug.cgi?id=357695
|
||||
- Not focusing panels
|
||||
http://bugzilla.gnome.org/show_bug.cgi?id=160470
|
||||
http://bugzilla.gnome.org/show_bug.cgi?id=120100
|
||||
|
@@ -1,6 +1,91 @@
|
||||
Docs on the theme format
|
||||
Themes are in a simple XML-subset format. There are multiple versions
|
||||
of the theme format, and a given theme can support more than one format.
|
||||
|
||||
Themes are in a simple XML-subset format.
|
||||
Version 1: THEMEDIR/metacity-1/metacity-theme-1.xml
|
||||
(original metacity format)
|
||||
Version 2: THEMEDIR/metacity-1/metacity-theme-2.xml
|
||||
|
||||
The subdirectory name is "metacity-1" in all versions.
|
||||
|
||||
As you might expect, older versions of metacity will not understand
|
||||
newer theme formats. However, newer versions will use old themes.
|
||||
Metacity will always use the newest theme format it understands that
|
||||
the X server supports. Some format versions are only supported if you
|
||||
have the right X server features.
|
||||
|
||||
Each format *requires* the corresponding filename. If you put version
|
||||
2 format features in the metacity-1/metacity-theme-1.xml file, then
|
||||
metacity will get angry.
|
||||
|
||||
This document has separate sections for each format version. You may
|
||||
want to read the document in reverse order, since the base features
|
||||
are discussed under version 1.
|
||||
|
||||
New Features in Theme Format Version 2
|
||||
======================================
|
||||
|
||||
The optional attributes rounded_top_left, rounded_top_right,
|
||||
rounded_bottom_left and rounded_bottom_right on <frame_geometry>
|
||||
should now be the radius of the corner in pixels. You may still use
|
||||
the values "false" for 0 and "true" for 5, which means v1 values will
|
||||
still work just fine.
|
||||
|
||||
<frame_geometry> has a new optional attribute, hide_buttons. If this
|
||||
is true, no buttons will be displayed on the titlebar.
|
||||
|
||||
Anywhere you can use a positive integer, you can use an integer constant.
|
||||
|
||||
As well as constant integers and reals, you may define constant colours,
|
||||
thus:
|
||||
<constant name="RevoltingPink" value="#FF00FF"/>
|
||||
<constant name="Background" value="gtk:bg[NORMAL]"/>
|
||||
|
||||
<frame_style> has two new optional attributes, background and alpha.
|
||||
If you specify alpha, you must specify background. background is a
|
||||
colour used for the background of the frame. alpha is the transparency
|
||||
as a real between 0.0 and 1.0. If the current X server does not support
|
||||
alpha channels, the value is ignored.
|
||||
|
||||
The filename attribute of <image> may begin with "theme:". If so, the
|
||||
rest of the string is the name of a theme icon. The 64x64 version of the
|
||||
icon is used, except for fallback mini_icons, which use the 16x16 version.
|
||||
This does not affect ordinary resizing. For example:
|
||||
<button function="close" state="normal">
|
||||
<draw_ops>
|
||||
<include name="active_button"/>
|
||||
<image filename="theme:gnome-logout" x="2" y="2"
|
||||
width="width-4" height="height-4"/>
|
||||
<!-- Note: not "theme:gnome-logout.png" or similar. -->
|
||||
</draw_ops>
|
||||
</button>
|
||||
|
||||
<menu_icon>s are parsed but ignored.
|
||||
|
||||
Fallback icons can be specified using <fallback>. There are two
|
||||
optional arguments, icon and mini_icon. The values of these arguments
|
||||
are identical to that of the filename attribute of <image>. Fallback
|
||||
icons are used when a window does not supply its own icon. If a fallback
|
||||
icon is not specified with <fallback>, Metacity will use a built-in
|
||||
icon, as in metacity-theme-1.
|
||||
|
||||
The <arc> element, as well as the original start_angle and end_angle
|
||||
attributes, may be given from and to attributes. The values of these
|
||||
attributes are given in degrees clockwise, with 0 being straight up.
|
||||
For example:
|
||||
<arc from="0.0" to="90.0" filled="true" color="#FF00FF"
|
||||
x="0" y="5" width="15" height="15"/>
|
||||
|
||||
<frame state="shaded"> may now take an optional resize attribute, with
|
||||
the same interpretation as the resize attribute on <frame state="normal">.
|
||||
If this attribute is omitted for state="shaded", it defaults to "both".
|
||||
(If it is omitted for state="normal", it remains an error.)
|
||||
|
||||
In addition to the four <button> functions which are required in
|
||||
metacity-theme-1, there are six new functions in metacity-theme-2:
|
||||
shade, unshade, above, unabove, stick and unstick.
|
||||
|
||||
Overview of Theme Format Version 1
|
||||
==================================
|
||||
|
||||
<?xml version="1.0"?>
|
||||
<metacity_theme>
|
||||
|
@@ -9,3 +9,4 @@ cat-id-tbl.c
|
||||
messages
|
||||
missing
|
||||
stamp-cat-id
|
||||
stamp-it
|
||||
|
738
po/ChangeLog
738
po/ChangeLog
File diff suppressed because it is too large
Load Diff
77
po/LINGUAS
Normal file
77
po/LINGUAS
Normal file
@@ -0,0 +1,77 @@
|
||||
# please keep this list sorted alphabetically
|
||||
#
|
||||
am
|
||||
ar
|
||||
az
|
||||
be
|
||||
bg
|
||||
bn
|
||||
bn_IN
|
||||
bs
|
||||
ca
|
||||
cs
|
||||
cy
|
||||
da
|
||||
de
|
||||
dz
|
||||
el
|
||||
en_CA
|
||||
en_GB
|
||||
es
|
||||
et
|
||||
eu
|
||||
fa
|
||||
fi
|
||||
fr
|
||||
ga
|
||||
gl
|
||||
gu
|
||||
he
|
||||
hi
|
||||
hr
|
||||
hu
|
||||
hy
|
||||
id
|
||||
is
|
||||
it
|
||||
ja
|
||||
ka
|
||||
ko
|
||||
ku
|
||||
lt
|
||||
lv
|
||||
mg
|
||||
mk
|
||||
ml
|
||||
mn
|
||||
mr
|
||||
ms
|
||||
nb
|
||||
ne
|
||||
nl
|
||||
nn
|
||||
or
|
||||
pa
|
||||
pl
|
||||
pt
|
||||
pt_BR
|
||||
ro
|
||||
ru
|
||||
rw
|
||||
sk
|
||||
sl
|
||||
sq
|
||||
sr
|
||||
sr@Latn
|
||||
sv
|
||||
ta
|
||||
th
|
||||
tk
|
||||
tr
|
||||
uk
|
||||
vi
|
||||
wa
|
||||
xh
|
||||
zh_CN
|
||||
zh_HK
|
||||
zh_TW
|
2843
po/bn_IN.po
Normal file
2843
po/bn_IN.po
Normal file
File diff suppressed because it is too large
Load Diff
2571
po/en_GB.po
2571
po/en_GB.po
File diff suppressed because it is too large
Load Diff
2195
po/no.po → po/mr.po
2195
po/no.po → po/mr.po
File diff suppressed because it is too large
Load Diff
2163
po/pt_BR.po
2163
po/pt_BR.po
File diff suppressed because it is too large
Load Diff
1091
po/sr@Latn.po
1091
po/sr@Latn.po
File diff suppressed because it is too large
Load Diff
980
po/zh_CN.po
980
po/zh_CN.po
File diff suppressed because it is too large
Load Diff
2830
po/zh_HK.po
Normal file
2830
po/zh_HK.po
Normal file
File diff suppressed because it is too large
Load Diff
1690
po/zh_TW.po
1690
po/zh_TW.po
File diff suppressed because it is too large
Load Diff
@@ -39,10 +39,22 @@ workspace wrapping:
|
||||
http://bugzilla.gnome.org/show_bug.cgi?id=89315
|
||||
|
||||
raise windows on click:
|
||||
http://bugzilla.gnome.org/show_bug.cgi?id=326156
|
||||
http://bugzilla.gnome.org/show_bug.cgi?id=86108
|
||||
http://bugzilla.gnome.org/show_bug.cgi?id=115072
|
||||
http://bugzilla.gnome.org/show_bug.cgi?id=115753
|
||||
|
||||
Pointer warping:
|
||||
http://bugzilla.gnome.org/show_bug.cgi?id=134353
|
||||
http://bugzilla.gnome.org/show_bug.cgi?id=134352
|
||||
(Think about tasklist & window selector too; this would be a very bad idea)
|
||||
|
||||
|
||||
Bugs for easy dupe-finding that seem to be hard to find otherwise:
|
||||
===
|
||||
Applications opening in wrong workspace:
|
||||
http://bugzilla.gnome.org/show_bug.cgi?id=160687
|
||||
|
||||
|
||||
Tracking bugs
|
||||
====
|
||||
@@ -62,3 +74,6 @@ moving/resizing (constraints): http://bugzilla.gnome.org/show_bug.cgi?id=155458
|
||||
modal dialogs: http://bugzilla.gnome.org/show_bug.cgi?id=164841
|
||||
multi-head sans xinerama: http://bugzilla.gnome.org/show_bug.cgi?id=324772
|
||||
xinerama: http://bugzilla.gnome.org/show_bug.cgi?id=324773
|
||||
output-only windows: http://bugzilla.gnome.org/show_bug.cgi?id=340584
|
||||
allowed actions/window-type: http://bugzilla.gnome.org/show_bug.cgi?id=340682
|
||||
EWMH/ICCCM compliance: http://bugzilla.gnome.org/show_bug.cgi?id=340691
|
||||
|
@@ -2,11 +2,7 @@ lib_LTLIBRARIES = libmetacity-private.la
|
||||
|
||||
SUBDIRS=wm-tester tools themes
|
||||
|
||||
INCLUDES=@METACITY_CFLAGS@ -DMETACITY_LIBEXECDIR=\"$(libexecdir)\" -DMETACITY_LIBDIR=\"$(libdir)\" -DHOST_ALIAS=\"@HOST_ALIAS@\" -DMETACITY_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\" -DMETACITY_PKGDATADIR=\"$(pkgdatadir)\" -DMETACITY_DATADIR=\"$(datadir)\" -DG_LOG_DOMAIN=\"metacity\" -DSN_API_NOT_YET_FROZEN=1
|
||||
|
||||
EGGFILES= \
|
||||
eggaccelerators.c \
|
||||
eggaccelerators.h
|
||||
INCLUDES=@METACITY_CFLAGS@ -DMETACITY_LIBEXECDIR=\"$(libexecdir)\" -DHOST_ALIAS=\"@HOST_ALIAS@\" -DMETACITY_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\" -DMETACITY_PKGDATADIR=\"$(pkgdatadir)\" -DMETACITY_DATADIR=\"$(datadir)\" -DG_LOG_DOMAIN=\"metacity\" -DSN_API_NOT_YET_FROZEN=1
|
||||
|
||||
metacity_SOURCES= \
|
||||
async-getprop.c \
|
||||
@@ -16,6 +12,10 @@ metacity_SOURCES= \
|
||||
boxes.h \
|
||||
boxes.c \
|
||||
common.h \
|
||||
c-screen.c \
|
||||
c-screen.h \
|
||||
c-window.c \
|
||||
c-window.h \
|
||||
compositor.c \
|
||||
compositor.h \
|
||||
constraints.c \
|
||||
@@ -70,6 +70,8 @@ metacity_SOURCES= \
|
||||
screen.h \
|
||||
session.c \
|
||||
session.h \
|
||||
spring-model.c \
|
||||
spring-model.h \
|
||||
stack.c \
|
||||
stack.h \
|
||||
tabpopup.c \
|
||||
@@ -91,13 +93,14 @@ metacity_SOURCES= \
|
||||
workspace.c \
|
||||
workspace.h \
|
||||
xprops.c \
|
||||
xprops.h \
|
||||
$(EGGFILES)
|
||||
xprops.h
|
||||
|
||||
# by setting libmetacity_private_la_CFLAGS, the files shared with
|
||||
# metacity proper will be compiled with different names.
|
||||
libmetacity_private_la_CFLAGS =
|
||||
libmetacity_private_la_SOURCES= \
|
||||
boxes.c \
|
||||
boxes.h \
|
||||
gradient.c \
|
||||
gradient.h \
|
||||
preview-widget.c \
|
||||
@@ -116,6 +119,7 @@ libmetacity_private_la_LIBADD = @METACITY_LIBS@
|
||||
libmetacityincludedir = $(includedir)/metacity-1/metacity-private
|
||||
|
||||
libmetacityinclude_HEADERS = \
|
||||
boxes.h \
|
||||
common.h \
|
||||
gradient.h \
|
||||
preview-widget.h \
|
||||
@@ -184,13 +188,6 @@ pkgconfig_DATA = libmetacity-private.pc
|
||||
|
||||
EXTRA_DIST=$(desktopfiles_files) \
|
||||
$(IMAGES) $(schema_DATA) \
|
||||
update-from-egg.sh \
|
||||
$(desktopfiles_in_files) \
|
||||
$(schema_in_files) \
|
||||
libmetacity-private.pc.in
|
||||
|
||||
|
||||
EGGDIR=$(srcdir)/../../libegg/libegg
|
||||
|
||||
regenerate-built-sources:
|
||||
EGGFILES="$(EGGFILES)" EGGDIR="$(EGGDIR)" $(srcdir)/update-from-egg.sh
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/* Metacity misc. public entry points */
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/* Metacity misc. public entry points */
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/* Asynchronous X property getting hack */
|
||||
|
||||
/*
|
||||
@@ -66,7 +68,7 @@ struct _AgGetPropertyTask
|
||||
|
||||
unsigned long n_items;
|
||||
unsigned long bytes_after;
|
||||
unsigned char *data;
|
||||
char *data;
|
||||
|
||||
Bool have_reply;
|
||||
};
|
||||
@@ -316,7 +318,7 @@ async_get_property_handler (Display *dpy,
|
||||
/* there's padding to word boundary */
|
||||
netbytes = ALIGN_VALUE (nbytes, 4);
|
||||
if (nbytes + 1 > 0 &&
|
||||
(task->data = (unsigned char *) Xmalloc ((unsigned)nbytes + 1)))
|
||||
(task->data = (char *) Xmalloc ((unsigned)nbytes + 1)))
|
||||
{
|
||||
#ifdef DEBUG_SPEW
|
||||
printf ("%s: already read %d bytes using %ld, more eating %ld more\n",
|
||||
@@ -334,7 +336,7 @@ async_get_property_handler (Display *dpy,
|
||||
netbytes = reply->nItems << 1;
|
||||
netbytes = ALIGN_VALUE (netbytes, 4); /* align to word boundary */
|
||||
if (nbytes + 1 > 0 &&
|
||||
(task->data = (unsigned char *) Xmalloc ((unsigned)nbytes + 1)))
|
||||
(task->data = (char *) Xmalloc ((unsigned)nbytes + 1)))
|
||||
{
|
||||
#ifdef DEBUG_SPEW
|
||||
printf ("%s: already read %d bytes using %ld more, eating %ld more\n",
|
||||
@@ -351,7 +353,7 @@ async_get_property_handler (Display *dpy,
|
||||
nbytes = reply->nItems * sizeof (long);
|
||||
netbytes = reply->nItems << 2; /* wire size is always 32 bits though */
|
||||
if (nbytes + 1 > 0 &&
|
||||
(task->data = (unsigned char *) Xmalloc ((unsigned)nbytes + 1)))
|
||||
(task->data = (char *) Xmalloc ((unsigned)nbytes + 1)))
|
||||
{
|
||||
#ifdef DEBUG_SPEW
|
||||
printf ("%s: already read %d bytes using %ld more, eating %ld more\n",
|
||||
@@ -363,9 +365,9 @@ async_get_property_handler (Display *dpy,
|
||||
*/
|
||||
if (sizeof (long) == 8)
|
||||
{
|
||||
unsigned char *netdata;
|
||||
unsigned char *lptr;
|
||||
unsigned char *end_lptr;
|
||||
char *netdata;
|
||||
char *lptr;
|
||||
char *end_lptr;
|
||||
|
||||
/* Store the 32-bit values in the end of the array */
|
||||
netdata = task->data + nbytes / 2;
|
||||
@@ -584,7 +586,7 @@ ag_task_get_reply_and_free (AgGetPropertyTask *task,
|
||||
int *actual_format,
|
||||
unsigned long *nitems,
|
||||
unsigned long *bytesafter,
|
||||
unsigned char **prop)
|
||||
char **prop)
|
||||
{
|
||||
Display *dpy;
|
||||
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/* Asynchronous X property getting hack */
|
||||
|
||||
/*
|
||||
@@ -45,7 +47,7 @@ Status ag_task_get_reply_and_free (AgGetPropertyTask *task,
|
||||
int *actual_format,
|
||||
unsigned long *nitems,
|
||||
unsigned long *bytesafter,
|
||||
unsigned char **prop);
|
||||
char **prop);
|
||||
|
||||
Bool ag_task_have_reply (AgGetPropertyTask *task);
|
||||
Atom ag_task_get_property (AgGetPropertyTask *task);
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/* Metacity visual bell */
|
||||
|
||||
/*
|
||||
|
@@ -1,5 +1,6 @@
|
||||
/* Metacity visual bell */
|
||||
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
/*
|
||||
* Copyright (C) 2002 Sun Microsystems Inc.
|
||||
*
|
||||
|
21
src/boxes.c
21
src/boxes.c
@@ -1,3 +1,5 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/* Simple box operations */
|
||||
|
||||
/*
|
||||
@@ -705,6 +707,25 @@ meta_rectangle_contained_in_region (const GList *spanning_rects,
|
||||
return contained;
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_rectangle_overlaps_with_region (const GList *spanning_rects,
|
||||
const MetaRectangle *rect)
|
||||
{
|
||||
const GList *temp;
|
||||
gboolean overlaps;
|
||||
|
||||
temp = spanning_rects;
|
||||
overlaps = FALSE;
|
||||
while (!overlaps && temp != NULL)
|
||||
{
|
||||
overlaps = overlaps || meta_rectangle_overlap (temp->data, rect);
|
||||
temp = temp->next;
|
||||
}
|
||||
|
||||
return overlaps;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
meta_rectangle_clamp_to_fit_into_region (const GList *spanning_rects,
|
||||
FixedDirections fixed_directions,
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/* Simple box operations */
|
||||
|
||||
/*
|
||||
@@ -183,6 +185,9 @@ gboolean meta_rectangle_could_fit_in_region (
|
||||
gboolean meta_rectangle_contained_in_region (
|
||||
const GList *spanning_rects,
|
||||
const MetaRectangle *rect);
|
||||
gboolean meta_rectangle_overlaps_with_region (
|
||||
const GList *spanning_rects,
|
||||
const MetaRectangle *rect);
|
||||
|
||||
/* Make the rectangle small enough to fit into one of the spanning_rects,
|
||||
* but make it no smaller than min_size.
|
||||
|
679
src/c-screen.c
Normal file
679
src/c-screen.c
Normal file
@@ -0,0 +1,679 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2006 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.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
||||
#include <cm/ws.h>
|
||||
#include <cm/stacker.h>
|
||||
#include <cm/wsint.h>
|
||||
#include <cm/drawable-node.h>
|
||||
#include <cm/state.h>
|
||||
#include <cm/magnifier.h>
|
||||
#include <cm/square.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "screen.h"
|
||||
#include "c-screen.h"
|
||||
#include "c-window.h"
|
||||
|
||||
struct MetaCompScreen
|
||||
{
|
||||
WsDisplay *display;
|
||||
CmStacker *stacker;
|
||||
CmMagnifier *magnifier;
|
||||
|
||||
WsWindow *gl_window;
|
||||
WsWindow *root_window;
|
||||
|
||||
WsScreen *screen;
|
||||
MetaScreen *meta_screen;
|
||||
|
||||
int repaint_id;
|
||||
int idle_id;
|
||||
|
||||
WsWindow *selection_window;
|
||||
|
||||
GHashTable *windows_by_xid;
|
||||
};
|
||||
|
||||
static MetaCompWindow *
|
||||
meta_comp_window_lookup (MetaCompScreen *info,
|
||||
Window xid)
|
||||
{
|
||||
MetaCompWindow *window;
|
||||
|
||||
window = g_hash_table_lookup (info->windows_by_xid, (gpointer)xid);
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
MetaCompWindow *
|
||||
meta_comp_screen_lookup_window (MetaCompScreen *info,
|
||||
Window xwindow)
|
||||
{
|
||||
return meta_comp_window_lookup (info, xwindow);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
update_frame_counter (void)
|
||||
{
|
||||
#define BUFSIZE 128
|
||||
static GTimer *timer;
|
||||
static double buffer [BUFSIZE];
|
||||
static int next = 0;
|
||||
|
||||
if (!timer)
|
||||
timer = g_timer_new ();
|
||||
|
||||
buffer[next++] = g_timer_elapsed (timer, NULL);
|
||||
|
||||
if (next == BUFSIZE)
|
||||
{
|
||||
int i;
|
||||
double total;
|
||||
|
||||
next = 0;
|
||||
|
||||
total = 0.0;
|
||||
for (i = 1; i < BUFSIZE; ++i)
|
||||
total += buffer[i] - buffer[i - 1];
|
||||
|
||||
g_print ("frames per second: %f\n", 1 / (total / (BUFSIZE - 1)));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
dump_stacking_order (GList *nodes)
|
||||
{
|
||||
GList *list;
|
||||
|
||||
for (list = nodes; list != NULL; list = list->next)
|
||||
{
|
||||
CmDrawableNode *node = list->data;
|
||||
|
||||
if (node)
|
||||
g_print ("%lx, ", WS_RESOURCE_XID (node->drawable));
|
||||
}
|
||||
g_print ("\n");
|
||||
}
|
||||
|
||||
static gboolean
|
||||
repaint (gpointer data)
|
||||
{
|
||||
MetaCompScreen *info = data;
|
||||
CmState *state;
|
||||
#if 0
|
||||
g_print ("repaint\n");
|
||||
#endif
|
||||
glViewport (0, 0,
|
||||
info->meta_screen->rect.width,
|
||||
info->meta_screen->rect.height);
|
||||
|
||||
glLoadIdentity();
|
||||
|
||||
#if 0
|
||||
glClearColor (0, 0, 0, 1.0);
|
||||
glClear (GL_COLOR_BUFFER_BIT);
|
||||
#endif
|
||||
|
||||
ws_window_raise (info->gl_window);
|
||||
|
||||
#if 0
|
||||
glDisable (GL_TEXTURE_2D);
|
||||
glDisable (GL_TEXTURE_RECTANGLE_ARB);
|
||||
glPolygonMode (GL_FRONT_AND_BACK, GL_FILL);
|
||||
glColor4f (0.0, 1.0, 0.0, 1.0);
|
||||
glRectf (-1.0, -1.0, 1.0, 1.0);
|
||||
glFinish();
|
||||
#endif
|
||||
|
||||
state = cm_state_new ();
|
||||
|
||||
cm_state_disable_depth_buffer_update (state);
|
||||
|
||||
cm_node_render (CM_NODE (info->magnifier), state);
|
||||
|
||||
cm_state_enable_depth_buffer_update (state);
|
||||
|
||||
g_object_unref (state);
|
||||
|
||||
ws_window_gl_swap_buffers (info->gl_window);
|
||||
glFinish();
|
||||
|
||||
#if 0
|
||||
dump_stacking_order (info->stacker->children);
|
||||
#endif
|
||||
|
||||
info->idle_id = 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static MetaCompWindow *
|
||||
find_comp_window (MetaCompScreen *info,
|
||||
Window xwindow)
|
||||
{
|
||||
return meta_comp_window_lookup (info, xwindow);
|
||||
}
|
||||
|
||||
static CmNode *
|
||||
find_node (MetaCompScreen *info,
|
||||
Window xwindow)
|
||||
{
|
||||
MetaCompWindow *window = meta_comp_window_lookup (info, xwindow);
|
||||
|
||||
if (window)
|
||||
return meta_comp_window_get_node (window);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static GList *all_screen_infos;
|
||||
|
||||
MetaCompScreen *
|
||||
meta_comp_screen_get_by_xwindow (Window xwindow)
|
||||
{
|
||||
GList *list;
|
||||
|
||||
for (list = all_screen_infos; list != NULL; list = list->next)
|
||||
{
|
||||
MetaCompScreen *info = list->data;
|
||||
|
||||
if (find_node (info, xwindow))
|
||||
return info;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
MetaCompScreen *
|
||||
meta_comp_screen_new (WsDisplay *display,
|
||||
MetaScreen *screen)
|
||||
{
|
||||
MetaCompScreen *scr_info = g_new0 (MetaCompScreen, 1);
|
||||
|
||||
scr_info->screen = ws_display_get_screen_from_number (
|
||||
display, screen->number);
|
||||
scr_info->root_window = ws_screen_get_root_window (scr_info->screen);
|
||||
scr_info->display = display;
|
||||
scr_info->meta_screen = screen;
|
||||
scr_info->windows_by_xid = g_hash_table_new (g_direct_hash, g_direct_equal);
|
||||
|
||||
all_screen_infos = g_list_prepend (all_screen_infos, scr_info);
|
||||
|
||||
return scr_info;
|
||||
}
|
||||
|
||||
static char *
|
||||
make_selection_name (MetaCompScreen *info)
|
||||
{
|
||||
char *buffer;
|
||||
|
||||
buffer = g_strdup_printf ("_NET_WM_CM_S%d", info->meta_screen->number);
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
static void
|
||||
on_selection_clear (WsWindow *window,
|
||||
WsSelectionClearEvent *event,
|
||||
gpointer data)
|
||||
{
|
||||
MetaCompScreen *info = data;
|
||||
char *buffer = make_selection_name (info);
|
||||
|
||||
if (strcmp (event->selection, buffer))
|
||||
{
|
||||
/* We lost the selection */
|
||||
meta_comp_screen_unredirect (info);
|
||||
}
|
||||
}
|
||||
|
||||
static WsWindow *
|
||||
claim_selection (MetaCompScreen *info)
|
||||
{
|
||||
WsWindow *window = ws_window_new (info->root_window);
|
||||
char *buffer = make_selection_name (info);
|
||||
|
||||
#if 0
|
||||
g_print ("selection window: %lx\n", WS_RESOURCE_XID (window));
|
||||
#endif
|
||||
|
||||
ws_window_own_selection (window, buffer, WS_CURRENT_TIME);
|
||||
|
||||
g_signal_connect (window, "selection_clear_event", G_CALLBACK (on_selection_clear), info);
|
||||
|
||||
g_free (buffer);
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
static void
|
||||
queue_paint (CmNode *node,
|
||||
MetaCompScreen *info)
|
||||
{
|
||||
#if 0
|
||||
g_print ("queueing %s\n", G_OBJECT_TYPE_NAME (node));
|
||||
#endif
|
||||
meta_comp_screen_queue_paint (info);
|
||||
}
|
||||
|
||||
void
|
||||
meta_comp_screen_redirect (MetaCompScreen *info)
|
||||
{
|
||||
WsWindow *root = ws_screen_get_root_window (info->screen);
|
||||
WsRectangle source;
|
||||
WsRectangle target;
|
||||
WsServerRegion *region;
|
||||
int screen_w;
|
||||
int screen_h;
|
||||
CmSquare *square;
|
||||
|
||||
#if 0
|
||||
g_print ("redirecting %lx\n", WS_RESOURCE_XID (root));
|
||||
#endif
|
||||
|
||||
ws_window_redirect_subwindows (root);
|
||||
info->gl_window = ws_screen_get_gl_window (info->screen);
|
||||
/* FIXME: This should probably happen in libcm */
|
||||
ws_window_set_override_redirect (info->gl_window, TRUE);
|
||||
region = ws_server_region_new (info->display);
|
||||
ws_window_set_input_shape (info->gl_window, region);
|
||||
g_object_unref (G_OBJECT (region));
|
||||
|
||||
ws_display_begin_error_trap (info->display);
|
||||
|
||||
ws_window_unredirect (info->gl_window);
|
||||
|
||||
ws_display_end_error_trap (info->display);
|
||||
|
||||
info->selection_window = claim_selection (info);
|
||||
|
||||
ws_window_map (info->gl_window);
|
||||
|
||||
info->stacker = cm_stacker_new ();
|
||||
|
||||
square = cm_square_new (0.3, 0.3, 0.8, 1.0);
|
||||
|
||||
cm_stacker_add_child (info->stacker, CM_NODE (square));
|
||||
|
||||
g_object_unref (square);
|
||||
|
||||
screen_w = ws_screen_get_width (info->screen);
|
||||
screen_h = ws_screen_get_height (info->screen);
|
||||
|
||||
#if 0
|
||||
g_print ("width: %d height %d\n", screen_w, screen_h);
|
||||
#endif
|
||||
|
||||
source.x = (screen_w - (screen_w / 4)) / 2;
|
||||
source.y = screen_h / 16;
|
||||
source.width = screen_w / 4;
|
||||
source.height = screen_h / 16;
|
||||
|
||||
target.x = 0;
|
||||
target.y = screen_h - screen_h / 4;
|
||||
target.width = screen_w;
|
||||
target.height = screen_h / 4;
|
||||
|
||||
info->magnifier = cm_magnifier_new (CM_NODE (info->stacker), &source, &target);
|
||||
|
||||
g_object_unref (info->stacker);
|
||||
|
||||
if (g_getenv ("USE_MAGNIFIER"))
|
||||
cm_magnifier_set_active (info->magnifier, TRUE);
|
||||
else
|
||||
cm_magnifier_set_active (info->magnifier, FALSE);
|
||||
|
||||
info->repaint_id =
|
||||
g_signal_connect (info->magnifier, "need_repaint",
|
||||
G_CALLBACK (queue_paint), info);
|
||||
|
||||
ws_display_sync (info->display);
|
||||
}
|
||||
|
||||
static void
|
||||
listify (gpointer key,
|
||||
gpointer value,
|
||||
gpointer data)
|
||||
{
|
||||
GList **windows = data;
|
||||
|
||||
*windows = g_list_prepend (*windows, (gpointer)value);
|
||||
}
|
||||
|
||||
static void
|
||||
free_all_windows (MetaCompScreen *info)
|
||||
{
|
||||
GList *windows = NULL, *list;
|
||||
|
||||
g_hash_table_foreach (info->windows_by_xid, listify, &windows);
|
||||
|
||||
for (list = windows; list != NULL; list = list->next)
|
||||
{
|
||||
MetaCompWindow *window = list->data;
|
||||
|
||||
meta_comp_window_free (window);
|
||||
}
|
||||
|
||||
g_list_free (windows);
|
||||
}
|
||||
|
||||
void
|
||||
meta_comp_screen_unredirect (MetaCompScreen *info)
|
||||
{
|
||||
WsScreen *ws_screen = info->screen;
|
||||
WsWindow *root = ws_screen_get_root_window (ws_screen);
|
||||
|
||||
g_signal_handler_disconnect (info->magnifier, info->repaint_id);
|
||||
g_object_unref (info->magnifier);
|
||||
|
||||
ws_window_unredirect_subwindows (root);
|
||||
ws_screen_release_gl_window (ws_screen);
|
||||
|
||||
free_all_windows (info);
|
||||
|
||||
ws_display_sync (info->display);
|
||||
|
||||
/* FIXME: libcm needs a way to guarantee that a window is destroyed,
|
||||
* without relying on ref counting having it as a side effect
|
||||
*/
|
||||
g_object_unref (info->selection_window);
|
||||
}
|
||||
|
||||
void
|
||||
meta_comp_screen_queue_paint (MetaCompScreen *info)
|
||||
{
|
||||
#if 0
|
||||
g_print ("queuing\n");
|
||||
#endif
|
||||
if (!info->idle_id)
|
||||
info->idle_id = g_idle_add (repaint, info);
|
||||
}
|
||||
|
||||
void
|
||||
meta_comp_screen_restack (MetaCompScreen *info,
|
||||
Window window,
|
||||
Window above_this)
|
||||
{
|
||||
MetaCompWindow *comp_window = find_comp_window (info, window);
|
||||
MetaCompWindow *above_comp_window = find_comp_window (info, above_this);
|
||||
CmNode *window_node = find_node (info, window);
|
||||
CmNode *above_node = find_node (info, above_this);
|
||||
|
||||
if ((comp_window && meta_comp_window_stack_frozen (comp_window)) ||
|
||||
(above_comp_window && meta_comp_window_stack_frozen (above_comp_window)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
#if 0
|
||||
dump_stacking_order (info->stacker->children);
|
||||
#endif
|
||||
|
||||
if (window_node == above_node)
|
||||
return;
|
||||
|
||||
if (window_node && above_this == WS_RESOURCE_XID (info->gl_window))
|
||||
{
|
||||
cm_stacker_raise_child (info->stacker, window_node);
|
||||
}
|
||||
else if (window_node && above_this == None)
|
||||
{
|
||||
cm_stacker_lower_child (info->stacker, window_node);
|
||||
}
|
||||
else if (window_node && above_node)
|
||||
{
|
||||
cm_stacker_restack_child (info->stacker, window_node, above_node);
|
||||
}
|
||||
#if 0
|
||||
else
|
||||
g_print ("nothing happened\n");
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
g_print ("done restacking; new order:\n");
|
||||
#endif
|
||||
#if 0
|
||||
dump_stacking_order (info->stacker->children);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
meta_comp_screen_raise_window (MetaCompScreen *info,
|
||||
Window window)
|
||||
{
|
||||
CmNode *node = find_node (info, window);
|
||||
|
||||
if (node)
|
||||
cm_stacker_raise_child (info->stacker, node);
|
||||
}
|
||||
|
||||
void
|
||||
meta_comp_screen_set_size (MetaCompScreen *info,
|
||||
Window xwindow,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
MetaCompWindow *comp_window = meta_comp_window_lookup (info, xwindow);
|
||||
|
||||
if (comp_window)
|
||||
{
|
||||
WsRectangle rect;
|
||||
|
||||
rect.x = x;
|
||||
rect.y = y;
|
||||
rect.width = width;
|
||||
rect.height = height;
|
||||
|
||||
meta_comp_window_set_size (comp_window, &rect);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
print_child_titles (WsWindow *window)
|
||||
{
|
||||
GList *children = ws_window_query_subwindows (window);
|
||||
GList *list;
|
||||
int i;
|
||||
|
||||
g_print ("window: %lx %s\n", WS_RESOURCE_XID (window), ws_window_query_title (window));
|
||||
|
||||
i = 0;
|
||||
for (list = children; list != NULL; list = list->next)
|
||||
{
|
||||
WsWindow *child = list->data;
|
||||
|
||||
g_print (" %d adding: %lx %s\n", i++, WS_RESOURCE_XID (child), ws_window_query_title (child));
|
||||
}
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
MetaCompScreen *cscreen;
|
||||
XID xid;
|
||||
} DestroyData;
|
||||
|
||||
static void
|
||||
on_window_destroy (MetaCompWindow *comp_window,
|
||||
gpointer closure)
|
||||
{
|
||||
DestroyData *data = closure;
|
||||
CmNode *node = meta_comp_window_get_node (comp_window);
|
||||
|
||||
cm_stacker_remove_child (data->cscreen->stacker, node);
|
||||
g_hash_table_remove (data->cscreen->windows_by_xid, (gpointer)data->xid);
|
||||
}
|
||||
|
||||
void
|
||||
meta_comp_screen_add_window (MetaCompScreen *info,
|
||||
Window xwindow)
|
||||
{
|
||||
WsDrawable *drawable;
|
||||
MetaCompWindow *comp_window;
|
||||
DestroyData *data;
|
||||
|
||||
ws_display_begin_error_trap (info->display);
|
||||
|
||||
comp_window = meta_comp_window_lookup (info, xwindow);
|
||||
|
||||
if (comp_window)
|
||||
goto out;
|
||||
|
||||
drawable = WS_DRAWABLE (ws_window_lookup (info->display, xwindow));
|
||||
|
||||
if (ws_window_query_input_only (WS_WINDOW (drawable)))
|
||||
goto out;
|
||||
|
||||
if (WS_WINDOW (drawable) == info->gl_window ||
|
||||
WS_WINDOW (drawable) == info->screen->overlay_window)
|
||||
{
|
||||
#if 0
|
||||
g_print ("gl window\n");
|
||||
#endif
|
||||
goto out;
|
||||
}
|
||||
|
||||
data = g_new (DestroyData, 1);
|
||||
data->cscreen = info;
|
||||
data->xid = WS_RESOURCE_XID (drawable);
|
||||
|
||||
comp_window = meta_comp_window_new (info->meta_screen, drawable,
|
||||
on_window_destroy, data);
|
||||
|
||||
g_hash_table_insert (info->windows_by_xid, (gpointer)WS_RESOURCE_XID (drawable), comp_window);
|
||||
|
||||
cm_stacker_add_child (info->stacker, meta_comp_window_get_node (comp_window));
|
||||
|
||||
out:
|
||||
if (comp_window)
|
||||
{
|
||||
/* This function is called both when windows are created and when they
|
||||
* are mapped, so for now we have this silly function.
|
||||
*/
|
||||
meta_comp_window_refresh_attrs (comp_window);
|
||||
}
|
||||
|
||||
ws_display_end_error_trap (info->display);
|
||||
|
||||
#if 0
|
||||
g_print ("done checking\n");
|
||||
#endif
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
meta_comp_screen_remove_window (MetaCompScreen *info,
|
||||
Window xwindow)
|
||||
{
|
||||
MetaCompWindow *comp_window = meta_comp_window_lookup (info, xwindow);
|
||||
|
||||
if (comp_window)
|
||||
meta_comp_window_free (comp_window);
|
||||
}
|
||||
|
||||
void
|
||||
meta_comp_screen_set_updates (MetaCompScreen *info,
|
||||
Window xwindow,
|
||||
gboolean updates)
|
||||
{
|
||||
MetaCompWindow *comp_window = meta_comp_window_lookup (info, xwindow);
|
||||
|
||||
meta_comp_window_set_updates (comp_window, updates);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
meta_comp_screen_set_patch (MetaCompScreen *info,
|
||||
Window xwindow,
|
||||
CmPoint points[4][4])
|
||||
{
|
||||
CmDrawableNode *node = CM_DRAWABLE_NODE (find_node (info, xwindow));
|
||||
|
||||
if (node)
|
||||
cm_drawable_node_set_patch (node, points);
|
||||
}
|
||||
|
||||
void
|
||||
meta_comp_screen_unset_patch (MetaCompScreen *info,
|
||||
Window xwindow)
|
||||
{
|
||||
CmDrawableNode *node = CM_DRAWABLE_NODE (find_node (info, xwindow));
|
||||
|
||||
if (node)
|
||||
cm_drawable_node_unset_patch (node);
|
||||
}
|
||||
|
||||
void
|
||||
meta_comp_screen_set_alpha (MetaCompScreen *info,
|
||||
Window xwindow,
|
||||
gdouble alpha)
|
||||
{
|
||||
CmDrawableNode *node = CM_DRAWABLE_NODE (find_node (info, xwindow));
|
||||
#if 0
|
||||
g_print ("alpha: %f\n", alpha);
|
||||
#endif
|
||||
cm_drawable_node_set_alpha (node, alpha);
|
||||
}
|
||||
|
||||
void
|
||||
meta_comp_screen_get_real_size (MetaCompScreen *info,
|
||||
Window xwindow,
|
||||
WsRectangle *size)
|
||||
{
|
||||
CmDrawableNode *node = CM_DRAWABLE_NODE (find_node (info, xwindow));
|
||||
|
||||
if (!size)
|
||||
return;
|
||||
|
||||
cm_drawable_node_get_clipbox (node, size);
|
||||
}
|
||||
|
||||
void
|
||||
meta_comp_screen_unmap (MetaCompScreen *info,
|
||||
Window xwindow)
|
||||
{
|
||||
MetaCompWindow *window = find_comp_window (info, xwindow);
|
||||
|
||||
if (window)
|
||||
meta_comp_window_hide (window);
|
||||
}
|
||||
|
||||
void
|
||||
meta_comp_screen_set_target_rect (MetaCompScreen *info,
|
||||
Window xwindow,
|
||||
WsRectangle *rect)
|
||||
{
|
||||
CmDrawableNode *node = CM_DRAWABLE_NODE (find_node (info, xwindow));
|
||||
|
||||
if (node)
|
||||
cm_drawable_node_set_scale_rect (node, rect);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
53
src/c-screen.h
Normal file
53
src/c-screen.h
Normal file
@@ -0,0 +1,53 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
#include "screen.h"
|
||||
#include "c-window.h"
|
||||
|
||||
typedef struct MetaCompScreen MetaCompScreen;
|
||||
|
||||
MetaCompScreen *meta_comp_screen_new (WsDisplay *display,
|
||||
MetaScreen *screen);
|
||||
MetaCompScreen *meta_comp_screen_get_by_xwindow (Window xwindow);
|
||||
void meta_comp_screen_destroy (MetaCompScreen *scr_info);
|
||||
void meta_comp_screen_redirect (MetaCompScreen *info);
|
||||
void meta_comp_screen_unredirect (MetaCompScreen *info);
|
||||
void meta_comp_screen_add_window (MetaCompScreen *scr_info,
|
||||
Window xwindow);
|
||||
void meta_comp_screen_remove_window (MetaCompScreen *scr_info,
|
||||
Window xwindow);
|
||||
void meta_comp_screen_restack (MetaCompScreen *scr_info,
|
||||
Window window,
|
||||
Window above_this);
|
||||
void meta_comp_screen_set_size (MetaCompScreen *info,
|
||||
Window window,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height);
|
||||
void meta_comp_screen_raise_window (MetaCompScreen *scr_info,
|
||||
Window window);
|
||||
void meta_comp_screen_queue_paint (MetaCompScreen *info);
|
||||
void meta_comp_screen_set_updates (MetaCompScreen *info,
|
||||
Window xwindow,
|
||||
gboolean updates);
|
||||
void meta_comp_screen_set_patch (MetaCompScreen *info,
|
||||
Window xwindow,
|
||||
CmPoint points[4][4]);
|
||||
void meta_comp_screen_unset_patch (MetaCompScreen *info,
|
||||
Window xwindow);
|
||||
void meta_comp_screen_set_alpha (MetaCompScreen *info,
|
||||
Window xwindow,
|
||||
gdouble alpha);
|
||||
void meta_comp_screen_get_real_size (MetaCompScreen *info,
|
||||
Window xwindow,
|
||||
WsRectangle *size);
|
||||
void meta_comp_screen_set_target_rect (MetaCompScreen *info,
|
||||
Window xwindow,
|
||||
WsRectangle *rect);
|
||||
void meta_comp_screen_set_explode (MetaCompScreen *info,
|
||||
Window xwindow,
|
||||
gdouble level);
|
||||
void meta_comp_screen_unmap (MetaCompScreen *info,
|
||||
Window xwindow);
|
||||
MetaCompWindow *meta_comp_screen_lookup_window (MetaCompScreen *info,
|
||||
Window xwindow);
|
1262
src/c-window.c
Normal file
1262
src/c-window.c
Normal file
File diff suppressed because it is too large
Load Diff
72
src/c-window.h
Normal file
72
src/c-window.h
Normal file
@@ -0,0 +1,72 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
/*
|
||||
* Copyright (C) 2006 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.
|
||||
*/
|
||||
|
||||
#include <cm/node.h>
|
||||
#include "display.h"
|
||||
#include "effects.h"
|
||||
|
||||
#ifndef C_WINDOW_H
|
||||
#define C_WINDOW_H
|
||||
|
||||
typedef struct _MetaCompWindow MetaCompWindow;
|
||||
|
||||
typedef void (* MetaCompWindowDestroy) (MetaCompWindow *window,
|
||||
gpointer closure);
|
||||
|
||||
MetaCompWindow *meta_comp_window_new (MetaScreen *screen,
|
||||
WsDrawable *drawable,
|
||||
MetaCompWindowDestroy destroy,
|
||||
gpointer data);
|
||||
CmNode *meta_comp_window_get_node (MetaCompWindow *window);
|
||||
gboolean meta_comp_window_free (MetaCompWindow *window);
|
||||
void meta_comp_window_set_size (MetaCompWindow *window,
|
||||
WsRectangle *size);
|
||||
|
||||
void meta_comp_window_hide (MetaCompWindow *comp_window);
|
||||
void meta_comp_window_show (MetaCompWindow *comp_window);
|
||||
void meta_comp_window_refresh_attrs (MetaCompWindow *comp_window);
|
||||
void meta_comp_window_set_updates (MetaCompWindow *comp_window,
|
||||
gboolean updates);
|
||||
|
||||
void meta_comp_window_explode (MetaCompWindow *comp_window,
|
||||
MetaEffect *effect);
|
||||
void meta_comp_window_shrink (MetaCompWindow *comp_window,
|
||||
MetaEffect *effect);
|
||||
void meta_comp_window_unshrink (MetaCompWindow *comp_window,
|
||||
MetaEffect *effect);
|
||||
void meta_comp_window_run_focus (MetaCompWindow *comp_window,
|
||||
MetaEffect *effect);
|
||||
void meta_comp_window_restack (MetaCompWindow *comp_window,
|
||||
MetaCompWindow *above);
|
||||
void meta_comp_window_freeze_stack (MetaCompWindow *comp_window);
|
||||
void meta_comp_window_thaw_stack (MetaCompWindow *comp_window);
|
||||
gboolean meta_comp_window_stack_frozen (MetaCompWindow *comp_window);
|
||||
void meta_comp_window_run_minimize (MetaCompWindow *window,
|
||||
MetaEffect *effect);
|
||||
void meta_comp_window_run_unminimize (MetaCompWindow *comp_window,
|
||||
MetaEffect *effect);
|
||||
|
||||
#if 0
|
||||
void meta_comp_window_set_explode (MetaCompWindow *comp_window,
|
||||
double level);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/* Metacity RGB color stuff */
|
||||
|
||||
/*
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/* Metacity RGB color stuff */
|
||||
|
||||
/*
|
||||
|
36
src/common.h
36
src/common.h
@@ -1,3 +1,5 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/* Metacity common types shared by core.h and ui.h */
|
||||
|
||||
/*
|
||||
@@ -44,7 +46,8 @@ typedef enum
|
||||
META_FRAME_ALLOWS_SHADE = 1 << 10,
|
||||
META_FRAME_ALLOWS_MOVE = 1 << 11,
|
||||
META_FRAME_FULLSCREEN = 1 << 12,
|
||||
META_FRAME_IS_FLASHING = 1 << 13
|
||||
META_FRAME_IS_FLASHING = 1 << 13,
|
||||
META_FRAME_ABOVE = 1 << 14
|
||||
} MetaFrameFlags;
|
||||
|
||||
typedef enum
|
||||
@@ -74,7 +77,7 @@ typedef struct _MetaWindowMenu MetaWindowMenu;
|
||||
typedef void (* MetaWindowMenuFunc) (MetaWindowMenu *menu,
|
||||
Display *xdisplay,
|
||||
Window client_xwindow,
|
||||
Time timestamp,
|
||||
guint32 timestamp,
|
||||
MetaMenuOp op,
|
||||
int workspace,
|
||||
gpointer data);
|
||||
@@ -116,6 +119,11 @@ typedef enum
|
||||
/* Alt+Esc */
|
||||
META_GRAB_OP_KEYBOARD_ESCAPING_NORMAL,
|
||||
META_GRAB_OP_KEYBOARD_ESCAPING_DOCK,
|
||||
|
||||
META_GRAB_OP_KEYBOARD_ESCAPING_GROUP,
|
||||
|
||||
/* Alt+F6 */
|
||||
META_GRAB_OP_KEYBOARD_TABBING_GROUP,
|
||||
|
||||
META_GRAB_OP_KEYBOARD_WORKSPACE_SWITCHING,
|
||||
|
||||
@@ -124,7 +132,13 @@ typedef enum
|
||||
META_GRAB_OP_CLICKING_MAXIMIZE,
|
||||
META_GRAB_OP_CLICKING_UNMAXIMIZE,
|
||||
META_GRAB_OP_CLICKING_DELETE,
|
||||
META_GRAB_OP_CLICKING_MENU
|
||||
META_GRAB_OP_CLICKING_MENU,
|
||||
META_GRAB_OP_CLICKING_SHADE,
|
||||
META_GRAB_OP_CLICKING_UNSHADE,
|
||||
META_GRAB_OP_CLICKING_ABOVE,
|
||||
META_GRAB_OP_CLICKING_UNABOVE,
|
||||
META_GRAB_OP_CLICKING_STICK,
|
||||
META_GRAB_OP_CLICKING_UNSTICK
|
||||
} MetaGrabOp;
|
||||
|
||||
typedef enum
|
||||
@@ -138,8 +152,7 @@ typedef enum
|
||||
META_CURSOR_SW_RESIZE,
|
||||
META_CURSOR_NE_RESIZE,
|
||||
META_CURSOR_NW_RESIZE,
|
||||
META_CURSOR_MOVE_WINDOW,
|
||||
META_CURSOR_RESIZE_WINDOW,
|
||||
META_CURSOR_MOVE_OR_RESIZE_WINDOW,
|
||||
META_CURSOR_BUSY
|
||||
|
||||
} MetaCursor;
|
||||
@@ -151,6 +164,12 @@ typedef enum
|
||||
META_FOCUS_MODE_MOUSE
|
||||
} MetaFocusMode;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
META_FOCUS_NEW_WINDOWS_SMART,
|
||||
META_FOCUS_NEW_WINDOWS_STRICT
|
||||
} MetaFocusNewWindows;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
META_ACTION_DOUBLE_CLICK_TITLEBAR_TOGGLE_SHADE,
|
||||
@@ -190,7 +209,6 @@ typedef enum
|
||||
|
||||
/* Relative directions or sides seem to come up all over the place... */
|
||||
/* FIXME: Replace
|
||||
* place.[ch]:MetaWindowEdgePosition,
|
||||
* screen.[ch]:MetaScreenDirection,
|
||||
* workspace.[ch]:MetaMotionDirection,
|
||||
* with the use of MetaDirection.
|
||||
@@ -215,6 +233,12 @@ typedef enum
|
||||
META_BUTTON_FUNCTION_MINIMIZE,
|
||||
META_BUTTON_FUNCTION_MAXIMIZE,
|
||||
META_BUTTON_FUNCTION_CLOSE,
|
||||
META_BUTTON_FUNCTION_SHADE,
|
||||
META_BUTTON_FUNCTION_ABOVE,
|
||||
META_BUTTON_FUNCTION_STICK,
|
||||
META_BUTTON_FUNCTION_UNSHADE,
|
||||
META_BUTTON_FUNCTION_UNABOVE,
|
||||
META_BUTTON_FUNCTION_UNSTICK,
|
||||
META_BUTTON_FUNCTION_LAST
|
||||
} MetaButtonFunction;
|
||||
|
||||
|
1417
src/compositor.c
1417
src/compositor.c
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,5 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/* Metacity compositing manager */
|
||||
|
||||
/*
|
||||
@@ -25,7 +27,10 @@
|
||||
#include "util.h"
|
||||
#include "display.h"
|
||||
|
||||
typedef void (* MetaMinimizeFinishedFunc) (gpointer data);
|
||||
typedef void (* MetaAnimationFinishedFunc) (gpointer data);
|
||||
|
||||
/* XXX namespace me */
|
||||
void compute_window_rect (MetaWindow *window, MetaRectangle *rect);
|
||||
|
||||
MetaCompositor* meta_compositor_new (MetaDisplay *display);
|
||||
void meta_compositor_unref (MetaCompositor *compositor);
|
||||
@@ -45,13 +50,36 @@ void meta_compositor_manage_screen (MetaCompositor *compositor,
|
||||
void meta_compositor_unmanage_screen (MetaCompositor *compositor,
|
||||
MetaScreen *screen);
|
||||
|
||||
void meta_compositor_minimize (MetaCompositor *compositor,
|
||||
MetaWindow *window,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height,
|
||||
MetaMinimizeFinishedFunc finished_cb,
|
||||
gpointer finished_data);
|
||||
#if 0
|
||||
void meta_compositor_minimize (MetaCompositor *compositor,
|
||||
MetaWindow *window,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height,
|
||||
MetaAnimationFinishedFunc finished_cb,
|
||||
gpointer finished_data);
|
||||
#endif
|
||||
|
||||
void
|
||||
meta_compositor_set_updates (MetaCompositor *compositor,
|
||||
MetaWindow *window,
|
||||
gboolean updates);
|
||||
void
|
||||
meta_compositor_destroy (MetaCompositor *compositor);
|
||||
|
||||
void meta_compositor_begin_move (MetaCompositor *compositor,
|
||||
MetaWindow *window,
|
||||
MetaRectangle *initial,
|
||||
int grab_x, int grab_y);
|
||||
void meta_compositor_update_move (MetaCompositor *compositor,
|
||||
MetaWindow *window,
|
||||
int x, int y);
|
||||
void meta_compositor_end_move (MetaCompositor *compositor,
|
||||
MetaWindow *window);
|
||||
void meta_compositor_free_window (MetaCompositor *compositor,
|
||||
MetaWindow *window);
|
||||
void meta_compositor_free_window (MetaCompositor *compositor,
|
||||
MetaWindow *window);
|
||||
|
||||
#endif /* META_COMPOSITOR_H */
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/* Metacity size/position constraints */
|
||||
|
||||
/*
|
||||
@@ -97,6 +99,7 @@ typedef enum
|
||||
PRIORITY_MAXIMIZATION = 2,
|
||||
PRIORITY_FULLSCREEN = 2,
|
||||
PRIORITY_SIZE_HINTS_LIMITS = 3,
|
||||
PRIORITY_TITLEBAR_VISIBLE = 4,
|
||||
PRIORITY_PARTIALLY_VISIBLE_ON_WORKAREA = 4,
|
||||
PRIORITY_MAXIMUM = 4 // Dummy value used for loop end = max(all priorities)
|
||||
} ConstraintPriority;
|
||||
@@ -165,6 +168,10 @@ static gboolean constrain_fully_onscreen (MetaWindow *window,
|
||||
ConstraintInfo *info,
|
||||
ConstraintPriority priority,
|
||||
gboolean check_only);
|
||||
static gboolean constrain_titlebar_visible (MetaWindow *window,
|
||||
ConstraintInfo *info,
|
||||
ConstraintPriority priority,
|
||||
gboolean check_only);
|
||||
static gboolean constrain_partially_onscreen (MetaWindow *window,
|
||||
ConstraintInfo *info,
|
||||
ConstraintPriority priority,
|
||||
@@ -209,6 +216,7 @@ static const Constraint all_constraints[] = {
|
||||
{constrain_aspect_ratio, "constrain_aspect_ratio"},
|
||||
{constrain_to_single_xinerama, "constrain_to_single_xinerama"},
|
||||
{constrain_fully_onscreen, "constrain_fully_onscreen"},
|
||||
{constrain_titlebar_visible, "constrain_titlebar_visible"},
|
||||
{constrain_partially_onscreen, "constrain_partially_onscreen"},
|
||||
{NULL, NULL}
|
||||
};
|
||||
@@ -379,10 +387,11 @@ setup_constraint_info (ConstraintInfo *info,
|
||||
if (!info->is_user_action)
|
||||
info->fixed_directions = 0;
|
||||
|
||||
meta_window_get_work_area_current_xinerama (window, &info->work_area_xinerama);
|
||||
|
||||
xinerama_info =
|
||||
meta_screen_get_xinerama_for_window (window->screen, window);
|
||||
meta_screen_get_xinerama_for_rect (window->screen, &info->current);
|
||||
meta_window_get_work_area_for_xinerama (window,
|
||||
xinerama_info->number,
|
||||
&info->work_area_xinerama);
|
||||
info->entire_xinerama = xinerama_info->rect;
|
||||
|
||||
cur_workspace = window->screen->active_workspace;
|
||||
@@ -392,6 +401,23 @@ setup_constraint_info (ConstraintInfo *info,
|
||||
meta_workspace_get_onxinerama_region (cur_workspace,
|
||||
xinerama_info->number);
|
||||
|
||||
/* Workaround braindead legacy apps that don't know how to
|
||||
* fullscreen themselves properly.
|
||||
*/
|
||||
if (meta_rectangle_equal (new, &xinerama_info->rect) &&
|
||||
window->has_fullscreen_func &&
|
||||
!window->fullscreen)
|
||||
{
|
||||
/*
|
||||
meta_topic (META_DEBUG_GEOMETRY,
|
||||
*/
|
||||
meta_warning (
|
||||
"Treating resize request of legacy application %s as a "
|
||||
"fullscreen request\n",
|
||||
window->desc);
|
||||
meta_window_make_fullscreen_internal (window);
|
||||
}
|
||||
|
||||
/* Log all this information for debugging */
|
||||
meta_topic (META_DEBUG_GEOMETRY,
|
||||
"Setting up constraint info:\n"
|
||||
@@ -434,13 +460,15 @@ place_window_if_needed(MetaWindow *window,
|
||||
|
||||
/* Do placement if any, so we go ahead and apply position
|
||||
* constraints in a move-only context. Don't place
|
||||
* maximized/fullscreen windows until they are unmaximized
|
||||
* and unfullscreened
|
||||
* maximized/minimized/fullscreen windows until they are
|
||||
* unmaximized, unminimized and unfullscreened.
|
||||
*/
|
||||
did_placement = FALSE;
|
||||
if (!window->placed &&
|
||||
window->calc_placement &&
|
||||
!META_WINDOW_MAXIMIZED (window) &&
|
||||
!(window->maximized_horizontally ||
|
||||
window->maximized_vertically) &&
|
||||
!window->minimized &&
|
||||
!window->fullscreen)
|
||||
{
|
||||
MetaRectangle placed_rect = info->orig;
|
||||
@@ -475,53 +503,47 @@ place_window_if_needed(MetaWindow *window,
|
||||
info->fixed_directions = 0;
|
||||
}
|
||||
|
||||
if ((window->maximize_horizontally_after_placement ||
|
||||
window->maximize_vertically_after_placement) &&
|
||||
(window->placed || did_placement))
|
||||
if (window->placed || did_placement)
|
||||
{
|
||||
/* define a sane saved_rect so that the user can unmaximize to
|
||||
* something reasonable.
|
||||
*/
|
||||
if (info->current.width >= info->work_area_xinerama.width)
|
||||
{
|
||||
info->current.width = .75 * info->work_area_xinerama.width;
|
||||
info->current.x = info->work_area_xinerama.x +
|
||||
.125 * info->work_area_xinerama.width;
|
||||
}
|
||||
if (info->current.height >= info->work_area_xinerama.height)
|
||||
{
|
||||
info->current.height = .75 * info->work_area_xinerama.height;
|
||||
info->current.y = info->work_area_xinerama.y +
|
||||
.083 * info->work_area_xinerama.height;
|
||||
}
|
||||
|
||||
if (window->maximize_horizontally_after_placement &&
|
||||
if (window->maximize_horizontally_after_placement ||
|
||||
window->maximize_vertically_after_placement)
|
||||
meta_window_maximize_internal (window,
|
||||
META_MAXIMIZE_HORIZONTAL |
|
||||
META_MAXIMIZE_VERTICAL,
|
||||
&info->current);
|
||||
else if (window->maximize_horizontally_after_placement)
|
||||
{
|
||||
info->current.x = info->work_area_xinerama.x
|
||||
+ info->fgeom->left_width;
|
||||
info->current.width = info->work_area_xinerama.width
|
||||
- info->fgeom->left_width - info->fgeom->right_width;
|
||||
/* define a sane saved_rect so that the user can unmaximize to
|
||||
* something reasonable.
|
||||
*/
|
||||
if (info->current.width >= info->work_area_xinerama.width)
|
||||
{
|
||||
info->current.width = .75 * info->work_area_xinerama.width;
|
||||
info->current.x = info->work_area_xinerama.x +
|
||||
.125 * info->work_area_xinerama.width;
|
||||
}
|
||||
if (info->current.height >= info->work_area_xinerama.height)
|
||||
{
|
||||
info->current.height = .75 * info->work_area_xinerama.height;
|
||||
info->current.y = info->work_area_xinerama.y +
|
||||
.083 * info->work_area_xinerama.height;
|
||||
}
|
||||
|
||||
if (window->maximize_horizontally_after_placement ||
|
||||
window->maximize_vertically_after_placement)
|
||||
meta_window_maximize_internal (window,
|
||||
(window->maximize_horizontally_after_placement ?
|
||||
META_MAXIMIZE_HORIZONTAL : 0 ) |
|
||||
(window->maximize_vertically_after_placement ?
|
||||
META_MAXIMIZE_VERTICAL : 0), &info->current);
|
||||
|
||||
/* maximization may have changed frame geometry */
|
||||
if (window->frame && !window->fullscreen)
|
||||
meta_frame_calc_geometry (window->frame, info->fgeom);
|
||||
|
||||
window->maximize_horizontally_after_placement = FALSE;
|
||||
window->maximize_vertically_after_placement = FALSE;
|
||||
}
|
||||
else if (window->maximize_vertically_after_placement);
|
||||
if (window->minimize_after_placement)
|
||||
{
|
||||
info->current.y = info->work_area_xinerama.y
|
||||
+ info->fgeom->top_height;
|
||||
info->current.height = info->work_area_xinerama.height
|
||||
- info->fgeom->top_height - info->fgeom->bottom_height;
|
||||
meta_window_minimize (window);
|
||||
window->minimize_after_placement = FALSE;
|
||||
}
|
||||
|
||||
/* maximization may have changed frame geometry */
|
||||
if (window->frame && !window->fullscreen)
|
||||
meta_frame_calc_geometry (window->frame, info->fgeom);
|
||||
|
||||
window->maximize_horizontally_after_placement = FALSE;
|
||||
window->maximize_vertically_after_placement = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -536,23 +558,33 @@ update_onscreen_requirements (MetaWindow *window,
|
||||
window->type == META_WINDOW_DOCK)
|
||||
return;
|
||||
|
||||
/* USABILITY NOTE: Naturally, I only want the require_fully_onscreen and
|
||||
* require_on_single_xinerama flags to *become false* due to user
|
||||
* interactions (which is allowed since certain constraints are ignored
|
||||
* for user interactions regardless of the setting of these flags).
|
||||
* However, whether to make these flags *become true* due to just an
|
||||
* application interaction is a little trickier. It's possible that
|
||||
* users may find not doing that strange since two application
|
||||
* interactions that resize in opposite ways don't necessarily end up
|
||||
* cancelling--but it may also be strange for the user to have an
|
||||
* application resize the window so that it's onscreen, the user forgets
|
||||
* about it, and then later the app is able to resize itself off the
|
||||
* screen. Anyway, for now, I'm think the latter is the more problematic
|
||||
* case but this may need to be revisited.
|
||||
/* We don't want to update the requirements for fullscreen windows;
|
||||
* fullscreen windows are specially handled anyway, and it updating
|
||||
* the requirements when windows enter fullscreen mode mess up the
|
||||
* handling of the window when it leaves that mode (especially when
|
||||
* the application sends a bunch of configurerequest events). See
|
||||
* #353699.
|
||||
*/
|
||||
if (window->fullscreen)
|
||||
return;
|
||||
|
||||
/* USABILITY NOTE: Naturally, I only want the require_fully_onscreen,
|
||||
* require_on_single_xinerama, and require_titlebar_visible flags to
|
||||
* *become false* due to user interactions (which is allowed since
|
||||
* certain constraints are ignored for user interactions regardless of
|
||||
* the setting of these flags). However, whether to make these flags
|
||||
* *become true* due to just an application interaction is a little
|
||||
* trickier. It's possible that users may find not doing that strange
|
||||
* since two application interactions that resize in opposite ways don't
|
||||
* necessarily end up cancelling--but it may also be strange for the user
|
||||
* to have an application resize the window so that it's onscreen, the
|
||||
* user forgets about it, and then later the app is able to resize itself
|
||||
* off the screen. Anyway, for now, I think the latter is the more
|
||||
* problematic case but this may need to be revisited.
|
||||
*/
|
||||
|
||||
/* The require onscreen/on-single-xinerama stuff is relative to the
|
||||
* outer window, not the inner
|
||||
/* The require onscreen/on-single-xinerama and titlebar_visible
|
||||
* stuff is relative to the outer window, not the inner
|
||||
*/
|
||||
extend_by_frame (&info->current, info->fgeom);
|
||||
|
||||
@@ -582,6 +614,26 @@ update_onscreen_requirements (MetaWindow *window,
|
||||
window->desc,
|
||||
window->require_on_single_xinerama ? "TRUE" : "FALSE");
|
||||
|
||||
/* Update whether we want future constraint runs to require the
|
||||
* titlebar to be visible.
|
||||
*/
|
||||
if (window->frame && window->decorated)
|
||||
{
|
||||
MetaRectangle titlebar_rect;
|
||||
|
||||
titlebar_rect = info->current;
|
||||
titlebar_rect.height = info->fgeom->top_height;
|
||||
old = window->require_titlebar_visible;
|
||||
window->require_titlebar_visible =
|
||||
meta_rectangle_overlaps_with_region (info->usable_screen_region,
|
||||
&titlebar_rect);
|
||||
if (old ^ window->require_titlebar_visible)
|
||||
meta_topic (META_DEBUG_GEOMETRY,
|
||||
"require_titlebar_visible for %s toggled to %s\n",
|
||||
window->desc,
|
||||
window->require_titlebar_visible ? "TRUE" : "FALSE");
|
||||
}
|
||||
|
||||
/* Don't forget to restore the position of the window */
|
||||
unextend_by_frame (&info->current, info->fgeom);
|
||||
}
|
||||
@@ -640,7 +692,7 @@ constrain_maximization (MetaWindow *window,
|
||||
gboolean check_only)
|
||||
{
|
||||
MetaRectangle min_size, max_size, work_area;
|
||||
gboolean hminbad, vminbad, hmaxbad, vmaxbad;
|
||||
gboolean hminbad, vminbad;
|
||||
gboolean horiz_equal, vert_equal;
|
||||
gboolean constraint_already_satisfied;
|
||||
|
||||
@@ -657,9 +709,7 @@ constrain_maximization (MetaWindow *window,
|
||||
|
||||
hminbad = work_area.width < min_size.width && window->maximized_horizontally;
|
||||
vminbad = work_area.height < min_size.height && window->maximized_vertically;
|
||||
hmaxbad = work_area.width > max_size.width && window->maximized_horizontally;
|
||||
vmaxbad = work_area.height > max_size.height && window->maximized_vertically;
|
||||
if (hminbad || vminbad || hmaxbad || vmaxbad)
|
||||
if (hminbad || vminbad)
|
||||
return TRUE;
|
||||
|
||||
/* Determine whether constraint is already satisfied; exit if it is */
|
||||
@@ -787,8 +837,13 @@ constrain_size_limits (MetaWindow *window,
|
||||
|
||||
/* Determine whether constraint is already satisfied; exit if it is */
|
||||
get_size_limits (window, info->fgeom, FALSE, &min_size, &max_size);
|
||||
too_big = !meta_rectangle_could_fit_rect (&info->current, &min_size);
|
||||
too_small = !meta_rectangle_could_fit_rect (&max_size, &info->current);
|
||||
/* We ignore max-size limits for maximized windows; see #327543 */
|
||||
if (window->maximized_horizontally)
|
||||
max_size.width = MAX (max_size.width, info->current.width);
|
||||
if (window->maximized_vertically)
|
||||
max_size.height = MAX (max_size.height, info->current.height);
|
||||
too_small = !meta_rectangle_could_fit_rect (&info->current, &min_size);
|
||||
too_big = !meta_rectangle_could_fit_rect (&max_size, &info->current);
|
||||
constraint_already_satisfied = !too_big && !too_small;
|
||||
if (check_only || constraint_already_satisfied)
|
||||
return constraint_already_satisfied;
|
||||
@@ -1042,6 +1097,7 @@ constrain_fully_onscreen (MetaWindow *window,
|
||||
*/
|
||||
if (window->type == META_WINDOW_DESKTOP ||
|
||||
window->type == META_WINDOW_DOCK ||
|
||||
window->fullscreen ||
|
||||
!window->require_fully_onscreen ||
|
||||
info->is_user_action)
|
||||
return TRUE;
|
||||
@@ -1053,6 +1109,91 @@ constrain_fully_onscreen (MetaWindow *window,
|
||||
check_only);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
constrain_titlebar_visible (MetaWindow *window,
|
||||
ConstraintInfo *info,
|
||||
ConstraintPriority priority,
|
||||
gboolean check_only)
|
||||
{
|
||||
gboolean unconstrained_user_action;
|
||||
gboolean retval;
|
||||
int bottom_amount;
|
||||
int horiz_amount_offscreen, vert_amount_offscreen;
|
||||
int horiz_amount_onscreen, vert_amount_onscreen;
|
||||
|
||||
if (priority > PRIORITY_TITLEBAR_VISIBLE)
|
||||
return TRUE;
|
||||
|
||||
/* Allow the titlebar beyond the top of the screen only if the user wasn't
|
||||
* clicking on the frame to start the move.
|
||||
*/
|
||||
unconstrained_user_action =
|
||||
info->is_user_action && !window->display->grab_frame_action;
|
||||
|
||||
/* Exit early if we know the constraint won't apply--note that this constraint
|
||||
* is only meant for normal windows (e.g. we don't want docks to be shoved
|
||||
* "onscreen" by their own strut).
|
||||
*/
|
||||
if (window->type == META_WINDOW_DESKTOP ||
|
||||
window->type == META_WINDOW_DOCK ||
|
||||
window->fullscreen ||
|
||||
!window->require_titlebar_visible ||
|
||||
!window->decorated ||
|
||||
unconstrained_user_action)
|
||||
return TRUE;
|
||||
|
||||
/* Determine how much offscreen things are allowed. We first need to
|
||||
* figure out how much must remain on the screen. For that, we use 25%
|
||||
* window width/height but clamp to the range of (10,75) pixels. This is
|
||||
* somewhat of a seat of my pants random guess at what might look good.
|
||||
* Then, the amount that is allowed off is just the window size minus
|
||||
* this amount (but no less than 0 for tiny windows).
|
||||
*/
|
||||
horiz_amount_onscreen = info->current.width / 4;
|
||||
vert_amount_onscreen = info->current.height / 4;
|
||||
horiz_amount_onscreen = CLAMP (horiz_amount_onscreen, 10, 75);
|
||||
vert_amount_onscreen = CLAMP (vert_amount_onscreen, 10, 75);
|
||||
horiz_amount_offscreen = info->current.width - horiz_amount_onscreen;
|
||||
vert_amount_offscreen = info->current.height - vert_amount_onscreen;
|
||||
horiz_amount_offscreen = MAX (horiz_amount_offscreen, 0);
|
||||
vert_amount_offscreen = MAX (vert_amount_offscreen, 0);
|
||||
/* Allow the titlebar to touch the bottom panel; If there is no titlebar,
|
||||
* require vert_amount to remain on the screen.
|
||||
*/
|
||||
if (window->frame)
|
||||
{
|
||||
bottom_amount = info->current.height + info->fgeom->bottom_height;
|
||||
vert_amount_onscreen = info->fgeom->top_height;
|
||||
}
|
||||
else
|
||||
bottom_amount = vert_amount_offscreen;
|
||||
|
||||
/* Extend the region, have a helper function handle the constraint,
|
||||
* then return the region to its original size.
|
||||
*/
|
||||
meta_rectangle_expand_region_conditionally (info->usable_screen_region,
|
||||
horiz_amount_offscreen,
|
||||
horiz_amount_offscreen,
|
||||
0, /* Don't let titlebar off */
|
||||
bottom_amount,
|
||||
horiz_amount_onscreen,
|
||||
vert_amount_onscreen);
|
||||
retval =
|
||||
do_screen_and_xinerama_relative_constraints (window,
|
||||
info->usable_screen_region,
|
||||
info,
|
||||
check_only);
|
||||
meta_rectangle_expand_region_conditionally (info->usable_screen_region,
|
||||
-horiz_amount_offscreen,
|
||||
-horiz_amount_offscreen,
|
||||
0, /* Don't let titlebar off */
|
||||
-bottom_amount,
|
||||
horiz_amount_onscreen,
|
||||
vert_amount_onscreen);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
constrain_partially_onscreen (MetaWindow *window,
|
||||
ConstraintInfo *info,
|
||||
@@ -1080,7 +1221,7 @@ constrain_partially_onscreen (MetaWindow *window,
|
||||
* window width/height but clamp to the range of (10,75) pixels. This is
|
||||
* somewhat of a seat of my pants random guess at what might look good.
|
||||
* Then, the amount that is allowed off is just the window size minus
|
||||
* this amount.
|
||||
* this amount (but no less than 0 for tiny windows).
|
||||
*/
|
||||
horiz_amount_onscreen = info->current.width / 4;
|
||||
vert_amount_onscreen = info->current.height / 4;
|
||||
@@ -1088,6 +1229,8 @@ constrain_partially_onscreen (MetaWindow *window,
|
||||
vert_amount_onscreen = CLAMP (vert_amount_onscreen, 10, 75);
|
||||
horiz_amount_offscreen = info->current.width - horiz_amount_onscreen;
|
||||
vert_amount_offscreen = info->current.height - vert_amount_onscreen;
|
||||
horiz_amount_offscreen = MAX (horiz_amount_offscreen, 0);
|
||||
vert_amount_offscreen = MAX (vert_amount_offscreen, 0);
|
||||
top_amount = vert_amount_offscreen;
|
||||
/* Allow the titlebar to touch the bottom panel; If there is no titlebar,
|
||||
* require vert_amount to remain on the screen.
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/* Metacity size/position constraints */
|
||||
|
||||
/*
|
||||
|
381
src/core.c
381
src/core.c
@@ -1,3 +1,5 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/* Metacity interface used by GTK+ UI to talk to core */
|
||||
|
||||
/*
|
||||
@@ -27,11 +29,20 @@
|
||||
#include "workspace.h"
|
||||
#include "prefs.h"
|
||||
|
||||
void
|
||||
meta_core_get_client_size (Display *xdisplay,
|
||||
Window frame_xwindow,
|
||||
int *width,
|
||||
int *height)
|
||||
/* Looks up the MetaWindow representing the frame of the given X window.
|
||||
* Used as a helper function by a bunch of the functions below.
|
||||
*
|
||||
* FIXME: The functions that use this function throw the result away
|
||||
* after use. Many of these functions tend to be called in small groups,
|
||||
* which results in get_window() getting called several times in succession
|
||||
* with the same parameters. We should profile to see whether this wastes
|
||||
* much time, and if it does we should look into a generalised
|
||||
* meta_core_get_window_info() which takes a bunch of pointers to variables
|
||||
* to put its results in, and only fills in the non-null ones.
|
||||
*/
|
||||
static MetaWindow *
|
||||
get_window (Display *xdisplay,
|
||||
Window frame_xwindow)
|
||||
{
|
||||
MetaDisplay *display;
|
||||
MetaWindow *window;
|
||||
@@ -40,7 +51,21 @@ meta_core_get_client_size (Display *xdisplay,
|
||||
window = meta_display_lookup_x_window (display, frame_xwindow);
|
||||
|
||||
if (window == NULL || window->frame == NULL)
|
||||
meta_bug ("No such frame window 0x%lx!\n", frame_xwindow);
|
||||
{
|
||||
meta_bug ("No such frame window 0x%lx!\n", frame_xwindow);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
void
|
||||
meta_core_get_client_size (Display *xdisplay,
|
||||
Window frame_xwindow,
|
||||
int *width,
|
||||
int *height)
|
||||
{
|
||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||
|
||||
if (width)
|
||||
*width = window->rect.width;
|
||||
@@ -49,8 +74,8 @@ meta_core_get_client_size (Display *xdisplay,
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_core_titlebar_is_onscreen (Display *xdisplay,
|
||||
Window frame_xwindow)
|
||||
meta_core_window_has_frame (Display *xdisplay,
|
||||
Window frame_xwindow)
|
||||
{
|
||||
MetaDisplay *display;
|
||||
MetaWindow *window;
|
||||
@@ -58,25 +83,23 @@ meta_core_titlebar_is_onscreen (Display *xdisplay,
|
||||
display = meta_display_for_x_display (xdisplay);
|
||||
window = meta_display_lookup_x_window (display, frame_xwindow);
|
||||
|
||||
if (window == NULL || window->frame == NULL)
|
||||
meta_bug ("No such frame window 0x%lx!\n", frame_xwindow);
|
||||
return window != NULL && window->frame != NULL;
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_core_titlebar_is_onscreen (Display *xdisplay,
|
||||
Window frame_xwindow)
|
||||
{
|
||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||
|
||||
return meta_window_titlebar_is_onscreen (window);
|
||||
}
|
||||
|
||||
|
||||
Window
|
||||
meta_core_get_client_xwindow (Display *xdisplay,
|
||||
Window frame_xwindow)
|
||||
{
|
||||
MetaDisplay *display;
|
||||
MetaWindow *window;
|
||||
|
||||
display = meta_display_for_x_display (xdisplay);
|
||||
window = meta_display_lookup_x_window (display, frame_xwindow);
|
||||
|
||||
if (window == NULL || window->frame == NULL)
|
||||
meta_bug ("No such frame window 0x%lx!\n", frame_xwindow);
|
||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||
|
||||
return window->xwindow;
|
||||
}
|
||||
@@ -85,15 +108,8 @@ MetaFrameFlags
|
||||
meta_core_get_frame_flags (Display *xdisplay,
|
||||
Window frame_xwindow)
|
||||
{
|
||||
MetaDisplay *display;
|
||||
MetaWindow *window;
|
||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||
|
||||
display = meta_display_for_x_display (xdisplay);
|
||||
window = meta_display_lookup_x_window (display, frame_xwindow);
|
||||
|
||||
if (window == NULL || window->frame == NULL)
|
||||
meta_bug ("No such frame window 0x%lx!\n", frame_xwindow);
|
||||
|
||||
return meta_frame_get_flags (window->frame);
|
||||
}
|
||||
|
||||
@@ -101,15 +117,10 @@ MetaFrameType
|
||||
meta_core_get_frame_type (Display *xdisplay,
|
||||
Window frame_xwindow)
|
||||
{
|
||||
MetaDisplay *display;
|
||||
MetaWindow *window;
|
||||
MetaFrameType base_type;
|
||||
|
||||
display = meta_display_for_x_display (xdisplay);
|
||||
window = meta_display_lookup_x_window (display, frame_xwindow);
|
||||
|
||||
if (window == NULL || window->frame == NULL)
|
||||
meta_bug ("No such frame window 0x%lx!\n", frame_xwindow);
|
||||
window = get_window (xdisplay, frame_xwindow);
|
||||
|
||||
base_type = META_FRAME_TYPE_LAST;
|
||||
|
||||
@@ -156,14 +167,7 @@ GdkPixbuf*
|
||||
meta_core_get_mini_icon (Display *xdisplay,
|
||||
Window frame_xwindow)
|
||||
{
|
||||
MetaDisplay *display;
|
||||
MetaWindow *window;
|
||||
|
||||
display = meta_display_for_x_display (xdisplay);
|
||||
window = meta_display_lookup_x_window (display, frame_xwindow);
|
||||
|
||||
if (window == NULL || window->frame == NULL)
|
||||
meta_bug ("No such frame window 0x%lx!\n", frame_xwindow);
|
||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||
|
||||
return window->mini_icon;
|
||||
}
|
||||
@@ -172,14 +176,7 @@ GdkPixbuf*
|
||||
meta_core_get_icon (Display *xdisplay,
|
||||
Window frame_xwindow)
|
||||
{
|
||||
MetaDisplay *display;
|
||||
MetaWindow *window;
|
||||
|
||||
display = meta_display_for_x_display (xdisplay);
|
||||
window = meta_display_lookup_x_window (display, frame_xwindow);
|
||||
|
||||
if (window == NULL || window->frame == NULL)
|
||||
meta_bug ("No such frame window 0x%lx!\n", frame_xwindow);
|
||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||
|
||||
return window->icon;
|
||||
}
|
||||
@@ -188,14 +185,7 @@ void
|
||||
meta_core_queue_frame_resize (Display *xdisplay,
|
||||
Window frame_xwindow)
|
||||
{
|
||||
MetaDisplay *display;
|
||||
MetaWindow *window;
|
||||
|
||||
display = meta_display_for_x_display (xdisplay);
|
||||
window = meta_display_lookup_x_window (display, frame_xwindow);
|
||||
|
||||
if (window == NULL || window->frame == NULL)
|
||||
meta_bug ("No such frame window 0x%lx!\n", frame_xwindow);
|
||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||
|
||||
meta_window_queue_move_resize (window);
|
||||
}
|
||||
@@ -206,14 +196,7 @@ meta_core_user_move (Display *xdisplay,
|
||||
int x,
|
||||
int y)
|
||||
{
|
||||
MetaDisplay *display;
|
||||
MetaWindow *window;
|
||||
|
||||
display = meta_display_for_x_display (xdisplay);
|
||||
window = meta_display_lookup_x_window (display, frame_xwindow);
|
||||
|
||||
if (window == NULL || window->frame == NULL)
|
||||
meta_bug ("No such frame window 0x%lx!\n", frame_xwindow);
|
||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||
|
||||
meta_window_move (window, TRUE, x, y);
|
||||
}
|
||||
@@ -225,14 +208,7 @@ meta_core_user_resize (Display *xdisplay,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
MetaDisplay *display;
|
||||
MetaWindow *window;
|
||||
|
||||
display = meta_display_for_x_display (xdisplay);
|
||||
window = meta_display_lookup_x_window (display, frame_xwindow);
|
||||
|
||||
if (window == NULL || window->frame == NULL)
|
||||
meta_bug ("No such frame window 0x%lx!\n", frame_xwindow);
|
||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||
|
||||
meta_window_resize_with_gravity (window, TRUE, width, height, gravity);
|
||||
}
|
||||
@@ -241,14 +217,7 @@ void
|
||||
meta_core_user_raise (Display *xdisplay,
|
||||
Window frame_xwindow)
|
||||
{
|
||||
MetaDisplay *display;
|
||||
MetaWindow *window;
|
||||
|
||||
display = meta_display_for_x_display (xdisplay);
|
||||
window = meta_display_lookup_x_window (display, frame_xwindow);
|
||||
|
||||
if (window == NULL || window->frame == NULL)
|
||||
meta_bug ("No such frame window 0x%lx!\n", frame_xwindow);
|
||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||
|
||||
meta_window_raise (window);
|
||||
}
|
||||
@@ -256,16 +225,9 @@ meta_core_user_raise (Display *xdisplay,
|
||||
void
|
||||
meta_core_user_lower_and_unfocus (Display *xdisplay,
|
||||
Window frame_xwindow,
|
||||
Time timestamp)
|
||||
guint32 timestamp)
|
||||
{
|
||||
MetaDisplay *display;
|
||||
MetaWindow *window;
|
||||
|
||||
display = meta_display_for_x_display (xdisplay);
|
||||
window = meta_display_lookup_x_window (display, frame_xwindow);
|
||||
|
||||
if (window == NULL || window->frame == NULL)
|
||||
meta_bug ("No such frame window 0x%lx!\n", frame_xwindow);
|
||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||
|
||||
meta_window_lower (window);
|
||||
|
||||
@@ -306,16 +268,9 @@ meta_core_user_lower_and_unfocus (Display *xdisplay,
|
||||
void
|
||||
meta_core_user_focus (Display *xdisplay,
|
||||
Window frame_xwindow,
|
||||
Time timestamp)
|
||||
guint32 timestamp)
|
||||
{
|
||||
MetaDisplay *display;
|
||||
MetaWindow *window;
|
||||
|
||||
display = meta_display_for_x_display (xdisplay);
|
||||
window = meta_display_lookup_x_window (display, frame_xwindow);
|
||||
|
||||
if (window == NULL || window->frame == NULL)
|
||||
meta_bug ("No such frame window 0x%lx!\n", frame_xwindow);
|
||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||
|
||||
meta_window_focus (window, timestamp);
|
||||
}
|
||||
@@ -326,14 +281,7 @@ meta_core_get_position (Display *xdisplay,
|
||||
int *x,
|
||||
int *y)
|
||||
{
|
||||
MetaDisplay *display;
|
||||
MetaWindow *window;
|
||||
|
||||
display = meta_display_for_x_display (xdisplay);
|
||||
window = meta_display_lookup_x_window (display, frame_xwindow);
|
||||
|
||||
if (window == NULL || window->frame == NULL)
|
||||
meta_bug ("No such frame window 0x%lx!\n", frame_xwindow);
|
||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||
|
||||
meta_window_get_position (window, x, y);
|
||||
}
|
||||
@@ -344,14 +292,7 @@ meta_core_get_size (Display *xdisplay,
|
||||
int *width,
|
||||
int *height)
|
||||
{
|
||||
MetaDisplay *display;
|
||||
MetaWindow *window;
|
||||
|
||||
display = meta_display_for_x_display (xdisplay);
|
||||
window = meta_display_lookup_x_window (display, frame_xwindow);
|
||||
|
||||
if (window == NULL || window->frame == NULL)
|
||||
meta_bug ("No such frame window 0x%lx!\n", frame_xwindow);
|
||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||
|
||||
if (width)
|
||||
*width = window->rect.width;
|
||||
@@ -364,14 +305,7 @@ void
|
||||
meta_core_minimize (Display *xdisplay,
|
||||
Window frame_xwindow)
|
||||
{
|
||||
MetaDisplay *display;
|
||||
MetaWindow *window;
|
||||
|
||||
display = meta_display_for_x_display (xdisplay);
|
||||
window = meta_display_lookup_x_window (display, frame_xwindow);
|
||||
|
||||
if (window == NULL || window->frame == NULL)
|
||||
meta_bug ("No such frame window 0x%lx!\n", frame_xwindow);
|
||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||
|
||||
meta_window_minimize (window);
|
||||
}
|
||||
@@ -380,14 +314,10 @@ void
|
||||
meta_core_maximize (Display *xdisplay,
|
||||
Window frame_xwindow)
|
||||
{
|
||||
MetaDisplay *display;
|
||||
MetaWindow *window;
|
||||
|
||||
display = meta_display_for_x_display (xdisplay);
|
||||
window = meta_display_lookup_x_window (display, frame_xwindow);
|
||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||
|
||||
if (window == NULL || window->frame == NULL)
|
||||
meta_bug ("No such frame window 0x%lx!\n", frame_xwindow);
|
||||
if (meta_prefs_get_raise_on_click ())
|
||||
meta_window_raise (window);
|
||||
|
||||
meta_window_maximize (window,
|
||||
META_MAXIMIZE_HORIZONTAL | META_MAXIMIZE_VERTICAL);
|
||||
@@ -397,14 +327,10 @@ void
|
||||
meta_core_toggle_maximize (Display *xdisplay,
|
||||
Window frame_xwindow)
|
||||
{
|
||||
MetaDisplay *display;
|
||||
MetaWindow *window;
|
||||
|
||||
display = meta_display_for_x_display (xdisplay);
|
||||
window = meta_display_lookup_x_window (display, frame_xwindow);
|
||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||
|
||||
if (window == NULL || window->frame == NULL)
|
||||
meta_bug ("No such frame window 0x%lx!\n", frame_xwindow);
|
||||
if (meta_prefs_get_raise_on_click ())
|
||||
meta_window_raise (window);
|
||||
|
||||
if (META_WINDOW_MAXIMIZED (window))
|
||||
meta_window_unmaximize (window,
|
||||
@@ -418,14 +344,10 @@ void
|
||||
meta_core_unmaximize (Display *xdisplay,
|
||||
Window frame_xwindow)
|
||||
{
|
||||
MetaDisplay *display;
|
||||
MetaWindow *window;
|
||||
|
||||
display = meta_display_for_x_display (xdisplay);
|
||||
window = meta_display_lookup_x_window (display, frame_xwindow);
|
||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||
|
||||
if (window == NULL || window->frame == NULL)
|
||||
meta_bug ("No such frame window 0x%lx!\n", frame_xwindow);
|
||||
if (meta_prefs_get_raise_on_click ())
|
||||
meta_window_raise (window);
|
||||
|
||||
meta_window_unmaximize (window,
|
||||
META_MAXIMIZE_HORIZONTAL | META_MAXIMIZE_VERTICAL);
|
||||
@@ -436,78 +358,63 @@ meta_core_delete (Display *xdisplay,
|
||||
Window frame_xwindow,
|
||||
guint32 timestamp)
|
||||
{
|
||||
MetaDisplay *display;
|
||||
MetaWindow *window;
|
||||
|
||||
display = meta_display_for_x_display (xdisplay);
|
||||
window = meta_display_lookup_x_window (display, frame_xwindow);
|
||||
|
||||
if (window == NULL || window->frame == NULL)
|
||||
meta_bug ("No such frame window 0x%lx!\n", frame_xwindow);
|
||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||
|
||||
meta_window_delete (window, timestamp);
|
||||
}
|
||||
|
||||
void
|
||||
meta_core_unshade (Display *xdisplay,
|
||||
Window frame_xwindow)
|
||||
Window frame_xwindow,
|
||||
guint32 timestamp)
|
||||
{
|
||||
MetaDisplay *display;
|
||||
MetaWindow *window;
|
||||
|
||||
display = meta_display_for_x_display (xdisplay);
|
||||
window = meta_display_lookup_x_window (display, frame_xwindow);
|
||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||
|
||||
if (window == NULL || window->frame == NULL)
|
||||
meta_bug ("No such frame window 0x%lx!\n", frame_xwindow);
|
||||
|
||||
meta_window_unshade (window);
|
||||
meta_window_unshade (window, timestamp);
|
||||
}
|
||||
|
||||
void
|
||||
meta_core_shade (Display *xdisplay,
|
||||
Window frame_xwindow)
|
||||
Window frame_xwindow,
|
||||
guint32 timestamp)
|
||||
{
|
||||
MetaDisplay *display;
|
||||
MetaWindow *window;
|
||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||
|
||||
display = meta_display_for_x_display (xdisplay);
|
||||
window = meta_display_lookup_x_window (display, frame_xwindow);
|
||||
|
||||
if (window == NULL || window->frame == NULL)
|
||||
meta_bug ("No such frame window 0x%lx!\n", frame_xwindow);
|
||||
|
||||
meta_window_shade (window);
|
||||
meta_window_shade (window, timestamp);
|
||||
}
|
||||
|
||||
void
|
||||
meta_core_unstick (Display *xdisplay,
|
||||
Window frame_xwindow)
|
||||
{
|
||||
MetaDisplay *display;
|
||||
MetaWindow *window;
|
||||
|
||||
display = meta_display_for_x_display (xdisplay);
|
||||
window = meta_display_lookup_x_window (display, frame_xwindow);
|
||||
|
||||
if (window == NULL || window->frame == NULL)
|
||||
meta_bug ("No such frame window 0x%lx!\n", frame_xwindow);
|
||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||
|
||||
meta_window_unstick (window);
|
||||
}
|
||||
|
||||
void
|
||||
meta_core_make_above (Display *xdisplay,
|
||||
Window frame_xwindow)
|
||||
{
|
||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||
|
||||
meta_window_make_above (window);
|
||||
}
|
||||
|
||||
void
|
||||
meta_core_unmake_above (Display *xdisplay,
|
||||
Window frame_xwindow)
|
||||
{
|
||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||
|
||||
meta_window_unmake_above (window);
|
||||
}
|
||||
|
||||
void
|
||||
meta_core_stick (Display *xdisplay,
|
||||
Window frame_xwindow)
|
||||
{
|
||||
MetaDisplay *display;
|
||||
MetaWindow *window;
|
||||
|
||||
display = meta_display_for_x_display (xdisplay);
|
||||
window = meta_display_lookup_x_window (display, frame_xwindow);
|
||||
|
||||
if (window == NULL || window->frame == NULL)
|
||||
meta_bug ("No such frame window 0x%lx!\n", frame_xwindow);
|
||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||
|
||||
meta_window_stick (window);
|
||||
}
|
||||
@@ -517,14 +424,7 @@ meta_core_change_workspace (Display *xdisplay,
|
||||
Window frame_xwindow,
|
||||
int new_workspace)
|
||||
{
|
||||
MetaDisplay *display;
|
||||
MetaWindow *window;
|
||||
|
||||
display = meta_display_for_x_display (xdisplay);
|
||||
window = meta_display_lookup_x_window (display, frame_xwindow);
|
||||
|
||||
if (window == NULL || window->frame == NULL)
|
||||
meta_bug ("No such frame window 0x%lx!\n", frame_xwindow);
|
||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||
|
||||
meta_window_change_workspace (window,
|
||||
meta_screen_get_workspace_by_index (window->screen,
|
||||
@@ -555,14 +455,7 @@ int
|
||||
meta_core_get_frame_workspace (Display *xdisplay,
|
||||
Window frame_xwindow)
|
||||
{
|
||||
MetaDisplay *display;
|
||||
MetaWindow *window;
|
||||
|
||||
display = meta_display_for_x_display (xdisplay);
|
||||
window = meta_display_lookup_x_window (display, frame_xwindow);
|
||||
|
||||
if (window == NULL || window->frame == NULL)
|
||||
meta_bug ("No such frame window 0x%lx!\n", frame_xwindow);
|
||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||
|
||||
return meta_window_get_net_wm_desktop (window);
|
||||
}
|
||||
@@ -575,14 +468,7 @@ meta_core_get_frame_extents (Display *xdisplay,
|
||||
int *width,
|
||||
int *height)
|
||||
{
|
||||
MetaDisplay *display;
|
||||
MetaWindow *window;
|
||||
|
||||
display = meta_display_for_x_display (xdisplay);
|
||||
window = meta_display_lookup_x_window (display, frame_xwindow);
|
||||
|
||||
if (window == NULL || window->frame == NULL)
|
||||
meta_bug ("No such frame window 0x%lx!\n", frame_xwindow);
|
||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||
|
||||
if (x)
|
||||
*x = window->frame->rect.x;
|
||||
@@ -601,17 +487,10 @@ meta_core_show_window_menu (Display *xdisplay,
|
||||
int root_x,
|
||||
int root_y,
|
||||
int button,
|
||||
Time timestamp)
|
||||
guint32 timestamp)
|
||||
{
|
||||
MetaDisplay *display;
|
||||
MetaWindow *window;
|
||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||
|
||||
display = meta_display_for_x_display (xdisplay);
|
||||
window = meta_display_lookup_x_window (display, frame_xwindow);
|
||||
|
||||
if (window == NULL || window->frame == NULL)
|
||||
meta_bug ("No such frame window 0x%lx!\n", frame_xwindow);
|
||||
|
||||
if (meta_prefs_get_raise_on_click ())
|
||||
meta_window_raise (window);
|
||||
meta_window_focus (window, timestamp);
|
||||
@@ -751,28 +630,26 @@ meta_core_begin_grab_op (Display *xdisplay,
|
||||
Window frame_xwindow,
|
||||
MetaGrabOp op,
|
||||
gboolean pointer_already_grabbed,
|
||||
gboolean frame_action,
|
||||
int event_serial,
|
||||
int button,
|
||||
gulong modmask,
|
||||
Time timestamp,
|
||||
guint32 timestamp,
|
||||
int root_x,
|
||||
int root_y)
|
||||
{
|
||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||
MetaDisplay *display;
|
||||
MetaWindow *window;
|
||||
MetaScreen *screen;
|
||||
|
||||
display = meta_display_for_x_display (xdisplay);
|
||||
screen = meta_display_screen_for_xwindow (display, frame_xwindow);
|
||||
window = meta_display_lookup_x_window (display, frame_xwindow);
|
||||
|
||||
g_assert (screen != NULL);
|
||||
|
||||
if (window == NULL || window->frame == NULL)
|
||||
meta_bug ("No such frame window 0x%lx!\n", frame_xwindow);
|
||||
|
||||
return meta_display_begin_grab_op (display, screen, window,
|
||||
op, pointer_already_grabbed,
|
||||
frame_action,
|
||||
event_serial,
|
||||
button, modmask,
|
||||
timestamp, root_x, root_y);
|
||||
@@ -780,7 +657,7 @@ meta_core_begin_grab_op (Display *xdisplay,
|
||||
|
||||
void
|
||||
meta_core_end_grab_op (Display *xdisplay,
|
||||
Time timestamp)
|
||||
guint32 timestamp)
|
||||
{
|
||||
MetaDisplay *display;
|
||||
|
||||
@@ -838,7 +715,7 @@ meta_core_grab_buttons (Display *xdisplay,
|
||||
Window frame_xwindow)
|
||||
{
|
||||
MetaDisplay *display;
|
||||
|
||||
|
||||
display = meta_display_for_x_display (xdisplay);
|
||||
|
||||
meta_verbose ("Grabbing buttons on frame 0x%lx\n", frame_xwindow);
|
||||
@@ -850,14 +727,7 @@ meta_core_set_screen_cursor (Display *xdisplay,
|
||||
Window frame_on_screen,
|
||||
MetaCursor cursor)
|
||||
{
|
||||
MetaDisplay *display;
|
||||
MetaWindow *window;
|
||||
|
||||
display = meta_display_for_x_display (xdisplay);
|
||||
window = meta_display_lookup_x_window (display, frame_on_screen);
|
||||
|
||||
if (window == NULL || window->frame == NULL)
|
||||
meta_bug ("No such frame window 0x%lx!\n", frame_on_screen);
|
||||
MetaWindow *window = get_window (xdisplay, frame_on_screen);
|
||||
|
||||
meta_frame_set_screen_cursor (window->frame, cursor);
|
||||
}
|
||||
@@ -868,14 +738,7 @@ meta_core_get_screen_size (Display *xdisplay,
|
||||
int *width,
|
||||
int *height)
|
||||
{
|
||||
MetaDisplay *display;
|
||||
MetaWindow *window;
|
||||
|
||||
display = meta_display_for_x_display (xdisplay);
|
||||
window = meta_display_lookup_x_window (display, frame_on_screen);
|
||||
|
||||
if (window == NULL || window->frame == NULL)
|
||||
meta_bug ("No such frame window 0x%lx!\n", frame_on_screen);
|
||||
MetaWindow *window = get_window (xdisplay, frame_on_screen);
|
||||
|
||||
if (width)
|
||||
*width = window->screen->rect.width;
|
||||
@@ -893,3 +756,31 @@ meta_core_increment_event_serial (Display *xdisplay)
|
||||
meta_display_increment_event_serial (display);
|
||||
}
|
||||
|
||||
void
|
||||
meta_invalidate_default_icons (void)
|
||||
{
|
||||
GSList *displays, *windows;
|
||||
|
||||
for (displays = meta_displays_list ();
|
||||
displays != NULL;
|
||||
displays = displays->next)
|
||||
{
|
||||
|
||||
for (windows = meta_display_list_windows (displays->data);
|
||||
windows != NULL;
|
||||
windows = windows->next)
|
||||
{
|
||||
|
||||
MetaWindow *window = (MetaWindow*)windows->data;
|
||||
|
||||
if (window->icon_cache.origin == USING_FALLBACK_ICON)
|
||||
{
|
||||
meta_icon_cache_free (&(window->icon_cache));
|
||||
meta_window_update_icon_now (window);
|
||||
}
|
||||
}
|
||||
|
||||
g_slist_free (windows);
|
||||
}
|
||||
}
|
||||
|
||||
|
29
src/core.h
29
src/core.h
@@ -1,3 +1,5 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/* Metacity interface used by GTK+ UI to talk to core */
|
||||
|
||||
/*
|
||||
@@ -35,6 +37,10 @@ void meta_core_get_client_size (Display *xdisplay,
|
||||
gboolean meta_core_titlebar_is_onscreen (Display *xdisplay,
|
||||
Window frame_xwindow);
|
||||
|
||||
gboolean meta_core_window_has_frame (Display *xdisplay,
|
||||
Window frame_xwindow);
|
||||
|
||||
|
||||
Window meta_core_get_client_xwindow (Display *xdisplay,
|
||||
Window frame_xwindow);
|
||||
|
||||
@@ -66,11 +72,11 @@ void meta_core_user_raise (Display *xdisplay,
|
||||
Window frame_xwindow);
|
||||
void meta_core_user_lower_and_unfocus (Display *xdisplay,
|
||||
Window frame_xwindow,
|
||||
Time timestamp);
|
||||
guint32 timestamp);
|
||||
|
||||
void meta_core_user_focus (Display *xdisplay,
|
||||
Window frame_xwindow,
|
||||
Time timestamp);
|
||||
guint32 timestamp);
|
||||
|
||||
/* get position of client, same coord space expected by move */
|
||||
void meta_core_get_position (Display *xdisplay,
|
||||
@@ -95,13 +101,19 @@ void meta_core_delete (Display *xdisplay,
|
||||
Window frame_xwindow,
|
||||
guint32 timestamp);
|
||||
void meta_core_unshade (Display *xdisplay,
|
||||
Window frame_xwindow);
|
||||
Window frame_xwindow,
|
||||
guint32 timestamp);
|
||||
void meta_core_shade (Display *xdisplay,
|
||||
Window frame_xwindow);
|
||||
Window frame_xwindow,
|
||||
guint32 timestamp);
|
||||
void meta_core_unstick (Display *xdisplay,
|
||||
Window frame_xwindow);
|
||||
void meta_core_stick (Display *xdisplay,
|
||||
Window frame_xwindow);
|
||||
void meta_core_unmake_above (Display *xdisplay,
|
||||
Window frame_xwindow);
|
||||
void meta_core_make_above (Display *xdisplay,
|
||||
Window frame_xwindow);
|
||||
void meta_core_change_workspace (Display *xdisplay,
|
||||
Window frame_xwindow,
|
||||
int new_workspace);
|
||||
@@ -127,7 +139,7 @@ void meta_core_show_window_menu (Display *xdisplay,
|
||||
int root_x,
|
||||
int root_y,
|
||||
int button,
|
||||
Time timestamp);
|
||||
guint32 timestamp);
|
||||
|
||||
void meta_core_get_menu_accelerator (MetaMenuOp menu_op,
|
||||
int workspace,
|
||||
@@ -138,14 +150,15 @@ gboolean meta_core_begin_grab_op (Display *xdisplay,
|
||||
Window frame_xwindow,
|
||||
MetaGrabOp op,
|
||||
gboolean pointer_already_grabbed,
|
||||
gboolean frame_action,
|
||||
int event_serial,
|
||||
int button,
|
||||
gulong modmask,
|
||||
Time timestamp,
|
||||
guint32 timestamp,
|
||||
int root_x,
|
||||
int root_y);
|
||||
void meta_core_end_grab_op (Display *xdisplay,
|
||||
Time timestamp);
|
||||
guint32 timestamp);
|
||||
MetaGrabOp meta_core_get_grab_op (Display *xdisplay);
|
||||
Window meta_core_get_grab_frame (Display *xdisplay);
|
||||
int meta_core_get_grab_button (Display *xdisplay);
|
||||
@@ -171,6 +184,8 @@ void meta_core_increment_event_serial (Display *display);
|
||||
|
||||
int meta_ui_get_last_event_serial (Display *xdisplay);
|
||||
|
||||
void meta_invalidate_default_icons (void);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
20
src/delete.c
20
src/delete.c
@@ -1,3 +1,5 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/* Metacity window deletion */
|
||||
|
||||
/*
|
||||
@@ -34,12 +36,13 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
static void meta_window_present_delete_dialog (MetaWindow *window);
|
||||
static void meta_window_present_delete_dialog (MetaWindow *window,
|
||||
guint32 timestamp);
|
||||
|
||||
static void
|
||||
delete_ping_reply_func (MetaDisplay *display,
|
||||
Window xwindow,
|
||||
Time timestamp,
|
||||
guint32 timestamp,
|
||||
void *user_data)
|
||||
{
|
||||
meta_topic (META_DEBUG_PING,
|
||||
@@ -292,7 +295,7 @@ io_from_ping_dialog (GIOChannel *channel,
|
||||
static void
|
||||
delete_ping_timeout_func (MetaDisplay *display,
|
||||
Window xwindow,
|
||||
Time timestamp,
|
||||
guint32 timestamp,
|
||||
void *user_data)
|
||||
{
|
||||
MetaWindow *window = user_data;
|
||||
@@ -311,14 +314,14 @@ delete_ping_timeout_func (MetaDisplay *display,
|
||||
|
||||
if (window->dialog_pid >= 0)
|
||||
{
|
||||
meta_window_present_delete_dialog (window);
|
||||
meta_window_present_delete_dialog (window, timestamp);
|
||||
return;
|
||||
}
|
||||
|
||||
window_id_str = g_strdup_printf ("0x%lx", window->xwindow);
|
||||
|
||||
sprintf (numbuf, "%d", window->screen->number);
|
||||
sprintf (timestampbuf, "%lu", timestamp);
|
||||
sprintf (timestampbuf, "%u", timestamp);
|
||||
|
||||
argv[0] = METACITY_LIBEXECDIR"/metacity-dialog";
|
||||
argv[1] = "--screen";
|
||||
@@ -364,7 +367,7 @@ delete_ping_timeout_func (MetaDisplay *display,
|
||||
|
||||
void
|
||||
meta_window_delete (MetaWindow *window,
|
||||
Time timestamp)
|
||||
guint32 timestamp)
|
||||
{
|
||||
meta_error_trap_push (window->display);
|
||||
if (window->delete_window)
|
||||
@@ -476,7 +479,7 @@ meta_window_free_delete_dialog (MetaWindow *window)
|
||||
}
|
||||
|
||||
static void
|
||||
meta_window_present_delete_dialog (MetaWindow *window)
|
||||
meta_window_present_delete_dialog (MetaWindow *window, guint32 timestamp)
|
||||
{
|
||||
meta_topic (META_DEBUG_PING,
|
||||
"Presenting existing ping dialog for %s\n",
|
||||
@@ -501,8 +504,7 @@ meta_window_present_delete_dialog (MetaWindow *window)
|
||||
w->res_class &&
|
||||
g_strcasecmp (w->res_class, "metacity-dialog") == 0)
|
||||
{
|
||||
meta_window_activate (w,
|
||||
meta_display_get_current_time (w->display));
|
||||
meta_window_activate (w, timestamp);
|
||||
break;
|
||||
}
|
||||
|
||||
|
575
src/display.c
575
src/display.c
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,5 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/* Metacity X display handler */
|
||||
|
||||
/*
|
||||
@@ -62,7 +64,7 @@ typedef struct MetaEdgeResistanceData MetaEdgeResistanceData;
|
||||
|
||||
typedef void (* MetaWindowPingFunc) (MetaDisplay *display,
|
||||
Window xwindow,
|
||||
Time timestamp,
|
||||
guint32 timestamp,
|
||||
gpointer user_data);
|
||||
|
||||
|
||||
@@ -194,21 +196,22 @@ struct _MetaDisplay
|
||||
MetaWindow *expected_focus_window;
|
||||
|
||||
/* last timestamp passed to XSetInputFocus */
|
||||
Time last_focus_time;
|
||||
guint32 last_focus_time;
|
||||
|
||||
/* last user interaction time in any app */
|
||||
Time last_user_time;
|
||||
guint32 last_user_time;
|
||||
|
||||
/* whether we're using mousenav (only relevant for sloppy&mouse focus modes;
|
||||
* !mouse_mode means "keynav mode")
|
||||
*/
|
||||
guint mouse_mode : 1;
|
||||
|
||||
/* Helper var for strict focus for terminals; only relevant if the focus
|
||||
* window is a terminal. Typically, we don't allow new windows to take
|
||||
* focus away from a terminal, but if the user explicitly did something
|
||||
* that should allow a different window to gain focus (e.g. global
|
||||
* keybinding or clicking on a dock), then we will allow the transfer.
|
||||
/* Helper var used when focus_new_windows setting is 'strict'; only
|
||||
* relevant in 'strict' mode and if the focus window is a terminal.
|
||||
* In that case, we don't allow new windows to take focus away from
|
||||
* a terminal, but if the user explicitly did something that should
|
||||
* allow a different window to gain focus (e.g. global keybinding or
|
||||
* clicking on a dock), then we will allow the transfer.
|
||||
*/
|
||||
guint allow_terminal_deactivation : 1;
|
||||
|
||||
@@ -225,12 +228,6 @@ struct _MetaDisplay
|
||||
XErrorEvent *error);
|
||||
int server_grab_count;
|
||||
|
||||
/* for double click */
|
||||
Time last_button_time;
|
||||
Window last_button_xwindow;
|
||||
int last_button_num;
|
||||
guint is_double_click : 1;
|
||||
|
||||
/* serials of leave/unmap events that may
|
||||
* correspond to an enter event we should
|
||||
* ignore
|
||||
@@ -266,7 +263,8 @@ struct _MetaDisplay
|
||||
guint grab_have_pointer : 1;
|
||||
guint grab_have_keyboard : 1;
|
||||
guint grab_wireframe_active : 1;
|
||||
guint grab_was_cancelled : 1;
|
||||
guint grab_was_cancelled : 1; /* Only used in wireframe mode */
|
||||
guint grab_frame_action : 1;
|
||||
MetaRectangle grab_wireframe_rect;
|
||||
MetaRectangle grab_wireframe_last_xor_rect;
|
||||
MetaRectangle grab_initial_window_pos;
|
||||
@@ -274,12 +272,13 @@ struct _MetaDisplay
|
||||
gboolean grab_threshold_movement_reached; /* raise_on_click == FALSE. */
|
||||
MetaResizePopup *grab_resize_popup;
|
||||
GTimeVal grab_last_moveresize_time;
|
||||
Time grab_motion_notify_time;
|
||||
guint32 grab_motion_notify_time;
|
||||
int grab_wireframe_last_display_width;
|
||||
int grab_wireframe_last_display_height;
|
||||
GList* grab_old_window_stacking;
|
||||
MetaEdgeResistanceData *grab_edge_resistance_data;
|
||||
|
||||
unsigned int grab_last_user_action_was_snap;
|
||||
|
||||
/* we use property updates as sentinels for certain window focus events
|
||||
* to avoid some race conditions on EnterNotify events
|
||||
*/
|
||||
@@ -287,7 +286,7 @@ struct _MetaDisplay
|
||||
|
||||
#ifdef HAVE_XKB
|
||||
int xkb_base_event_type;
|
||||
Time last_bell_time;
|
||||
guint32 last_bell_time;
|
||||
#endif
|
||||
#ifdef HAVE_XSYNC
|
||||
/* alarm monitoring client's _NET_WM_SYNC_REQUEST_COUNTER */
|
||||
@@ -300,8 +299,8 @@ struct _MetaDisplay
|
||||
int n_screen_bindings;
|
||||
MetaKeyBinding *window_bindings;
|
||||
int n_window_bindings;
|
||||
unsigned int min_keycode;
|
||||
unsigned int max_keycode;
|
||||
int min_keycode;
|
||||
int max_keycode;
|
||||
KeySym *keymap;
|
||||
int keysyms_per_keycode;
|
||||
XModifierKeymap *modmap;
|
||||
@@ -315,6 +314,9 @@ struct _MetaDisplay
|
||||
/* Xinerama cache */
|
||||
unsigned int xinerama_cache_invalidated : 1;
|
||||
|
||||
/* Opening the display */
|
||||
unsigned int display_opening : 1;
|
||||
|
||||
/* Closing down the display */
|
||||
int closing;
|
||||
|
||||
@@ -350,7 +352,6 @@ struct _MetaDisplay
|
||||
int render_error_base;
|
||||
#endif
|
||||
#ifdef HAVE_XSYNC
|
||||
unsigned int grab_last_user_action_was_snap;
|
||||
unsigned int have_xsync : 1;
|
||||
#define META_DISPLAY_HAS_XSYNC(display) ((display)->have_xsync)
|
||||
#else
|
||||
@@ -392,8 +393,9 @@ struct _MetaDisplay
|
||||
(time2) != 0) \
|
||||
)
|
||||
|
||||
gboolean meta_display_open (const char *name);
|
||||
void meta_display_close (MetaDisplay *display);
|
||||
gboolean meta_display_open (void);
|
||||
void meta_display_close (MetaDisplay *display,
|
||||
guint32 timestamp);
|
||||
MetaScreen* meta_display_screen_for_root (MetaDisplay *display,
|
||||
Window xroot);
|
||||
MetaScreen* meta_display_screen_for_x_screen (MetaDisplay *display,
|
||||
@@ -402,13 +404,14 @@ MetaScreen* meta_display_screen_for_xwindow (MetaDisplay *display,
|
||||
Window xindow);
|
||||
void meta_display_grab (MetaDisplay *display);
|
||||
void meta_display_ungrab (MetaDisplay *display);
|
||||
gboolean meta_display_is_double_click (MetaDisplay *display);
|
||||
|
||||
void meta_display_unmanage_screen (MetaDisplay *display,
|
||||
MetaScreen *screen);
|
||||
MetaScreen *screen,
|
||||
guint32 timestamp);
|
||||
|
||||
void meta_display_unmanage_windows_for_screen (MetaDisplay *display,
|
||||
MetaScreen *screen);
|
||||
MetaScreen *screen,
|
||||
guint32 timestamp);
|
||||
|
||||
/* A given MetaWindow may have various X windows that "belong"
|
||||
* to it, such as the frame window.
|
||||
@@ -437,21 +440,22 @@ void meta_display_set_grab_op_cursor (MetaDisplay *display,
|
||||
MetaGrabOp op,
|
||||
gboolean change_pointer,
|
||||
Window grab_xwindow,
|
||||
Time timestamp);
|
||||
guint32 timestamp);
|
||||
|
||||
gboolean meta_display_begin_grab_op (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
MetaGrabOp op,
|
||||
gboolean pointer_already_grabbed,
|
||||
gboolean frame_action,
|
||||
int event_serial,
|
||||
int button,
|
||||
gulong modmask,
|
||||
Time timestamp,
|
||||
guint32 timestamp,
|
||||
int root_x,
|
||||
int root_y);
|
||||
void meta_display_end_grab_op (MetaDisplay *display,
|
||||
Time timestamp);
|
||||
guint32 timestamp);
|
||||
|
||||
void meta_display_check_threshold_reached (MetaDisplay *display,
|
||||
int x,
|
||||
@@ -488,19 +492,20 @@ 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,
|
||||
Time timestamp,
|
||||
MetaWindowPingFunc ping_reply_func,
|
||||
MetaWindowPingFunc ping_timeout_func,
|
||||
void *user_data);
|
||||
void meta_display_ping_window (MetaDisplay *display,
|
||||
MetaWindow *window,
|
||||
guint32 timestamp,
|
||||
MetaWindowPingFunc ping_reply_func,
|
||||
MetaWindowPingFunc ping_timeout_func,
|
||||
void *user_data);
|
||||
gboolean meta_display_window_has_pending_pings (MetaDisplay *display,
|
||||
MetaWindow *window);
|
||||
|
||||
typedef enum
|
||||
{
|
||||
META_TAB_LIST_NORMAL,
|
||||
META_TAB_LIST_DOCKS
|
||||
META_TAB_LIST_DOCKS,
|
||||
META_TAB_LIST_GROUP
|
||||
} MetaTabList;
|
||||
|
||||
typedef enum
|
||||
@@ -551,7 +556,7 @@ gboolean meta_display_focus_sentinel_clear (MetaDisplay *display);
|
||||
void meta_display_set_input_focus_window (MetaDisplay *display,
|
||||
MetaWindow *window,
|
||||
gboolean focus_frame,
|
||||
Time timestamp);
|
||||
guint32 timestamp);
|
||||
|
||||
/* meta_display_focus_the_no_focus_window is called when the
|
||||
* designated no_focus_window should be focused, but is otherwise the
|
||||
@@ -559,7 +564,7 @@ void meta_display_set_input_focus_window (MetaDisplay *display,
|
||||
*/
|
||||
void meta_display_focus_the_no_focus_window (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
Time timestamp);
|
||||
guint32 timestamp);
|
||||
|
||||
void meta_display_queue_autoraise_callback (MetaDisplay *display,
|
||||
MetaWindow *window);
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/* Draw a workspace */
|
||||
|
||||
/* This file should not be modified to depend on other files in
|
||||
@@ -64,21 +66,38 @@ get_window_rect (const WnckWindowDisplayInfo *win,
|
||||
}
|
||||
|
||||
static void
|
||||
draw_window (GtkWidget *widget,
|
||||
GdkDrawable *drawable,
|
||||
draw_window (GtkWidget *widget,
|
||||
GdkDrawable *drawable,
|
||||
const WnckWindowDisplayInfo *win,
|
||||
const GdkRectangle *winrect)
|
||||
const GdkRectangle *winrect,
|
||||
GtkStateType state)
|
||||
{
|
||||
cairo_t *cr;
|
||||
GdkPixbuf *icon;
|
||||
int icon_x, icon_y, icon_w, icon_h;
|
||||
|
||||
gdk_draw_rectangle (drawable,
|
||||
win->is_active ?
|
||||
widget->style->bg_gc[GTK_STATE_SELECTED] :
|
||||
widget->style->bg_gc[GTK_STATE_NORMAL],
|
||||
TRUE,
|
||||
winrect->x + 1, winrect->y + 1,
|
||||
winrect->width - 2, winrect->height - 2);
|
||||
gboolean is_active;
|
||||
GdkColor *color;
|
||||
|
||||
is_active = win->is_active;
|
||||
|
||||
cr = gdk_cairo_create (drawable);
|
||||
cairo_rectangle (cr, winrect->x, winrect->y, winrect->width, winrect->height);
|
||||
cairo_clip (cr);
|
||||
|
||||
if (is_active)
|
||||
color = &widget->style->light[state];
|
||||
else
|
||||
color = &widget->style->bg[state];
|
||||
cairo_set_source_rgb (cr,
|
||||
color->red / 65535.,
|
||||
color->green / 65535.,
|
||||
color->blue / 65535.);
|
||||
|
||||
cairo_rectangle (cr,
|
||||
winrect->x + 1, winrect->y + 1,
|
||||
MAX (0, winrect->width - 2), MAX (0, winrect->height - 2));
|
||||
cairo_fill (cr);
|
||||
|
||||
|
||||
icon = win->icon;
|
||||
|
||||
@@ -101,7 +120,7 @@ draw_window (GtkWidget *widget,
|
||||
{
|
||||
icon_w = gdk_pixbuf_get_width (icon);
|
||||
icon_h = gdk_pixbuf_get_height (icon);
|
||||
|
||||
|
||||
/* Give up. */
|
||||
if (icon_w > (winrect->width - 2) ||
|
||||
icon_h > (winrect->height - 2))
|
||||
@@ -114,44 +133,31 @@ draw_window (GtkWidget *widget,
|
||||
{
|
||||
icon_x = winrect->x + (winrect->width - icon_w) / 2;
|
||||
icon_y = winrect->y + (winrect->height - icon_h) / 2;
|
||||
|
||||
{
|
||||
/* render_to_drawable should take a clip rect to save
|
||||
* us this mess...
|
||||
*/
|
||||
GdkRectangle pixbuf_rect;
|
||||
GdkRectangle draw_rect;
|
||||
|
||||
pixbuf_rect.x = icon_x;
|
||||
pixbuf_rect.y = icon_y;
|
||||
pixbuf_rect.width = icon_w;
|
||||
pixbuf_rect.height = icon_h;
|
||||
|
||||
if (gdk_rectangle_intersect ((GdkRectangle *)winrect, &pixbuf_rect,
|
||||
&draw_rect))
|
||||
{
|
||||
gdk_pixbuf_render_to_drawable_alpha (icon,
|
||||
drawable,
|
||||
draw_rect.x - pixbuf_rect.x,
|
||||
draw_rect.y - pixbuf_rect.y,
|
||||
draw_rect.x, draw_rect.y,
|
||||
draw_rect.width,
|
||||
draw_rect.height,
|
||||
GDK_PIXBUF_ALPHA_FULL,
|
||||
128,
|
||||
GDK_RGB_DITHER_NORMAL,
|
||||
0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
cairo_save (cr);
|
||||
gdk_cairo_set_source_pixbuf (cr, icon, icon_x, icon_y);
|
||||
cairo_rectangle (cr, icon_x, icon_y, icon_w, icon_h);
|
||||
cairo_clip (cr);
|
||||
cairo_paint (cr);
|
||||
cairo_restore (cr);
|
||||
}
|
||||
|
||||
gdk_draw_rectangle (drawable,
|
||||
win->is_active ?
|
||||
widget->style->fg_gc[GTK_STATE_SELECTED] :
|
||||
widget->style->fg_gc[GTK_STATE_NORMAL],
|
||||
FALSE,
|
||||
winrect->x, winrect->y,
|
||||
winrect->width - 1, winrect->height - 1);
|
||||
if (is_active)
|
||||
color = &widget->style->fg[state];
|
||||
else
|
||||
color = &widget->style->fg[state];
|
||||
|
||||
cairo_set_source_rgb (cr,
|
||||
color->red / 65535.,
|
||||
color->green / 65535.,
|
||||
color->blue / 65535.);
|
||||
cairo_set_line_width (cr, 1.0);
|
||||
cairo_rectangle (cr,
|
||||
winrect->x + 0.5, winrect->y + 0.5,
|
||||
MAX (0, winrect->width - 1), MAX (0, winrect->height - 1));
|
||||
cairo_stroke (cr);
|
||||
|
||||
cairo_destroy (cr);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -170,48 +176,56 @@ wnck_draw_workspace (GtkWidget *widget,
|
||||
{
|
||||
int i;
|
||||
GdkRectangle workspace_rect;
|
||||
|
||||
GtkStateType state;
|
||||
|
||||
workspace_rect.x = x;
|
||||
workspace_rect.y = y;
|
||||
workspace_rect.width = width;
|
||||
workspace_rect.height = height;
|
||||
|
||||
|
||||
if (is_active)
|
||||
gdk_draw_rectangle (drawable,
|
||||
GTK_WIDGET (widget)->style->dark_gc[GTK_STATE_SELECTED],
|
||||
TRUE,
|
||||
x, y, width, height);
|
||||
else if (workspace_background)
|
||||
state = GTK_STATE_SELECTED;
|
||||
else if (workspace_background)
|
||||
state = GTK_STATE_PRELIGHT;
|
||||
else
|
||||
state = GTK_STATE_NORMAL;
|
||||
|
||||
if (workspace_background)
|
||||
{
|
||||
gdk_pixbuf_render_to_drawable (workspace_background,
|
||||
drawable,
|
||||
GTK_WIDGET (widget)->style->dark_gc[GTK_STATE_SELECTED],
|
||||
0, 0,
|
||||
x, y,
|
||||
-1, -1,
|
||||
GDK_RGB_DITHER_MAX,
|
||||
0, 0);
|
||||
gdk_draw_pixbuf (drawable,
|
||||
GTK_WIDGET (widget)->style->dark_gc[state],
|
||||
workspace_background,
|
||||
0, 0,
|
||||
x, y,
|
||||
-1, -1,
|
||||
GDK_RGB_DITHER_MAX,
|
||||
0, 0);
|
||||
}
|
||||
else
|
||||
gdk_draw_rectangle (drawable,
|
||||
GTK_WIDGET (widget)->style->dark_gc[GTK_STATE_NORMAL],
|
||||
TRUE,
|
||||
x, y, width, height);
|
||||
|
||||
|
||||
{
|
||||
cairo_t *cr;
|
||||
|
||||
cr = gdk_cairo_create (widget->window);
|
||||
gdk_cairo_set_source_color (cr, &widget->style->dark[state]);
|
||||
cairo_rectangle (cr, x, y, width, height);
|
||||
cairo_fill (cr);
|
||||
cairo_destroy (cr);
|
||||
}
|
||||
|
||||
i = 0;
|
||||
while (i < n_windows)
|
||||
{
|
||||
const WnckWindowDisplayInfo *win = &windows[i];
|
||||
GdkRectangle winrect;
|
||||
|
||||
get_window_rect (win, screen_width, screen_height, &workspace_rect, &winrect);
|
||||
get_window_rect (win, screen_width,
|
||||
screen_height, &workspace_rect, &winrect);
|
||||
|
||||
draw_window (widget,
|
||||
drawable,
|
||||
win,
|
||||
&winrect);
|
||||
&winrect,
|
||||
state);
|
||||
|
||||
++i;
|
||||
}
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/* Draw a workspace */
|
||||
|
||||
/* This file should not be modified to depend on other files in
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/* Edge resistance for move/resize operations */
|
||||
|
||||
/*
|
||||
@@ -44,7 +46,6 @@ struct ResistanceDataForAnEdge
|
||||
GSourceFunc timeout_func;
|
||||
MetaWindow *window;
|
||||
int keyboard_buildup;
|
||||
gboolean allow_past_screen_edge;
|
||||
};
|
||||
typedef struct ResistanceDataForAnEdge ResistanceDataForAnEdge;
|
||||
|
||||
@@ -397,18 +398,6 @@ apply_edge_resistance (MetaWindow *window,
|
||||
{
|
||||
int threshold;
|
||||
|
||||
/* INFINITE RESISTANCE for screen edges under certain cases; If
|
||||
* the edge is relevant and we're moving towards it and it's a
|
||||
* screen edge and infinite resistance has been requested for
|
||||
* this particular grab op then don't allow movement past it.
|
||||
*/
|
||||
if (edge->edge_type == META_EDGE_SCREEN &&
|
||||
!resistance_data->allow_past_screen_edge &&
|
||||
movement_towards_edge (edge->side_type, increment))
|
||||
{
|
||||
return compare;
|
||||
}
|
||||
|
||||
/* TIMEOUT RESISTANCE: If the edge is relevant and we're moving
|
||||
* towards it, then we may want to have some kind of time delay
|
||||
* before the user can move past this edge.
|
||||
@@ -541,7 +530,8 @@ apply_edge_resistance_to_each_side (MetaDisplay *display,
|
||||
MetaRectangle *new_outer,
|
||||
GSourceFunc timeout_func,
|
||||
gboolean auto_snap,
|
||||
gboolean keyboard_op)
|
||||
gboolean keyboard_op,
|
||||
gboolean is_resize)
|
||||
{
|
||||
MetaEdgeResistanceData *edge_data;
|
||||
MetaRectangle modified_rect;
|
||||
@@ -588,47 +578,68 @@ apply_edge_resistance_to_each_side (MetaDisplay *display,
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Now, apply the normal edge resistance */
|
||||
new_left = apply_edge_resistance (window,
|
||||
BOX_LEFT (*old_outer),
|
||||
BOX_LEFT (*new_outer),
|
||||
old_outer,
|
||||
new_outer,
|
||||
edge_data->left_edges,
|
||||
&edge_data->left_data,
|
||||
timeout_func,
|
||||
TRUE,
|
||||
keyboard_op);
|
||||
new_right = apply_edge_resistance (window,
|
||||
BOX_RIGHT (*old_outer),
|
||||
BOX_RIGHT (*new_outer),
|
||||
old_outer,
|
||||
new_outer,
|
||||
edge_data->right_edges,
|
||||
&edge_data->right_data,
|
||||
timeout_func,
|
||||
TRUE,
|
||||
keyboard_op);
|
||||
new_top = apply_edge_resistance (window,
|
||||
BOX_TOP (*old_outer),
|
||||
BOX_TOP (*new_outer),
|
||||
old_outer,
|
||||
new_outer,
|
||||
edge_data->top_edges,
|
||||
&edge_data->top_data,
|
||||
timeout_func,
|
||||
FALSE,
|
||||
keyboard_op);
|
||||
new_bottom = apply_edge_resistance (window,
|
||||
BOX_BOTTOM (*old_outer),
|
||||
BOX_BOTTOM (*new_outer),
|
||||
old_outer,
|
||||
new_outer,
|
||||
edge_data->bottom_edges,
|
||||
&edge_data->bottom_data,
|
||||
timeout_func,
|
||||
FALSE,
|
||||
keyboard_op);
|
||||
/* Disable edge resistance for resizes when windows have size
|
||||
* increment hints; see #346782. For all other cases, apply
|
||||
* them.
|
||||
*/
|
||||
if (!is_resize || window->size_hints.width_inc == 1)
|
||||
{
|
||||
/* Now, apply the normal horizontal edge resistance */
|
||||
new_left = apply_edge_resistance (window,
|
||||
BOX_LEFT (*old_outer),
|
||||
BOX_LEFT (*new_outer),
|
||||
old_outer,
|
||||
new_outer,
|
||||
edge_data->left_edges,
|
||||
&edge_data->left_data,
|
||||
timeout_func,
|
||||
TRUE,
|
||||
keyboard_op);
|
||||
new_right = apply_edge_resistance (window,
|
||||
BOX_RIGHT (*old_outer),
|
||||
BOX_RIGHT (*new_outer),
|
||||
old_outer,
|
||||
new_outer,
|
||||
edge_data->right_edges,
|
||||
&edge_data->right_data,
|
||||
timeout_func,
|
||||
TRUE,
|
||||
keyboard_op);
|
||||
}
|
||||
else
|
||||
{
|
||||
new_left = new_outer->x;
|
||||
new_right = new_outer->x + new_outer->width;
|
||||
}
|
||||
/* Same for vertical resizes... */
|
||||
if (!is_resize || window->size_hints.height_inc == 1)
|
||||
{
|
||||
new_top = apply_edge_resistance (window,
|
||||
BOX_TOP (*old_outer),
|
||||
BOX_TOP (*new_outer),
|
||||
old_outer,
|
||||
new_outer,
|
||||
edge_data->top_edges,
|
||||
&edge_data->top_data,
|
||||
timeout_func,
|
||||
FALSE,
|
||||
keyboard_op);
|
||||
new_bottom = apply_edge_resistance (window,
|
||||
BOX_BOTTOM (*old_outer),
|
||||
BOX_BOTTOM (*new_outer),
|
||||
old_outer,
|
||||
new_outer,
|
||||
edge_data->bottom_edges,
|
||||
&edge_data->bottom_data,
|
||||
timeout_func,
|
||||
FALSE,
|
||||
keyboard_op);
|
||||
}
|
||||
else
|
||||
{
|
||||
new_top = new_outer->y;
|
||||
new_bottom = new_outer->y + new_outer->height;
|
||||
}
|
||||
}
|
||||
|
||||
/* Determine whether anything changed, and save the changes */
|
||||
@@ -746,6 +757,31 @@ cache_edges (MetaDisplay *display,
|
||||
int num_left, num_right, num_top, num_bottom;
|
||||
int i;
|
||||
|
||||
/*
|
||||
* 0th: Print debugging information to the log about the edges
|
||||
*/
|
||||
#ifdef WITH_VERBOSE_MODE
|
||||
if (meta_is_verbose())
|
||||
{
|
||||
int max_edges = MAX (MAX( g_list_length (window_edges),
|
||||
g_list_length (xinerama_edges)),
|
||||
g_list_length (screen_edges));
|
||||
char big_buffer[(EDGE_LENGTH+2)*max_edges];
|
||||
|
||||
meta_rectangle_edge_list_to_string (window_edges, ", ", big_buffer);
|
||||
meta_topic (META_DEBUG_EDGE_RESISTANCE,
|
||||
"Window edges for resistance : %s\n", big_buffer);
|
||||
|
||||
meta_rectangle_edge_list_to_string (xinerama_edges, ", ", big_buffer);
|
||||
meta_topic (META_DEBUG_EDGE_RESISTANCE,
|
||||
"Xinerama edges for resistance: %s\n", big_buffer);
|
||||
|
||||
meta_rectangle_edge_list_to_string (screen_edges, ", ", big_buffer);
|
||||
meta_topic (META_DEBUG_EDGE_RESISTANCE,
|
||||
"Screen edges for resistance : %s\n", big_buffer);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 1st: Get the total number of each kind of edge
|
||||
*/
|
||||
@@ -888,12 +924,6 @@ initialize_grab_edge_resistance_data (MetaDisplay *display)
|
||||
edge_data->right_data.keyboard_buildup = 0;
|
||||
edge_data->top_data.keyboard_buildup = 0;
|
||||
edge_data->bottom_data.keyboard_buildup = 0;
|
||||
|
||||
edge_data->left_data.allow_past_screen_edge = TRUE;
|
||||
edge_data->right_data.allow_past_screen_edge = TRUE;
|
||||
edge_data->bottom_data.allow_past_screen_edge = TRUE;
|
||||
edge_data->top_data.allow_past_screen_edge =
|
||||
display->grab_anchor_root_y >= display->grab_initial_window_pos.y;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1096,6 +1126,7 @@ meta_window_edge_resistance_for_move (MetaWindow *window,
|
||||
gboolean is_keyboard_op)
|
||||
{
|
||||
MetaRectangle old_outer, proposed_outer, new_outer;
|
||||
gboolean is_resize;
|
||||
|
||||
if (window == window->display->grab_window &&
|
||||
window->display->grab_wireframe_active)
|
||||
@@ -1114,13 +1145,15 @@ meta_window_edge_resistance_for_move (MetaWindow *window,
|
||||
new_outer = proposed_outer;
|
||||
|
||||
window->display->grab_last_user_action_was_snap = snap;
|
||||
is_resize = FALSE;
|
||||
if (apply_edge_resistance_to_each_side (window->display,
|
||||
window,
|
||||
&old_outer,
|
||||
&new_outer,
|
||||
timeout_func,
|
||||
snap,
|
||||
is_keyboard_op))
|
||||
is_keyboard_op,
|
||||
is_resize))
|
||||
{
|
||||
/* apply_edge_resistance_to_each_side independently applies
|
||||
* resistance to both the right and left edges of new_outer as both
|
||||
@@ -1163,6 +1196,12 @@ meta_window_edge_resistance_for_move (MetaWindow *window,
|
||||
(BOX_LEFT (*reference) - BOX_LEFT (old_outer));
|
||||
*new_y = old_y + smaller_y_change +
|
||||
(BOX_TOP (*reference) - BOX_TOP (old_outer));
|
||||
|
||||
meta_topic (META_DEBUG_EDGE_RESISTANCE,
|
||||
"outer x & y move-to coordinate changed from %d,%d to %d,%d\n",
|
||||
proposed_outer.x, proposed_outer.y,
|
||||
old_outer.x + (*new_x - old_x),
|
||||
old_outer.y + (*new_y - old_y));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1181,7 +1220,8 @@ meta_window_edge_resistance_for_resize (MetaWindow *window,
|
||||
gboolean is_keyboard_op)
|
||||
{
|
||||
MetaRectangle old_outer, new_outer;
|
||||
int new_outer_width, new_outer_height;
|
||||
int proposed_outer_width, proposed_outer_height;
|
||||
gboolean is_resize;
|
||||
|
||||
if (window == window->display->grab_window &&
|
||||
window->display->grab_wireframe_active)
|
||||
@@ -1194,24 +1234,31 @@ meta_window_edge_resistance_for_resize (MetaWindow *window,
|
||||
{
|
||||
meta_window_get_outer_rect (window, &old_outer);
|
||||
}
|
||||
new_outer_width = old_outer.width + (*new_width - old_width);
|
||||
new_outer_height = old_outer.height + (*new_height - old_height);
|
||||
proposed_outer_width = old_outer.width + (*new_width - old_width);
|
||||
proposed_outer_height = old_outer.height + (*new_height - old_height);
|
||||
meta_rectangle_resize_with_gravity (&old_outer,
|
||||
&new_outer,
|
||||
gravity,
|
||||
new_outer_width,
|
||||
new_outer_height);
|
||||
proposed_outer_width,
|
||||
proposed_outer_height);
|
||||
|
||||
window->display->grab_last_user_action_was_snap = snap;
|
||||
is_resize = TRUE;
|
||||
if (apply_edge_resistance_to_each_side (window->display,
|
||||
window,
|
||||
&old_outer,
|
||||
&new_outer,
|
||||
timeout_func,
|
||||
snap,
|
||||
is_keyboard_op))
|
||||
is_keyboard_op,
|
||||
is_resize))
|
||||
{
|
||||
*new_width = old_width + (new_outer.width - old_outer.width);
|
||||
*new_height = old_height + (new_outer.height - old_outer.height);
|
||||
|
||||
meta_topic (META_DEBUG_EDGE_RESISTANCE,
|
||||
"outer width & height got changed from %d,%d to %d,%d\n",
|
||||
proposed_outer_width, proposed_outer_height,
|
||||
new_outer.width, new_outer.height);
|
||||
}
|
||||
}
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/* Edge resistance for move/resize operations */
|
||||
|
||||
/*
|
||||
|
162
src/effects.c
162
src/effects.c
@@ -1,3 +1,5 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/* Metacity animation effects */
|
||||
|
||||
/*
|
||||
@@ -23,6 +25,7 @@
|
||||
#include "effects.h"
|
||||
#include "display.h"
|
||||
#include "ui.h"
|
||||
#include "window.h"
|
||||
|
||||
#ifdef HAVE_SHAPE
|
||||
#include <X11/extensions/shape.h>
|
||||
@@ -72,6 +75,132 @@ typedef struct
|
||||
|
||||
} BoxAnimationContext;
|
||||
|
||||
struct MetaEffectPriv
|
||||
{
|
||||
MetaEffectFinished finished;
|
||||
gpointer finished_data;
|
||||
};
|
||||
|
||||
static void run_default_effect_handler (MetaEffect *effect);
|
||||
static void run_handler (MetaEffect *effect);
|
||||
|
||||
static MetaEffectHandler effect_handler;
|
||||
static gpointer effect_handler_data;
|
||||
|
||||
void
|
||||
meta_push_effect_handler (MetaEffectHandler handler,
|
||||
gpointer data)
|
||||
{
|
||||
effect_handler = handler;
|
||||
effect_handler_data = data;
|
||||
}
|
||||
|
||||
void
|
||||
meta_pop_effect_handler (void)
|
||||
{
|
||||
/* FIXME: not implemented yet */
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
static MetaEffect *
|
||||
create_effect (MetaEffectType type,
|
||||
MetaWindow *window,
|
||||
MetaEffectFinished finished,
|
||||
gpointer finished_data)
|
||||
{
|
||||
MetaEffect *effect = g_new (MetaEffect, 1);
|
||||
|
||||
effect->type = type;
|
||||
effect->window = window;
|
||||
effect->priv = g_new (MetaEffectPriv, 1);
|
||||
effect->priv->finished = finished;
|
||||
effect->priv->finished_data = finished_data;
|
||||
|
||||
return effect;
|
||||
}
|
||||
|
||||
void
|
||||
meta_effect_end (MetaEffect *effect)
|
||||
{
|
||||
if (effect->priv->finished)
|
||||
effect->priv->finished (effect, effect->priv->finished_data);
|
||||
|
||||
g_free (effect->priv);
|
||||
g_free (effect);
|
||||
}
|
||||
|
||||
void
|
||||
meta_effect_run_focus (MetaWindow *window,
|
||||
MetaEffectFinished finished,
|
||||
gpointer data)
|
||||
{
|
||||
MetaEffect *effect;
|
||||
|
||||
g_return_if_fail (window != NULL);
|
||||
|
||||
effect = create_effect (META_EFFECT_FOCUS, window, finished, data);
|
||||
|
||||
run_handler (effect);
|
||||
}
|
||||
|
||||
void
|
||||
meta_effect_run_minimize (MetaWindow *window,
|
||||
MetaRectangle *window_rect,
|
||||
MetaRectangle *icon_rect,
|
||||
MetaEffectFinished finished,
|
||||
gpointer data)
|
||||
{
|
||||
MetaEffect *effect;
|
||||
|
||||
g_return_if_fail (window != NULL);
|
||||
g_return_if_fail (icon_rect != NULL);
|
||||
|
||||
effect = create_effect (META_EFFECT_MINIMIZE, window, finished, data);
|
||||
|
||||
effect->u.minimize.window_rect = *window_rect;
|
||||
effect->u.minimize.icon_rect = *icon_rect;
|
||||
|
||||
run_handler (effect);
|
||||
}
|
||||
|
||||
void
|
||||
meta_effect_run_unminimize (MetaWindow *window,
|
||||
MetaRectangle *window_rect,
|
||||
MetaRectangle *icon_rect,
|
||||
MetaEffectFinished finished,
|
||||
gpointer data)
|
||||
{
|
||||
MetaEffect *effect;
|
||||
|
||||
g_return_if_fail (window != NULL);
|
||||
g_return_if_fail (icon_rect != NULL);
|
||||
|
||||
effect = create_effect (META_EFFECT_UNMINIMIZE, window, finished, data);
|
||||
|
||||
effect->u.minimize.window_rect = *window_rect;
|
||||
effect->u.minimize.icon_rect = *icon_rect;
|
||||
|
||||
run_handler (effect);
|
||||
}
|
||||
|
||||
void
|
||||
meta_effect_run_close (MetaWindow *window,
|
||||
MetaEffectFinished finished,
|
||||
gpointer data)
|
||||
{
|
||||
MetaEffect *effect;
|
||||
|
||||
g_return_if_fail (window != NULL);
|
||||
|
||||
effect = create_effect (META_EFFECT_CLOSE, window,
|
||||
finished, data);
|
||||
|
||||
run_handler (effect);
|
||||
}
|
||||
|
||||
|
||||
/* old ugly minimization effect */
|
||||
|
||||
static void
|
||||
update_wireframe_window (MetaDisplay *display,
|
||||
Window xwindow,
|
||||
@@ -374,7 +503,7 @@ meta_effects_draw_box_animation (MetaScreen *screen,
|
||||
attrs.override_redirect = True;
|
||||
attrs.background_pixel = BlackPixel (screen->display->xdisplay,
|
||||
screen->number);
|
||||
|
||||
|
||||
context->wireframe_xwindow = XCreateWindow (screen->display->xdisplay,
|
||||
screen->xroot,
|
||||
initial_rect->x,
|
||||
@@ -624,3 +753,34 @@ meta_effects_end_wireframe (MetaScreen *screen,
|
||||
meta_ui_pop_delay_exposes (screen->ui);
|
||||
}
|
||||
|
||||
static void
|
||||
run_default_effect_handler (MetaEffect *effect)
|
||||
{
|
||||
switch (effect->type)
|
||||
{
|
||||
case META_EFFECT_MINIMIZE:
|
||||
meta_effects_draw_box_animation (effect->window->screen,
|
||||
&(effect->u.minimize.window_rect),
|
||||
&(effect->u.minimize.icon_rect),
|
||||
META_MINIMIZE_ANIMATION_LENGTH,
|
||||
META_BOX_ANIM_SCALE);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
run_handler (MetaEffect *effect)
|
||||
{
|
||||
if (effect_handler)
|
||||
{
|
||||
effect_handler (effect, effect_handler_data);
|
||||
}
|
||||
else
|
||||
{
|
||||
run_default_effect_handler (effect);
|
||||
meta_effect_end (effect);
|
||||
}
|
||||
}
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/* Metacity animation effects */
|
||||
|
||||
/*
|
||||
@@ -25,6 +27,9 @@
|
||||
#include "util.h"
|
||||
#include "screen.h"
|
||||
|
||||
typedef struct MetaEffect MetaEffect;
|
||||
typedef struct MetaEffectPriv MetaEffectPriv;
|
||||
|
||||
#define META_MINIMIZE_ANIMATION_LENGTH 0.25
|
||||
#define META_SHADE_ANIMATION_LENGTH 0.2
|
||||
|
||||
@@ -35,6 +40,87 @@ typedef enum
|
||||
|
||||
} MetaBoxAnimType;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
META_EFFECT_MINIMIZE,
|
||||
META_EFFECT_UNMINIMIZE,
|
||||
META_EFFECT_MENU_MAP,
|
||||
META_EFFECT_MENU_UNMAP,
|
||||
META_EFFECT_DIALOG_MAP,
|
||||
META_EFFECT_DIALOG_UNMAP,
|
||||
META_EFFECT_TOPLEVEL_MAP,
|
||||
META_EFFECT_TOPLEVEL_UNMAP,
|
||||
META_EFFECT_WIREFRAME_BEGIN,
|
||||
META_EFFECT_WIREFRAME_UPDATE,
|
||||
META_EFFECT_WIREFRAME_END,
|
||||
META_EFFECT_FOCUS,
|
||||
META_EFFECT_CLOSE,
|
||||
META_NUM_EFFECTS
|
||||
} MetaEffectType;
|
||||
|
||||
typedef void (* MetaEffectHandler) (MetaEffect *effect,
|
||||
gpointer data);
|
||||
typedef void (* MetaEffectFinished) (const MetaEffect *effect,
|
||||
gpointer data);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
MetaRectangle window_rect;
|
||||
MetaRectangle icon_rect;
|
||||
} MetaMinimizeEffect, MetaUnminimizeEffect;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
||||
} MetaCloseEffect;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
} MetaFocusEffect;
|
||||
|
||||
struct MetaEffect
|
||||
{
|
||||
MetaWindow *window;
|
||||
MetaEffectType type;
|
||||
gpointer info; /* effect handler can hang data here */
|
||||
|
||||
union
|
||||
{
|
||||
MetaMinimizeEffect minimize;
|
||||
MetaUnminimizeEffect unminimize;
|
||||
MetaCloseEffect close;
|
||||
MetaFocusEffect focus;
|
||||
} u;
|
||||
|
||||
MetaEffectPriv *priv;
|
||||
};
|
||||
|
||||
void meta_push_effect_handler (MetaEffectHandler handler,
|
||||
gpointer data);
|
||||
void meta_pop_effect_handler (void);
|
||||
|
||||
void meta_effect_run_minimize (MetaWindow *window,
|
||||
MetaRectangle *window_rect,
|
||||
MetaRectangle *target,
|
||||
MetaEffectFinished finished,
|
||||
gpointer data);
|
||||
void meta_effect_run_unminimize (MetaWindow *window,
|
||||
MetaRectangle *window_rect,
|
||||
MetaRectangle *icon_rect,
|
||||
MetaEffectFinished finished,
|
||||
gpointer data);
|
||||
void meta_effect_run_close (MetaWindow *window,
|
||||
MetaEffectFinished finished,
|
||||
gpointer data);
|
||||
void meta_effect_run_focus (MetaWindow *window,
|
||||
MetaEffectFinished finished,
|
||||
gpointer data);
|
||||
void meta_effect_end (MetaEffect *effect);
|
||||
|
||||
|
||||
|
||||
/* Stuff that should become static functions */
|
||||
|
||||
void meta_effects_draw_box_animation (MetaScreen *screen,
|
||||
MetaRectangle *initial_rect,
|
||||
MetaRectangle *destination_rect,
|
||||
|
@@ -1,657 +0,0 @@
|
||||
/* eggaccelerators.c
|
||||
* Copyright (C) 2002 Red Hat, Inc.; Copyright 1998, 2001 Tim Janik
|
||||
* Developed by Havoc Pennington, Tim Janik
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "eggaccelerators.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <gdk/gdkx.h>
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
|
||||
enum
|
||||
{
|
||||
EGG_MODMAP_ENTRY_SHIFT = 0,
|
||||
EGG_MODMAP_ENTRY_LOCK = 1,
|
||||
EGG_MODMAP_ENTRY_CONTROL = 2,
|
||||
EGG_MODMAP_ENTRY_MOD1 = 3,
|
||||
EGG_MODMAP_ENTRY_MOD2 = 4,
|
||||
EGG_MODMAP_ENTRY_MOD3 = 5,
|
||||
EGG_MODMAP_ENTRY_MOD4 = 6,
|
||||
EGG_MODMAP_ENTRY_MOD5 = 7,
|
||||
EGG_MODMAP_ENTRY_LAST = 8
|
||||
};
|
||||
|
||||
#define MODMAP_ENTRY_TO_MODIFIER(x) (1 << (x))
|
||||
|
||||
typedef struct
|
||||
{
|
||||
EggVirtualModifierType mapping[EGG_MODMAP_ENTRY_LAST];
|
||||
|
||||
} EggModmap;
|
||||
|
||||
static const EggModmap* egg_keymap_get_modmap (GdkKeymap *keymap);
|
||||
|
||||
static inline gboolean
|
||||
is_alt (const gchar *string)
|
||||
{
|
||||
return ((string[0] == '<') &&
|
||||
(string[1] == 'a' || string[1] == 'A') &&
|
||||
(string[2] == 'l' || string[2] == 'L') &&
|
||||
(string[3] == 't' || string[3] == 'T') &&
|
||||
(string[4] == '>'));
|
||||
}
|
||||
|
||||
static inline gboolean
|
||||
is_ctl (const gchar *string)
|
||||
{
|
||||
return ((string[0] == '<') &&
|
||||
(string[1] == 'c' || string[1] == 'C') &&
|
||||
(string[2] == 't' || string[2] == 'T') &&
|
||||
(string[3] == 'l' || string[3] == 'L') &&
|
||||
(string[4] == '>'));
|
||||
}
|
||||
|
||||
static inline gboolean
|
||||
is_modx (const gchar *string)
|
||||
{
|
||||
return ((string[0] == '<') &&
|
||||
(string[1] == 'm' || string[1] == 'M') &&
|
||||
(string[2] == 'o' || string[2] == 'O') &&
|
||||
(string[3] == 'd' || string[3] == 'D') &&
|
||||
(string[4] >= '1' && string[4] <= '5') &&
|
||||
(string[5] == '>'));
|
||||
}
|
||||
|
||||
static inline gboolean
|
||||
is_ctrl (const gchar *string)
|
||||
{
|
||||
return ((string[0] == '<') &&
|
||||
(string[1] == 'c' || string[1] == 'C') &&
|
||||
(string[2] == 't' || string[2] == 'T') &&
|
||||
(string[3] == 'r' || string[3] == 'R') &&
|
||||
(string[4] == 'l' || string[4] == 'L') &&
|
||||
(string[5] == '>'));
|
||||
}
|
||||
|
||||
static inline gboolean
|
||||
is_shft (const gchar *string)
|
||||
{
|
||||
return ((string[0] == '<') &&
|
||||
(string[1] == 's' || string[1] == 'S') &&
|
||||
(string[2] == 'h' || string[2] == 'H') &&
|
||||
(string[3] == 'f' || string[3] == 'F') &&
|
||||
(string[4] == 't' || string[4] == 'T') &&
|
||||
(string[5] == '>'));
|
||||
}
|
||||
|
||||
static inline gboolean
|
||||
is_shift (const gchar *string)
|
||||
{
|
||||
return ((string[0] == '<') &&
|
||||
(string[1] == 's' || string[1] == 'S') &&
|
||||
(string[2] == 'h' || string[2] == 'H') &&
|
||||
(string[3] == 'i' || string[3] == 'I') &&
|
||||
(string[4] == 'f' || string[4] == 'F') &&
|
||||
(string[5] == 't' || string[5] == 'T') &&
|
||||
(string[6] == '>'));
|
||||
}
|
||||
|
||||
static inline gboolean
|
||||
is_control (const gchar *string)
|
||||
{
|
||||
return ((string[0] == '<') &&
|
||||
(string[1] == 'c' || string[1] == 'C') &&
|
||||
(string[2] == 'o' || string[2] == 'O') &&
|
||||
(string[3] == 'n' || string[3] == 'N') &&
|
||||
(string[4] == 't' || string[4] == 'T') &&
|
||||
(string[5] == 'r' || string[5] == 'R') &&
|
||||
(string[6] == 'o' || string[6] == 'O') &&
|
||||
(string[7] == 'l' || string[7] == 'L') &&
|
||||
(string[8] == '>'));
|
||||
}
|
||||
|
||||
static inline gboolean
|
||||
is_release (const gchar *string)
|
||||
{
|
||||
return ((string[0] == '<') &&
|
||||
(string[1] == 'r' || string[1] == 'R') &&
|
||||
(string[2] == 'e' || string[2] == 'E') &&
|
||||
(string[3] == 'l' || string[3] == 'L') &&
|
||||
(string[4] == 'e' || string[4] == 'E') &&
|
||||
(string[5] == 'a' || string[5] == 'A') &&
|
||||
(string[6] == 's' || string[6] == 'S') &&
|
||||
(string[7] == 'e' || string[7] == 'E') &&
|
||||
(string[8] == '>'));
|
||||
}
|
||||
|
||||
static inline gboolean
|
||||
is_meta (const gchar *string)
|
||||
{
|
||||
return ((string[0] == '<') &&
|
||||
(string[1] == 'm' || string[1] == 'M') &&
|
||||
(string[2] == 'e' || string[2] == 'E') &&
|
||||
(string[3] == 't' || string[3] == 'T') &&
|
||||
(string[4] == 'a' || string[4] == 'A') &&
|
||||
(string[5] == '>'));
|
||||
}
|
||||
|
||||
static inline gboolean
|
||||
is_super (const gchar *string)
|
||||
{
|
||||
return ((string[0] == '<') &&
|
||||
(string[1] == 's' || string[1] == 'S') &&
|
||||
(string[2] == 'u' || string[2] == 'U') &&
|
||||
(string[3] == 'p' || string[3] == 'P') &&
|
||||
(string[4] == 'e' || string[4] == 'E') &&
|
||||
(string[5] == 'r' || string[5] == 'R') &&
|
||||
(string[6] == '>'));
|
||||
}
|
||||
|
||||
static inline gboolean
|
||||
is_hyper (const gchar *string)
|
||||
{
|
||||
return ((string[0] == '<') &&
|
||||
(string[1] == 'h' || string[1] == 'H') &&
|
||||
(string[2] == 'y' || string[2] == 'Y') &&
|
||||
(string[3] == 'p' || string[3] == 'P') &&
|
||||
(string[4] == 'e' || string[4] == 'E') &&
|
||||
(string[5] == 'r' || string[5] == 'R') &&
|
||||
(string[6] == '>'));
|
||||
}
|
||||
|
||||
/**
|
||||
* egg_accelerator_parse_virtual:
|
||||
* @accelerator: string representing an accelerator
|
||||
* @accelerator_key: return location for accelerator keyval
|
||||
* @accelerator_mods: return location for accelerator modifier mask
|
||||
*
|
||||
* Parses a string representing a virtual accelerator. The format
|
||||
* looks like "<Control>a" or "<Shift><Alt>F1" or
|
||||
* "<Release>z" (the last one is for key release). The parser
|
||||
* is fairly liberal and allows lower or upper case, and also
|
||||
* abbreviations such as "<Ctl>" and "<Ctrl>".
|
||||
*
|
||||
* If the parse fails, @accelerator_key and @accelerator_mods will
|
||||
* be set to 0 (zero) and %FALSE will be returned. If the string contains
|
||||
* only modifiers, @accelerator_key will be set to 0 but %TRUE will be
|
||||
* returned.
|
||||
*
|
||||
* The virtual vs. concrete accelerator distinction is a relic of
|
||||
* how the X Window System works; there are modifiers Mod2-Mod5 that
|
||||
* can represent various keyboard keys (numlock, meta, hyper, etc.),
|
||||
* the virtual modifier represents the keyboard key, the concrete
|
||||
* modifier the actual Mod2-Mod5 bits in the key press event.
|
||||
*
|
||||
* Returns: %TRUE on success.
|
||||
*/
|
||||
gboolean
|
||||
egg_accelerator_parse_virtual (const gchar *accelerator,
|
||||
guint *accelerator_key,
|
||||
EggVirtualModifierType *accelerator_mods)
|
||||
{
|
||||
guint keyval;
|
||||
GdkModifierType mods;
|
||||
gint len;
|
||||
gboolean bad_keyval;
|
||||
|
||||
if (accelerator_key)
|
||||
*accelerator_key = 0;
|
||||
if (accelerator_mods)
|
||||
*accelerator_mods = 0;
|
||||
|
||||
g_return_val_if_fail (accelerator != NULL, FALSE);
|
||||
|
||||
bad_keyval = FALSE;
|
||||
|
||||
keyval = 0;
|
||||
mods = 0;
|
||||
len = strlen (accelerator);
|
||||
while (len)
|
||||
{
|
||||
if (*accelerator == '<')
|
||||
{
|
||||
if (len >= 9 && is_release (accelerator))
|
||||
{
|
||||
accelerator += 9;
|
||||
len -= 9;
|
||||
mods |= EGG_VIRTUAL_RELEASE_MASK;
|
||||
}
|
||||
else if (len >= 9 && is_control (accelerator))
|
||||
{
|
||||
accelerator += 9;
|
||||
len -= 9;
|
||||
mods |= EGG_VIRTUAL_CONTROL_MASK;
|
||||
}
|
||||
else if (len >= 7 && is_shift (accelerator))
|
||||
{
|
||||
accelerator += 7;
|
||||
len -= 7;
|
||||
mods |= EGG_VIRTUAL_SHIFT_MASK;
|
||||
}
|
||||
else if (len >= 6 && is_shft (accelerator))
|
||||
{
|
||||
accelerator += 6;
|
||||
len -= 6;
|
||||
mods |= EGG_VIRTUAL_SHIFT_MASK;
|
||||
}
|
||||
else if (len >= 6 && is_ctrl (accelerator))
|
||||
{
|
||||
accelerator += 6;
|
||||
len -= 6;
|
||||
mods |= EGG_VIRTUAL_CONTROL_MASK;
|
||||
}
|
||||
else if (len >= 6 && is_modx (accelerator))
|
||||
{
|
||||
static const guint mod_vals[] = {
|
||||
EGG_VIRTUAL_ALT_MASK, EGG_VIRTUAL_MOD2_MASK, EGG_VIRTUAL_MOD3_MASK,
|
||||
EGG_VIRTUAL_MOD4_MASK, EGG_VIRTUAL_MOD5_MASK
|
||||
};
|
||||
|
||||
len -= 6;
|
||||
accelerator += 4;
|
||||
mods |= mod_vals[*accelerator - '1'];
|
||||
accelerator += 2;
|
||||
}
|
||||
else if (len >= 5 && is_ctl (accelerator))
|
||||
{
|
||||
accelerator += 5;
|
||||
len -= 5;
|
||||
mods |= EGG_VIRTUAL_CONTROL_MASK;
|
||||
}
|
||||
else if (len >= 5 && is_alt (accelerator))
|
||||
{
|
||||
accelerator += 5;
|
||||
len -= 5;
|
||||
mods |= EGG_VIRTUAL_ALT_MASK;
|
||||
}
|
||||
else if (len >= 6 && is_meta (accelerator))
|
||||
{
|
||||
accelerator += 6;
|
||||
len -= 6;
|
||||
mods |= EGG_VIRTUAL_META_MASK;
|
||||
}
|
||||
else if (len >= 7 && is_hyper (accelerator))
|
||||
{
|
||||
accelerator += 7;
|
||||
len -= 7;
|
||||
mods |= EGG_VIRTUAL_HYPER_MASK;
|
||||
}
|
||||
else if (len >= 7 && is_super (accelerator))
|
||||
{
|
||||
accelerator += 7;
|
||||
len -= 7;
|
||||
mods |= EGG_VIRTUAL_SUPER_MASK;
|
||||
}
|
||||
else
|
||||
{
|
||||
gchar last_ch;
|
||||
|
||||
last_ch = *accelerator;
|
||||
while (last_ch && last_ch != '>')
|
||||
{
|
||||
last_ch = *accelerator;
|
||||
accelerator += 1;
|
||||
len -= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
keyval = gdk_keyval_from_name (accelerator);
|
||||
|
||||
if (keyval == 0)
|
||||
bad_keyval = TRUE;
|
||||
|
||||
accelerator += len;
|
||||
len -= len;
|
||||
}
|
||||
}
|
||||
|
||||
if (accelerator_key)
|
||||
*accelerator_key = gdk_keyval_to_lower (keyval);
|
||||
if (accelerator_mods)
|
||||
*accelerator_mods = mods;
|
||||
|
||||
return !bad_keyval;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* egg_virtual_accelerator_name:
|
||||
* @accelerator_key: accelerator keyval
|
||||
* @accelerator_mods: accelerator modifier mask
|
||||
* @returns: a newly-allocated accelerator name
|
||||
*
|
||||
* Converts an accelerator keyval and modifier mask
|
||||
* into a string parseable by egg_accelerator_parse_virtual().
|
||||
* For example, if you pass in #GDK_q and #EGG_VIRTUAL_CONTROL_MASK,
|
||||
* this function returns "<Control>q".
|
||||
*
|
||||
* The caller of this function must free the returned string.
|
||||
*/
|
||||
gchar*
|
||||
egg_virtual_accelerator_name (guint accelerator_key,
|
||||
EggVirtualModifierType accelerator_mods)
|
||||
{
|
||||
static const gchar text_release[] = "<Release>";
|
||||
static const gchar text_shift[] = "<Shift>";
|
||||
static const gchar text_control[] = "<Control>";
|
||||
static const gchar text_mod1[] = "<Alt>";
|
||||
static const gchar text_mod2[] = "<Mod2>";
|
||||
static const gchar text_mod3[] = "<Mod3>";
|
||||
static const gchar text_mod4[] = "<Mod4>";
|
||||
static const gchar text_mod5[] = "<Mod5>";
|
||||
static const gchar text_meta[] = "<Meta>";
|
||||
static const gchar text_super[] = "<Super>";
|
||||
static const gchar text_hyper[] = "<Hyper>";
|
||||
guint l;
|
||||
gchar *keyval_name;
|
||||
gchar *accelerator;
|
||||
|
||||
accelerator_mods &= EGG_VIRTUAL_MODIFIER_MASK;
|
||||
|
||||
keyval_name = gdk_keyval_name (gdk_keyval_to_lower (accelerator_key));
|
||||
if (!keyval_name)
|
||||
keyval_name = "";
|
||||
|
||||
l = 0;
|
||||
if (accelerator_mods & EGG_VIRTUAL_RELEASE_MASK)
|
||||
l += sizeof (text_release) - 1;
|
||||
if (accelerator_mods & EGG_VIRTUAL_SHIFT_MASK)
|
||||
l += sizeof (text_shift) - 1;
|
||||
if (accelerator_mods & EGG_VIRTUAL_CONTROL_MASK)
|
||||
l += sizeof (text_control) - 1;
|
||||
if (accelerator_mods & EGG_VIRTUAL_ALT_MASK)
|
||||
l += sizeof (text_mod1) - 1;
|
||||
if (accelerator_mods & EGG_VIRTUAL_MOD2_MASK)
|
||||
l += sizeof (text_mod2) - 1;
|
||||
if (accelerator_mods & EGG_VIRTUAL_MOD3_MASK)
|
||||
l += sizeof (text_mod3) - 1;
|
||||
if (accelerator_mods & EGG_VIRTUAL_MOD4_MASK)
|
||||
l += sizeof (text_mod4) - 1;
|
||||
if (accelerator_mods & EGG_VIRTUAL_MOD5_MASK)
|
||||
l += sizeof (text_mod5) - 1;
|
||||
if (accelerator_mods & EGG_VIRTUAL_META_MASK)
|
||||
l += sizeof (text_meta) - 1;
|
||||
if (accelerator_mods & EGG_VIRTUAL_HYPER_MASK)
|
||||
l += sizeof (text_hyper) - 1;
|
||||
if (accelerator_mods & EGG_VIRTUAL_SUPER_MASK)
|
||||
l += sizeof (text_super) - 1;
|
||||
l += strlen (keyval_name);
|
||||
|
||||
accelerator = g_new (gchar, l + 1);
|
||||
|
||||
l = 0;
|
||||
accelerator[l] = 0;
|
||||
if (accelerator_mods & EGG_VIRTUAL_RELEASE_MASK)
|
||||
{
|
||||
strcpy (accelerator + l, text_release);
|
||||
l += sizeof (text_release) - 1;
|
||||
}
|
||||
if (accelerator_mods & EGG_VIRTUAL_SHIFT_MASK)
|
||||
{
|
||||
strcpy (accelerator + l, text_shift);
|
||||
l += sizeof (text_shift) - 1;
|
||||
}
|
||||
if (accelerator_mods & EGG_VIRTUAL_CONTROL_MASK)
|
||||
{
|
||||
strcpy (accelerator + l, text_control);
|
||||
l += sizeof (text_control) - 1;
|
||||
}
|
||||
if (accelerator_mods & EGG_VIRTUAL_ALT_MASK)
|
||||
{
|
||||
strcpy (accelerator + l, text_mod1);
|
||||
l += sizeof (text_mod1) - 1;
|
||||
}
|
||||
if (accelerator_mods & EGG_VIRTUAL_MOD2_MASK)
|
||||
{
|
||||
strcpy (accelerator + l, text_mod2);
|
||||
l += sizeof (text_mod2) - 1;
|
||||
}
|
||||
if (accelerator_mods & EGG_VIRTUAL_MOD3_MASK)
|
||||
{
|
||||
strcpy (accelerator + l, text_mod3);
|
||||
l += sizeof (text_mod3) - 1;
|
||||
}
|
||||
if (accelerator_mods & EGG_VIRTUAL_MOD4_MASK)
|
||||
{
|
||||
strcpy (accelerator + l, text_mod4);
|
||||
l += sizeof (text_mod4) - 1;
|
||||
}
|
||||
if (accelerator_mods & EGG_VIRTUAL_MOD5_MASK)
|
||||
{
|
||||
strcpy (accelerator + l, text_mod5);
|
||||
l += sizeof (text_mod5) - 1;
|
||||
}
|
||||
if (accelerator_mods & EGG_VIRTUAL_META_MASK)
|
||||
{
|
||||
strcpy (accelerator + l, text_meta);
|
||||
l += sizeof (text_meta) - 1;
|
||||
}
|
||||
if (accelerator_mods & EGG_VIRTUAL_HYPER_MASK)
|
||||
{
|
||||
strcpy (accelerator + l, text_hyper);
|
||||
l += sizeof (text_hyper) - 1;
|
||||
}
|
||||
if (accelerator_mods & EGG_VIRTUAL_SUPER_MASK)
|
||||
{
|
||||
strcpy (accelerator + l, text_super);
|
||||
l += sizeof (text_super) - 1;
|
||||
}
|
||||
|
||||
strcpy (accelerator + l, keyval_name);
|
||||
|
||||
return accelerator;
|
||||
}
|
||||
|
||||
void
|
||||
egg_keymap_resolve_virtual_modifiers (GdkKeymap *keymap,
|
||||
EggVirtualModifierType virtual_mods,
|
||||
GdkModifierType *concrete_mods)
|
||||
{
|
||||
GdkModifierType concrete;
|
||||
int i;
|
||||
const EggModmap *modmap;
|
||||
|
||||
g_return_if_fail (GDK_IS_KEYMAP (keymap));
|
||||
g_return_if_fail (concrete_mods != NULL);
|
||||
|
||||
modmap = egg_keymap_get_modmap (keymap);
|
||||
|
||||
/* Not so sure about this algorithm. */
|
||||
|
||||
concrete = 0;
|
||||
i = 0;
|
||||
while (i < EGG_MODMAP_ENTRY_LAST)
|
||||
{
|
||||
if (modmap->mapping[i] & virtual_mods)
|
||||
concrete |= (1 << i);
|
||||
|
||||
++i;
|
||||
}
|
||||
|
||||
*concrete_mods = concrete;
|
||||
}
|
||||
|
||||
void
|
||||
egg_keymap_virtualize_modifiers (GdkKeymap *keymap,
|
||||
GdkModifierType concrete_mods,
|
||||
EggVirtualModifierType *virtual_mods)
|
||||
{
|
||||
GdkModifierType virtual;
|
||||
int i;
|
||||
const EggModmap *modmap;
|
||||
|
||||
g_return_if_fail (GDK_IS_KEYMAP (keymap));
|
||||
g_return_if_fail (virtual_mods != NULL);
|
||||
|
||||
modmap = egg_keymap_get_modmap (keymap);
|
||||
|
||||
/* Not so sure about this algorithm. */
|
||||
|
||||
virtual = 0;
|
||||
i = 0;
|
||||
while (i < EGG_MODMAP_ENTRY_LAST)
|
||||
{
|
||||
if ((1 << i) & concrete_mods)
|
||||
{
|
||||
EggVirtualModifierType cleaned;
|
||||
|
||||
cleaned = modmap->mapping[i] & ~(EGG_VIRTUAL_MOD2_MASK |
|
||||
EGG_VIRTUAL_MOD3_MASK |
|
||||
EGG_VIRTUAL_MOD4_MASK |
|
||||
EGG_VIRTUAL_MOD5_MASK);
|
||||
|
||||
if (cleaned != 0)
|
||||
{
|
||||
virtual |= cleaned;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Rather than dropping mod2->mod5 if not bound,
|
||||
* go ahead and use the concrete names
|
||||
*/
|
||||
virtual |= modmap->mapping[i];
|
||||
}
|
||||
}
|
||||
|
||||
++i;
|
||||
}
|
||||
|
||||
*virtual_mods = virtual;
|
||||
}
|
||||
|
||||
static void
|
||||
reload_modmap (GdkKeymap *keymap,
|
||||
EggModmap *modmap)
|
||||
{
|
||||
XModifierKeymap *xmodmap;
|
||||
int map_size;
|
||||
int i;
|
||||
|
||||
/* FIXME multihead */
|
||||
xmodmap = XGetModifierMapping (gdk_x11_get_default_xdisplay ());
|
||||
|
||||
memset (modmap->mapping, 0, sizeof (modmap->mapping));
|
||||
|
||||
/* there are 8 modifiers, and the first 3 are shift, shift lock,
|
||||
* and control
|
||||
*/
|
||||
map_size = 8 * xmodmap->max_keypermod;
|
||||
i = 3 * xmodmap->max_keypermod;
|
||||
while (i < map_size)
|
||||
{
|
||||
/* get the key code at this point in the map,
|
||||
* see if its keysym is one we're interested in
|
||||
*/
|
||||
int keycode = xmodmap->modifiermap[i];
|
||||
GdkKeymapKey *keys;
|
||||
guint *keyvals;
|
||||
int n_entries;
|
||||
int j;
|
||||
EggVirtualModifierType mask;
|
||||
|
||||
keys = NULL;
|
||||
keyvals = NULL;
|
||||
n_entries = 0;
|
||||
|
||||
gdk_keymap_get_entries_for_keycode (keymap,
|
||||
keycode,
|
||||
&keys, &keyvals, &n_entries);
|
||||
|
||||
mask = 0;
|
||||
j = 0;
|
||||
while (j < n_entries)
|
||||
{
|
||||
if (keyvals[j] == GDK_Num_Lock)
|
||||
mask |= EGG_VIRTUAL_NUM_LOCK_MASK;
|
||||
else if (keyvals[j] == GDK_Scroll_Lock)
|
||||
mask |= EGG_VIRTUAL_SCROLL_LOCK_MASK;
|
||||
else if (keyvals[j] == GDK_Meta_L ||
|
||||
keyvals[j] == GDK_Meta_R)
|
||||
mask |= EGG_VIRTUAL_META_MASK;
|
||||
else if (keyvals[j] == GDK_Hyper_L ||
|
||||
keyvals[j] == GDK_Hyper_R)
|
||||
mask |= EGG_VIRTUAL_HYPER_MASK;
|
||||
else if (keyvals[j] == GDK_Super_L ||
|
||||
keyvals[j] == GDK_Super_R)
|
||||
mask |= EGG_VIRTUAL_SUPER_MASK;
|
||||
else if (keyvals[j] == GDK_Mode_switch)
|
||||
mask |= EGG_VIRTUAL_MODE_SWITCH_MASK;
|
||||
|
||||
++j;
|
||||
}
|
||||
|
||||
/* Mod1Mask is 1 << 3 for example, i.e. the
|
||||
* fourth modifier, i / keyspermod is the modifier
|
||||
* index
|
||||
*/
|
||||
modmap->mapping[i/xmodmap->max_keypermod] |= mask;
|
||||
|
||||
g_free (keyvals);
|
||||
g_free (keys);
|
||||
|
||||
++i;
|
||||
}
|
||||
|
||||
/* Add in the not-really-virtual fixed entries */
|
||||
modmap->mapping[EGG_MODMAP_ENTRY_SHIFT] |= EGG_VIRTUAL_SHIFT_MASK;
|
||||
modmap->mapping[EGG_MODMAP_ENTRY_CONTROL] |= EGG_VIRTUAL_CONTROL_MASK;
|
||||
modmap->mapping[EGG_MODMAP_ENTRY_LOCK] |= EGG_VIRTUAL_LOCK_MASK;
|
||||
modmap->mapping[EGG_MODMAP_ENTRY_MOD1] |= EGG_VIRTUAL_ALT_MASK;
|
||||
modmap->mapping[EGG_MODMAP_ENTRY_MOD2] |= EGG_VIRTUAL_MOD2_MASK;
|
||||
modmap->mapping[EGG_MODMAP_ENTRY_MOD3] |= EGG_VIRTUAL_MOD3_MASK;
|
||||
modmap->mapping[EGG_MODMAP_ENTRY_MOD4] |= EGG_VIRTUAL_MOD4_MASK;
|
||||
modmap->mapping[EGG_MODMAP_ENTRY_MOD5] |= EGG_VIRTUAL_MOD5_MASK;
|
||||
|
||||
XFreeModifiermap (xmodmap);
|
||||
}
|
||||
|
||||
const EggModmap*
|
||||
egg_keymap_get_modmap (GdkKeymap *keymap)
|
||||
{
|
||||
EggModmap *modmap;
|
||||
|
||||
/* This is all a hack, much simpler when we can just
|
||||
* modify GDK directly.
|
||||
*/
|
||||
|
||||
modmap = g_object_get_data (G_OBJECT (keymap),
|
||||
"egg-modmap");
|
||||
|
||||
if (modmap == NULL)
|
||||
{
|
||||
modmap = g_new0 (EggModmap, 1);
|
||||
|
||||
/* FIXME modify keymap change events with an event filter
|
||||
* and force a reload if we get one
|
||||
*/
|
||||
|
||||
reload_modmap (keymap, modmap);
|
||||
|
||||
g_object_set_data_full (G_OBJECT (keymap),
|
||||
"egg-modmap",
|
||||
modmap,
|
||||
g_free);
|
||||
}
|
||||
|
||||
g_assert (modmap != NULL);
|
||||
|
||||
return modmap;
|
||||
}
|
@@ -1,87 +0,0 @@
|
||||
/* eggaccelerators.h
|
||||
* Copyright (C) 2002 Red Hat, Inc.
|
||||
* Developed by Havoc Pennington
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __EGG_ACCELERATORS_H__
|
||||
#define __EGG_ACCELERATORS_H__
|
||||
|
||||
#include <gtk/gtkaccelgroup.h>
|
||||
#include <gdk/gdk.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/* Where a value is also in GdkModifierType we coincide,
|
||||
* otherwise we don't overlap.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
EGG_VIRTUAL_SHIFT_MASK = 1 << 0,
|
||||
EGG_VIRTUAL_LOCK_MASK = 1 << 1,
|
||||
EGG_VIRTUAL_CONTROL_MASK = 1 << 2,
|
||||
|
||||
EGG_VIRTUAL_ALT_MASK = 1 << 3, /* fixed as Mod1 */
|
||||
|
||||
EGG_VIRTUAL_MOD2_MASK = 1 << 4,
|
||||
EGG_VIRTUAL_MOD3_MASK = 1 << 5,
|
||||
EGG_VIRTUAL_MOD4_MASK = 1 << 6,
|
||||
EGG_VIRTUAL_MOD5_MASK = 1 << 7,
|
||||
|
||||
#if 0
|
||||
GDK_BUTTON1_MASK = 1 << 8,
|
||||
GDK_BUTTON2_MASK = 1 << 9,
|
||||
GDK_BUTTON3_MASK = 1 << 10,
|
||||
GDK_BUTTON4_MASK = 1 << 11,
|
||||
GDK_BUTTON5_MASK = 1 << 12,
|
||||
/* 13, 14 are used by Xkb for the keyboard group */
|
||||
#endif
|
||||
|
||||
EGG_VIRTUAL_META_MASK = 1 << 24,
|
||||
EGG_VIRTUAL_SUPER_MASK = 1 << 25,
|
||||
EGG_VIRTUAL_HYPER_MASK = 1 << 26,
|
||||
EGG_VIRTUAL_MODE_SWITCH_MASK = 1 << 27,
|
||||
EGG_VIRTUAL_NUM_LOCK_MASK = 1 << 28,
|
||||
EGG_VIRTUAL_SCROLL_LOCK_MASK = 1 << 29,
|
||||
|
||||
/* Also in GdkModifierType */
|
||||
EGG_VIRTUAL_RELEASE_MASK = 1 << 30,
|
||||
|
||||
/* 28-31 24-27 20-23 16-19 12-15 8-11 4-7 0-3
|
||||
* 7 f 0 0 0 0 f f
|
||||
*/
|
||||
EGG_VIRTUAL_MODIFIER_MASK = 0x7f0000ff
|
||||
|
||||
} EggVirtualModifierType;
|
||||
|
||||
gboolean egg_accelerator_parse_virtual (const gchar *accelerator,
|
||||
guint *accelerator_key,
|
||||
EggVirtualModifierType *accelerator_mods);
|
||||
void egg_keymap_resolve_virtual_modifiers (GdkKeymap *keymap,
|
||||
EggVirtualModifierType virtual_mods,
|
||||
GdkModifierType *concrete_mods);
|
||||
void egg_keymap_virtualize_modifiers (GdkKeymap *keymap,
|
||||
GdkModifierType concrete_mods,
|
||||
EggVirtualModifierType *virtual_mods);
|
||||
|
||||
gchar* egg_virtual_accelerator_name (guint accelerator_key,
|
||||
EggVirtualModifierType accelerator_mods);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
#endif /* __EGG_ACCELERATORS_H__ */
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user