Compare commits
306 Commits
METACITY_2
...
METACITY_2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
04fcad7c13 | ||
|
|
ebbc4c499b | ||
|
|
3c8b051e31 | ||
|
|
d34e54785d | ||
|
|
51e74d4027 | ||
|
|
2d662f67a5 | ||
|
|
67cbbeb6c1 | ||
|
|
cc7493cac9 | ||
|
|
be96be95f6 | ||
|
|
6b144cd2eb | ||
|
|
38412b4460 | ||
|
|
b8287d3aca | ||
|
|
5eb4eea57e | ||
|
|
af3b5b77b1 | ||
|
|
5f75334d57 | ||
|
|
4481be72d1 | ||
|
|
c595a7ac0f | ||
|
|
fa3de81741 | ||
|
|
6094763def | ||
|
|
4e96dd7ea6 | ||
|
|
6e6e85632a | ||
|
|
6af9a11361 | ||
|
|
8377c7776c | ||
|
|
73cce3b174 | ||
|
|
947adb6d07 | ||
|
|
d0f1f084e8 | ||
|
|
c27d89218c | ||
|
|
15c5ddbec4 | ||
|
|
546679cbd1 | ||
|
|
b54c422b93 | ||
|
|
5049fdc13a | ||
|
|
d8bb7c8ae9 | ||
|
|
61d5423b5d | ||
|
|
d85012ecfd | ||
|
|
fb9ad1eb13 | ||
|
|
8764b89942 | ||
|
|
48bc82e82f | ||
|
|
e8d63890fc | ||
|
|
6ed08019c2 | ||
|
|
00d6f549f9 | ||
|
|
02a491c1bc | ||
|
|
ed25155fc1 | ||
|
|
e65a70ded9 | ||
|
|
3b49b81ff5 | ||
|
|
bdcc6cb20d | ||
|
|
e616f930d3 | ||
|
|
536d51183c | ||
|
|
6a3c1fbe57 | ||
|
|
2cca0f0eac | ||
|
|
cdb4e2541c | ||
|
|
9b03b75aaf | ||
|
|
f5072b7f3a | ||
|
|
b60bb724aa | ||
|
|
7d7f8aab93 | ||
|
|
3b133195fd | ||
|
|
18990530b0 | ||
|
|
b424364710 | ||
|
|
4fb05e54ab | ||
|
|
3ee5ad8b12 | ||
|
|
b73ea5eb0a | ||
|
|
e710d9f1b8 | ||
|
|
ae07c8677d | ||
|
|
2a24562f45 | ||
|
|
b7d27d9114 | ||
|
|
5169a06dd0 | ||
|
|
e868a001f9 | ||
|
|
a8526454b0 | ||
|
|
fabc5507f3 | ||
|
|
82bd20911c | ||
|
|
95d747269b | ||
|
|
d02dbd62e9 | ||
|
|
bcb9de9198 | ||
|
|
3558657e53 | ||
|
|
1187edeadb | ||
|
|
0c684c6f35 | ||
|
|
c1b863ee75 | ||
|
|
8922b0ecc6 | ||
|
|
6cd916ea39 | ||
|
|
4b18f64914 | ||
|
|
1e6a8a31d1 | ||
|
|
9e7a26500c | ||
|
|
5d862ac29b | ||
|
|
25b9a9e37d | ||
|
|
da7918554e | ||
|
|
e45eda148b | ||
|
|
b24308eab1 | ||
|
|
366399eb0c | ||
|
|
25615f929e | ||
|
|
667a056066 | ||
|
|
c2fbb37c8c | ||
|
|
45269e0e2d | ||
|
|
8f7eda43a8 | ||
|
|
339a86150b | ||
|
|
374e5d400d | ||
|
|
0e5727eeb3 | ||
|
|
9073724c2b | ||
|
|
92c8ba0497 | ||
|
|
efb26cb769 | ||
|
|
050e55c9d7 | ||
|
|
e402f41b33 | ||
|
|
859c1e752d | ||
|
|
198398ba88 | ||
|
|
5d2f307735 | ||
|
|
70bd23278b | ||
|
|
76bfdcf038 | ||
|
|
8e14da1759 | ||
|
|
24ecc29f49 | ||
|
|
4a23782f51 | ||
|
|
b619f9baa8 | ||
|
|
878d6df404 | ||
|
|
5e5ebc7914 | ||
|
|
e2155c8fee | ||
|
|
036747fba5 | ||
|
|
a8f93c454a | ||
|
|
aad72e575d | ||
|
|
b799630ba5 | ||
|
|
90748385c2 | ||
|
|
1d22cb8518 | ||
|
|
4832cc6d63 | ||
|
|
f8226bf1bb | ||
|
|
6cfcc01334 | ||
|
|
f8b2f6ca5c | ||
|
|
d9a2207ebe | ||
|
|
1be097628f | ||
|
|
c51a55b0e5 | ||
|
|
f88852cff6 | ||
|
|
8d266f5550 | ||
|
|
b9e86197f2 | ||
|
|
b9e4faa1aa | ||
|
|
625b7a25b0 | ||
|
|
0e6b393896 | ||
|
|
109761e973 | ||
|
|
fd5557f44c | ||
|
|
79d28b4709 | ||
|
|
5cf84e6702 | ||
|
|
f218216a2c | ||
|
|
5f99b61f07 | ||
|
|
a5fa06ebb1 | ||
|
|
a0d3c8e20b | ||
|
|
1ece207400 | ||
|
|
91641c2cf3 | ||
|
|
4045ee474d | ||
|
|
e3b364c055 | ||
|
|
89c31c43ca | ||
|
|
0d1e643e1c | ||
|
|
f6b4f11ebe | ||
|
|
908198c25d | ||
|
|
f4cb740aac | ||
|
|
a2d0235d68 | ||
|
|
bda692174a | ||
|
|
e7e47a8b85 | ||
|
|
32a8bf50b7 | ||
|
|
b0818f97f2 | ||
|
|
ea45e43082 | ||
|
|
1ad94dec1c | ||
|
|
995aef2577 | ||
|
|
5817e204b4 | ||
|
|
50b5a2b8d8 | ||
|
|
8a9a4aba77 | ||
|
|
4ad2d1a048 | ||
|
|
07296490b4 | ||
|
|
d3b2764ff6 | ||
|
|
6c51b8ae6a | ||
|
|
4fdc3667a3 | ||
|
|
fd8c3514d6 | ||
|
|
c2700863ca | ||
|
|
18d32248ab | ||
|
|
d8a59d7cd1 | ||
|
|
4213beea4b | ||
|
|
967777b965 | ||
|
|
ba18c630b7 | ||
|
|
a70fc3259f | ||
|
|
094df1295c | ||
|
|
8db78742c3 | ||
|
|
9c337d0a8f | ||
|
|
e0c8b245ef | ||
|
|
8d314aead8 | ||
|
|
15d28dfd97 | ||
|
|
48b00403b6 | ||
|
|
d78fab02eb | ||
|
|
d275e4bbc2 | ||
|
|
d26ad2c490 | ||
|
|
cef58f676d | ||
|
|
214bcceaea | ||
|
|
5e1439f89e | ||
|
|
eb40c5c2cf | ||
|
|
ba3cf950ba | ||
|
|
d26eb15bff | ||
|
|
aed65de051 | ||
|
|
bf767e8420 | ||
|
|
ad65fda1a8 | ||
|
|
170d3ed121 | ||
|
|
7f1dfffab3 | ||
|
|
40e3058408 | ||
|
|
3e05c7c6c6 | ||
|
|
fd135d0869 | ||
|
|
5452a0ecac | ||
|
|
6557627d8f | ||
|
|
cfa2e165ba | ||
|
|
e9999aa93c | ||
|
|
b8788e9c0d | ||
|
|
60293ee189 | ||
|
|
2541da1d83 | ||
|
|
bd537dcfc6 | ||
|
|
b95dd0574c | ||
|
|
49dca9e5b1 | ||
|
|
02a8fb4a37 | ||
|
|
1a5b861dff | ||
|
|
0970829146 | ||
|
|
3ee131245c | ||
|
|
80a1a8d26b | ||
|
|
d1aaf6a9b1 | ||
|
|
5590e8878b | ||
|
|
de703edfd7 | ||
|
|
772bbb8d91 | ||
|
|
b17b88595e | ||
|
|
e64d1bf881 | ||
|
|
40696052ca | ||
|
|
b567879eac | ||
|
|
0163c58ee1 | ||
|
|
bc3b64f922 | ||
|
|
765cb51df3 | ||
|
|
b56824f650 | ||
|
|
c613fed9ef | ||
|
|
6c18374142 | ||
|
|
a64b868dbd | ||
|
|
cfd2d87fea | ||
|
|
77349f6878 | ||
|
|
5efd276a22 | ||
|
|
373f6de13e | ||
|
|
e0a4c2a1df | ||
|
|
9feebc05c7 | ||
|
|
d7917c02fe | ||
|
|
1d0b5ef660 | ||
|
|
ee84fbb81f | ||
|
|
6a1abc7482 | ||
|
|
7f36a8c7d1 | ||
|
|
d1d7767033 | ||
|
|
18973c23b3 | ||
|
|
93289dc950 | ||
|
|
817c357335 | ||
|
|
f5bf830754 | ||
|
|
b3a1122b2a | ||
|
|
c7d9042e5d | ||
|
|
4512f8317a | ||
|
|
effec94613 | ||
|
|
c9c67387ce | ||
|
|
81089c2d8c | ||
|
|
04c9c3e058 | ||
|
|
4d5cc9d0bb | ||
|
|
0d88e93787 | ||
|
|
5a8af8c2fb | ||
|
|
e8097a6f8f | ||
|
|
cb27f0c4be | ||
|
|
c3a5c4c169 | ||
|
|
bc46b2f0e0 | ||
|
|
ce657d7807 | ||
|
|
9702903343 | ||
|
|
15a05467bd | ||
|
|
0041f49d3f | ||
|
|
0cfb05a661 | ||
|
|
c6b475b251 | ||
|
|
37a1e6f57b | ||
|
|
0c5cacf7cc | ||
|
|
95e5a13131 | ||
|
|
c1a88f5457 | ||
|
|
70b6a57003 | ||
|
|
915c2db3b9 | ||
|
|
eb647577c3 | ||
|
|
1094410ff8 | ||
|
|
6e90c238e8 | ||
|
|
44a63a9911 | ||
|
|
149e8d12cd | ||
|
|
9888f0434d | ||
|
|
370982b812 | ||
|
|
5c5de1c6b3 | ||
|
|
5ba2fa893f | ||
|
|
4eb8a93c83 | ||
|
|
3da0b1c7d9 | ||
|
|
aa62466091 | ||
|
|
337812d51d | ||
|
|
17ac646f70 | ||
|
|
e3cfa163d0 | ||
|
|
9657b6cebe | ||
|
|
90b8a5a20b | ||
|
|
54c50e96e7 | ||
|
|
8c2e8ddf5c | ||
|
|
9740b3f1df | ||
|
|
0c57ebca70 | ||
|
|
ae577d7724 | ||
|
|
82e5cb578c | ||
|
|
4ba0ce89c4 | ||
|
|
0df65b9f9f | ||
|
|
30e3cf5050 | ||
|
|
25ca0e21db | ||
|
|
f08337d939 | ||
|
|
372dc090fd | ||
|
|
81b6316081 | ||
|
|
fc4a0aef0d | ||
|
|
a1bb0e0015 | ||
|
|
b8e5a4d707 | ||
|
|
979392efa5 | ||
|
|
9de7b59e93 | ||
|
|
0388149904 | ||
|
|
7b0cd87838 | ||
|
|
7641c6f952 |
@@ -26,3 +26,5 @@ intl
|
||||
ABOUT-NLS
|
||||
COPYING
|
||||
intltool-*
|
||||
metacity.spec
|
||||
autom4te.cache
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
SUBDIRS=src po
|
||||
SUBDIRS=src po doc
|
||||
|
||||
EXTRA_DIST=HACKING theme-format.txt metacity.spec.in metacity.spec \
|
||||
EXTRA_DIST=HACKING metacity.spec.in metacity.spec \
|
||||
intltool-extract.in intltool-merge.in intltool-update.in
|
||||
|
||||
63
NEWS
63
NEWS
@@ -1 +1,62 @@
|
||||
See README.
|
||||
2.5.0
|
||||
===
|
||||
|
||||
Thanks to Rob Adams, Owen Taylor, Frederic Crozat, Arvind Samptur,
|
||||
Bill Haneman, Akira Tagoh for help with fixes in this release.
|
||||
|
||||
- many new translations
|
||||
- fix an infinite loop while holding a server grab triggered by
|
||||
some recent Qt versions doing weird stuff
|
||||
- fix bug where Alt+rightclick repeatedly on titlebar resulted
|
||||
in zillions of menus
|
||||
- fix Alt+Tab to *actually* put minimized windows at the end,
|
||||
though this was always intended
|
||||
- rewrite size/positions constraint code (currently known
|
||||
to be quite buggy, e.g. xmms is hosed)
|
||||
- enforce size of at least 1x1 on windows
|
||||
- reduce latency of managing new windows still further
|
||||
by using async properties code in more places
|
||||
- don't grab keybindings on docks, so gnome-panel
|
||||
can handle them
|
||||
- suck in the panel's screenshot and run dialog global
|
||||
bindings
|
||||
- lots of improvements to window placement
|
||||
- sync max number of workspaces with pager applet
|
||||
- fix to keep focus when inside window frame in
|
||||
strict mouse focus mode
|
||||
- make it possible to start a reverse tab with
|
||||
shift+alt+tab (vs. alt+tab then shift)
|
||||
- fix a multihead issue with constraints between two
|
||||
windows on different heads
|
||||
- require GTK+ 2.2.0 and fontconfig
|
||||
- default theme is now Simple
|
||||
- add visual bell feature
|
||||
- incorporate many fixes from 2.4.34
|
||||
- other stuff
|
||||
|
||||
2.4.13
|
||||
===
|
||||
|
||||
- we were making all dialogs skip the taskbar, even non-transient
|
||||
ones, though this was supposedly fixed a while ago. Now really
|
||||
fixed.
|
||||
- change back to Alt+click by default for the window drag feature.
|
||||
- assign Alt+F12 to shade window
|
||||
- fix not deleting enough workspaces when the number
|
||||
was reduced via the pager config dialog (readams@hmc.edu)
|
||||
- don't allow windows under the top panel ever, even if they
|
||||
are tall windows (Arvind)
|
||||
- fix up the window layout for directional workspace nav,
|
||||
so you always stop at the edges and always end up
|
||||
where you expect (hp, with tweaks from readams@hmc.edu)
|
||||
- focus new windows in mouse focus mode (readams@hmc.edu)
|
||||
- support xeyes, oclock, etc. by applying shape mask
|
||||
to the window manager frame (yeah it resizes slow, deal)
|
||||
- fix vertical/horizontal maximize
|
||||
- handle crossing events resizing for more opaque resize goodness
|
||||
(Soeren)
|
||||
- add wacky _METACITY_UPDATE_COUNTER experimental extension
|
||||
to do nice opaque resizing (does nothing without a GTK patch)
|
||||
- fix a crash setting workspace names
|
||||
- fix internationalized WM_NAME reading
|
||||
|
||||
|
||||
300
README
300
README
@@ -9,12 +9,23 @@ your petty hangups about version numbers.
|
||||
COMPILING METACITY
|
||||
===
|
||||
|
||||
You need GTK+ 2.0, ideally the latest in the 2.0.x series.
|
||||
You need GTK+ 2.0, ideally the latest in the 2.0.x series. For
|
||||
multihead/Xinerama support to work, you need GTK+ 2.2. For
|
||||
startup notification to work you need libstartup-notification at
|
||||
http://www.freedesktop.org/software/startup-notification/ or on the
|
||||
GNOME ftp site. You also need GConf 1.2 (unless building a funky
|
||||
extra-small embedded metacity with --disable-gconf).
|
||||
|
||||
REPORTING BUGS AND SUBMITTING PATCHES
|
||||
===
|
||||
|
||||
Report new bugs on http://bugzilla.gnome.org.
|
||||
Report new bugs on http://bugzilla.gnome.org. Please check for
|
||||
duplicates, *especially* if you are reporting a feature request.
|
||||
|
||||
Please do *not* add "me too!" or "yes I really want this!" comments to
|
||||
feature requests in bugzilla. Please read
|
||||
http://pobox.com/~hp/features.html prior to adding any kind of flame
|
||||
about missing features or misfeatures.
|
||||
|
||||
Feel free to send patches too; Metacity is relatively small and
|
||||
simple, so if you find a bug or want to add a feature it should be
|
||||
@@ -22,6 +33,39 @@ pretty easy. Send me mail, or put the patch in bugzilla.
|
||||
|
||||
See the HACKING file for some notes on hacking Metacity.
|
||||
|
||||
SHRINKING METACITY
|
||||
===
|
||||
|
||||
Not that metacity is huge (<400K binary last I checked), but about
|
||||
half of that is in the preferences handling, in static strings that
|
||||
aren't essential, and in the theme engine.
|
||||
|
||||
You can strip about 70K from the metacity binary by compiling with
|
||||
options such as:
|
||||
|
||||
--disable-gconf
|
||||
--disable-sm
|
||||
--disable-verbose
|
||||
--disable-startup-notification
|
||||
|
||||
However the result is no good for desktop use, all prefs have to be
|
||||
hardcoded in the binary, for example. If you wanted to make a really
|
||||
small metacity, here's some additional stuff you might consider
|
||||
implementing:
|
||||
|
||||
- add --disable-themes, which would replace theme.c and theme-parser.c
|
||||
with a hardcoded implementation of the interface in theme.h,
|
||||
should save about 80K. This should be fairly easy.
|
||||
|
||||
- add --disable-gtk, which would implement the interface in ui.h
|
||||
without using GTK. This one is easier than you think because the
|
||||
main part of the window manager doesn't use GTK directly, but is
|
||||
still fairly hard to do. You would probably have to give up some
|
||||
of the features, such as window menus, as menus are pretty complex
|
||||
to implement well. So time may be better spent adding a GTK
|
||||
configure script feature to build GTK with only a small core set of
|
||||
functionality.
|
||||
|
||||
METACITY FEATURES
|
||||
===
|
||||
|
||||
@@ -31,8 +75,22 @@ METACITY FEATURES
|
||||
- Uses GTK+ 2.0 for drawing window frames. This means colors, fonts,
|
||||
etc. come from GTK+ theme.
|
||||
|
||||
- Does not expose the concept of "window manager" to the user. Some
|
||||
of the features in the GNOME control panel and other parts of the
|
||||
desktop happen to be implemented in metacity, such as changing your
|
||||
window border theme, or changing your window navigation shortcuts,
|
||||
but the user doesn't need to know this.
|
||||
|
||||
- Includes only the window manager; does not try to be a desktop
|
||||
environment. The pager, configuration, etc. are all separate and
|
||||
modular. The "libwnck" library (which I also wrote) is available
|
||||
for writing metacity extensions, pagers, and so on. (But libwnck
|
||||
isn't metacity specific, or GNOME-dependent; it requires only GTK,
|
||||
and should work with KWin, fvwm2, and other EWMH-compliant WMs.)
|
||||
|
||||
- Has a simple theme system and a couple of extra themes come with it.
|
||||
Change themes via gconf-editor or gconftool:
|
||||
Change themes via gconf-editor or gconftool or GNOME themes control
|
||||
panel:
|
||||
gconftool-2 --type=string --set /apps/metacity/general/theme Crux
|
||||
gconftool-2 --type=string --set /apps/metacity/general/theme Gorilla
|
||||
gconftool-2 --type=string --set /apps/metacity/general/theme Atlanta
|
||||
@@ -51,7 +109,7 @@ METACITY FEATURES
|
||||
gconftool-2 --type=string --set /apps/metacity/general/focus_mode sloppy
|
||||
gconftool-2 --type=string --set /apps/metacity/general/focus_mode click
|
||||
|
||||
- Global keybinding defaults:
|
||||
- Global keybinding defaults include:
|
||||
|
||||
Alt-Tab forward cycle window focus
|
||||
Alt-Shift-Tab backward cycle focus
|
||||
@@ -66,7 +124,10 @@ METACITY FEATURES
|
||||
|
||||
unst gconftool-2 --type=string --set /apps/metacity/global_keybindings/switch_to_workspace_1 '<Alt>F1'
|
||||
|
||||
See metacity.schemas for available bindings.
|
||||
Also try the GNOME keyboard shortcuts control panel, or
|
||||
gconf-editor.
|
||||
|
||||
See metacity.schemas for all available bindings.
|
||||
|
||||
- Window keybindings:
|
||||
|
||||
@@ -83,8 +144,9 @@ METACITY FEATURES
|
||||
Choose Resize from menu, and nothing happens yet, but
|
||||
eventually I might implement something.
|
||||
|
||||
Keybindings for things like maximize window, etc. can be bound,
|
||||
but don't exist by default. See metacity.schemas.
|
||||
Keybindings for things like maximize window, vertical maximize,
|
||||
etc. can be bound, but may not all exist by default. See
|
||||
metacity.schemas.
|
||||
|
||||
- Window mouse bindings:
|
||||
|
||||
@@ -99,11 +161,15 @@ METACITY FEATURES
|
||||
If you click and drag the titlebar with button 1 it moves the
|
||||
window.
|
||||
|
||||
If you click anywhere on the frame with button 2 it lowers the
|
||||
window.
|
||||
|
||||
If you click anywhere on the frame with button 3 it shows the
|
||||
window menu.
|
||||
|
||||
If you hold down Alt and click inside a window, it will move the
|
||||
window (buttons 1 and 2) or show menu (button 3).
|
||||
If you hold down Super (windows key) and click inside a window, it
|
||||
will move the window (buttons 1 and 2) or show menu (button 3).
|
||||
Or you can configure a different modifier for this.
|
||||
|
||||
If you pick up a window with button 1 and then switch workspaces
|
||||
the window will come with you to the new workspace, this is
|
||||
@@ -119,9 +185,10 @@ METACITY FEATURES
|
||||
for session-aware applications.
|
||||
|
||||
- Metacity implements much of the new window manager spec from
|
||||
freedesktop.org, and much of the ICCCM. But then there are
|
||||
parts of each that it doesn't implement, just because I haven't
|
||||
yet.
|
||||
freedesktop.org
|
||||
(http://www.freedesktop.org/standards/wm-spec.html), and much of
|
||||
the ICCCM. But then there are parts of each that it doesn't
|
||||
implement, just because I haven't yet.
|
||||
|
||||
- Uses Pango to render text, so has cool i18n capabilities.
|
||||
Supports UTF-8 window titles and such.
|
||||
@@ -144,80 +211,83 @@ METACITY FEATURES
|
||||
|
||||
- does basic colormap handling
|
||||
|
||||
- and much more! well, maybe not a lot more.
|
||||
|
||||
HOW TO ADD EXTERNAL FEATURES
|
||||
===
|
||||
|
||||
You can write a metacity "plugin" such as a pager, window list, icon
|
||||
box, task menu, or even things like "window matching" using the
|
||||
Extended Window Manager Hints. See http://www.freedesktop.org for the
|
||||
EWMH specification. An easy-to-use library called "libwnck" is
|
||||
available that uses the EWMH and is specifically designed for writing
|
||||
WM accessories.
|
||||
|
||||
You might be interested in existing accessories such as "Devil's Pie"
|
||||
by Ross Burton, which add features to Metacity (or other
|
||||
EWMH-compliant WMs).
|
||||
|
||||
METACITY BUGS, NON-FEATURES, AND CAVEATS
|
||||
===
|
||||
|
||||
- You need an EWMH-spec compliant pager/tasklist to be able
|
||||
to navigate graphically; this does NOT include GNOME 1.x,
|
||||
but should include GNOME 2 and KDE 3.
|
||||
|
||||
- doesn't do WM_COLORMAPS from the ICCCM, may matter on some really
|
||||
old obscure hardware with some really obscure apps.
|
||||
|
||||
- There are probably other ICCCM-compliance issues.
|
||||
|
||||
- The first-fit algorithm for placement isn't very clever.
|
||||
|
||||
- Should Metacity support flipping in right-to-left locales?
|
||||
I don't know what window managers look like in a right-to-left
|
||||
locale. I assume the window titles should be right-justified;
|
||||
should the window controls also be flipped?
|
||||
See bugzilla: http://bugzilla.gnome.org/query.cgi
|
||||
|
||||
FAQ
|
||||
===
|
||||
|
||||
Q: Will you add my feature?
|
||||
|
||||
A: If it makes sense to turn on unconditionally,
|
||||
or is genuinely a harmless preference that I would not
|
||||
be embarrassed to put in a simple, uncluttered, user-friendly
|
||||
configuration dialog.
|
||||
A: If it makes sense to turn on unconditionally, or is genuinely a
|
||||
harmless preference that I would not be embarrassed to put in a
|
||||
simple, uncluttered, user-friendly configuration dialog.
|
||||
|
||||
If the only rationale for your feature is that other window
|
||||
managers have it, or that you are personally used to it, or something
|
||||
like that, then I will not be impressed. Metacity is firmly in the
|
||||
"choose good defaults" camp rather than the "offer 6 equally broken
|
||||
ways to do it, and let the user pick one" camp.
|
||||
managers have it, or that you are personally used to it, or
|
||||
something like that, then I will not be impressed. Metacity is
|
||||
firmly in the "choose good defaults" camp rather than the "offer 6
|
||||
equally broken ways to do it, and let the user pick one" camp.
|
||||
|
||||
This is part of a "no crackrock" policy, despite some exceptions
|
||||
I'm mildly embarrassed about. For example, multiple workspaces
|
||||
probably constitute crackrock, they confuse most users
|
||||
and really are not that useful if you have a decent tasklist and
|
||||
so on. But I am too used to them to turn them off.
|
||||
Or alternatively iconification/tasklist is crack, and workspaces/pager
|
||||
are good. But having both is certainly a bit wrong.
|
||||
Sloppy focus is probably crackrock too.
|
||||
probably constitute crackrock, they confuse most users and really
|
||||
are not that useful if you have a decent tasklist and so on. But I
|
||||
am too used to them to turn them off. Or alternatively
|
||||
iconification/tasklist is crack, and workspaces/pager are good. But
|
||||
having both is certainly a bit wrong. Sloppy focus is probably
|
||||
crackrock too.
|
||||
|
||||
But don't think unlimited crack is OK just because I slipped up a
|
||||
little. No slippery slope here.
|
||||
little. No slippery slope here.
|
||||
|
||||
Don't let this discourage patches and fixes - I love those. ;-)
|
||||
Just be prepared to hear the above objections if your patch
|
||||
adds some crack-ridden configuration option.
|
||||
Just be prepared to hear the above objections if your patch adds
|
||||
some crack-ridden configuration option.
|
||||
|
||||
http://pobox.com/~hp/free-software-ui.html
|
||||
http://pobox.com/~hp/features.html
|
||||
|
||||
Q: Will Metacity be part of GNOME?
|
||||
|
||||
A: Many people are now asking for this, though it was not the original
|
||||
plan - Metacity started out as sort of an experiment.
|
||||
|
||||
A decision hasn't really been made but the issue will probably
|
||||
be raised shortly after the GNOME 2 release.
|
||||
A: It is officially part of GNOME as of GNOME 2.2. Prior to that,
|
||||
it was unofficially shipped as the default GNOME WM by several
|
||||
OS vendors.
|
||||
|
||||
Q: Is Metacity a Red Hat project?
|
||||
|
||||
A: Metacity is in no way funded, endorsed, or encouraged by Red Hat,
|
||||
Inc. - I'm guessing Red Hat would not consider "insufficient number
|
||||
of window managers for Linux" an urgent problem. Just a wild guess
|
||||
though.
|
||||
A: Metacity's original creation was in no way funded, endorsed, or
|
||||
encouraged by Red Hat, Inc. - I'm guessing Red Hat would not
|
||||
consider "insufficient number of window managers for Linux" an
|
||||
urgent problem. Just a wild guess though.
|
||||
|
||||
Now that metacity is the default WM however, Red Hat supports some
|
||||
bugfixing and other work.
|
||||
|
||||
Q: Why does Metacity remember the workspace/position of some apps
|
||||
but not others?
|
||||
but not others across logout/login?
|
||||
|
||||
A: Metacity only stores sizes/positions for apps that are session
|
||||
managed. As far as I can determine, there is no way to attempt
|
||||
to remember workspace/position for non-session-aware apps without
|
||||
A: Metacity only stores sizes/positions for apps that are session
|
||||
managed. As far as I can determine, there is no way to attempt to
|
||||
remember workspace/position for non-session-aware apps without
|
||||
causing a lot of weird effects.
|
||||
|
||||
The reason is that you don't know which non-SM-aware apps were
|
||||
@@ -270,6 +340,120 @@ A: I could conceivably be convinced to use viewports _instead_ of
|
||||
features traditionally associated with either kind if those
|
||||
features make sense.
|
||||
|
||||
Q: Why is the panel always on top?
|
||||
|
||||
A: Because it's a better user interface, and until we made this not
|
||||
configurable a bunch of apps were not getting fixed (the app
|
||||
authors were just saying "put your panel on the bottom" instead of
|
||||
properly supporting fullscreen mode, and such).
|
||||
|
||||
rationales.txt has the bugzilla URL for some flamefesting on this,
|
||||
if you want to go back and relive the glory.
|
||||
Read these and the bugzilla stuff before asking/commenting:
|
||||
http://pobox.com/~hp/free-software-ui.html
|
||||
http://pobox.com/~hp/features.html
|
||||
|
||||
Q: Why is there no edge flipping?
|
||||
|
||||
A: This one is also in rationales.txt. Because "ouija board" UI, where
|
||||
you just move the mouse around and the computer guesses what you
|
||||
mean, has a lot of issues. This includes mouse focus, shade-hover
|
||||
mode, edge flipping, autoraise, etc. Metacity has mouse focus and
|
||||
autoraise as a compromise, but these features are all confusing for
|
||||
many users, and cause problems with accessibility, fitt's law, and
|
||||
so on.
|
||||
|
||||
Read these and the bugzilla stuff before asking/commenting:
|
||||
http://pobox.com/~hp/free-software-ui.html
|
||||
http://pobox.com/~hp/features.html
|
||||
|
||||
Q: Why no wireframe move/resize?
|
||||
|
||||
A: Also in rationales.txt. Because it has low usability, and is a pain
|
||||
to implement, and there's no reason opaque move/resize should be a
|
||||
problem on any setup that can run a modern desktop worth a darn to
|
||||
begin with.
|
||||
|
||||
Read these and the bugzilla stuff before asking/commenting:
|
||||
http://pobox.com/~hp/free-software-ui.html
|
||||
http://pobox.com/~hp/features.html
|
||||
|
||||
Q: Why no XYZ?
|
||||
|
||||
A: You are probably getting the idea by now - check rationales.txt,
|
||||
query/search bugzilla, and read http://pobox.com/~hp/features.html
|
||||
and http://pobox.com/~hp/free-software-ui.html
|
||||
|
||||
Then sit down and answer the question for yourself. Is the feature
|
||||
good? What's the rationale for it? Answer "why" not just "why not."
|
||||
Justify in terms of users as a whole, not just users like
|
||||
yourself. How else can you solve the same problem? etc. If that
|
||||
leads you to a strong opinion, then please, post the rationale for
|
||||
discussion to an appropriate bugzilla bug, or to
|
||||
usability@gnome.org.
|
||||
|
||||
Please don't just "me too!" on bugzilla bugs, please don't think
|
||||
flames will get you anywhere, and please don't repeat rationale
|
||||
that's already been offered.
|
||||
|
||||
Q: Your dumb web pages you made me read talk about solving problems in
|
||||
fundamental ways instead of adding preferences or workarounds.
|
||||
What are some examples where metacity has done this?
|
||||
|
||||
A: There are quite a few, though many opportunities remain. Sometimes
|
||||
the real fix involves application changes. The metacity approach is
|
||||
that it's OK to require apps to change, though there are also
|
||||
plenty of workarounds in metacity for battles considered too hard
|
||||
to fight.
|
||||
|
||||
Here are some examples:
|
||||
|
||||
- fullscreen mode was introduced to allow position constraints,
|
||||
panel-on-top, and other such things to apply to normal windows
|
||||
while still allowing video players etc. to "just work"
|
||||
|
||||
- "whether to include minimized windows in Alt+Tab" was solved
|
||||
by putting minimized windows at the *end* of the tab order.
|
||||
|
||||
- Whether to pop up a feedback display during Alt+Tab was solved by
|
||||
having both Alt+Tab and Alt+Esc
|
||||
|
||||
- Whether to have a "kill" feature was solved by automatically
|
||||
detecting and offering to kill stuck apps. Better, metacity
|
||||
actually does "kill -9" on the process, it doesn't just
|
||||
disconnect the process from the X server. You'll appreciate this
|
||||
if you ever did a "kill" on Netscape 4, and watched it keep
|
||||
eating 100% CPU even though the X server had booted it.
|
||||
|
||||
- The workspaces vs. viewports mess was avoided by adding
|
||||
directional navigation and such to workspaces, see discussion
|
||||
earlier in this file.
|
||||
|
||||
- Instead of configurable placement algorithms, there's just one
|
||||
that works fairly well most of the time.
|
||||
|
||||
- To avoid excess CPU use during opaque move/resize, we rate limit
|
||||
the updates to the application window's size.
|
||||
|
||||
- Instead of configurable "show size of window while resizing,"
|
||||
it's only shown for windows where it matters, such as terminals.
|
||||
(Only use-case given for all windows is for web designers
|
||||
choosing their web browser size, but there are web sites and
|
||||
desktop backgrounds that do this for you.)
|
||||
|
||||
- Using startup notification, applications open on the workspace
|
||||
where you launched them, not the active workspace when their
|
||||
window is opened.
|
||||
|
||||
- and much more.
|
||||
|
||||
Q: I think metacity sucks.
|
||||
|
||||
A: Feel free to use any WM you like. The reason metacity follows the
|
||||
ICCCM and EWMH specifications is that it makes metacity a modular,
|
||||
interchangeable part in the desktop. libwnck-based apps such as the
|
||||
GNOME window list will work just fine with any EWMH-compliant WM.
|
||||
|
||||
Q: Did you spend a lot of time on this?
|
||||
|
||||
A: Originally the answer was no. Sadly the answer is now yes.
|
||||
@@ -278,5 +462,3 @@ Q: How can you claim that you are anti-crack, while still
|
||||
writing a window manager?
|
||||
|
||||
A: I have no comment on that.
|
||||
|
||||
|
||||
|
||||
16
acconfig.h
16
acconfig.h
@@ -1,16 +0,0 @@
|
||||
#undef PACKAGE
|
||||
#undef VERSION
|
||||
#undef HAVE_CATGETS
|
||||
#undef HAVE_GETTEXT
|
||||
#undef HAVE_LC_MESSAGES
|
||||
#undef HAVE_STPCPY
|
||||
#undef ENABLE_NLS
|
||||
#undef HAVE_PTHREAD_H
|
||||
#undef GETTEXT_PACKAGE
|
||||
#undef HAVE_SHAPE_EXT
|
||||
#undef HAVE_XFT
|
||||
#undef HAVE_SM
|
||||
#undef HAVE_XINERAMA
|
||||
#undef HAVE_SOLARIS_XINERAMA
|
||||
#undef HAVE_XFREE_XINERAMA
|
||||
#undef HAVE_SHAPE
|
||||
@@ -46,6 +46,7 @@ ACLOCAL=aclocal-1.4
|
||||
}
|
||||
}
|
||||
|
||||
CONFIGURE=configure.in
|
||||
if grep "^AM_[A-Z0-9_]\{1,\}_GETTEXT" "$CONFIGURE" >/dev/null; then
|
||||
if grep "sed.*POTFILES" "$CONFIGURE" >/dev/null; then
|
||||
GETTEXTIZE=""
|
||||
|
||||
237
configure.in
237
configure.in
@@ -1,16 +1,18 @@
|
||||
AC_PREREQ(2.50)
|
||||
AC_INIT(src/display.c)
|
||||
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
# 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987
|
||||
AM_INIT_AUTOMAKE(metacity, 2.4.2)
|
||||
# releases on a branch add a 4th version like 2.4.21.1
|
||||
AM_INIT_AUTOMAKE(metacity, 2.5.0)
|
||||
|
||||
# Honor aclocal flags
|
||||
ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
|
||||
|
||||
GETTEXT_PACKAGE=metacity
|
||||
AC_SUBST(GETTEXT_PACKAGE)
|
||||
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE")
|
||||
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Name of default gettext domain])
|
||||
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
@@ -18,7 +20,6 @@ AC_PROG_INTLTOOL([0.21])
|
||||
AC_PROG_CC
|
||||
AC_ISC_POSIX
|
||||
AC_HEADER_STDC
|
||||
AC_ARG_PROGRAM
|
||||
AM_PROG_LIBTOOL
|
||||
|
||||
changequote(,)dnl
|
||||
@@ -82,24 +83,84 @@ if test "x$GCC" = "xyes"; then
|
||||
fi
|
||||
changequote([,])dnl
|
||||
|
||||
METACITY_PC_MODULES='gtk+-2.0 >= 2.2.0 pango >= 1.2.0'
|
||||
|
||||
AC_ARG_ENABLE(config-dialog, [ --enable-config-dialog enable the config dialog that you need with GNOME 2.0 (obsolete with GNOME 2.2)],,enable_config_dialog=no)
|
||||
|
||||
AM_CONDITIONAL(BUILD_CONFIG_DIALOG, test x$enable_config_dialog = xyes)
|
||||
if test x$enable_config_dialog = xyes; then
|
||||
AC_DEFINE(BUILD_CONFIG_DIALOG,1,[Build configuration dialog])
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(gconf, [ --disable-gconf disable gconf usage, for embedded/size-sensitive non-GNOME builds],,enable_gconf=yes)
|
||||
|
||||
if test x$enable_gconf = xyes; then
|
||||
AC_DEFINE(HAVE_GCONF,1,[Build with gconf support])
|
||||
METACITY_PC_MODULES="$METACITY_PC_MODULES gconf-2.0 >= 1.2.0"
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(verbose-mode, [ --disable-verbose disable metacity's ability to do verbose logging, for embedded/size-sensitive custom builds],,enable_verbose_mode=yes)
|
||||
|
||||
if test x$enable_verbose_mode = xyes; then
|
||||
AC_DEFINE(WITH_VERBOSE_MODE,1,[Build with verbose mode support])
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(sm, [ --disable-sm disable metacity's session management support, for embedded/size-sensitive custom non-GNOME builds],,enable_sm=auto)
|
||||
|
||||
AC_ARG_ENABLE(startup-notification, [ --disable-startup-notification disable metacity's startup notification support, for embedded/size-sensitive custom non-GNOME builds],,enable_startup_notification=auto)
|
||||
|
||||
AC_ARG_ENABLE(xsync, [ --disable-xsync disable metacity's use of the XSync extension],,enable_xsync=auto)
|
||||
|
||||
AC_ARG_ENABLE(shape, [ --disable-shape disable metacity's use of the shaped window extension],,enable_shape=auto)
|
||||
|
||||
## try definining HAVE_BACKTRACE
|
||||
AC_CHECK_HEADERS(execinfo.h, [AC_CHECK_FUNCS(backtrace)])
|
||||
|
||||
|
||||
ALL_LINGUAS="az ca cs da de el es fr gl it ja ko lv ms no pl pt pt_BR ro ru sk sv tr uk vi zh_CN zh_TW"
|
||||
ALL_LINGUAS="am az be bg ca cs da de el en_GB es fa fi fr ga gl he hu it ja ko lv mk ml mn ms nl no pl pt pt_BR ro ru sl sk sv tr uk vi zh_CN zh_TW"
|
||||
AM_GLIB_GNU_GETTEXT
|
||||
|
||||
## here we get the flags we'll actually use
|
||||
PKG_CHECK_MODULES(METACITY, gtk+-2.0 >= 2.0.0 gconf-2.0 >= 1.1.9)
|
||||
PKG_CHECK_MODULES(METACITY_MESSAGE, gtk+-2.0 >= 2.0.0)
|
||||
PKG_CHECK_MODULES(METACITY_WINDOW_DEMO, gtk+-2.0 >= 2.0.0)
|
||||
PKG_CHECK_MODULES(METACITY_PROPS, gtk+-2.0 >= 2.0.0 gconf-2.0 >= 1.1.9 libglade-2.0)
|
||||
PKG_CHECK_MODULES(METACITY_MESSAGE, gtk+-2.0 >= 2.2.0)
|
||||
PKG_CHECK_MODULES(METACITY_WINDOW_DEMO, gtk+-2.0 >= 2.2.0)
|
||||
|
||||
if $PKG_CONFIG --atleast-version 2.1.0 gtk+-2.0; then
|
||||
AC_DEFINE(HAVE_GTK_MULTIHEAD,,[gtk+ with multihead support found])
|
||||
if test x$enable_config_dialog = xyes; then
|
||||
PKG_CHECK_MODULES(METACITY_PROPS, gtk+-2.0 >= 2.2.0 gconf-2.0 >= 1.1.9 libglade-2.0)
|
||||
fi
|
||||
|
||||
if $PKG_CONFIG --atleast-version 1.2.0 pangoxft; then
|
||||
echo "pangoxft found"
|
||||
else
|
||||
AC_MSG_ERROR("Pango 1.2.0 or greater based on Xft2 is required")
|
||||
fi
|
||||
|
||||
STARTUP_NOTIFICATION_VERSION=0.4
|
||||
AC_MSG_CHECKING([Startup notification library >= $STARTUP_NOTIFICATION_VERSION])
|
||||
if $PKG_CONFIG --atleast-version $STARTUP_NOTIFICATION_VERSION libstartup-notification-1.0; then
|
||||
have_startup_notification=yes
|
||||
else
|
||||
have_startup_notification=no
|
||||
fi
|
||||
AC_MSG_RESULT($have_startup_notification)
|
||||
|
||||
if test x$enable_startup_notification = xyes; then
|
||||
have_startup_notification=yes
|
||||
echo "startup-notification support forced on"
|
||||
elif test x$enable_startup_notification = xauto; then
|
||||
true
|
||||
else
|
||||
have_startup_notification=no
|
||||
fi
|
||||
|
||||
if test x$have_startup_notification = xyes; then
|
||||
echo "Building with libstartup-notification"
|
||||
METACITY_PC_MODULES="$METACITY_PC_MODULES libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION"
|
||||
AC_DEFINE(HAVE_STARTUP_NOTIFICATION, , [Building with startup notification support])
|
||||
else
|
||||
echo "Building without libstartup-notification"
|
||||
fi
|
||||
|
||||
PKG_CHECK_MODULES(METACITY, $METACITY_PC_MODULES)
|
||||
|
||||
AC_PATH_XTRA
|
||||
|
||||
ALL_X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
|
||||
@@ -108,6 +169,8 @@ ALL_X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
|
||||
metacity_save_cppflags="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
|
||||
|
||||
use_solaris_xinerama=no
|
||||
use_xfree_xinerama=no
|
||||
case "$host" in
|
||||
*-*-solaris*)
|
||||
# Check for solaris
|
||||
@@ -120,8 +183,8 @@ case "$host" in
|
||||
if test -z "`echo $ALL_X_LIBS | grep "\-lXext" 2> /dev/null`"; then
|
||||
X_EXTRA_LIBS="-lXext $X_EXTRA_LIBS"
|
||||
fi
|
||||
AC_DEFINE(HAVE_SOLARIS_XINERAMA)
|
||||
AC_DEFINE(HAVE_XINERAMA),
|
||||
AC_DEFINE(HAVE_SOLARIS_XINERAMA, , [Have Solaris-style Xinerama])
|
||||
AC_DEFINE(HAVE_XINERAMA, , [Have some version of Xinerama]),
|
||||
use_solaris_xinerama=no,
|
||||
[#include <X11/Xlib.h>])
|
||||
fi
|
||||
@@ -137,8 +200,8 @@ case "$host" in
|
||||
if test -z "`echo $ALL_X_LIBS | grep "\-lXext" 2> /dev/null`"; then
|
||||
X_EXTRA_LIBS="-lXext $X_EXTRA_LIBS"
|
||||
fi
|
||||
AC_DEFINE(HAVE_XFREE_XINERAMA)
|
||||
AC_DEFINE(HAVE_XINERAMA),
|
||||
AC_DEFINE(HAVE_XFREE_XINERAMA, , [Have XFree86-style Xinerama])
|
||||
AC_DEFINE(HAVE_XINERAMA,, [Have some version of Xinerama]),
|
||||
use_xfree_xinerama=no,
|
||||
[#include <X11/Xlib.h>])],
|
||||
use_xfree_xinerama=no, -lXext $ALL_X_LIBS)
|
||||
@@ -150,41 +213,108 @@ esac
|
||||
CPPFLAGS="$metacity_save_cppflags"
|
||||
|
||||
SHAPE_LIBS=
|
||||
found_shape=false
|
||||
found_shape=no
|
||||
AC_CHECK_LIB(Xext, XShapeQueryExtension,
|
||||
[AC_CHECK_HEADERS(X11/extensions/shape.h,
|
||||
SHAPE_LIBS=-lXext found_shape=true)],
|
||||
[AC_CHECK_HEADER(X11/extensions/shape.h,
|
||||
SHAPE_LIBS=-lXext found_shape=yes)],
|
||||
, $ALL_X_LIBS)
|
||||
|
||||
if test "$found_shape" = "true"; then
|
||||
AC_DEFINE(HAVE_SHAPE)
|
||||
if test x$enable_shape = xno; then
|
||||
found_shape=no
|
||||
fi
|
||||
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
if test x$enable_shape = xyes; then
|
||||
if test "$found_shape" = "no"; then
|
||||
AC_MSG_ERROR([--enable-shape forced and Shape not found])
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
METACITY_LIBS="$SHAPE_LIBS $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $METACITY_LIBS"
|
||||
if test "x$found_shape" = "xyes"; then
|
||||
AC_DEFINE(HAVE_SHAPE, , [Have the shape extension library])
|
||||
fi
|
||||
|
||||
found_xkb=no
|
||||
AC_CHECK_LIB(X11, XkbQueryExtension,
|
||||
[AC_CHECK_HEADER(X11/XKBlib.h,
|
||||
found_xkb=yes)],
|
||||
, $ALL_X_LIBS)
|
||||
|
||||
if test "x$found_xkb" = "xyes"; then
|
||||
AC_DEFINE(HAVE_XKB, , [Have keyboard extension library])
|
||||
fi
|
||||
|
||||
|
||||
RANDR_LIBS=
|
||||
found_randr=no
|
||||
AC_CHECK_LIB(Xrandr, XRRUpdateConfiguration,
|
||||
[AC_CHECK_HEADER(X11/extensions/Xrandr.h,
|
||||
RANDR_LIBS=-lXrandr found_randr=yes,,
|
||||
[#include <X11/Xlib.h>])],
|
||||
, -lXrender $ALL_X_LIBS)
|
||||
|
||||
if test "x$found_randr" = "xyes"; then
|
||||
AC_DEFINE(HAVE_RANDR, , [Have the Xrandr extension library])
|
||||
fi
|
||||
|
||||
XSYNC_LIBS=
|
||||
found_xsync=no
|
||||
AC_CHECK_LIB(Xext, XSyncQueryExtension,
|
||||
[AC_CHECK_HEADER(X11/extensions/sync.h,
|
||||
found_xsync=yes,,
|
||||
[#include <X11/Xlib.h>])],
|
||||
, $ALL_X_LIBS)
|
||||
|
||||
if test x$enable_xsync = xno; then
|
||||
found_xsync=no
|
||||
fi
|
||||
|
||||
if test x$enable_xsync = xyes; then
|
||||
if test "$found_xsync" = "no"; then
|
||||
AC_MSG_ERROR([--enable-xsync forced and XSync not found])
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$found_xsync" = "xyes"; then
|
||||
XSYNC_LIBS=-lXext
|
||||
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"
|
||||
|
||||
found_sm=false
|
||||
found_sm=no
|
||||
case "$METACITY_LIBS" in
|
||||
*-lSM*)
|
||||
found_sm=true
|
||||
found_sm=yes
|
||||
;;
|
||||
*)
|
||||
AC_CHECK_LIB(SM, SmcSaveYourselfDone,
|
||||
[AC_CHECK_HEADERS(X11/SM/SMlib.h,
|
||||
METACITY_LIBS="-lSM -lICE $METACITY_LIBS" found_sm=true)],
|
||||
METACITY_LIBS="-lSM -lICE $METACITY_LIBS" found_sm=no)],
|
||||
, $METACITY_LIBS)
|
||||
;;
|
||||
esac
|
||||
|
||||
if test "$found_sm" = "true"; then
|
||||
AC_DEFINE(HAVE_SM)
|
||||
if test x$enable_sm = xno; then
|
||||
found_sm=no
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(HAVE_SM, test "$found_sm" = "true")
|
||||
if test x$enable_sm = xyes; then
|
||||
if test "$found_sm" = "no"; then
|
||||
AC_MSG_ERROR([--enable-sm forced and -lSM not found])
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$found_sm" = "yes"; then
|
||||
AC_DEFINE(HAVE_SM, , [Building with SM support])
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(HAVE_SM, test "$found_sm" = "yes")
|
||||
|
||||
HOST_ALIAS=$host_alias
|
||||
AC_SUBST(HOST_ALIAS)
|
||||
@@ -203,20 +333,61 @@ LDFLAGS="$METACITY_LIBS $LDFLAGS"
|
||||
AC_CHECK_FUNCS(gdk_pixbuf_new_from_stream)
|
||||
LDFLAGS=$save_LDFLAGS
|
||||
|
||||
AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
|
||||
if test x$enable_gconf = xyes; then
|
||||
AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
|
||||
if test x"$GCONFTOOL" = xno; then
|
||||
AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
|
||||
fi
|
||||
|
||||
if test x"$GCONFTOOL" = xno; then
|
||||
AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
|
||||
AM_GCONF_SOURCE_2
|
||||
fi
|
||||
|
||||
AM_GCONF_SOURCE_2
|
||||
|
||||
AC_OUTPUT([
|
||||
Makefile
|
||||
doc/Makefile
|
||||
src/Makefile
|
||||
src/wm-tester/Makefile
|
||||
src/libmetacity-private.pc
|
||||
src/tools/Makefile
|
||||
src/themes/Makefile
|
||||
po/Makefile.in
|
||||
metacity.spec
|
||||
])
|
||||
|
||||
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 "*** This is intended for embedded systems etc., not for normal use."
|
||||
fi
|
||||
|
||||
if test x$enable_verbose_mode = xno; then
|
||||
echo "*** WARNING WARNING WARNING WARNING WARNING"
|
||||
echo "*** Building without verbose mode"
|
||||
echo "*** This means there's no way to debug metacity problems."
|
||||
echo "*** Please build normal desktop versions of metacity"
|
||||
echo "*** with verbose mode enabled so users can use it when they report bugs."
|
||||
fi
|
||||
|
||||
dnl ==========================================================================
|
||||
echo "
|
||||
metacity-$VERSION:
|
||||
|
||||
prefix: ${prefix}
|
||||
source code location: ${srcdir}
|
||||
compiler: ${CC}
|
||||
|
||||
GConf: ${enable_gconf}
|
||||
XFree86 Xinerama: ${use_xfree_xinerama}
|
||||
Solaris Xinerama: ${use_solaris_xinerama}
|
||||
Startup notification: ${have_startup_notification}
|
||||
Session management: ${found_sm}
|
||||
Shape extension: ${found_shape}
|
||||
Resize-and-rotate: ${found_randr}
|
||||
Xsync: ${found_xsync}
|
||||
Deprecated config dialog: ${enable_config_dialog}
|
||||
"
|
||||
echo "This is the UNSTABLE branch of metacity, use 2.4.x for stable (gnome-2-2 branch in CVS)"
|
||||
|
||||
2
doc/.cvsignore
Normal file
2
doc/.cvsignore
Normal file
@@ -0,0 +1,2 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
2
doc/Makefile.am
Normal file
2
doc/Makefile.am
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
EXTRA_DIST=theme-format.txt metacity-theme.dtd dialogs.txt
|
||||
32
doc/dialogs.txt
Normal file
32
doc/dialogs.txt
Normal file
@@ -0,0 +1,32 @@
|
||||
Dialogs which have no transient parent or root window being
|
||||
their tranisent parent are the ones which will be visible in
|
||||
the tasklist.
|
||||
|
||||
All such dialogs will be *always* on top of the window
|
||||
group i.e they would transients for the whole group.
|
||||
|
||||
|
||||
1) Modal dialogs
|
||||
|
||||
|
||||
* If you wish to open another window from a modal dialog
|
||||
|
||||
open *only* a modal dialog and set it's transient parent.
|
||||
|
||||
|
||||
2) Normal dialog
|
||||
|
||||
|
||||
without transient parent
|
||||
|
||||
* If you wish to open another window from a normal dialog
|
||||
|
||||
open either a normal dialog or a modal dialog only.
|
||||
Set the transient parent for the child dialog if you do not
|
||||
want them to be transient for all the other windows in the group.
|
||||
|
||||
with transient parent
|
||||
|
||||
* If you wish to open another window from a normal dialog
|
||||
|
||||
you could open any type of window.
|
||||
273
doc/metacity-theme.dtd
Normal file
273
doc/metacity-theme.dtd
Normal file
@@ -0,0 +1,273 @@
|
||||
<!--
|
||||
DTD for Metacity themes, as of Metacity 2.4.1
|
||||
Author: Ross Burton <ross@burtonini.com>
|
||||
Copyright (C) 2002 Ross Burton
|
||||
Licensed under the GPL, version 2
|
||||
-->
|
||||
|
||||
<!-- Top-level element -->
|
||||
<!ELEMENT metacity_theme (info,(window|frame_style_set|frame_style|frame_geometry|constant|draw_ops|menu_icon)+)>
|
||||
|
||||
<!-- Theme metadata -->
|
||||
<!ELEMENT info (name?|author?|copyright?|date?|description?)*>
|
||||
<!ELEMENT name (#PCDATA)>
|
||||
<!ELEMENT author (#PCDATA)>
|
||||
<!ELEMENT copyright (#PCDATA)>
|
||||
<!ELEMENT date (#PCDATA)>
|
||||
<!ELEMENT description (#PCDATA)>
|
||||
|
||||
<!ENTITY % xyrequired "
|
||||
x CDATA #REQUIRED
|
||||
y CDATA #REQUIRED
|
||||
">
|
||||
|
||||
<!ENTITY % xyimplied "
|
||||
x CDATA #IMPLIED
|
||||
y CDATA #IMPLIED
|
||||
">
|
||||
|
||||
<!ENTITY % widthheightrequired "
|
||||
width CDATA #REQUIRED
|
||||
height CDATA #REQUIRED
|
||||
">
|
||||
|
||||
<!ENTITY % widthheightimplied "
|
||||
width CDATA #IMPLIED
|
||||
height CDATA #IMPLIED
|
||||
">
|
||||
|
||||
<!ENTITY % boolean "(true|false)">
|
||||
|
||||
<!ENTITY % piece_positions "
|
||||
(entire_background|titlebar|titlebar_middle|left_titlebar_edge|right_titlebar_edge|top_titlebar_edge|bottom_titlebar_edge|title|left_edge|right_edge|bottom_edge|overlay)
|
||||
">
|
||||
|
||||
<!ENTITY % gtk-state "
|
||||
state (normal|prelight|active|selected|insensitive) #REQUIRED
|
||||
">
|
||||
|
||||
<!ENTITY % gtk-shadow "
|
||||
shadow (none|in|out|etched_in|etched_out) #REQUIRED
|
||||
">
|
||||
|
||||
|
||||
<!-- The actual theme -->
|
||||
|
||||
<!ELEMENT window EMPTY>
|
||||
<!ATTLIST window
|
||||
type (normal|dialog|modal_dialog|menu|utility|border) #REQUIRED
|
||||
style_set CDATA #REQUIRED
|
||||
>
|
||||
|
||||
|
||||
<!ELEMENT frame_style_set (frame+)>
|
||||
<!ATTLIST frame_style_set
|
||||
name CDATA #REQUIRED
|
||||
parent CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT frame EMPTY>
|
||||
<!ATTLIST frame
|
||||
focus (yes|no) #REQUIRED
|
||||
state (normal|maximized|shaded|maximized_and_shaded) #REQUIRED
|
||||
resize (both|horizontal|vertical|none) #IMPLIED
|
||||
style CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT frame_style (piece|button)*>
|
||||
<!ATTLIST frame_style
|
||||
name CDATA #REQUIRED
|
||||
geometry CDATA #REQUIRED
|
||||
parent CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT piece (draw_ops?)>
|
||||
<!ATTLIST piece
|
||||
position %piece_positions; #REQUIRED
|
||||
draw_ops CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT button (draw_ops?)>
|
||||
<!ATTLIST button
|
||||
function (menu|minimize|maximize|close|left_left_background|left_middle_background|left_right_background|right_left_background|right_middle_background|right_right_background) #REQUIRED
|
||||
state (normal|prelight|pressed) #REQUIRED
|
||||
draw_ops CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT frame_geometry (border|(aspect_ratio|distance))+>
|
||||
<!ATTLIST frame_geometry
|
||||
name CDATA #REQUIRED
|
||||
parent CDATA #IMPLIED
|
||||
title_scale (xx-small|x-small|small|medium|large|x-large|xx-large) #IMPLIED
|
||||
has_title (true|false) 'true'
|
||||
rounded_top_left %boolean; #IMPLIED
|
||||
rounded_top_right %boolean; #IMPLIED
|
||||
rounded_bottom_left %boolean; #IMPLIED
|
||||
rounded_bottom_right %boolean; #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT distance EMPTY>
|
||||
<!ATTLIST distance
|
||||
name (left_width|right_width|bottom_height|title_vertical_pad|right_titlebar_edge|left_titlebar_edge|button_width|button_height) #REQUIRED
|
||||
value CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT border EMPTY>
|
||||
<!ATTLIST border
|
||||
name CDATA #REQUIRED
|
||||
top CDATA #REQUIRED
|
||||
bottom CDATA #REQUIRED
|
||||
left CDATA #REQUIRED
|
||||
right CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT aspect_ratio EMPTY>
|
||||
<!ATTLIST aspect_ratio
|
||||
name CDATA #REQUIRED
|
||||
value CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT draw_ops (line|rectangle|arc|tint|gradient|image|gtk_arrow|gtk_box|gtk_vline|icon|title|clip|include|tile)*>
|
||||
<!-- not sure about this.. maybe it should be removed. see #3478 in theme-parser.c -->
|
||||
<!ATTLIST draw_ops
|
||||
name CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT line EMPTY>
|
||||
<!ATTLIST line
|
||||
color CDATA #REQUIRED
|
||||
x1 CDATA #REQUIRED
|
||||
y1 CDATA #REQUIRED
|
||||
x2 CDATA #REQUIRED
|
||||
y2 CDATA #REQUIRED
|
||||
width CDATA #IMPLIED
|
||||
dash_on_length CDATA #IMPLIED
|
||||
dash_off_length CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT rectangle EMPTY>
|
||||
<!ATTLIST rectangle
|
||||
color CDATA #REQUIRED
|
||||
%xyrequired;
|
||||
%widthheightrequired;
|
||||
filled %boolean; 'false'
|
||||
>
|
||||
|
||||
<!ELEMENT arc EMPTY>
|
||||
<!ATTLIST arc
|
||||
color CDATA #REQUIRED
|
||||
%xyrequired;
|
||||
%widthheightrequired;
|
||||
start_angle CDATA #REQUIRED
|
||||
extent_angle CDATA #REQUIRED
|
||||
filled %boolean; 'false'
|
||||
>
|
||||
|
||||
<!ELEMENT icon EMPTY>
|
||||
<!ATTLIST icon
|
||||
%xyrequired;
|
||||
width CDATA #REQUIRED
|
||||
height CDATA #REQUIRED
|
||||
alpha CDATA #IMPLIED
|
||||
fill_type (tile|scale) 'scale'
|
||||
>
|
||||
|
||||
<!ELEMENT image EMPTY>
|
||||
<!ATTLIST image
|
||||
filename CDATA #REQUIRED
|
||||
colorize CDATA #IMPLIED
|
||||
%xyrequired;
|
||||
%widthheightrequired;
|
||||
alpha CDATA #IMPLIED
|
||||
fill_type (tile|scale) 'scale'
|
||||
>
|
||||
|
||||
<!ELEMENT tile EMPTY>
|
||||
<!ATTLIST tile
|
||||
name CDATA #REQUIRED
|
||||
%xyrequired;
|
||||
%widthheightrequired;
|
||||
tile_xoffset CDATA #IMPLIED
|
||||
tile_yoffset CDATA #IMPLIED
|
||||
tile_width CDATA #REQUIRED
|
||||
tile_height CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT clip EMPTY>
|
||||
<!ATTLIST clip
|
||||
%xyrequired;
|
||||
%widthheightrequired;
|
||||
>
|
||||
|
||||
<!ELEMENT title EMPTY>
|
||||
<!ATTLIST title
|
||||
color CDATA #REQUIRED
|
||||
%xyrequired;
|
||||
>
|
||||
|
||||
<!ELEMENT tint EMPTY>
|
||||
<!ATTLIST tint
|
||||
color CDATA #REQUIRED
|
||||
%xyrequired;
|
||||
%widthheightrequired;
|
||||
alpha CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT gtk_box EMPTY>
|
||||
<!ATTLIST gtk_box
|
||||
%gtk-state;
|
||||
%gtk-shadow;
|
||||
%xyrequired;
|
||||
%widthheightrequired;
|
||||
>
|
||||
|
||||
<!ELEMENT gtk_arrow EMPTY>
|
||||
<!ATTLIST gtk_arrow
|
||||
%gtk-state;
|
||||
%gtk-shadow;
|
||||
arrow (up|down|left|right) #REQUIRED
|
||||
%xyrequired;
|
||||
%widthheightrequired;
|
||||
filed CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT gtk_vline EMPTY>
|
||||
<!ATTLIST gtk_vline
|
||||
%gtk-state;
|
||||
x CDATA #REQUIRED
|
||||
y1 CDATA #REQUIRED
|
||||
y2 CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT gradient (color)+>
|
||||
<!ATTLIST gradient
|
||||
type (vertical|horizontal|diagonal) #REQUIRED
|
||||
%xyrequired;
|
||||
%widthheightrequired;
|
||||
alpha CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT color EMPTY>
|
||||
<!ATTLIST color
|
||||
value CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT include EMPTY>
|
||||
<!ATTLIST include
|
||||
name CDATA #REQUIRED
|
||||
%xyimplied;
|
||||
%widthheightimplied;
|
||||
>
|
||||
|
||||
<!ELEMENT constant EMPTY>
|
||||
<!ATTLIST constant
|
||||
name CDATA #REQUIRED
|
||||
value CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT menu_icon (draw_ops?)>
|
||||
<!ATTLIST menu_icon
|
||||
function (close|maximize|minimize|unmaximize) #REQUIRED
|
||||
%gtk-state;
|
||||
draw_ops CDATA #IMPLIED
|
||||
>
|
||||
497
po/ChangeLog
497
po/ChangeLog
@@ -1,3 +1,452 @@
|
||||
2003-03-27 Christophe Merlet <redfox@redfoxcenter.org>
|
||||
|
||||
* fr.po: Updated French translation.
|
||||
|
||||
2003-03-13 Christian Rose <menthos@menthos.com>
|
||||
|
||||
* ml.po: Added Malayalam translation by
|
||||
FSF-India <locale@gnu.org.in>.
|
||||
|
||||
2003-03-11 Paul Duffy <dubhthach@zion.nuigalway.ie>
|
||||
|
||||
* ga.po: Added Irish translation
|
||||
|
||||
2003-03-10 Roozbeh Pournader <roozbeh@sharif.edu>
|
||||
|
||||
* fa.po: Added Persian translation.
|
||||
|
||||
2003-02-26 Dmitry G. Mastrukov <dmitry@taurussoft.org>
|
||||
|
||||
* be.po: Added Belarusian translation
|
||||
from Belarusian team <i18n@infonet.by>.
|
||||
|
||||
2003-02-25 Pablo Gonzalo del Campo <pablodc@bigfoot.com>
|
||||
|
||||
* es.po: Fixed a translation string to match with libwnck.
|
||||
|
||||
2003-02-22 Rob Adams <robadams@ucla.edu>
|
||||
|
||||
* *.po: change toggle_maximized to toggle_maximize and
|
||||
toggle_shaded to toggle_shade in action_double_click_titlebar long
|
||||
description to match the values used by metacity
|
||||
|
||||
2003-02-12 Christian Rose <menthos@menthos.com>
|
||||
|
||||
* sv.po: Some fixes for problems catched in translation review.
|
||||
|
||||
2003-02-11 Fatih Demir <kabalak@gtranslator.org>
|
||||
|
||||
* tr.po: Branchy.
|
||||
|
||||
2003-02-09 Fatih Demir <kabalak@gtranslator.org>
|
||||
|
||||
* tr.po: Take over from branch...
|
||||
|
||||
2003-02-08 Fatih Demir <kabalak@gtranslator.org>
|
||||
|
||||
* tr.po: Committed updated Turkish translation by Sinan.
|
||||
|
||||
2003-02-05 Abel Cheung <maddog@linux.org.hk>
|
||||
|
||||
* en_GB.po: Fix header.
|
||||
* ko.po, pt_BR.po: Fix positional parameters.
|
||||
|
||||
2003-02-05 Abel Cheung <maddog@linux.org.hk>
|
||||
|
||||
* zh_TW.po: Updated traditional Chinese translation.
|
||||
|
||||
2003-02-03 Daniel Yacob <locales@geez.org>
|
||||
|
||||
* am.po: Updated Amharic translation.
|
||||
|
||||
2003-01-30 Marius Andreiana <marius galuna.ro>
|
||||
|
||||
* ro.po: updated ( thanks to Mugurel Tudor )
|
||||
|
||||
2003-01-25 Christophe Merlet <redfox@redfoxcenter.org>
|
||||
|
||||
* fr.po: Updated French translation from
|
||||
Guy Clotilde <guy.clotilde@wanadoo.fr>.
|
||||
|
||||
2003-01-25 Kjartan Maraas <kmaraas@gnome.org>
|
||||
|
||||
* no.po: Updated Norwegian (bokmal) translation.
|
||||
|
||||
2003-01-23 He Qiangqiang <carton@linux.net.cn>
|
||||
|
||||
* zh_CN.po: Updated Simplified Chinese translation by
|
||||
Xiong Jiang <jxiong@offtopic.org>.
|
||||
|
||||
2003-01-23 Dmitry G. Mastrukov <dmitry@taurussoft.org>
|
||||
|
||||
* ru.po: updated Russian translation
|
||||
from Russian team <gnome-cyr@gnome.org>.
|
||||
|
||||
2003-01-23 Abel Cheung <maddog@linux.org.hk>
|
||||
|
||||
* zh_TW.po: Updated traditional Chinese translation.
|
||||
|
||||
2003-01-22 Christian Rose <menthos@menthos.com>
|
||||
|
||||
* mn.po: Added Mongolian translation by
|
||||
Ochirbat Batzaya <buuvei@yahoo.com>.
|
||||
|
||||
2003-01-21 Dmitry G. Mastrukov <dmitry@taurussoft.org>
|
||||
|
||||
* ru.po: updated Russian translation
|
||||
from Russian team <gnome-cyr@gnome.org>.
|
||||
|
||||
2003-01-21 Kjartan Maraas <kmaraas@gnome.org>
|
||||
|
||||
* no.po: Updated Norwegian (bokmal) translation.
|
||||
|
||||
2003-01-20 Christian Neumair <chris@gnome-de.org>
|
||||
|
||||
* de.po: Updated German translation.
|
||||
|
||||
2003-01-20 Dmitry G. Mastrukov <dmitry@taurussoft.org>
|
||||
|
||||
* ru.po: updated Russian translation
|
||||
from Russian team <gnome-cyr@gnome.org>.
|
||||
|
||||
2003-01-20 Dmitry G. Mastrukov <dmitry@taurussoft.org>
|
||||
|
||||
* ru.po: updated Russian translation
|
||||
from Russian team <gnome-cyr@gnome.org>.
|
||||
|
||||
2003-01-20 Dmitry G. Mastrukov <dmitry@taurussoft.org>
|
||||
|
||||
* ru.po: updated Russian translation
|
||||
from Russian team <gnome-cyr@gnome.org>.
|
||||
|
||||
2003-01-19 Abel Cheung <maddog@linux.org.hk>
|
||||
|
||||
* zh_TW.po: Updated traditional Chinese translation, and replaced
|
||||
copyright symbol with correct one.
|
||||
|
||||
2003-01-17 Gustavo Noronha Silva <kov@debian.org>
|
||||
|
||||
* pt_BR.po: translation update
|
||||
|
||||
2003-01-16 Vincent van Adrighem <V.vanAdrighem@dirck.mine.nu>
|
||||
|
||||
* nl.po: Dutch translation updated by Tino Meinen.
|
||||
|
||||
2003-01-16 Vincent van Adrighem <V.vanAdrighem@dirck.mine.nu>
|
||||
|
||||
* nl.po: Dutch translation updated by Tino Meinen.
|
||||
|
||||
2003-01-14 Yanko Kaneti <yaneti@declera.com>
|
||||
|
||||
* bg.po: Full Bulgarian translation by
|
||||
Alexander Shopov <al_shopov@yahoo.com>.
|
||||
|
||||
2003-01-11 Kjartan Maraas <kmaraas@gnome.org>
|
||||
|
||||
* no.po: Updated Norwegian (bokmal) translation.
|
||||
|
||||
2003-01-10 Vincent van Adrighem <V.vanAdrighem@dirck.mine.nu>
|
||||
|
||||
* nl.po: Dutch translation updated by Tino Meinen.
|
||||
|
||||
2003-01-10 Andras Timar <timar@gnome.hu>
|
||||
|
||||
* hu.po: Updated Hungarian translation.
|
||||
|
||||
2003-01-10 Yukihiro Nakai <nakai@gnome.gr.jp>
|
||||
|
||||
* ja.po: Minor fix.
|
||||
|
||||
2003-01-09 Vincent van Adrighem <V.vanAdrighem@dirck.mine.nu>
|
||||
|
||||
* nl.po: Dutch translation updated by Tino Meinen.
|
||||
|
||||
2003-01-08 Pauli Virtanen <pauli.virtanen@hut.fi>
|
||||
|
||||
* fi.po: Fixed a string that had an invalid printf format.
|
||||
|
||||
2003-01-09 Abel Cheung <maddog@linux.org.hk>
|
||||
|
||||
* zh_TW.po: Updated traditional Chinese translation.
|
||||
|
||||
2003-01-07 Daniel Yacob <locales@geez.org>
|
||||
|
||||
* am.po: Updated Amharic translation.
|
||||
|
||||
2003-01-06 Vincent van Adrighem <V.vanAdrighem@dirck.mine.nu>
|
||||
|
||||
* nl.po: Dutch translation added by Tino Meinen.
|
||||
|
||||
2003-01-05 Pablo Saratxaga <pablo@mandrakesoft.com>
|
||||
|
||||
* vi.po: Updated Vietnamese file
|
||||
* pt_BR.po: fixed syntax errors
|
||||
|
||||
2003-01-05 Pauli Virtanen <pauli.virtanen@hut.fi>
|
||||
|
||||
* fi.po: Added Finnish translation.
|
||||
|
||||
2003-01-05 Stanislav Visnovsky <visnovsky@nenya.ms.mff.cuni.cz>
|
||||
|
||||
* sk.po: Updated Slovak translation.
|
||||
|
||||
2003-01-03 Kjartan Maraas <kmaraas@gnome.org>
|
||||
|
||||
* no.po: Updated Norwegian (bokmal) translation.
|
||||
|
||||
2003-01-02 Zbigniew Chyla <cyba@gnome.pl>
|
||||
|
||||
* pl.po: Updated Polish translation by
|
||||
GNOME PL Team <translators@gnome.pl>.
|
||||
|
||||
2002-12-29 Daniel Yacob <locales@geez.org>
|
||||
|
||||
* am.po: Updated Amharic translation.
|
||||
|
||||
2002-12-29 Kostas Papadimas <pkst@gmx.net>
|
||||
|
||||
* el.po: Updated Greek translation.
|
||||
|
||||
2002-12-25 Ole Laursen <olau@hardworking.dk>
|
||||
|
||||
* da.po: Updated Danish translation.
|
||||
|
||||
2002-12-25 Kostas Papadimas <pkst@gmx.net>
|
||||
|
||||
* el.po: Updated Greek translation.
|
||||
|
||||
2002-12-22 Daniel Yacob <locales@geez.org>
|
||||
|
||||
* am.po: Updated Amharic translation.
|
||||
|
||||
2002-12-22 Artis Trops <hornet@navigator.lv>
|
||||
|
||||
* lv.po: Updated Latvian translation.
|
||||
|
||||
2002-12-21 Daniel Yacob <locales@geez.org>
|
||||
|
||||
* am.po: Updated Amharic translation.
|
||||
|
||||
2002-12-20 Christian Neumair <chris@gnome-de.org>
|
||||
|
||||
* de.po: Updated German translation.
|
||||
|
||||
2002-12-20 Miloslav Trmac <mitr@volny.cz>
|
||||
|
||||
* cs.po: Updated Czech translation.
|
||||
|
||||
2002-12-19 Hasbullah Bin Pit <sebol@ikhlas.com>
|
||||
|
||||
* ms.po: Updated Malay Translation.
|
||||
|
||||
2002-12-19 Yanko Kaneti <yaneti@declera.com>
|
||||
|
||||
* bg.po (added): Added start of Bulgarian translation by
|
||||
Alexander Shopov <al_shopov@yahoo.com>.
|
||||
|
||||
2002-12-18 Pablo Gonzalo del Campo <pablodc@bigfoot.com>
|
||||
|
||||
* es.po: Updated Spanish translation.
|
||||
|
||||
2002-12-17 Miloslav Trmac <mitr@volny.cz>
|
||||
|
||||
* cs.po: Updated Czech translation.
|
||||
|
||||
2002-12-17 Christian Rose <menthos@menthos.com>
|
||||
|
||||
* sv.po: Updated Swedish translation.
|
||||
|
||||
2002-12-17 Christian Rose <menthos@menthos.com>
|
||||
|
||||
* sv.po: Updated Swedish translation.
|
||||
|
||||
2002-12-16 Christian Neumair <chris@gnome-de.org>
|
||||
|
||||
* de.po: Updated German translation.
|
||||
|
||||
2002-12-16 Miloslav Trmac <mitr@volny.cz>
|
||||
|
||||
* cs.po: Updated Czech translation.
|
||||
|
||||
2002-12-16 Ole Laursen <olau@hardworking.dk>
|
||||
|
||||
* da.po: Updated Danish translation.
|
||||
|
||||
2002-12-14 Kjartan Maraas <kmaraas@gnome.org>
|
||||
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
|
||||
2002-12-13 Daniel Yacob <locales@geez.org>
|
||||
|
||||
* am.po: Added Amharic translation.
|
||||
|
||||
2002-12-13 Christian Rose <menthos@menthos.com>
|
||||
|
||||
* sv.po: Updated Swedish translation.
|
||||
|
||||
2002-12-12 Ole Laursen <olau@hardworking.dk>
|
||||
|
||||
* da.po: Updated Danish translation.
|
||||
|
||||
2002-12-11 Christian Neumair <chris@gnome-de.org>
|
||||
|
||||
* POTFILES.in: Added src/tools/metacity-message.c.
|
||||
* de.po: Updated German translation.
|
||||
|
||||
2002-12-11 Evandro Fernandes Giovanini <evandrofg@ig.com.br>
|
||||
|
||||
* pt_BR.po: Updated Brazilian Portuguese translation.
|
||||
|
||||
2002-12-09 Pablo Gonzalo del Campo <pablodc@bigfoot.com>
|
||||
|
||||
* es.po: Updated Spanish translation.
|
||||
|
||||
2002-12-09 Miloslav Trmac <mitr@volny.cz>
|
||||
|
||||
* cs.po: Updated Czech translation.
|
||||
|
||||
2002-12-04 Pablo Gonzalo del Campo <pablodc@bigfoot.com>
|
||||
|
||||
* es.po: Updated Spanish translation.
|
||||
|
||||
2002-11-25 Kjartan Maraas <kmaraas@gnome.org>
|
||||
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
|
||||
2002-11-25 Yanko Kaneti <yaneti@declera.com>
|
||||
|
||||
* *.po: Convert all to UTF-8.
|
||||
|
||||
2002-11-24 Kostas Papadimas <pkst@gmx.net>
|
||||
|
||||
* el.po: Updated Greek translation.
|
||||
|
||||
2002-11-23 Kostas Papadimas <pkst@gmx.net>
|
||||
|
||||
* el.po: Updated Greek translation.
|
||||
|
||||
2002-11-19 Andras Timar <timar@gnome.hu>
|
||||
|
||||
* hu.po: Updated Hungarian translation.
|
||||
|
||||
2002-11-15 Kjartan Maraas <kmaraas@gnome.org>
|
||||
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
|
||||
2002-11-14 Gustavo Noronha Silva <kov@debian.org>
|
||||
|
||||
* pt_BR.po: Update translation.
|
||||
|
||||
2002-11-14 Pablo Gonzalo del Campo <pablodc@bigfoot.com>
|
||||
|
||||
* es.po: Updated Spanish translation.
|
||||
|
||||
2002-11-13 Christian Neumair <chris@gnome-de.org>
|
||||
|
||||
* de.po: Updated German translation.
|
||||
|
||||
2002-11-11 Peteris Krisjanis <peteris.krisjanis@os.lv>
|
||||
|
||||
* lv.po: Updated Latvian translation.
|
||||
|
||||
2002-11-11 Changwoo Ryu <cwryu@debian.org>
|
||||
|
||||
* ko.po: Updated Korean translation by Young-Ho Cha
|
||||
<ganadist@chollian.net>.
|
||||
|
||||
2002-11-10 Ole Laursen <olau@hardworking.dk>
|
||||
|
||||
* da.po: Updated Danish translation.
|
||||
|
||||
2002-11-05 Hasbullah Bin Pit <sebol@ikhlas.com>
|
||||
|
||||
* ms.po: Updated Malay Translation.
|
||||
|
||||
2002-11-05 Christian Rose <menthos@menthos.com>
|
||||
|
||||
* POTFILES.in: Added missing file.
|
||||
* sv.po: Updated Swedish translation.
|
||||
|
||||
2002-11-01 Christian Neumair <chris@gnome-de.org>
|
||||
|
||||
* de.po: Updated German translation.
|
||||
|
||||
2002-10-31 Pablo Gonzalo del Campo <pablodc@bigfoot.com>
|
||||
|
||||
* es.po: Updated Spanish translation.
|
||||
|
||||
2002-10-28 Ole Laursen <olau@hardworking.dk>
|
||||
|
||||
* da.po: Updated Danish translation.
|
||||
|
||||
2002-10-28 Peteris Krisjanis <peteris.krisjanis@os.lv>
|
||||
|
||||
* lv.po: Updated Latvian translation.
|
||||
|
||||
2002-10-24 Christian Rose <menthos@menthos.com>
|
||||
|
||||
* POTFILES.in: Added missing file.
|
||||
* sv.po: Updated Swedish translation.
|
||||
|
||||
2002-10-24 Pablo Saratxaga <pablo@mandrakesoft.com>
|
||||
|
||||
* vi.po: Updated Vietnamese file
|
||||
|
||||
2002-10-22 Ole Laursen <olau@hardworking.dk>
|
||||
|
||||
* da.po: Updated Danish translation.
|
||||
|
||||
2002-10-21 Kjartan Maraas <kmaraas@gnome.org>
|
||||
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
|
||||
2002-10-17 Andras Timar <timar@gnome.hu>
|
||||
|
||||
* hu.po: Added Hungarian translation.
|
||||
|
||||
2002-10-17 Christophe Merlet <christophe@merlet.net>
|
||||
|
||||
* fr.po: Updated French translation.
|
||||
|
||||
2002-10-16 Christian Neumair <chris@gnome-de.org>
|
||||
|
||||
* de.po: Updated German translation.
|
||||
|
||||
2002-10-16 Yukihiro Nakai <ynakai@redhat.com>
|
||||
|
||||
* ja.po: Minor fix
|
||||
|
||||
2002-10-16 Bastien Nocera <hadess@hadess.net>
|
||||
|
||||
* en_GB.po: added, more colours for your theme, time to upgrade!
|
||||
|
||||
2002-10-15 Kjartan Maraas <kmaraas@gnome.org>
|
||||
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
|
||||
2002-10-15 Ole Laursen <olau@hardworking.dk>
|
||||
|
||||
* da.po: Updated Danish translation.
|
||||
|
||||
2002-10-13 Hasbullah Bin Pit <sebol@ikhlas.com>
|
||||
|
||||
* ms.po: Updated Malay Translation.
|
||||
|
||||
2002-10-11 Stanislav Brabec <sbrabec@suse.cz>
|
||||
|
||||
* cs.po: Updated Czech translation from Miloslav Trmac
|
||||
<mitr@volny.cz>.
|
||||
|
||||
2002-10-10 Zbigniew Chyla <cyba@gnome.pl>
|
||||
|
||||
* pl.po: Updated Polish translation by
|
||||
GNOME PL Team <translators@gnome.pl>.
|
||||
|
||||
2002-10-06 Zbigniew Chyla <cyba@gnome.pl>
|
||||
|
||||
* pl.po: Updated Polish translation by
|
||||
GNOME PL Team <translators@gnome.pl>.
|
||||
|
||||
2002-10-01 Stanislav Brabec <sbrabec@suse.cz>
|
||||
|
||||
* cs.po: Added Czech translation from Miloslav Trmac
|
||||
@@ -37,7 +486,7 @@
|
||||
|
||||
2002-09-11 Kjartan Maraas <kmaraas@gnome.org>
|
||||
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
|
||||
2002-09-10 Pablo Gonzalo del Campo <pablodc@bigfoot.com>
|
||||
|
||||
@@ -214,7 +663,7 @@
|
||||
|
||||
2002-08-04 Kjartan Maraas <kmaraas@gnome.org>
|
||||
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
|
||||
2002-07-30 Pablo Saratxaga <pablo@mandrakesoft.com>
|
||||
|
||||
@@ -271,7 +720,7 @@
|
||||
|
||||
2002-07-16 Kjartan Maraas <kmaraas@gnome.org>
|
||||
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
|
||||
2002-07-15 Ole Laursen <olau@hardworking.dk>
|
||||
|
||||
@@ -320,7 +769,7 @@
|
||||
|
||||
2002-06-23 Kjartan Maraas <kmaraas@gnome.org>
|
||||
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
|
||||
2002-06-23 Christian Rose <menthos@menthos.com>
|
||||
|
||||
@@ -398,7 +847,7 @@
|
||||
|
||||
2002-06-03 Kjartan Maraas <kmaraas@gnome.org>
|
||||
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
|
||||
2002-06-03 Stanislav Visnovsky <visnovsky@nenya.ms.mff.cuni.cz>
|
||||
|
||||
@@ -423,7 +872,7 @@
|
||||
|
||||
2002-05-31 Kjartan Maraas <kmaraas@gnome.org>
|
||||
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
|
||||
2002-05-28 Pablo Gonzalo del Campo <pablodc@bigfoot.com>
|
||||
|
||||
@@ -470,7 +919,7 @@
|
||||
|
||||
2002-05-18 Kjartan Maraas <kmaraas@gnome.org>
|
||||
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
|
||||
2002-05-18 Ole Laursen <olau@hardworking.dk>
|
||||
|
||||
@@ -496,7 +945,7 @@
|
||||
|
||||
2002-04-22 Kjartan Maraas <kmaraas@gnome.org>
|
||||
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
|
||||
2002-04-19 Changwoo Ryu <cwryu@debian.org>
|
||||
|
||||
@@ -524,11 +973,11 @@
|
||||
|
||||
2002-03-28 Kjartan Maraas <kmaraas@gnome.org>
|
||||
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
|
||||
2002-03-27 Kjartan Maraas <kmaraas@gnome.org>
|
||||
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
|
||||
2002-03-22 Zbigniew Chyla <cyba@gnome.pl>
|
||||
|
||||
@@ -536,19 +985,19 @@
|
||||
|
||||
2002-02-22 Kjartan Maraas <kmaraas@gnome.org>
|
||||
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
|
||||
2002-02-17 Kjartan Maraas <kmaraas@gnome.org>
|
||||
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
|
||||
2002-02-16 Kjartan Maraas <kmaraas@gnome.org>
|
||||
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
|
||||
2002-02-12 Kjartan Maraas <kmaraas@gnome.org>
|
||||
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
|
||||
2002-02-11 Duarte Loreto <happyguy_pt@hotmail.com>
|
||||
|
||||
@@ -560,7 +1009,7 @@
|
||||
|
||||
2002-02-10 Kjartan Maraas <kmaraas@gnome.org>
|
||||
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
|
||||
2002-02-08 Christian Rose <menthos@menthos.com>
|
||||
|
||||
@@ -577,7 +1026,7 @@
|
||||
|
||||
2002-02-02 Kjartan Maraas <kmaraas@gnome.org>
|
||||
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
|
||||
2002-01-31 Christian Rose <menthos@menthos.com>
|
||||
|
||||
@@ -593,7 +1042,7 @@
|
||||
|
||||
2002-01-29 Kjartan Maraas <kmaraas@gnome.org>
|
||||
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
|
||||
2002-01-27 Peteris Krisjanis <peteris.krisjanis@ttc.lv>
|
||||
|
||||
@@ -605,7 +1054,7 @@
|
||||
|
||||
2002-01-11 Kjartan Maraas <kmaraas@gnome.org>
|
||||
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
* no.po: Updated Norwegian (bokmål) translation.
|
||||
|
||||
2002-01-09 Stanislav Visnovsky <visnovsky@nenya.ms.mff.cuni.cz>
|
||||
|
||||
@@ -617,7 +1066,7 @@
|
||||
|
||||
2002-01-06 Fatih Demir <kabalak@gtranslator.org>
|
||||
|
||||
* tr.po: Added Turkish translation by Görkem Cetin.
|
||||
* tr.po: Added Turkish translation by Görkem Cetin.
|
||||
|
||||
2002-01-05 Christian Rose <menthos@menthos.com>
|
||||
|
||||
@@ -639,7 +1088,7 @@
|
||||
|
||||
2001-12-16 Kjartan Maraas <kmaraas@gnome.org>
|
||||
|
||||
* no.po: Updated Norwegian (bokm�) translation.
|
||||
* no.po: Updated Norwegian (bokmᅵ) translation.
|
||||
|
||||
2001-12-15 Christian Rose <menthos@menthos.com>
|
||||
|
||||
@@ -656,17 +1105,17 @@
|
||||
2001-11-27 Jesus Bravo Alvarez <jba@pobox.com>
|
||||
|
||||
* gl.po: Added Galician translation from
|
||||
Manuel A. Fern�dez Montecelo <manuel@sindominio.net>
|
||||
Manuel A. Fernᅵdez Montecelo <manuel@sindominio.net>
|
||||
|
||||
2001-10-29 Yuriy Syrota <rasta@renome.rovno.ua>
|
||||
|
||||
* uk.po: Added Ukrainian translation file.
|
||||
|
||||
2001-10-28 H�tor Garc� �varez <hector@scouts-es.org>
|
||||
2001-10-28 Hᅵtor Garcᅵ ᅵvarez <hector@scouts-es.org>
|
||||
|
||||
* es.po: Updated Spanish translation.
|
||||
|
||||
2001-10-14 H�tor Garc� �varez <hector@scouts-es.org>
|
||||
2001-10-14 Hᅵtor Garcᅵ ᅵvarez <hector@scouts-es.org>
|
||||
|
||||
* es.po: Added Spanish translation.
|
||||
|
||||
@@ -676,7 +1125,7 @@
|
||||
|
||||
2001-10-11 Christian Rose <menthos@menthos.com>
|
||||
|
||||
* sv.po: Fixed some typos. Thanks to Tomas �ren <stric@ing.umu.se>
|
||||
* sv.po: Fixed some typos. Thanks to Tomas ᅵren <stric@ing.umu.se>
|
||||
for spotting many of them.
|
||||
|
||||
2001-10-11 Christian Rose <menthos@menthos.com>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# List of source files containing translatable strings.
|
||||
# Please keep this file sorted alphabetically.
|
||||
src/tools/metacity-message.c
|
||||
src/delete.c
|
||||
src/display.c
|
||||
src/errors.c
|
||||
@@ -7,6 +8,7 @@ src/frames.c
|
||||
src/keybindings.c
|
||||
src/main.c
|
||||
src/menu.c
|
||||
src/metaaccellabel.c
|
||||
src/metacity-dialog.c
|
||||
src/metacity.desktop.in
|
||||
src/metacity.schemas.in
|
||||
@@ -19,6 +21,7 @@ src/theme.c
|
||||
src/tools/metacity-properties.desktop.in
|
||||
src/tools/metacity-properties.glade
|
||||
src/util.c
|
||||
src/window-props.c
|
||||
src/window.c
|
||||
src/workspace.c
|
||||
src/xprops.c
|
||||
|
||||
2441
po/en_GB.po
Normal file
2441
po/en_GB.po
Normal file
File diff suppressed because it is too large
Load Diff
1343
po/pt_BR.po
1343
po/pt_BR.po
File diff suppressed because it is too large
Load Diff
1977
po/zh_CN.po
1977
po/zh_CN.po
File diff suppressed because it is too large
Load Diff
2003
po/zh_TW.po
2003
po/zh_TW.po
File diff suppressed because it is too large
Load Diff
@@ -2,3 +2,17 @@
|
||||
Focus windows on map: see http://bugzilla.gnome.org/show_bug.cgi?id=82921
|
||||
Keep panel always on top: http://bugzilla.gnome.org/show_bug.cgi?id=81551
|
||||
Edge flipping: http://bugzilla.gnome.org/show_bug.cgi?id=82917
|
||||
Opaque resize: http://bugzilla.gnome.org/show_bug.cgi?id=92618
|
||||
Super+click to resize: http://bugzilla.gnome.org/show_bug.cgi?id=79315
|
||||
minimized windows in Alt+tab: http://bugzilla.gnome.org/show_bug.cgi?id=89416
|
||||
raise windows on click: http://bugzilla.gnome.org/show_bug.cgi?id=86108
|
||||
dialogs above entire app group: http://bugzilla.gnome.org/show_bug.cgi?id=88926
|
||||
display window size/position: http://bugzilla.gnome.org/show_bug.cgi?id=85213,
|
||||
http://bugzilla.gnome.org/show_bug.cgi?id=106645
|
||||
|
||||
configure click actions, alt+click:
|
||||
http://bugzilla.gnome.org/show_bug.cgi?id=83210
|
||||
|
||||
system modal dialogs: http://bugzilla.gnome.org/show_bug.cgi?id=83357
|
||||
|
||||
workspace wrapping: http://bugzilla.gnome.org/show_bug.cgi?id=89315
|
||||
|
||||
@@ -9,3 +9,5 @@ testgradient
|
||||
inlinepixbufs.h
|
||||
metacity.desktop
|
||||
metacity.schemas
|
||||
libmetacity-private.pc
|
||||
testasyncgetprop
|
||||
|
||||
@@ -1,14 +1,21 @@
|
||||
lib_LTLIBRARIES = libmetacity-private.la
|
||||
|
||||
SUBDIRS=wm-tester tools themes
|
||||
|
||||
INCLUDES=@METACITY_CFLAGS@ -DMETACITY_LIBEXECDIR=\"$(libexecdir)\" -DHOST_ALIAS=\"@HOST_ALIAS@\" -DMETACITY_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\" -DMETACITY_PKGDATADIR=\"$(pkgdatadir)\" -DMETACITY_DATADIR=\"$(datadir)\"
|
||||
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
|
||||
|
||||
EGGFILES= \
|
||||
eggaccelerators.c \
|
||||
eggaccelerators.h
|
||||
|
||||
metacity_SOURCES= \
|
||||
async-getprop.c \
|
||||
async-getprop.h \
|
||||
bell.h \
|
||||
bell.c \
|
||||
common.h \
|
||||
constraints.c \
|
||||
constraints.h \
|
||||
core.c \
|
||||
core.h \
|
||||
delete.c \
|
||||
@@ -32,6 +39,9 @@ metacity_SOURCES= \
|
||||
gradient.h \
|
||||
group.c \
|
||||
group.h \
|
||||
group-private.h \
|
||||
group-props.c \
|
||||
group-props.h \
|
||||
iconcache.c \
|
||||
iconcache.h \
|
||||
inlinepixbufs.h \
|
||||
@@ -43,6 +53,7 @@ metacity_SOURCES= \
|
||||
menu.h \
|
||||
metaaccellabel.c \
|
||||
metaaccellabel.h \
|
||||
metacity-Xatomtype.h \
|
||||
place.c \
|
||||
place.h \
|
||||
prefs.c \
|
||||
@@ -69,13 +80,15 @@ metacity_SOURCES= \
|
||||
util.h \
|
||||
window.c \
|
||||
window.h \
|
||||
window-props.c \
|
||||
window-props.h \
|
||||
workspace.c \
|
||||
workspace.h \
|
||||
xprops.c \
|
||||
xprops.h \
|
||||
$(EGGFILES)
|
||||
|
||||
metacity_theme_viewer_SOURCES= \
|
||||
libmetacity_private_la_SOURCES= \
|
||||
gradient.c \
|
||||
gradient.h \
|
||||
preview-widget.c \
|
||||
@@ -84,9 +97,22 @@ metacity_theme_viewer_SOURCES= \
|
||||
theme.h \
|
||||
theme-parser.c \
|
||||
theme-parser.h \
|
||||
theme-viewer.c \
|
||||
util.c \
|
||||
util.h
|
||||
util.h \
|
||||
common.h
|
||||
|
||||
libmetacityincludedir = $(includedir)/metacity-1/metacity-private
|
||||
|
||||
libmetacityinclude_HEADERS = \
|
||||
common.h \
|
||||
gradient.h \
|
||||
preview-widget.h \
|
||||
theme.h \
|
||||
theme-parser.h \
|
||||
util.h
|
||||
|
||||
metacity_theme_viewer_SOURCES= \
|
||||
theme-viewer.c
|
||||
|
||||
metacity_dialog_SOURCES= \
|
||||
metacity-dialog.c
|
||||
@@ -94,19 +120,23 @@ metacity_dialog_SOURCES= \
|
||||
bin_PROGRAMS=metacity metacity-theme-viewer
|
||||
libexec_PROGRAMS=metacity-dialog
|
||||
|
||||
metacity_LDADD= @METACITY_LIBS@
|
||||
metacity_theme_viewer_LDADD= @METACITY_LIBS@
|
||||
EFENCE=
|
||||
metacity_LDADD=@METACITY_LIBS@ $(EFENCE)
|
||||
metacity_theme_viewer_LDADD= @METACITY_LIBS@ libmetacity-private.la
|
||||
metacity_dialog_LDADD=@METACITY_LIBS@
|
||||
|
||||
testgradient_SOURCES=gradient.h gradient.c testgradient.c
|
||||
testasyncgetprop_SOURCES=async-getprop.h async-getprop.c testasyncgetprop.c
|
||||
|
||||
noinst_PROGRAMS=testgradient
|
||||
noinst_PROGRAMS=testgradient testasyncgetprop
|
||||
|
||||
testgradient_LDADD= @METACITY_LIBS@
|
||||
testasyncgetprop_LDADD= @METACITY_LIBS@
|
||||
|
||||
desktopfilesdir=$(datadir)/gnome/wm-properties
|
||||
desktopfiles_in_files=metacity.desktop.in
|
||||
desktopfiles_DATA = $(desktopfiles_in_files:.desktop.in=.desktop)
|
||||
desktopfiles_files=$(desktopfiles_in_files:.desktop.in=.desktop)
|
||||
desktopfiles_DATA = $(desktopfiles_files)
|
||||
@INTLTOOL_DESKTOP_RULE@
|
||||
|
||||
schemadir = @GCONF_SCHEMA_FILE_DIR@
|
||||
@@ -130,7 +160,17 @@ CLEANFILES = inlinepixbufs.h
|
||||
inlinepixbufs.h: $(IMAGES)
|
||||
$(GDK_PIXBUF_CSOURCE) --raw --build-list $(VARIABLES) >$(srcdir)/inlinepixbufs.h
|
||||
|
||||
EXTRA_DIST=$(desktopfiles_DATA) $(IMAGES) $(schema_DATA) update-from-egg.sh $(desktopfiles_in_files) $(schema_in_files)
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
|
||||
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
|
||||
|
||||
|
||||
649
src/async-getprop.c
Normal file
649
src/async-getprop.c
Normal file
@@ -0,0 +1,649 @@
|
||||
/* Asynchronous X property getting hack */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2002 Havoc Pennington
|
||||
* Copyright (C) 1986, 1998 The Open Group
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software
|
||||
* and its documentation for any purpose is hereby granted without
|
||||
* fee, provided that the above copyright notice appear in all copies
|
||||
* and that both that copyright notice and this permission notice
|
||||
* appear in supporting documentation.
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR
|
||||
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
||||
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Except as contained in this notice, the name of The Open Group shall not be
|
||||
* used in advertising or otherwise to promote the sale, use or other dealings
|
||||
* in this Software without prior written authorization from The Open Group.
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#undef DEBUG_SPEW
|
||||
#ifdef DEBUG_SPEW
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
#include "async-getprop.h"
|
||||
|
||||
#define NEED_REPLIES
|
||||
#include <X11/Xlibint.h>
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL ((void*)0)
|
||||
#endif
|
||||
|
||||
typedef struct _ListNode ListNode;
|
||||
typedef struct _AgPerDisplayData AgPerDisplayData;
|
||||
|
||||
struct _ListNode
|
||||
{
|
||||
ListNode *next;
|
||||
};
|
||||
|
||||
struct _AgGetPropertyTask
|
||||
{
|
||||
ListNode node;
|
||||
|
||||
AgPerDisplayData *dd;
|
||||
Window window;
|
||||
Atom property;
|
||||
|
||||
unsigned long request_seq;
|
||||
int error;
|
||||
|
||||
Atom actual_type;
|
||||
int actual_format;
|
||||
|
||||
unsigned long n_items;
|
||||
unsigned long bytes_after;
|
||||
unsigned char *data;
|
||||
|
||||
Bool have_reply;
|
||||
};
|
||||
|
||||
struct _AgPerDisplayData
|
||||
{
|
||||
ListNode node;
|
||||
_XAsyncHandler async;
|
||||
|
||||
Display *display;
|
||||
ListNode *pending_tasks;
|
||||
ListNode *pending_tasks_tail;
|
||||
ListNode *completed_tasks;
|
||||
ListNode *completed_tasks_tail;
|
||||
int n_tasks_pending;
|
||||
int n_tasks_completed;
|
||||
};
|
||||
|
||||
static ListNode *display_datas = NULL;
|
||||
static ListNode *display_datas_tail = NULL;
|
||||
|
||||
static void
|
||||
append_to_list (ListNode **head,
|
||||
ListNode **tail,
|
||||
ListNode *task)
|
||||
{
|
||||
task->next = NULL;
|
||||
|
||||
if (*tail == NULL)
|
||||
{
|
||||
assert (*head == NULL);
|
||||
*head = task;
|
||||
*tail = task;
|
||||
}
|
||||
else
|
||||
{
|
||||
(*tail)->next = task;
|
||||
*tail = task;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
remove_from_list (ListNode **head,
|
||||
ListNode **tail,
|
||||
ListNode *task)
|
||||
{
|
||||
ListNode *prev;
|
||||
ListNode *node;
|
||||
|
||||
prev = NULL;
|
||||
node = *head;
|
||||
while (node != NULL)
|
||||
{
|
||||
if (node == task)
|
||||
{
|
||||
if (prev)
|
||||
prev->next = node->next;
|
||||
else
|
||||
*head = node->next;
|
||||
|
||||
if (node == *tail)
|
||||
*tail = prev;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
prev = node;
|
||||
node = node->next;
|
||||
}
|
||||
|
||||
/* can't remove what's not there */
|
||||
assert (node != NULL);
|
||||
|
||||
node->next = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
move_to_completed (AgPerDisplayData *dd,
|
||||
AgGetPropertyTask *task)
|
||||
{
|
||||
remove_from_list (&dd->pending_tasks,
|
||||
&dd->pending_tasks_tail,
|
||||
&task->node);
|
||||
|
||||
append_to_list (&dd->completed_tasks,
|
||||
&dd->completed_tasks_tail,
|
||||
&task->node);
|
||||
|
||||
dd->n_tasks_pending -= 1;
|
||||
dd->n_tasks_completed += 1;
|
||||
}
|
||||
|
||||
static AgGetPropertyTask*
|
||||
find_pending_by_request_sequence (AgPerDisplayData *dd,
|
||||
unsigned long request_seq)
|
||||
{
|
||||
ListNode *node;
|
||||
|
||||
/* if the sequence is after our last pending task, we
|
||||
* aren't going to find a match
|
||||
*/
|
||||
{
|
||||
AgGetPropertyTask *task = (AgGetPropertyTask*) dd->pending_tasks_tail;
|
||||
if (task != NULL)
|
||||
{
|
||||
if (task->request_seq < request_seq)
|
||||
return NULL;
|
||||
else if (task->request_seq == request_seq)
|
||||
return task; /* why not check this */
|
||||
}
|
||||
}
|
||||
|
||||
/* Generally we should get replies in the order we sent
|
||||
* requests, so we should usually be using the task
|
||||
* at the head of the list, if we use any task at all.
|
||||
* I'm not sure this is 100% guaranteed, if it is,
|
||||
* it would be a big speedup.
|
||||
*/
|
||||
|
||||
node = dd->pending_tasks;
|
||||
while (node != NULL)
|
||||
{
|
||||
AgGetPropertyTask *task = (AgGetPropertyTask*) node;
|
||||
|
||||
if (task->request_seq == request_seq)
|
||||
return task;
|
||||
|
||||
node = node->next;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static Bool
|
||||
async_get_property_handler (Display *dpy,
|
||||
xReply *rep,
|
||||
char *buf,
|
||||
int len,
|
||||
XPointer data)
|
||||
{
|
||||
xGetPropertyReply replbuf;
|
||||
xGetPropertyReply *reply;
|
||||
AgGetPropertyTask *task;
|
||||
AgPerDisplayData *dd;
|
||||
int bytes_read;
|
||||
|
||||
dd = (AgPerDisplayData*) data;
|
||||
|
||||
#if 0
|
||||
printf ("%s: seeing request seq %ld buflen %d\n", __FUNCTION__,
|
||||
dpy->last_request_read, len);
|
||||
#endif
|
||||
|
||||
task = find_pending_by_request_sequence (dd, dpy->last_request_read);
|
||||
|
||||
if (task == NULL)
|
||||
return False;
|
||||
|
||||
assert (dpy->last_request_read == task->request_seq);
|
||||
|
||||
task->have_reply = True;
|
||||
move_to_completed (dd, task);
|
||||
|
||||
/* read bytes so far */
|
||||
bytes_read = SIZEOF (xReply);
|
||||
|
||||
if (rep->generic.type == X_Error)
|
||||
{
|
||||
xError errbuf;
|
||||
|
||||
task->error = rep->error.errorCode;
|
||||
|
||||
#ifdef DEBUG_SPEW
|
||||
printf ("%s: error code = %d (ignoring error, eating %d bytes, generic.length = %ld)\n",
|
||||
__FUNCTION__, task->error, (SIZEOF (xError) - bytes_read),
|
||||
rep->generic.length);
|
||||
#endif
|
||||
|
||||
/* We return True (meaning we consumed the reply)
|
||||
* because otherwise it would invoke the X error handler,
|
||||
* and an async API is useless if you have to synchronously
|
||||
* trap X errors. Also GetProperty can always fail, pretty
|
||||
* much, so trapping errors is always what you want.
|
||||
*
|
||||
* We have to eat all the error reply data here.
|
||||
* (kind of a charade as we know sizeof(xError) == sizeof(xReply))
|
||||
*
|
||||
* Passing discard = True seems to break things; I don't understand
|
||||
* why, because there should be no extra data in an error reply,
|
||||
* right?
|
||||
*/
|
||||
_XGetAsyncReply (dpy, (char *)&errbuf, rep, buf, len,
|
||||
(SIZEOF (xError) - bytes_read) >> 2, /* in 32-bit words */
|
||||
False); /* really seems like it should be True */
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_SPEW
|
||||
printf ("%s: already read %d bytes reading %d more for total of %d; generic.length = %ld\n",
|
||||
__FUNCTION__, bytes_read, (SIZEOF (xGetPropertyReply) - bytes_read) >> 2,
|
||||
SIZEOF (xGetPropertyReply), rep->generic.length);
|
||||
#endif
|
||||
|
||||
/* (kind of a silly as we know sizeof(xGetPropertyReply) == sizeof(xReply)) */
|
||||
reply = (xGetPropertyReply *)
|
||||
_XGetAsyncReply (dpy, (char *)&replbuf, rep, buf, len,
|
||||
(SIZEOF (xGetPropertyReply) - bytes_read) >> 2, /* in 32-bit words */
|
||||
False); /* False means expecting more data to follow,
|
||||
* don't eat the rest of the reply
|
||||
*/
|
||||
|
||||
bytes_read = SIZEOF (xGetPropertyReply);
|
||||
|
||||
#ifdef DEBUG_SPEW
|
||||
printf ("%s: have reply propertyType = %ld format = %d n_items = %ld\n",
|
||||
__FUNCTION__, reply->propertyType, reply->format, reply->nItems);
|
||||
#endif
|
||||
|
||||
assert (task->data == NULL);
|
||||
|
||||
/* This is all copied from XGetWindowProperty(). Not sure we should
|
||||
* LockDisplay(). Not sure I'm passing the right args to
|
||||
* XGetAsyncData(). Not sure about a lot of things.
|
||||
*/
|
||||
|
||||
/* LockDisplay (dpy); */
|
||||
|
||||
if (reply->propertyType != None)
|
||||
{
|
||||
long nbytes, netbytes;
|
||||
|
||||
/* this alignment macro from orbit2 */
|
||||
#define ALIGN_VALUE(this, boundary) \
|
||||
(( ((unsigned long)(this)) + (((unsigned long)(boundary)) -1)) & (~(((unsigned long)(boundary))-1)))
|
||||
|
||||
switch (reply->format)
|
||||
{
|
||||
/*
|
||||
* One extra byte is malloced than is needed to contain the property
|
||||
* data, but this last byte is null terminated and convenient for
|
||||
* returning string properties, so the client doesn't then have to
|
||||
* recopy the string to make it null terminated.
|
||||
*/
|
||||
case 8:
|
||||
nbytes = reply->nItems;
|
||||
/* there's padding to word boundary */
|
||||
netbytes = ALIGN_VALUE (nbytes, 4);
|
||||
if (nbytes + 1 > 0 &&
|
||||
(task->data = (unsigned char *) Xmalloc ((unsigned)nbytes + 1)))
|
||||
{
|
||||
#ifdef DEBUG_SPEW
|
||||
printf ("%s: already read %d bytes using %ld, more eating %ld more\n",
|
||||
__FUNCTION__, bytes_read, nbytes, netbytes);
|
||||
#endif
|
||||
/* _XReadPad (dpy, (char *) task->data, netbytes); */
|
||||
_XGetAsyncData (dpy, task->data, buf, len,
|
||||
bytes_read, nbytes,
|
||||
netbytes);
|
||||
}
|
||||
break;
|
||||
|
||||
case 16:
|
||||
nbytes = reply->nItems * sizeof (short);
|
||||
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)))
|
||||
{
|
||||
#ifdef DEBUG_SPEW
|
||||
printf ("%s: already read %d bytes using %ld more, eating %ld more\n",
|
||||
__FUNCTION__, bytes_read, nbytes, netbytes);
|
||||
#endif
|
||||
/* _XRead16Pad (dpy, (short *) task->data, netbytes); */
|
||||
_XGetAsyncData (dpy, task->data, buf, len,
|
||||
bytes_read, nbytes, netbytes);
|
||||
}
|
||||
break;
|
||||
|
||||
case 32:
|
||||
nbytes = reply->nItems * sizeof (CARD32);
|
||||
netbytes = reply->nItems << 2;
|
||||
if (nbytes + 1 > 0 &&
|
||||
(task->data = (unsigned char *) Xmalloc ((unsigned)nbytes + 1)))
|
||||
{
|
||||
#ifdef DEBUG_SPEW
|
||||
printf ("%s: already read %d bytes using %ld more, eating %ld more\n",
|
||||
__FUNCTION__, bytes_read, nbytes, netbytes);
|
||||
#endif
|
||||
/* _XRead32 (dpy, (long *) task->data, netbytes); */
|
||||
_XGetAsyncData (dpy, task->data, buf, len,
|
||||
bytes_read, nbytes,
|
||||
netbytes);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
/*
|
||||
* This part of the code should never be reached. If it is,
|
||||
* the server sent back a property with an invalid format.
|
||||
* This is a BadImplementation error.
|
||||
*
|
||||
* However this async GetProperty API doesn't report errors
|
||||
* via the standard X mechanism, so don't do anything about
|
||||
* it, other than store it in task->error.
|
||||
*/
|
||||
{
|
||||
#if 0
|
||||
xError error;
|
||||
#endif
|
||||
|
||||
task->error = BadImplementation;
|
||||
|
||||
#if 0
|
||||
error.sequenceNumber = task->request_seq;
|
||||
error.type = X_Error;
|
||||
error.majorCode = X_GetProperty;
|
||||
error.minorCode = 0;
|
||||
error.errorCode = BadImplementation;
|
||||
|
||||
_XError (dpy, &error);
|
||||
#endif
|
||||
}
|
||||
|
||||
nbytes = netbytes = 0L;
|
||||
break;
|
||||
}
|
||||
|
||||
if (task->data == NULL)
|
||||
{
|
||||
task->error = BadAlloc;
|
||||
|
||||
#ifdef DEBUG_SPEW
|
||||
printf ("%s: already read %d bytes eating %ld\n",
|
||||
__FUNCTION__, bytes_read, netbytes);
|
||||
#endif
|
||||
/* _XEatData (dpy, (unsigned long) netbytes); */
|
||||
_XGetAsyncData (dpy, NULL, buf, len,
|
||||
bytes_read, 0, netbytes);
|
||||
|
||||
/* UnlockDisplay (dpy); */
|
||||
return BadAlloc; /* not Success */
|
||||
}
|
||||
|
||||
(task->data)[nbytes] = '\0';
|
||||
}
|
||||
|
||||
#ifdef DEBUG_SPEW
|
||||
printf ("%s: have data\n", __FUNCTION__);
|
||||
#endif
|
||||
|
||||
task->actual_type = reply->propertyType;
|
||||
task->actual_format = reply->format;
|
||||
task->n_items = reply->nItems;
|
||||
task->bytes_after = reply->bytesAfter;
|
||||
|
||||
/* UnlockDisplay (dpy); */
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
static AgPerDisplayData*
|
||||
get_display_data (Display *display,
|
||||
Bool create)
|
||||
{
|
||||
ListNode *node;
|
||||
AgPerDisplayData *dd;
|
||||
|
||||
node = display_datas;
|
||||
while (node != NULL)
|
||||
{
|
||||
dd = (AgPerDisplayData*) node;
|
||||
|
||||
if (dd->display == display)
|
||||
return dd;
|
||||
|
||||
node = node->next;
|
||||
}
|
||||
|
||||
if (!create)
|
||||
return NULL;
|
||||
|
||||
dd = Xcalloc (1, sizeof (AgPerDisplayData));
|
||||
if (dd == NULL)
|
||||
return NULL;
|
||||
|
||||
dd->display = display;
|
||||
dd->async.next = display->async_handlers;
|
||||
dd->async.handler = async_get_property_handler;
|
||||
dd->async.data = (XPointer) dd;
|
||||
dd->display->async_handlers = &dd->async;
|
||||
|
||||
append_to_list (&display_datas,
|
||||
&display_datas_tail,
|
||||
&dd->node);
|
||||
|
||||
return dd;
|
||||
}
|
||||
|
||||
static void
|
||||
maybe_free_display_data (AgPerDisplayData *dd)
|
||||
{
|
||||
if (dd->pending_tasks == NULL &&
|
||||
dd->completed_tasks == NULL)
|
||||
{
|
||||
DeqAsyncHandler (dd->display, &dd->async);
|
||||
remove_from_list (&display_datas, &display_datas_tail,
|
||||
&dd->node);
|
||||
XFree (dd);
|
||||
}
|
||||
}
|
||||
|
||||
AgGetPropertyTask*
|
||||
ag_task_create (Display *dpy,
|
||||
Window window,
|
||||
Atom property,
|
||||
long offset,
|
||||
long length,
|
||||
Bool delete,
|
||||
Atom req_type)
|
||||
{
|
||||
AgGetPropertyTask *task;
|
||||
xGetPropertyReq *req;
|
||||
xError error;
|
||||
AgPerDisplayData *dd;
|
||||
|
||||
/* Fire up our request */
|
||||
LockDisplay (dpy);
|
||||
|
||||
dd = get_display_data (dpy, True);
|
||||
if (dd == NULL)
|
||||
{
|
||||
UnlockDisplay (dpy);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
GetReq (GetProperty, req);
|
||||
req->window = window;
|
||||
req->property = property;
|
||||
req->type = req_type;
|
||||
req->delete = delete;
|
||||
req->longOffset = offset;
|
||||
req->longLength = length;
|
||||
|
||||
error.sequenceNumber = dpy->request;
|
||||
|
||||
/* Queue up our async task */
|
||||
task = Xcalloc (1, sizeof (AgGetPropertyTask));
|
||||
if (task == NULL)
|
||||
{
|
||||
UnlockDisplay (dpy);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
task->dd = dd;
|
||||
task->window = window;
|
||||
task->property = property;
|
||||
task->request_seq = dpy->request;
|
||||
|
||||
append_to_list (&dd->pending_tasks,
|
||||
&dd->pending_tasks_tail,
|
||||
&task->node);
|
||||
dd->n_tasks_pending += 1;
|
||||
|
||||
UnlockDisplay (dpy);
|
||||
|
||||
SyncHandle ();
|
||||
|
||||
return task;
|
||||
}
|
||||
|
||||
static void
|
||||
free_task (AgGetPropertyTask *task)
|
||||
{
|
||||
remove_from_list (&task->dd->completed_tasks,
|
||||
&task->dd->completed_tasks_tail,
|
||||
&task->node);
|
||||
task->dd->n_tasks_completed -= 1;
|
||||
maybe_free_display_data (task->dd);
|
||||
XFree (task);
|
||||
}
|
||||
|
||||
Status
|
||||
ag_task_get_reply_and_free (AgGetPropertyTask *task,
|
||||
Atom *actual_type,
|
||||
int *actual_format,
|
||||
unsigned long *nitems,
|
||||
unsigned long *bytesafter,
|
||||
unsigned char **prop)
|
||||
{
|
||||
Display *dpy;
|
||||
|
||||
*prop = NULL;
|
||||
|
||||
dpy = task->dd->display; /* Xlib macros require a variable named "dpy" */
|
||||
|
||||
if (task->error != Success)
|
||||
{
|
||||
Status s = task->error;
|
||||
|
||||
free_task (task);
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
if (!task->have_reply)
|
||||
{
|
||||
free_task (task);
|
||||
|
||||
return BadAlloc; /* not Success */
|
||||
}
|
||||
|
||||
*actual_type = task->actual_type;
|
||||
*actual_format = task->actual_format;
|
||||
*nitems = task->n_items;
|
||||
*bytesafter = task->bytes_after;
|
||||
|
||||
*prop = task->data; /* pass out ownership of task->data */
|
||||
|
||||
SyncHandle ();
|
||||
|
||||
free_task (task);
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
Bool
|
||||
ag_task_have_reply (AgGetPropertyTask *task)
|
||||
{
|
||||
return task->have_reply;
|
||||
}
|
||||
|
||||
Atom
|
||||
ag_task_get_property (AgGetPropertyTask *task)
|
||||
{
|
||||
return task->property;
|
||||
}
|
||||
|
||||
Window
|
||||
ag_task_get_window (AgGetPropertyTask *task)
|
||||
{
|
||||
return task->window;
|
||||
}
|
||||
|
||||
Display*
|
||||
ag_task_get_display (AgGetPropertyTask *task)
|
||||
{
|
||||
return task->dd->display;
|
||||
}
|
||||
|
||||
AgGetPropertyTask*
|
||||
ag_get_next_completed_task (Display *display)
|
||||
{
|
||||
AgPerDisplayData *dd;
|
||||
|
||||
dd = get_display_data (display, False);
|
||||
|
||||
if (dd == NULL)
|
||||
return NULL;
|
||||
|
||||
#ifdef DEBUG_SPEW
|
||||
printf ("%d pending %d completed\n",
|
||||
dd->n_tasks_pending,
|
||||
dd->n_tasks_completed);
|
||||
#endif
|
||||
|
||||
return (AgGetPropertyTask*) dd->completed_tasks;
|
||||
}
|
||||
|
||||
void*
|
||||
ag_Xmalloc (unsigned long bytes)
|
||||
{
|
||||
return (void*) Xmalloc (bytes);
|
||||
}
|
||||
|
||||
void*
|
||||
ag_Xmalloc0 (unsigned long bytes)
|
||||
{
|
||||
return (void*) Xcalloc (bytes, 1);
|
||||
}
|
||||
65
src/async-getprop.h
Normal file
65
src/async-getprop.h
Normal file
@@ -0,0 +1,65 @@
|
||||
/* Asynchronous X property getting hack */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2002 Havoc Pennington
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software
|
||||
* and its documentation for any purpose is hereby granted without
|
||||
* fee, provided that the above copyright notice appear in all copies
|
||||
* and that both that copyright notice and this permission notice
|
||||
* appear in supporting documentation.
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR
|
||||
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
||||
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Except as contained in this notice, the name of The Open Group shall not be
|
||||
* used in advertising or otherwise to promote the sale, use or other dealings
|
||||
* in this Software without prior written authorization from The Open Group.
|
||||
*/
|
||||
|
||||
#ifndef ASYNC_GETPROP_H
|
||||
#define ASYNC_GETPROP_H
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
|
||||
typedef struct _AgGetPropertyTask AgGetPropertyTask;
|
||||
|
||||
AgGetPropertyTask* ag_task_create (Display *display,
|
||||
Window window,
|
||||
Atom property,
|
||||
long offset,
|
||||
long length,
|
||||
Bool delete,
|
||||
Atom req_type);
|
||||
Status ag_task_get_reply_and_free (AgGetPropertyTask *task,
|
||||
Atom *actual_type,
|
||||
int *actual_format,
|
||||
unsigned long *nitems,
|
||||
unsigned long *bytesafter,
|
||||
unsigned char **prop);
|
||||
|
||||
Bool ag_task_have_reply (AgGetPropertyTask *task);
|
||||
Atom ag_task_get_property (AgGetPropertyTask *task);
|
||||
Window ag_task_get_window (AgGetPropertyTask *task);
|
||||
Display* ag_task_get_display (AgGetPropertyTask *task);
|
||||
|
||||
AgGetPropertyTask* ag_get_next_completed_task (Display *display);
|
||||
|
||||
/* so other headers don't have to include internal Xlib goo */
|
||||
void* ag_Xmalloc (unsigned long bytes);
|
||||
void* ag_Xmalloc0 (unsigned long bytes);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
250
src/bell.c
Normal file
250
src/bell.c
Normal file
@@ -0,0 +1,250 @@
|
||||
/* Metacity visual bell */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2002 Sun Microsystems 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>
|
||||
#include "bell.h"
|
||||
#include "screen.h"
|
||||
#include "prefs.h"
|
||||
|
||||
static void
|
||||
meta_bell_flash_screen (MetaDisplay *display,
|
||||
MetaScreen *screen)
|
||||
{
|
||||
Window root = screen->xroot;
|
||||
int width = screen->width;
|
||||
int height = screen->height;
|
||||
|
||||
if (screen->flash_window == None)
|
||||
{
|
||||
Visual *visual = CopyFromParent;
|
||||
XSetWindowAttributes xswa;
|
||||
int depth = CopyFromParent;
|
||||
xswa.save_under = True;
|
||||
xswa.override_redirect = True;
|
||||
/*
|
||||
* TODO: use XGetVisualInfo and determine which is an
|
||||
* overlay, if one is present, and use the Overlay visual
|
||||
* for this window (for performance reasons).
|
||||
* Not sure how to tell this yet...
|
||||
*/
|
||||
screen->flash_window = XCreateWindow (display->xdisplay, root,
|
||||
0, 0, width, height,
|
||||
0, depth,
|
||||
InputOutput,
|
||||
visual,
|
||||
/* note: XSun doesn't like SaveUnder here */
|
||||
CWSaveUnder | CWOverrideRedirect,
|
||||
&xswa);
|
||||
XSelectInput (display->xdisplay, screen->flash_window, ExposureMask);
|
||||
XMapWindow (display->xdisplay, screen->flash_window);
|
||||
XSync (display->xdisplay, False);
|
||||
XFlush (display->xdisplay);
|
||||
XUnmapWindow (display->xdisplay, screen->flash_window);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* just draw something in the window */
|
||||
GC gc = XCreateGC (display->xdisplay, screen->flash_window, 0, NULL);
|
||||
XMapWindow (display->xdisplay, screen->flash_window);
|
||||
XSetForeground (display->xdisplay, gc,
|
||||
WhitePixel (display->xdisplay,
|
||||
XScreenNumberOfScreen (screen->xscreen)));
|
||||
XFillRectangle (display->xdisplay, screen->flash_window, gc,
|
||||
0, 0, width, height);
|
||||
XSetForeground (display->xdisplay, gc,
|
||||
BlackPixel (display->xdisplay,
|
||||
XScreenNumberOfScreen (screen->xscreen)));
|
||||
XFillRectangle (display->xdisplay, screen->flash_window, gc,
|
||||
0, 0, width, height);
|
||||
XFlush (display->xdisplay);
|
||||
XSync (display->xdisplay, False);
|
||||
XUnmapWindow (display->xdisplay, screen->flash_window);
|
||||
}
|
||||
XFlush (display->xdisplay);
|
||||
}
|
||||
|
||||
#ifdef HAVE_XKB
|
||||
static void
|
||||
meta_bell_flash_fullscreen (MetaDisplay *display,
|
||||
XkbAnyEvent *xkb_ev)
|
||||
{
|
||||
XkbBellNotifyEvent *xkb_bell_ev = (XkbBellNotifyEvent *) xkb_ev;
|
||||
MetaScreen *screen;
|
||||
|
||||
g_assert (xkb_ev->xkb_type == XkbBellNotify);
|
||||
if (xkb_bell_ev->window != None)
|
||||
{
|
||||
screen = meta_display_screen_for_xwindow (display, xkb_bell_ev->window);
|
||||
if (screen)
|
||||
meta_bell_flash_screen (display, screen);
|
||||
}
|
||||
else
|
||||
{
|
||||
GSList *screen_list = display->screens;
|
||||
while (screen_list)
|
||||
{
|
||||
screen = (MetaScreen *) screen_list->data;
|
||||
meta_bell_flash_screen (display, screen);
|
||||
screen_list = screen_list->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
meta_bell_unflash_frame (gpointer data)
|
||||
{
|
||||
MetaFrame *frame = (MetaFrame *) data;
|
||||
frame->is_flashing = 0;
|
||||
meta_frame_queue_draw (frame);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_bell_flash_window_frame (MetaWindow *window)
|
||||
{
|
||||
g_assert (window->frame != NULL);
|
||||
window->frame->is_flashing = 1;
|
||||
meta_frame_queue_draw (window->frame);
|
||||
g_timeout_add_full (G_PRIORITY_DEFAULT_IDLE, 100,
|
||||
meta_bell_unflash_frame, window->frame, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_bell_flash_frame (MetaDisplay *display,
|
||||
XkbAnyEvent *xkb_ev)
|
||||
{
|
||||
XkbBellNotifyEvent *xkb_bell_event = (XkbBellNotifyEvent *) xkb_ev;
|
||||
MetaWindow *window;
|
||||
|
||||
g_assert (xkb_ev->xkb_type == XkbBellNotify);
|
||||
window = meta_display_lookup_x_window (display, xkb_bell_event->window);
|
||||
if (!window && (display->focus_window->frame))
|
||||
{
|
||||
window = display->focus_window;
|
||||
}
|
||||
if (window)
|
||||
{
|
||||
meta_bell_flash_window_frame (window);
|
||||
}
|
||||
else /* revert to fullscreen flash if there's no focussed window */
|
||||
{
|
||||
meta_bell_flash_fullscreen (display, xkb_ev);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
meta_bell_visual_notify (MetaDisplay *display,
|
||||
XkbAnyEvent *xkb_ev)
|
||||
{
|
||||
switch (meta_prefs_get_visual_bell_type ())
|
||||
{
|
||||
case META_VISUAL_BELL_FULLSCREEN_FLASH:
|
||||
meta_bell_flash_fullscreen (display, xkb_ev);
|
||||
break;
|
||||
case META_VISUAL_BELL_FRAME_FLASH:
|
||||
meta_bell_flash_frame (display, xkb_ev); /* does nothing yet */
|
||||
break;
|
||||
case META_VISUAL_BELL_INVALID:
|
||||
/* do nothing */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
meta_bell_notify (MetaDisplay *display,
|
||||
XkbAnyEvent *xkb_ev)
|
||||
{
|
||||
/* flash something */
|
||||
if (meta_prefs_get_visual_bell ())
|
||||
meta_bell_visual_notify (display, xkb_ev);
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
meta_bell_set_audible (MetaDisplay *display, gboolean audible)
|
||||
{
|
||||
#ifdef HAVE_XKB
|
||||
XkbChangeEnabledControls (display->xdisplay,
|
||||
XkbUseCoreKbd,
|
||||
XkbAudibleBellMask,
|
||||
audible ? XkbAudibleBellMask : 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_bell_init (MetaDisplay *display)
|
||||
{
|
||||
#ifdef HAVE_XKB
|
||||
int xkb_base_error_type, xkb_opcode;
|
||||
|
||||
if (!XkbQueryExtension (display->xdisplay, &xkb_opcode,
|
||||
&display->xkb_base_event_type,
|
||||
&xkb_base_error_type,
|
||||
NULL, NULL))
|
||||
{
|
||||
display->xkb_base_event_type = -1;
|
||||
g_message ("could not find XKB extension.");
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned int mask = XkbBellNotifyMask;
|
||||
gboolean visual_bell_auto_reset = FALSE;
|
||||
/* TRUE if and when non-broken version is available */
|
||||
XkbSelectEvents (display->xdisplay,
|
||||
XkbUseCoreKbd,
|
||||
XkbBellNotifyMask,
|
||||
XkbBellNotifyMask);
|
||||
XkbChangeEnabledControls (display->xdisplay,
|
||||
XkbUseCoreKbd,
|
||||
XkbAudibleBellMask,
|
||||
meta_prefs_bell_is_audible ()
|
||||
? XkbAudibleBellMask : 0);
|
||||
if (visual_bell_auto_reset) {
|
||||
XkbSetAutoResetControls (display->xdisplay,
|
||||
XkbAudibleBellMask,
|
||||
&mask,
|
||||
&mask);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
meta_bell_shutdown (MetaDisplay *display)
|
||||
{
|
||||
#ifdef HAVE_XKB
|
||||
/* TODO: persist initial bell state in display, reset here */
|
||||
XkbChangeEnabledControls (display->xdisplay,
|
||||
XkbUseCoreKbd,
|
||||
XkbAudibleBellMask,
|
||||
XkbAudibleBellMask);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
meta_bell_notify_frame_destroy (MetaFrame *frame)
|
||||
{
|
||||
if (frame->is_flashing)
|
||||
g_idle_remove_by_data (frame);
|
||||
}
|
||||
34
src/bell.h
Normal file
34
src/bell.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/* Metacity visual bell */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2002 Sun Microsystems 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.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_XKB
|
||||
#include <X11/XKBlib.h>
|
||||
#endif
|
||||
#include "display.h"
|
||||
#include "frame.h"
|
||||
|
||||
#ifdef HAVE_XKB
|
||||
void meta_bell_notify (MetaDisplay *display, XkbAnyEvent *xkb_ev);
|
||||
#endif
|
||||
void meta_bell_set_audible (MetaDisplay *display, gboolean audible);
|
||||
gboolean meta_bell_init (MetaDisplay *display);
|
||||
void meta_bell_shutdown (MetaDisplay *display);
|
||||
void meta_bell_notify_frame_destroy (MetaFrame *frame);
|
||||
40
src/common.h
40
src/common.h
@@ -42,7 +42,8 @@ typedef enum
|
||||
META_FRAME_MAXIMIZED = 1 << 9,
|
||||
META_FRAME_ALLOWS_SHADE = 1 << 10,
|
||||
META_FRAME_ALLOWS_MOVE = 1 << 11,
|
||||
META_FRAME_FULLSCREEN = 1 << 12
|
||||
META_FRAME_FULLSCREEN = 1 << 12,
|
||||
META_FRAME_IS_FLASHING = 1 << 13
|
||||
} MetaFrameFlags;
|
||||
|
||||
typedef enum
|
||||
@@ -117,7 +118,6 @@ typedef enum
|
||||
META_GRAB_OP_CLICKING_MENU
|
||||
} MetaGrabOp;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
META_CURSOR_DEFAULT,
|
||||
@@ -130,7 +130,8 @@ typedef enum
|
||||
META_CURSOR_NE_RESIZE,
|
||||
META_CURSOR_NW_RESIZE,
|
||||
META_CURSOR_MOVE_WINDOW,
|
||||
META_CURSOR_RESIZE_WINDOW
|
||||
META_CURSOR_RESIZE_WINDOW,
|
||||
META_CURSOR_BUSY
|
||||
|
||||
} MetaCursor;
|
||||
|
||||
@@ -141,6 +142,13 @@ typedef enum
|
||||
META_FOCUS_MODE_MOUSE
|
||||
} MetaFocusMode;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
META_ACTION_DOUBLE_CLICK_TITLEBAR_TOGGLE_SHADE,
|
||||
META_ACTION_DOUBLE_CLICK_TITLEBAR_TOGGLE_MAXIMIZE,
|
||||
META_ACTION_DOUBLE_CLICK_TITLEBAR_LAST
|
||||
} MetaActionDoubleClickTitlebar;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
META_FRAME_TYPE_NORMAL,
|
||||
@@ -169,6 +177,32 @@ typedef enum
|
||||
META_VIRTUAL_MOD5_MASK = 1 << 14
|
||||
} MetaVirtualModifier;
|
||||
|
||||
|
||||
/* Function a window button can have. Note, you can't add stuff here
|
||||
* without extending the theme format to draw a new function and
|
||||
* breaking all existing themes.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
META_BUTTON_FUNCTION_MENU,
|
||||
META_BUTTON_FUNCTION_MINIMIZE,
|
||||
META_BUTTON_FUNCTION_MAXIMIZE,
|
||||
META_BUTTON_FUNCTION_CLOSE,
|
||||
META_BUTTON_FUNCTION_LAST
|
||||
} MetaButtonFunction;
|
||||
|
||||
#define MAX_BUTTONS_PER_CORNER META_BUTTON_FUNCTION_LAST
|
||||
|
||||
typedef struct _MetaButtonLayout MetaButtonLayout;
|
||||
struct _MetaButtonLayout
|
||||
{
|
||||
/* buttons in the group on the left side */
|
||||
MetaButtonFunction left_buttons[MAX_BUTTONS_PER_CORNER];
|
||||
|
||||
/* buttons in the group on the right side */
|
||||
MetaButtonFunction right_buttons[MAX_BUTTONS_PER_CORNER];
|
||||
};
|
||||
|
||||
/* should investigate changing these to whatever most apps use */
|
||||
#define META_ICON_WIDTH 32
|
||||
#define META_ICON_HEIGHT 32
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
71
src/core.c
71
src/core.c
@@ -19,6 +19,7 @@
|
||||
* 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include "core.h"
|
||||
#include "frame.h"
|
||||
#include "workspace.h"
|
||||
@@ -45,6 +46,22 @@ meta_core_get_client_size (Display *xdisplay,
|
||||
*height = window->rect.height;
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
return window->xwindow;
|
||||
}
|
||||
|
||||
MetaFrameFlags
|
||||
meta_core_get_frame_flags (Display *xdisplay,
|
||||
Window frame_xwindow)
|
||||
@@ -217,6 +234,22 @@ meta_core_user_raise (Display *xdisplay,
|
||||
meta_window_raise (window);
|
||||
}
|
||||
|
||||
void
|
||||
meta_core_user_lower (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);
|
||||
|
||||
meta_window_lower (window);
|
||||
}
|
||||
|
||||
void
|
||||
meta_core_user_focus (Display *xdisplay,
|
||||
Window frame_xwindow,
|
||||
@@ -306,6 +339,25 @@ meta_core_maximize (Display *xdisplay,
|
||||
meta_window_maximize (window);
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
if (window == NULL || window->frame == NULL)
|
||||
meta_bug ("No such frame window 0x%lx!\n", frame_xwindow);
|
||||
|
||||
if (window->maximized)
|
||||
meta_window_unmaximize (window);
|
||||
else
|
||||
meta_window_maximize (window);
|
||||
}
|
||||
|
||||
void
|
||||
meta_core_unmaximize (Display *xdisplay,
|
||||
Window frame_xwindow)
|
||||
@@ -418,9 +470,8 @@ meta_core_change_workspace (Display *xdisplay,
|
||||
meta_bug ("No such frame window 0x%lx!\n", frame_xwindow);
|
||||
|
||||
meta_window_change_workspace (window,
|
||||
meta_display_get_workspace_by_screen_index (display,
|
||||
window->screen,
|
||||
new_workspace));
|
||||
meta_screen_get_workspace_by_index (window->screen,
|
||||
new_workspace));
|
||||
}
|
||||
|
||||
int
|
||||
@@ -440,7 +491,7 @@ meta_core_get_active_workspace (Screen *xscreen)
|
||||
|
||||
screen = meta_screen_for_x_screen (xscreen);
|
||||
|
||||
return meta_workspace_screen_index (screen->active_workspace);
|
||||
return meta_workspace_index (screen->active_workspace);
|
||||
}
|
||||
|
||||
int
|
||||
@@ -606,16 +657,20 @@ meta_core_get_menu_accelerator (MetaMenuOp menu_op,
|
||||
}
|
||||
}
|
||||
|
||||
char *
|
||||
const char*
|
||||
meta_core_get_workspace_name_with_index (Display *xdisplay,
|
||||
int index)
|
||||
Window xroot,
|
||||
int index)
|
||||
{
|
||||
MetaDisplay *display;
|
||||
MetaScreen *screen;
|
||||
MetaWorkspace *workspace;
|
||||
|
||||
display = meta_display_for_x_display (xdisplay);
|
||||
workspace = meta_display_get_workspace_by_index (display, index);
|
||||
return (workspace != NULL) ? workspace->name : NULL;
|
||||
screen = meta_display_screen_for_root (display, xroot);
|
||||
g_assert (screen != NULL);
|
||||
workspace = meta_screen_get_workspace_by_index (screen, index);
|
||||
return workspace ? meta_workspace_get_name (workspace) : NULL;
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
||||
12
src/core.h
12
src/core.h
@@ -31,6 +31,9 @@ void meta_core_get_client_size (Display *xdisplay,
|
||||
int *width,
|
||||
int *height);
|
||||
|
||||
Window meta_core_get_client_xwindow (Display *xdisplay,
|
||||
Window frame_xwindow);
|
||||
|
||||
MetaFrameFlags meta_core_get_frame_flags (Display *xdisplay,
|
||||
Window frame_xwindow);
|
||||
MetaFrameType meta_core_get_frame_type (Display *xdisplay,
|
||||
@@ -57,6 +60,8 @@ void meta_core_user_resize (Display *xdisplay,
|
||||
|
||||
void meta_core_user_raise (Display *xdisplay,
|
||||
Window frame_xwindow);
|
||||
void meta_core_user_lower (Display *xdisplay,
|
||||
Window frame_xwindow);
|
||||
|
||||
void meta_core_user_focus (Display *xdisplay,
|
||||
Window frame_xwindow,
|
||||
@@ -75,6 +80,8 @@ void meta_core_get_size (Display *xdisplay,
|
||||
|
||||
void meta_core_minimize (Display *xdisplay,
|
||||
Window frame_xwindow);
|
||||
void meta_core_toggle_maximize (Display *xdisplay,
|
||||
Window frame_xwindow);
|
||||
void meta_core_unmaximize (Display *xdisplay,
|
||||
Window frame_xwindow);
|
||||
void meta_core_maximize (Display *xdisplay,
|
||||
@@ -98,8 +105,9 @@ int meta_core_get_num_workspaces (Screen *xscreen);
|
||||
int meta_core_get_active_workspace (Screen *xscreen);
|
||||
int meta_core_get_frame_workspace (Display *xdisplay,
|
||||
Window frame_xwindow);
|
||||
char* meta_core_get_workspace_name_with_index (Display *xdisplay,
|
||||
int index);
|
||||
const char* meta_core_get_workspace_name_with_index (Display *xdisplay,
|
||||
Window xroot,
|
||||
int index);
|
||||
|
||||
void meta_core_get_frame_extents (Display *xdisplay,
|
||||
Window frame_xwindow,
|
||||
|
||||
@@ -38,11 +38,9 @@ delete_ping_reply_func (MetaDisplay *display,
|
||||
Window xwindow,
|
||||
void *user_data)
|
||||
{
|
||||
MetaWindow *window = user_data;
|
||||
|
||||
meta_topic (META_DEBUG_PING,
|
||||
"Got reply to delete ping for %s\n",
|
||||
window->desc);
|
||||
((MetaWindow*)user_data)->desc);
|
||||
|
||||
/* we do nothing */
|
||||
}
|
||||
@@ -371,7 +369,7 @@ meta_window_delete (MetaWindow *window,
|
||||
window->desc);
|
||||
XKillClient (window->display->xdisplay, window->xwindow);
|
||||
}
|
||||
meta_error_trap_pop (window->display);
|
||||
meta_error_trap_pop (window->display, FALSE);
|
||||
|
||||
meta_display_ping_window (window->display,
|
||||
window,
|
||||
@@ -438,7 +436,7 @@ meta_window_kill (MetaWindow *window)
|
||||
window->desc);
|
||||
meta_error_trap_push (window->display);
|
||||
XKillClient (window->display->xdisplay, window->xwindow);
|
||||
meta_error_trap_pop (window->display);
|
||||
meta_error_trap_pop (window->display, FALSE);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
1267
src/display.c
1267
src/display.c
File diff suppressed because it is too large
Load Diff
102
src/display.h
102
src/display.h
@@ -2,6 +2,7 @@
|
||||
|
||||
/*
|
||||
* Copyright (C) 2001 Havoc Pennington
|
||||
* Copyright (C) 2002 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
|
||||
@@ -22,11 +23,23 @@
|
||||
#ifndef META_DISPLAY_H
|
||||
#define META_DISPLAY_H
|
||||
|
||||
#ifndef PACKAGE
|
||||
#error "config.h not included"
|
||||
#endif
|
||||
|
||||
#include <glib.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include "eventqueue.h"
|
||||
#include "common.h"
|
||||
|
||||
#ifdef HAVE_STARTUP_NOTIFICATION
|
||||
#include <libsn/sn.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_XSYNC
|
||||
#include <X11/extensions/sync.h>
|
||||
#endif
|
||||
|
||||
#define meta_XFree(p) do { if ((p)) XFree ((p)); } while (0)
|
||||
|
||||
/* this doesn't really belong here, oh well. */
|
||||
@@ -49,6 +62,9 @@ typedef struct _MetaUISlave MetaUISlave;
|
||||
typedef struct _MetaWindow MetaWindow;
|
||||
typedef struct _MetaWorkspace MetaWorkspace;
|
||||
|
||||
typedef struct _MetaWindowPropHooks MetaWindowPropHooks;
|
||||
typedef struct _MetaGroupPropHooks MetaGroupPropHooks;
|
||||
|
||||
typedef void (* MetaWindowPingFunc) (MetaDisplay *display,
|
||||
Window xwindow,
|
||||
gpointer user_data);
|
||||
@@ -123,7 +139,7 @@ struct _MetaDisplay
|
||||
Atom atom_metacity_set_keybindings_message;
|
||||
Atom atom_net_wm_state_hidden;
|
||||
Atom atom_net_wm_window_type_utility;
|
||||
Atom atom_net_wm_window_type_splashscreen;
|
||||
Atom atom_net_wm_window_type_splash;
|
||||
Atom atom_net_wm_ping;
|
||||
Atom atom_net_wm_pid;
|
||||
Atom atom_wm_client_machine;
|
||||
@@ -149,6 +165,13 @@ struct _MetaDisplay
|
||||
Atom atom_net_wm_action_close;
|
||||
Atom atom_net_wm_state_above;
|
||||
Atom atom_net_wm_state_below;
|
||||
Atom atom_net_startup_id;
|
||||
Atom atom_metacity_toggle_verbose;
|
||||
Atom atom_metacity_update_counter;
|
||||
Atom atom_sync_counter;
|
||||
Atom atom_gnome_panel_action;
|
||||
Atom atom_gnome_panel_action_main_menu;
|
||||
Atom atom_gnome_panel_action_run_dialog;
|
||||
|
||||
/* This is the actual window from focus events,
|
||||
* not the one we last set
|
||||
@@ -162,14 +185,12 @@ struct _MetaDisplay
|
||||
/* Most recently focused list. Always contains all
|
||||
* live windows.
|
||||
*/
|
||||
GList *mru_list;
|
||||
|
||||
GList *workspaces;
|
||||
GList *mru_list;
|
||||
|
||||
guint showing_desktop : 1;
|
||||
guint static_gravity_works : 1;
|
||||
|
||||
/*< private-ish >*/
|
||||
guint error_trap_synced_at_last_pop : 1;
|
||||
MetaEventQueue *events;
|
||||
GSList *screens;
|
||||
GHashTable *window_ids;
|
||||
@@ -204,6 +225,9 @@ struct _MetaDisplay
|
||||
|
||||
/* Pending autoraise */
|
||||
guint autoraise_timeout_id;
|
||||
|
||||
/* Alt+click button grabs */
|
||||
unsigned int window_grab_modifiers;
|
||||
|
||||
/* current window operation */
|
||||
MetaGrabOp grab_op;
|
||||
@@ -215,6 +239,8 @@ struct _MetaDisplay
|
||||
int grab_initial_root_y;
|
||||
int grab_current_root_x;
|
||||
int grab_current_root_y;
|
||||
int grab_latest_motion_x;
|
||||
int grab_latest_motion_y;
|
||||
gulong grab_mask;
|
||||
guint grab_have_pointer : 1;
|
||||
guint grab_have_keyboard : 1;
|
||||
@@ -222,15 +248,22 @@ struct _MetaDisplay
|
||||
MetaRectangle grab_current_window_pos;
|
||||
MetaResizePopup *grab_resize_popup;
|
||||
GTimeVal grab_last_moveresize_time;
|
||||
|
||||
Time grab_motion_notify_time;
|
||||
#ifdef HAVE_XKB
|
||||
int xkb_base_event_type;
|
||||
#endif
|
||||
#ifdef HAVE_XSYNC
|
||||
/* alarm monitoring client's _METACITY_UPDATE_COUNTER */
|
||||
XSyncAlarm grab_update_alarm;
|
||||
#endif
|
||||
|
||||
/* Keybindings stuff */
|
||||
MetaKeyBinding *screen_bindings;
|
||||
int n_screen_bindings;
|
||||
MetaKeyBinding *window_bindings;
|
||||
int n_window_bindings;
|
||||
int min_keycode;
|
||||
int max_keycode;
|
||||
unsigned int min_keycode;
|
||||
unsigned int max_keycode;
|
||||
KeySym *keymap;
|
||||
int keysyms_per_keycode;
|
||||
XModifierKeymap *modmap;
|
||||
@@ -249,6 +282,34 @@ struct _MetaDisplay
|
||||
|
||||
/* Managed by group.c */
|
||||
GHashTable *groups_by_leader;
|
||||
|
||||
/* currently-active window menu if any */
|
||||
MetaWindowMenu *window_menu;
|
||||
MetaWindow *window_with_menu;
|
||||
|
||||
/* Managed by window-props.c */
|
||||
MetaWindowPropHooks *prop_hooks;
|
||||
|
||||
/* Managed by group-props.c */
|
||||
MetaGroupPropHooks *group_prop_hooks;
|
||||
|
||||
#ifdef HAVE_STARTUP_NOTIFICATION
|
||||
SnDisplay *sn_display;
|
||||
#endif
|
||||
#ifdef HAVE_XSYNC
|
||||
int xsync_event_base;
|
||||
int xsync_error_base;
|
||||
#define META_DISPLAY_HAS_XSYNC(display) ((display)->xsync_event_base != 0)
|
||||
#else
|
||||
#define META_DISPLAY_HAS_XSYNC(display) FALSE
|
||||
#endif
|
||||
#ifdef HAVE_SHAPE
|
||||
int shape_event_base;
|
||||
int shape_error_base;
|
||||
#define META_DISPLAY_HAS_SHAPE(display) ((display)->shape_event_base != 0)
|
||||
#else
|
||||
#define META_DISPLAY_HAS_SHAPE(display) FALSE
|
||||
#endif
|
||||
};
|
||||
|
||||
gboolean meta_display_open (const char *name);
|
||||
@@ -285,12 +346,6 @@ GSList* meta_display_list_windows (MetaDisplay *display);
|
||||
MetaDisplay* meta_display_for_x_display (Display *xdisplay);
|
||||
GSList* meta_displays_list (void);
|
||||
|
||||
MetaWorkspace* meta_display_get_workspace_by_index (MetaDisplay *display,
|
||||
int index);
|
||||
MetaWorkspace* meta_display_get_workspace_by_screen_index (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
int index);
|
||||
|
||||
Cursor meta_display_create_x_cursor (MetaDisplay *display,
|
||||
MetaCursor cursor);
|
||||
|
||||
@@ -329,10 +384,6 @@ void meta_display_increment_event_serial (MetaDisplay *display);
|
||||
|
||||
void meta_display_update_active_window_hint (MetaDisplay *display);
|
||||
|
||||
/* Show/hide the desktop (temporarily hide all windows) */
|
||||
void meta_display_show_desktop (MetaDisplay *display);
|
||||
void meta_display_unshow_desktop (MetaDisplay *display);
|
||||
|
||||
guint32 meta_display_get_current_time (MetaDisplay *display);
|
||||
|
||||
/* utility goo */
|
||||
@@ -359,10 +410,10 @@ typedef enum
|
||||
|
||||
} MetaTabList;
|
||||
|
||||
GSList* meta_display_get_tab_list (MetaDisplay *display,
|
||||
MetaTabList type,
|
||||
MetaScreen *screen,
|
||||
MetaWorkspace *workspace);
|
||||
GList* meta_display_get_tab_list (MetaDisplay *display,
|
||||
MetaTabList type,
|
||||
MetaScreen *screen,
|
||||
MetaWorkspace *workspace);
|
||||
|
||||
MetaWindow* meta_display_get_tab_next (MetaDisplay *display,
|
||||
MetaTabList type,
|
||||
@@ -378,8 +429,15 @@ MetaWindow* meta_display_get_tab_current (MetaDisplay *display,
|
||||
|
||||
int meta_resize_gravity_from_grab_op (MetaGrabOp op);
|
||||
|
||||
gboolean meta_grab_op_is_moving (MetaGrabOp op);
|
||||
gboolean meta_grab_op_is_resizing (MetaGrabOp op);
|
||||
|
||||
gboolean meta_rectangle_intersect (MetaRectangle *src1,
|
||||
MetaRectangle *src2,
|
||||
MetaRectangle *dest);
|
||||
|
||||
void meta_display_devirtualize_modifiers (MetaDisplay *display,
|
||||
MetaVirtualModifier modifiers,
|
||||
unsigned int *mask);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -333,7 +333,9 @@ meta_effects_draw_box_animation (MetaScreen *screen,
|
||||
}
|
||||
else
|
||||
{
|
||||
context->image_window = meta_image_window_new (initial_rect->width,
|
||||
context->image_window = meta_image_window_new (screen->display->xdisplay,
|
||||
screen->number,
|
||||
initial_rect->width,
|
||||
initial_rect->height);
|
||||
context->orig_pixbuf = pix;
|
||||
meta_image_window_set (context->image_window,
|
||||
|
||||
91
src/errors.c
91
src/errors.c
@@ -37,13 +37,19 @@ meta_errors_init (void)
|
||||
XSetIOErrorHandler (x_io_error_handler);
|
||||
}
|
||||
|
||||
void
|
||||
meta_error_trap_push (MetaDisplay *display)
|
||||
static void
|
||||
meta_error_trap_push_internal (MetaDisplay *display,
|
||||
gboolean need_sync)
|
||||
{
|
||||
/* GDK resets the error handler on each push */
|
||||
int (* old_error_handler) (Display *,
|
||||
XErrorEvent *);
|
||||
|
||||
if (need_sync)
|
||||
{
|
||||
XSync (display->xdisplay, False);
|
||||
}
|
||||
|
||||
gdk_error_trap_push ();
|
||||
|
||||
/* old_error_handler will just be equal to x_error_handler
|
||||
@@ -60,17 +66,22 @@ meta_error_trap_push (MetaDisplay *display)
|
||||
}
|
||||
|
||||
display->error_traps += 1;
|
||||
|
||||
meta_topic (META_DEBUG_ERRORS, "%d traps remain\n", display->error_traps);
|
||||
}
|
||||
|
||||
int
|
||||
meta_error_trap_pop (MetaDisplay *display)
|
||||
static int
|
||||
meta_error_trap_pop_internal (MetaDisplay *display,
|
||||
gboolean need_sync)
|
||||
{
|
||||
int result;
|
||||
|
||||
g_assert (display->error_traps > 0);
|
||||
|
||||
/* just use GDK trap, but we do the sync since GDK doesn't */
|
||||
XSync (display->xdisplay, False);
|
||||
|
||||
if (need_sync)
|
||||
{
|
||||
XSync (display->xdisplay, False);
|
||||
}
|
||||
|
||||
result = gdk_error_trap_pop ();
|
||||
|
||||
@@ -92,9 +103,75 @@ meta_error_trap_pop (MetaDisplay *display)
|
||||
display->error_trap_handler = NULL;
|
||||
}
|
||||
|
||||
meta_topic (META_DEBUG_ERRORS, "%d traps\n", display->error_traps);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
meta_error_trap_push (MetaDisplay *display)
|
||||
{
|
||||
meta_error_trap_push_internal (display, FALSE);
|
||||
}
|
||||
|
||||
void
|
||||
meta_error_trap_pop (MetaDisplay *display,
|
||||
gboolean last_request_was_roundtrip)
|
||||
{
|
||||
gboolean need_sync;
|
||||
|
||||
/* we only have to sync when popping the outermost trap */
|
||||
need_sync = (display->error_traps == 1 && !last_request_was_roundtrip);
|
||||
|
||||
if (need_sync)
|
||||
meta_topic (META_DEBUG_SYNC, "Syncing on error_trap_pop, traps = %d, roundtrip = %d\n",
|
||||
display->error_traps, last_request_was_roundtrip);
|
||||
|
||||
display->error_trap_synced_at_last_pop = need_sync || last_request_was_roundtrip;
|
||||
|
||||
meta_error_trap_pop_internal (display, need_sync);
|
||||
}
|
||||
|
||||
void
|
||||
meta_error_trap_push_with_return (MetaDisplay *display)
|
||||
{
|
||||
gboolean need_sync;
|
||||
|
||||
/* We don't sync on push_with_return if there are no traps
|
||||
* currently, because we assume that any errors were either covered
|
||||
* by a previous pop, or were fatal.
|
||||
*
|
||||
* More generally, we don't sync if we were synchronized last time
|
||||
* we popped. This is known to be the case if there are no traps,
|
||||
* but we also keep a flag so we know whether it's the case otherwise.
|
||||
*/
|
||||
|
||||
if (!display->error_trap_synced_at_last_pop)
|
||||
need_sync = TRUE;
|
||||
else
|
||||
need_sync = FALSE;
|
||||
|
||||
if (need_sync)
|
||||
meta_topic (META_DEBUG_SYNC, "Syncing on error_trap_push_with_return, traps = %d\n",
|
||||
display->error_traps);
|
||||
|
||||
meta_error_trap_push_internal (display, FALSE);
|
||||
}
|
||||
|
||||
int
|
||||
meta_error_trap_pop_with_return (MetaDisplay *display,
|
||||
gboolean last_request_was_roundtrip)
|
||||
{
|
||||
if (!last_request_was_roundtrip)
|
||||
meta_topic (META_DEBUG_SYNC, "Syncing on error_trap_pop_with_return, traps = %d, roundtrip = %d\n",
|
||||
display->error_traps, last_request_was_roundtrip);
|
||||
|
||||
display->error_trap_synced_at_last_pop = TRUE;
|
||||
|
||||
return meta_error_trap_pop_internal (display,
|
||||
!last_request_was_roundtrip);
|
||||
}
|
||||
|
||||
static int
|
||||
x_error_handler (Display *xdisplay,
|
||||
XErrorEvent *error)
|
||||
|
||||
12
src/errors.h
12
src/errors.h
@@ -25,9 +25,15 @@
|
||||
#include "util.h"
|
||||
#include "display.h"
|
||||
|
||||
void meta_errors_init (void);
|
||||
void meta_error_trap_push (MetaDisplay *display);
|
||||
void meta_errors_init (void);
|
||||
void meta_error_trap_push (MetaDisplay *display);
|
||||
void meta_error_trap_pop (MetaDisplay *display,
|
||||
gboolean last_request_was_roundtrip);
|
||||
|
||||
void meta_error_trap_push_with_return (MetaDisplay *display);
|
||||
/* returns X error code, or 0 for no error */
|
||||
int meta_error_trap_pop (MetaDisplay *display);
|
||||
int meta_error_trap_pop_with_return (MetaDisplay *display,
|
||||
gboolean last_request_was_roundtrip);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
58
src/frame.c
58
src/frame.c
@@ -19,7 +19,9 @@
|
||||
* 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include "frame.h"
|
||||
#include "bell.h"
|
||||
#include "errors.h"
|
||||
#include "keybindings.h"
|
||||
|
||||
@@ -57,6 +59,8 @@ meta_window_ensure_frame (MetaWindow *window)
|
||||
frame->current_cursor = 0;
|
||||
|
||||
frame->mapped = FALSE;
|
||||
frame->need_reapply_frame_shape = TRUE;
|
||||
frame->is_flashing = FALSE;
|
||||
|
||||
attrs.event_mask = EVENT_MASK;
|
||||
|
||||
@@ -124,7 +128,7 @@ meta_window_ensure_frame (MetaWindow *window)
|
||||
window->rect.x,
|
||||
window->rect.y);
|
||||
/* FIXME handle this error */
|
||||
meta_error_trap_pop (window->display);
|
||||
meta_error_trap_pop (window->display, FALSE);
|
||||
|
||||
/* stick frame to the window */
|
||||
window->frame = frame;
|
||||
@@ -143,7 +147,9 @@ meta_window_ensure_frame (MetaWindow *window)
|
||||
meta_ui_apply_frame_shape (frame->window->screen->ui,
|
||||
frame->xwindow,
|
||||
frame->rect.width,
|
||||
frame->rect.height);
|
||||
frame->rect.height,
|
||||
frame->window->has_shape);
|
||||
frame->need_reapply_frame_shape = FALSE;
|
||||
|
||||
meta_display_ungrab (window->display);
|
||||
}
|
||||
@@ -158,6 +164,7 @@ meta_window_destroy_frame (MetaWindow *window)
|
||||
|
||||
frame = window->frame;
|
||||
|
||||
meta_bell_notify_frame_destroy (frame);
|
||||
meta_ui_remove_frame (window->screen->ui, frame->xwindow);
|
||||
|
||||
/* Unparent the client window; it may be destroyed,
|
||||
@@ -180,7 +187,7 @@ meta_window_destroy_frame (MetaWindow *window)
|
||||
/* FIXME where to put it back depends on the gravity */
|
||||
window->frame->rect.x,
|
||||
window->frame->rect.y);
|
||||
meta_error_trap_pop (window->display);
|
||||
meta_error_trap_pop (window->display, FALSE);
|
||||
|
||||
meta_display_unregister_x_window (window->display,
|
||||
frame->xwindow);
|
||||
@@ -254,6 +261,9 @@ meta_frame_get_flags (MetaFrame *frame)
|
||||
if (frame->window->fullscreen)
|
||||
flags |= META_FRAME_FULLSCREEN;
|
||||
|
||||
if (frame->is_flashing)
|
||||
flags |= META_FRAME_IS_FLASHING;
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
@@ -276,6 +286,20 @@ meta_frame_calc_geometry (MetaFrame *frame,
|
||||
*geomp = geom;
|
||||
}
|
||||
|
||||
static void
|
||||
update_shape (MetaFrame *frame)
|
||||
{
|
||||
if (frame->need_reapply_frame_shape)
|
||||
{
|
||||
meta_ui_apply_frame_shape (frame->window->screen->ui,
|
||||
frame->xwindow,
|
||||
frame->rect.width,
|
||||
frame->rect.height,
|
||||
frame->window->has_shape);
|
||||
frame->need_reapply_frame_shape = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
meta_frame_sync_to_window (MetaFrame *frame,
|
||||
int resize_gravity,
|
||||
@@ -283,8 +307,11 @@ meta_frame_sync_to_window (MetaFrame *frame,
|
||||
gboolean need_resize)
|
||||
{
|
||||
if (!(need_move || need_resize))
|
||||
return;
|
||||
|
||||
{
|
||||
update_shape (frame);
|
||||
return;
|
||||
}
|
||||
|
||||
meta_topic (META_DEBUG_GEOMETRY,
|
||||
"Syncing frame geometry %d,%d %dx%d (SE: %d,%d)\n",
|
||||
frame->rect.x, frame->rect.y,
|
||||
@@ -300,18 +327,17 @@ meta_frame_sync_to_window (MetaFrame *frame,
|
||||
frame->rect.width,
|
||||
frame->rect.height);
|
||||
|
||||
/* Done before the window resize, because doing it before means
|
||||
* part of the window being resized becomes unshaped, which may
|
||||
* be sort of hard to see with bg = None. If we did it after
|
||||
* window resize, part of the window being resized would become
|
||||
* shaped, which might be more visible.
|
||||
*/
|
||||
|
||||
meta_ui_apply_frame_shape (frame->window->screen->ui,
|
||||
frame->xwindow,
|
||||
frame->rect.width,
|
||||
frame->rect.height);
|
||||
/* we need new shape if we're resized */
|
||||
frame->need_reapply_frame_shape = TRUE;
|
||||
}
|
||||
|
||||
/* Done before the window resize, because doing it before means
|
||||
* part of the window being resized becomes unshaped, which may
|
||||
* be sort of hard to see with bg = None. If we did it after
|
||||
* window resize, part of the window being resized would become
|
||||
* shaped, which might be more visible.
|
||||
*/
|
||||
update_shape (frame);
|
||||
|
||||
if (need_move && need_resize)
|
||||
XMoveResizeWindow (frame->window->display->xdisplay,
|
||||
|
||||
@@ -57,6 +57,8 @@ struct _MetaFrame
|
||||
int bottom_height;
|
||||
|
||||
guint mapped : 1;
|
||||
guint need_reapply_frame_shape : 1;
|
||||
guint is_flashing : 1; /* used by the visual bell flash */
|
||||
};
|
||||
|
||||
void meta_window_ensure_frame (MetaWindow *window);
|
||||
|
||||
389
src/frames.c
389
src/frames.c
@@ -73,7 +73,9 @@ static void meta_frames_ensure_layout (MetaFrames *frames,
|
||||
static MetaUIFrame* meta_frames_lookup_window (MetaFrames *frames,
|
||||
Window xwindow);
|
||||
|
||||
static void meta_frames_font_changed (MetaFrames *frames);
|
||||
static void meta_frames_font_changed (MetaFrames *frames);
|
||||
static void meta_frames_button_layout_changed (MetaFrames *frames);
|
||||
|
||||
|
||||
static GdkRectangle* control_rect (MetaFrameControl control,
|
||||
MetaFrameGeometry *fgeom);
|
||||
@@ -161,12 +163,19 @@ unsigned_long_hash (gconstpointer v)
|
||||
}
|
||||
|
||||
static void
|
||||
font_changed_callback (MetaPreference pref,
|
||||
void *data)
|
||||
prefs_changed_callback (MetaPreference pref,
|
||||
void *data)
|
||||
{
|
||||
if (pref == META_PREF_TITLEBAR_FONT)
|
||||
switch (pref)
|
||||
{
|
||||
case META_PREF_TITLEBAR_FONT:
|
||||
meta_frames_font_changed (META_FRAMES (data));
|
||||
break;
|
||||
case META_PREF_BUTTON_LAYOUT:
|
||||
meta_frames_button_layout_changed (META_FRAMES (data));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,7 +194,7 @@ meta_frames_init (MetaFrames *frames)
|
||||
|
||||
gtk_widget_set_double_buffered (GTK_WIDGET (frames), FALSE);
|
||||
|
||||
meta_prefs_add_listener (font_changed_callback, frames);
|
||||
meta_prefs_add_listener (prefs_changed_callback, frames);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -237,7 +246,7 @@ meta_frames_finalize (GObject *object)
|
||||
|
||||
frames = META_FRAMES (object);
|
||||
|
||||
meta_prefs_remove_listener (font_changed_callback, frames);
|
||||
meta_prefs_remove_listener (prefs_changed_callback, frames);
|
||||
|
||||
g_hash_table_destroy (frames->text_heights);
|
||||
|
||||
@@ -292,6 +301,31 @@ meta_frames_font_changed (MetaFrames *frames)
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
queue_draw_func (gpointer key, gpointer value, gpointer data)
|
||||
{
|
||||
MetaUIFrame *frame;
|
||||
MetaFrames *frames;
|
||||
|
||||
frames = META_FRAMES (data);
|
||||
frame = value;
|
||||
|
||||
/* If a resize occurs it will cause a redraw, but the
|
||||
* resize may not actually be needed so we always redraw
|
||||
* in case of color change.
|
||||
*/
|
||||
gtk_style_set_background (GTK_WIDGET (frames)->style,
|
||||
frame->window, GTK_STATE_NORMAL);
|
||||
gdk_window_invalidate_rect (frame->window, NULL, FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_frames_button_layout_changed (MetaFrames *frames)
|
||||
{
|
||||
g_hash_table_foreach (frames->frames,
|
||||
queue_draw_func, frames);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_frames_style_set (GtkWidget *widget,
|
||||
GtkStyle *prev_style)
|
||||
@@ -394,6 +428,7 @@ meta_frames_calc_geometry (MetaFrames *frames,
|
||||
int width, height;
|
||||
MetaFrameFlags flags;
|
||||
MetaFrameType type;
|
||||
MetaButtonLayout button_layout;
|
||||
|
||||
meta_core_get_client_size (gdk_display, frame->xwindow,
|
||||
&width, &height);
|
||||
@@ -402,12 +437,15 @@ meta_frames_calc_geometry (MetaFrames *frames,
|
||||
type = meta_core_get_frame_type (gdk_display, frame->xwindow);
|
||||
|
||||
meta_frames_ensure_layout (frames, frame);
|
||||
|
||||
meta_prefs_get_button_layout (&button_layout);
|
||||
|
||||
meta_theme_calc_geometry (meta_theme_get_current (),
|
||||
type,
|
||||
frame->text_height,
|
||||
flags,
|
||||
width, height,
|
||||
&button_layout,
|
||||
fgeom);
|
||||
}
|
||||
|
||||
@@ -457,6 +495,7 @@ meta_frames_manage_window (MetaFrames *frames,
|
||||
frame->text_height = -1;
|
||||
frame->title = NULL;
|
||||
frame->expose_delayed = FALSE;
|
||||
frame->shape_applied = FALSE;
|
||||
frame->prelit_control = META_FRAME_CONTROL_NONE;
|
||||
|
||||
meta_core_grab_buttons (gdk_display, frame->xwindow);
|
||||
@@ -626,7 +665,8 @@ void
|
||||
meta_frames_apply_shapes (MetaFrames *frames,
|
||||
Window xwindow,
|
||||
int new_window_width,
|
||||
int new_window_height)
|
||||
int new_window_height,
|
||||
gboolean window_has_shape)
|
||||
{
|
||||
#ifdef HAVE_SHAPE
|
||||
/* Apply shapes as if window had new_window_width, new_window_height */
|
||||
@@ -647,10 +687,25 @@ meta_frames_apply_shapes (MetaFrames *frames,
|
||||
if (!(fgeom.top_left_corner_rounded ||
|
||||
fgeom.top_right_corner_rounded ||
|
||||
fgeom.bottom_left_corner_rounded ||
|
||||
fgeom.bottom_right_corner_rounded))
|
||||
fgeom.bottom_right_corner_rounded ||
|
||||
window_has_shape))
|
||||
{
|
||||
XShapeCombineMask (gdk_display, frame->xwindow,
|
||||
ShapeBounding, 0, 0, None, ShapeSet);
|
||||
if (frame->shape_applied)
|
||||
{
|
||||
meta_topic (META_DEBUG_SHAPES,
|
||||
"Unsetting shape mask on frame 0x%lx\n",
|
||||
frame->xwindow);
|
||||
|
||||
XShapeCombineMask (gdk_display, frame->xwindow,
|
||||
ShapeBounding, 0, 0, None, ShapeSet);
|
||||
frame->shape_applied = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
meta_topic (META_DEBUG_SHAPES,
|
||||
"Frame 0x%lx still doesn't need a shape mask\n",
|
||||
frame->xwindow);
|
||||
}
|
||||
|
||||
return; /* nothing to do */
|
||||
}
|
||||
@@ -766,12 +821,105 @@ meta_frames_apply_shapes (MetaFrames *frames,
|
||||
|
||||
XSubtractRegion (window_xregion, corners_xregion, window_xregion);
|
||||
|
||||
XShapeCombineRegion (gdk_display, frame->xwindow,
|
||||
ShapeBounding, 0, 0, window_xregion, ShapeSet);
|
||||
XDestroyRegion (corners_xregion);
|
||||
|
||||
if (window_has_shape)
|
||||
{
|
||||
/* The client window is oclock or something and has a shape
|
||||
* mask. To avoid a round trip to get its shape region, we
|
||||
* create a fake window that's never mapped, build up our shape
|
||||
* on that, then combine. Wasting the window is assumed cheaper
|
||||
* than a round trip, but who really knows for sure.
|
||||
*/
|
||||
XSetWindowAttributes attrs;
|
||||
Window shape_window;
|
||||
Window client_window;
|
||||
Region client_xregion;
|
||||
#ifdef HAVE_GTK_MULTIHEAD
|
||||
GdkScreen *screen;
|
||||
#endif
|
||||
int screen_number;
|
||||
|
||||
meta_topic (META_DEBUG_SHAPES,
|
||||
"Frame 0x%lx needs to incorporate client shape\n",
|
||||
frame->xwindow);
|
||||
|
||||
#ifdef HAVE_GTK_MULTIHEAD
|
||||
screen = gtk_widget_get_screen (GTK_WIDGET (frames));
|
||||
screen_number = gdk_x11_screen_get_screen_number (screen);
|
||||
#else
|
||||
screen_number = DefaultScreen (gdk_display);
|
||||
#endif
|
||||
|
||||
attrs.override_redirect = True;
|
||||
|
||||
shape_window = XCreateWindow (gdk_display,
|
||||
RootWindow (gdk_display, screen_number),
|
||||
-5000, -5000,
|
||||
new_window_width,
|
||||
new_window_height,
|
||||
0,
|
||||
CopyFromParent,
|
||||
CopyFromParent,
|
||||
CopyFromParent,
|
||||
CWOverrideRedirect,
|
||||
&attrs);
|
||||
|
||||
/* Copy the client's shape to the temporary shape_window */
|
||||
client_window = meta_core_get_client_xwindow (gdk_display,
|
||||
frame->xwindow);
|
||||
|
||||
XShapeCombineShape (gdk_display, shape_window, ShapeBounding,
|
||||
fgeom.left_width,
|
||||
fgeom.top_height,
|
||||
client_window,
|
||||
ShapeBounding,
|
||||
ShapeSet);
|
||||
|
||||
/* Punch the client area out of the normal frame shape,
|
||||
* then union it with the shape_window's existing shape
|
||||
*/
|
||||
client_xregion = XCreateRegion ();
|
||||
|
||||
xrect.x = fgeom.left_width;
|
||||
xrect.y = fgeom.top_height;
|
||||
xrect.width = new_window_width - fgeom.right_width - xrect.x;
|
||||
xrect.height = new_window_height - fgeom.bottom_height - xrect.y;
|
||||
|
||||
XUnionRectWithRegion (&xrect, client_xregion, client_xregion);
|
||||
|
||||
XSubtractRegion (window_xregion, client_xregion, window_xregion);
|
||||
|
||||
XDestroyRegion (client_xregion);
|
||||
|
||||
XShapeCombineRegion (gdk_display, shape_window,
|
||||
ShapeBounding, 0, 0, window_xregion, ShapeUnion);
|
||||
|
||||
/* Now copy shape_window shape to the real frame */
|
||||
XShapeCombineShape (gdk_display, frame->xwindow, ShapeBounding,
|
||||
0, 0,
|
||||
shape_window,
|
||||
ShapeBounding,
|
||||
ShapeSet);
|
||||
|
||||
XDestroyWindow (gdk_display, shape_window);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* No shape on the client, so just do simple stuff */
|
||||
|
||||
meta_topic (META_DEBUG_SHAPES,
|
||||
"Frame 0x%lx has shaped corners\n",
|
||||
frame->xwindow);
|
||||
|
||||
XShapeCombineRegion (gdk_display, frame->xwindow,
|
||||
ShapeBounding, 0, 0, window_xregion, ShapeSet);
|
||||
}
|
||||
|
||||
frame->shape_applied = TRUE;
|
||||
|
||||
XDestroyRegion (window_xregion);
|
||||
XDestroyRegion (corners_xregion);
|
||||
#endif
|
||||
#endif /* HAVE_SHAPE */
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1030,18 +1178,41 @@ meta_frames_button_press_event (GtkWidget *widget,
|
||||
{
|
||||
MetaFrameFlags flags;
|
||||
|
||||
flags = meta_core_get_frame_flags (gdk_display, frame->xwindow);
|
||||
|
||||
if (flags & META_FRAME_ALLOWS_SHADE)
|
||||
switch (meta_prefs_get_action_double_click_titlebar ())
|
||||
{
|
||||
if (flags & META_FRAME_SHADED)
|
||||
meta_core_unshade (gdk_display,
|
||||
frame->xwindow);
|
||||
else
|
||||
meta_core_shade (gdk_display,
|
||||
frame->xwindow);
|
||||
}
|
||||
case META_ACTION_DOUBLE_CLICK_TITLEBAR_TOGGLE_SHADE:
|
||||
{
|
||||
flags = meta_core_get_frame_flags (gdk_display, frame->xwindow);
|
||||
|
||||
if (flags & META_FRAME_ALLOWS_SHADE)
|
||||
{
|
||||
if (flags & META_FRAME_SHADED)
|
||||
meta_core_unshade (gdk_display,
|
||||
frame->xwindow);
|
||||
else
|
||||
meta_core_shade (gdk_display,
|
||||
frame->xwindow);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case META_ACTION_DOUBLE_CLICK_TITLEBAR_TOGGLE_MAXIMIZE:
|
||||
{
|
||||
MetaFrameFlags flags;
|
||||
|
||||
flags = meta_core_get_frame_flags (gdk_display, frame->xwindow);
|
||||
|
||||
if (flags & META_FRAME_ALLOWS_MAXIMIZE)
|
||||
{
|
||||
meta_core_toggle_maximize (gdk_display, frame->xwindow);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case META_ACTION_DOUBLE_CLICK_TITLEBAR_LAST:
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -1169,8 +1340,7 @@ meta_frames_button_press_event (GtkWidget *widget,
|
||||
event->x_root,
|
||||
event->y_root);
|
||||
}
|
||||
else if ((control == META_FRAME_CONTROL_TITLE ||
|
||||
control == META_FRAME_CONTROL_NONE) &&
|
||||
else if (control == META_FRAME_CONTROL_TITLE &&
|
||||
event->button == 1)
|
||||
{
|
||||
MetaFrameFlags flags;
|
||||
@@ -1190,6 +1360,10 @@ meta_frames_button_press_event (GtkWidget *widget,
|
||||
event->y_root);
|
||||
}
|
||||
}
|
||||
else if (event->button == 2)
|
||||
{
|
||||
meta_core_user_lower (gdk_display, frame->xwindow);
|
||||
}
|
||||
else if (event->button == 3)
|
||||
{
|
||||
meta_core_show_window_menu (gdk_display,
|
||||
@@ -1524,6 +1698,7 @@ meta_frames_paint_to_drawable (MetaFrames *frames,
|
||||
GdkRectangle *areas;
|
||||
int n_areas;
|
||||
int screen_width, screen_height;
|
||||
MetaButtonLayout button_layout;
|
||||
|
||||
widget = GTK_WIDGET (frames);
|
||||
|
||||
@@ -1656,10 +1831,12 @@ meta_frames_paint_to_drawable (MetaFrames *frames,
|
||||
|
||||
/* Now draw remaining portion of region */
|
||||
gdk_region_get_rectangles (edges, &areas, &n_areas);
|
||||
|
||||
meta_prefs_get_button_layout (&button_layout);
|
||||
|
||||
i = 0;
|
||||
while (i < n_areas)
|
||||
{
|
||||
{
|
||||
if (GDK_IS_WINDOW (drawable))
|
||||
gdk_window_begin_paint_rect (drawable, &areas[i]);
|
||||
|
||||
@@ -1673,6 +1850,7 @@ meta_frames_paint_to_drawable (MetaFrames *frames,
|
||||
w, h,
|
||||
frame->layout,
|
||||
frame->text_height,
|
||||
&button_layout,
|
||||
button_states,
|
||||
mini_icon, icon);
|
||||
|
||||
@@ -1787,14 +1965,17 @@ get_control (MetaFrames *frames,
|
||||
MetaFrameFlags flags;
|
||||
gboolean has_vert, has_horiz;
|
||||
GdkRectangle client;
|
||||
int bottom_of_titlebar;
|
||||
|
||||
meta_frames_calc_geometry (frames, frame, &fgeom);
|
||||
|
||||
client.x = fgeom.left_width;
|
||||
client.y = fgeom.top_height;
|
||||
client.width = fgeom.width - fgeom.left_width - fgeom.right_width;
|
||||
client.height = fgeom.height - fgeom.top_height - fgeom.bottom_height;
|
||||
client.height = fgeom.height - fgeom.top_height - fgeom.bottom_height;
|
||||
|
||||
bottom_of_titlebar = fgeom.title_rect.y + fgeom.title_rect.height;
|
||||
|
||||
if (POINT_IN_RECT (x, y, client))
|
||||
return META_FRAME_CONTROL_CLIENT_AREA;
|
||||
|
||||
@@ -1806,16 +1987,19 @@ get_control (MetaFrames *frames,
|
||||
|
||||
if (POINT_IN_RECT (x, y, fgeom.menu_rect))
|
||||
return META_FRAME_CONTROL_MENU;
|
||||
|
||||
flags = meta_core_get_frame_flags (gdk_display, frame->xwindow);
|
||||
|
||||
has_vert = (flags & META_FRAME_ALLOWS_VERTICAL_RESIZE) != 0;
|
||||
has_horiz = (flags & META_FRAME_ALLOWS_HORIZONTAL_RESIZE) != 0;
|
||||
|
||||
if (POINT_IN_RECT (x, y, fgeom.title_rect))
|
||||
{
|
||||
if (y <= TOP_RESIZE_HEIGHT)
|
||||
if (has_vert && y <= TOP_RESIZE_HEIGHT)
|
||||
return META_FRAME_CONTROL_RESIZE_N;
|
||||
else
|
||||
return META_FRAME_CONTROL_TITLE;
|
||||
}
|
||||
|
||||
flags = meta_core_get_frame_flags (gdk_display, frame->xwindow);
|
||||
|
||||
if (POINT_IN_RECT (x, y, fgeom.max_rect))
|
||||
{
|
||||
@@ -1824,83 +2008,78 @@ get_control (MetaFrames *frames,
|
||||
else
|
||||
return META_FRAME_CONTROL_MAXIMIZE;
|
||||
}
|
||||
|
||||
has_vert = (flags & META_FRAME_ALLOWS_VERTICAL_RESIZE) != 0;
|
||||
has_horiz = (flags & META_FRAME_ALLOWS_HORIZONTAL_RESIZE) != 0;
|
||||
|
||||
if (has_vert || has_horiz)
|
||||
{
|
||||
int bottom_of_titlebar;
|
||||
|
||||
bottom_of_titlebar = fgeom.title_rect.y + fgeom.title_rect.height;
|
||||
|
||||
/* South resize always has priority over north resize,
|
||||
* in case of overlap.
|
||||
*/
|
||||
/* South resize always has priority over north resize,
|
||||
* in case of overlap.
|
||||
*/
|
||||
|
||||
if (y >= (fgeom.height - fgeom.bottom_height - RESIZE_EXTENDS) &&
|
||||
x >= (fgeom.width - fgeom.right_width - RESIZE_EXTENDS))
|
||||
{
|
||||
if (has_vert && has_horiz)
|
||||
return META_FRAME_CONTROL_RESIZE_SE;
|
||||
else if (has_vert)
|
||||
return META_FRAME_CONTROL_RESIZE_S;
|
||||
else
|
||||
return META_FRAME_CONTROL_RESIZE_E;
|
||||
}
|
||||
else if (y >= (fgeom.height - fgeom.bottom_height - RESIZE_EXTENDS) &&
|
||||
x <= (fgeom.left_width + RESIZE_EXTENDS))
|
||||
{
|
||||
if (has_vert && has_horiz)
|
||||
return META_FRAME_CONTROL_RESIZE_SW;
|
||||
else if (has_vert)
|
||||
return META_FRAME_CONTROL_RESIZE_S;
|
||||
else
|
||||
return META_FRAME_CONTROL_RESIZE_W;
|
||||
}
|
||||
else if (y < (fgeom.top_height + RESIZE_EXTENDS) &&
|
||||
x < RESIZE_EXTENDS)
|
||||
{
|
||||
if (has_vert && has_horiz)
|
||||
return META_FRAME_CONTROL_RESIZE_NW;
|
||||
else if (has_vert)
|
||||
return META_FRAME_CONTROL_RESIZE_N;
|
||||
else
|
||||
return META_FRAME_CONTROL_RESIZE_W;
|
||||
}
|
||||
else if (y < (fgeom.top_height + RESIZE_EXTENDS) &&
|
||||
x >= (fgeom.width - RESIZE_EXTENDS))
|
||||
{
|
||||
if (has_vert && has_horiz)
|
||||
return META_FRAME_CONTROL_RESIZE_NE;
|
||||
else if (has_vert)
|
||||
return META_FRAME_CONTROL_RESIZE_N;
|
||||
else
|
||||
return META_FRAME_CONTROL_RESIZE_E;
|
||||
}
|
||||
else if (y >= (fgeom.height - fgeom.bottom_height - RESIZE_EXTENDS))
|
||||
{
|
||||
if (has_vert)
|
||||
return META_FRAME_CONTROL_RESIZE_S;
|
||||
}
|
||||
else if (y <= TOP_RESIZE_HEIGHT)
|
||||
{
|
||||
if (has_vert)
|
||||
return META_FRAME_CONTROL_RESIZE_N;
|
||||
}
|
||||
else if (x <= fgeom.left_width)
|
||||
{
|
||||
if (has_horiz)
|
||||
return META_FRAME_CONTROL_RESIZE_W;
|
||||
}
|
||||
else if (x >= (fgeom.width - fgeom.right_width))
|
||||
{
|
||||
if (has_horiz)
|
||||
return META_FRAME_CONTROL_RESIZE_E;
|
||||
}
|
||||
if (y >= (fgeom.height - fgeom.bottom_height - RESIZE_EXTENDS) &&
|
||||
x >= (fgeom.width - fgeom.right_width - RESIZE_EXTENDS))
|
||||
{
|
||||
if (has_vert && has_horiz)
|
||||
return META_FRAME_CONTROL_RESIZE_SE;
|
||||
else if (has_vert)
|
||||
return META_FRAME_CONTROL_RESIZE_S;
|
||||
else if (has_horiz)
|
||||
return META_FRAME_CONTROL_RESIZE_E;
|
||||
}
|
||||
|
||||
return META_FRAME_CONTROL_NONE;
|
||||
else if (y >= (fgeom.height - fgeom.bottom_height - RESIZE_EXTENDS) &&
|
||||
x <= (fgeom.left_width + RESIZE_EXTENDS))
|
||||
{
|
||||
if (has_vert && has_horiz)
|
||||
return META_FRAME_CONTROL_RESIZE_SW;
|
||||
else if (has_vert)
|
||||
return META_FRAME_CONTROL_RESIZE_S;
|
||||
else if (has_horiz)
|
||||
return META_FRAME_CONTROL_RESIZE_W;
|
||||
}
|
||||
else if (y < (fgeom.top_height + RESIZE_EXTENDS) &&
|
||||
x < RESIZE_EXTENDS)
|
||||
{
|
||||
if (has_vert && has_horiz)
|
||||
return META_FRAME_CONTROL_RESIZE_NW;
|
||||
else if (has_vert)
|
||||
return META_FRAME_CONTROL_RESIZE_N;
|
||||
else if (has_horiz)
|
||||
return META_FRAME_CONTROL_RESIZE_W;
|
||||
}
|
||||
else if (y < (fgeom.top_height + RESIZE_EXTENDS) &&
|
||||
x >= (fgeom.width - RESIZE_EXTENDS))
|
||||
{
|
||||
if (has_vert && has_horiz)
|
||||
return META_FRAME_CONTROL_RESIZE_NE;
|
||||
else if (has_vert)
|
||||
return META_FRAME_CONTROL_RESIZE_N;
|
||||
else if (has_horiz)
|
||||
return META_FRAME_CONTROL_RESIZE_E;
|
||||
}
|
||||
else if (y >= (fgeom.height - fgeom.bottom_height - RESIZE_EXTENDS))
|
||||
{
|
||||
if (has_vert)
|
||||
return META_FRAME_CONTROL_RESIZE_S;
|
||||
}
|
||||
else if (y <= TOP_RESIZE_HEIGHT)
|
||||
{
|
||||
if (has_vert)
|
||||
return META_FRAME_CONTROL_RESIZE_N;
|
||||
else if (has_horiz)
|
||||
return META_FRAME_CONTROL_TITLE;
|
||||
}
|
||||
else if (x <= fgeom.left_width)
|
||||
{
|
||||
if (has_horiz)
|
||||
return META_FRAME_CONTROL_RESIZE_W;
|
||||
}
|
||||
else if (x >= (fgeom.width - fgeom.right_width))
|
||||
{
|
||||
if (has_horiz)
|
||||
return META_FRAME_CONTROL_RESIZE_E;
|
||||
}
|
||||
|
||||
if (y >= bottom_of_titlebar)
|
||||
return META_FRAME_CONTROL_NONE;
|
||||
else
|
||||
return META_FRAME_CONTROL_TITLE;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -72,7 +72,8 @@ struct _MetaUIFrame
|
||||
int text_height;
|
||||
char *title; /* NULL once we have a layout */
|
||||
guint expose_delayed : 1;
|
||||
|
||||
guint shape_applied : 1;
|
||||
|
||||
/* FIXME get rid of this, it can just be in the MetaFrames struct */
|
||||
MetaFrameControl prelit_control;
|
||||
};
|
||||
@@ -127,7 +128,8 @@ void meta_frames_unflicker_bg (MetaFrames *frames,
|
||||
void meta_frames_apply_shapes (MetaFrames *frames,
|
||||
Window xwindow,
|
||||
int new_window_width,
|
||||
int new_window_height);
|
||||
int new_window_height,
|
||||
gboolean window_has_shape);
|
||||
|
||||
void meta_frames_queue_draw (MetaFrames *frames,
|
||||
Window xwindow);
|
||||
|
||||
41
src/group-private.h
Normal file
41
src/group-private.h
Normal file
@@ -0,0 +1,41 @@
|
||||
/* Metacity window group private header */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2002 Red Hat Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef META_GROUP_PRIVATE_H
|
||||
#define META_GROUP_PRIVATE_H
|
||||
|
||||
#include "group.h"
|
||||
|
||||
struct _MetaGroup
|
||||
{
|
||||
int refcount;
|
||||
MetaDisplay *display;
|
||||
GSList *windows;
|
||||
Window group_leader;
|
||||
char *startup_id;
|
||||
char *wm_client_machine;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
230
src/group-props.c
Normal file
230
src/group-props.c
Normal file
@@ -0,0 +1,230 @@
|
||||
/* MetaGroup property handling */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2002 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>
|
||||
#include "group-props.h"
|
||||
#include "group-private.h"
|
||||
#include "xprops.h"
|
||||
#include <X11/Xatom.h>
|
||||
|
||||
typedef void (* InitValueFunc) (MetaDisplay *display,
|
||||
Atom property,
|
||||
MetaPropValue *value);
|
||||
typedef void (* ReloadValueFunc) (MetaGroup *group,
|
||||
MetaPropValue *value);
|
||||
|
||||
struct _MetaGroupPropHooks
|
||||
{
|
||||
Atom property;
|
||||
InitValueFunc init_func;
|
||||
ReloadValueFunc reload_func;
|
||||
};
|
||||
|
||||
static void init_prop_value (MetaDisplay *display,
|
||||
Atom property,
|
||||
MetaPropValue *value);
|
||||
static void reload_prop_value (MetaGroup *group,
|
||||
MetaPropValue *value);
|
||||
static MetaGroupPropHooks* find_hooks (MetaDisplay *display,
|
||||
Atom property);
|
||||
|
||||
|
||||
|
||||
void
|
||||
meta_group_reload_property (MetaGroup *group,
|
||||
Atom property)
|
||||
{
|
||||
meta_group_reload_properties (group, &property, 1);
|
||||
}
|
||||
|
||||
void
|
||||
meta_group_reload_properties (MetaGroup *group,
|
||||
const Atom *properties,
|
||||
int n_properties)
|
||||
{
|
||||
int i;
|
||||
MetaPropValue *values;
|
||||
|
||||
g_return_if_fail (properties != NULL);
|
||||
g_return_if_fail (n_properties > 0);
|
||||
|
||||
values = g_new0 (MetaPropValue, n_properties);
|
||||
|
||||
i = 0;
|
||||
while (i < n_properties)
|
||||
{
|
||||
init_prop_value (group->display, properties[i], &values[i]);
|
||||
++i;
|
||||
}
|
||||
|
||||
meta_prop_get_values (group->display, group->group_leader,
|
||||
values, n_properties);
|
||||
|
||||
i = 0;
|
||||
while (i < n_properties)
|
||||
{
|
||||
reload_prop_value (group, &values[i]);
|
||||
|
||||
++i;
|
||||
}
|
||||
|
||||
meta_prop_free_values (values, n_properties);
|
||||
|
||||
g_free (values);
|
||||
}
|
||||
|
||||
/* Fill in the MetaPropValue used to get the value of "property" */
|
||||
static void
|
||||
init_prop_value (MetaDisplay *display,
|
||||
Atom property,
|
||||
MetaPropValue *value)
|
||||
{
|
||||
MetaGroupPropHooks *hooks;
|
||||
|
||||
value->type = META_PROP_VALUE_INVALID;
|
||||
value->atom = None;
|
||||
|
||||
hooks = find_hooks (display, property);
|
||||
if (hooks && hooks->init_func != NULL)
|
||||
(* hooks->init_func) (display, property, value);
|
||||
}
|
||||
|
||||
static void
|
||||
reload_prop_value (MetaGroup *group,
|
||||
MetaPropValue *value)
|
||||
{
|
||||
MetaGroupPropHooks *hooks;
|
||||
|
||||
hooks = find_hooks (group->display, value->atom);
|
||||
if (hooks && hooks->reload_func != NULL)
|
||||
(* hooks->reload_func) (group, value);
|
||||
}
|
||||
|
||||
static void
|
||||
init_wm_client_machine (MetaDisplay *display,
|
||||
Atom property,
|
||||
MetaPropValue *value)
|
||||
{
|
||||
value->type = META_PROP_VALUE_STRING;
|
||||
value->atom = display->atom_wm_client_machine;
|
||||
}
|
||||
|
||||
static void
|
||||
reload_wm_client_machine (MetaGroup *group,
|
||||
MetaPropValue *value)
|
||||
{
|
||||
g_free (group->wm_client_machine);
|
||||
group->wm_client_machine = NULL;
|
||||
|
||||
if (value->type != META_PROP_VALUE_INVALID)
|
||||
group->wm_client_machine = g_strdup (value->v.str);
|
||||
|
||||
meta_verbose ("Group has client machine \"%s\"\n",
|
||||
group->wm_client_machine ? group->wm_client_machine : "unset");
|
||||
}
|
||||
|
||||
static void
|
||||
init_net_startup_id (MetaDisplay *display,
|
||||
Atom property,
|
||||
MetaPropValue *value)
|
||||
{
|
||||
value->type = META_PROP_VALUE_UTF8;
|
||||
value->atom = display->atom_net_startup_id;
|
||||
}
|
||||
|
||||
static void
|
||||
reload_net_startup_id (MetaGroup *group,
|
||||
MetaPropValue *value)
|
||||
{
|
||||
g_free (group->startup_id);
|
||||
group->startup_id = NULL;
|
||||
|
||||
if (value->type != META_PROP_VALUE_INVALID)
|
||||
group->startup_id = g_strdup (value->v.str);
|
||||
|
||||
meta_verbose ("Group has startup id \"%s\"\n",
|
||||
group->startup_id ? group->startup_id : "unset");
|
||||
}
|
||||
|
||||
#define N_HOOKS 3
|
||||
|
||||
void
|
||||
meta_display_init_group_prop_hooks (MetaDisplay *display)
|
||||
{
|
||||
int i;
|
||||
MetaGroupPropHooks *hooks;
|
||||
|
||||
g_assert (display->group_prop_hooks == NULL);
|
||||
|
||||
display->group_prop_hooks = g_new0 (MetaGroupPropHooks, N_HOOKS);
|
||||
hooks = display->group_prop_hooks;
|
||||
|
||||
i = 0;
|
||||
|
||||
hooks[i].property = display->atom_wm_client_machine;
|
||||
hooks[i].init_func = init_wm_client_machine;
|
||||
hooks[i].reload_func = reload_wm_client_machine;
|
||||
++i;
|
||||
|
||||
hooks[i].property = display->atom_net_wm_pid;
|
||||
hooks[i].init_func = NULL;
|
||||
hooks[i].reload_func = NULL;
|
||||
++i;
|
||||
|
||||
hooks[i].property = display->atom_net_startup_id;
|
||||
hooks[i].init_func = init_net_startup_id;
|
||||
hooks[i].reload_func = reload_net_startup_id;
|
||||
++i;
|
||||
|
||||
if (i != N_HOOKS)
|
||||
g_error ("Initialized %d group hooks should have been %d\n", i, N_HOOKS);
|
||||
}
|
||||
|
||||
void
|
||||
meta_display_free_group_prop_hooks (MetaDisplay *display)
|
||||
{
|
||||
g_assert (display->group_prop_hooks != NULL);
|
||||
|
||||
g_free (display->group_prop_hooks);
|
||||
display->group_prop_hooks = NULL;
|
||||
}
|
||||
|
||||
static MetaGroupPropHooks*
|
||||
find_hooks (MetaDisplay *display,
|
||||
Atom property)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* FIXME we could sort the array and do binary search or
|
||||
* something
|
||||
*/
|
||||
|
||||
i = 0;
|
||||
while (i < N_HOOKS)
|
||||
{
|
||||
if (display->group_prop_hooks[i].property == property)
|
||||
return &display->group_prop_hooks[i];
|
||||
|
||||
++i;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
35
src/group-props.h
Normal file
35
src/group-props.h
Normal file
@@ -0,0 +1,35 @@
|
||||
/* MetaGroup property handling */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2002 Red Hat, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef META_GROUP_PROPS_H
|
||||
#define META_GROUP_PROPS_H
|
||||
|
||||
#include "group.h"
|
||||
|
||||
void meta_group_reload_property (MetaGroup *group,
|
||||
Atom property);
|
||||
void meta_group_reload_properties (MetaGroup *group,
|
||||
const Atom *properties,
|
||||
int n_properties);
|
||||
void meta_display_init_group_prop_hooks (MetaDisplay *display);
|
||||
void meta_display_free_group_prop_hooks (MetaDisplay *display);
|
||||
|
||||
#endif /* META_GROUP_PROPS_H */
|
||||
108
src/group.c
108
src/group.c
@@ -19,24 +19,23 @@
|
||||
* 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include "util.h"
|
||||
#include "group.h"
|
||||
#include "group-private.h"
|
||||
#include "group-props.h"
|
||||
#include "window.h"
|
||||
|
||||
struct _MetaGroup
|
||||
{
|
||||
MetaDisplay *display;
|
||||
GSList *windows;
|
||||
Window group_leader;
|
||||
int refcount;
|
||||
};
|
||||
|
||||
static MetaGroup*
|
||||
meta_group_new (MetaDisplay *display,
|
||||
Window group_leader)
|
||||
{
|
||||
MetaGroup *group;
|
||||
|
||||
#define N_INITIAL_PROPS 3
|
||||
Atom initial_props[N_INITIAL_PROPS];
|
||||
int i;
|
||||
|
||||
g_assert (N_INITIAL_PROPS == (int) G_N_ELEMENTS (initial_props));
|
||||
|
||||
group = g_new0 (MetaGroup, 1);
|
||||
|
||||
group->display = display;
|
||||
@@ -53,6 +52,19 @@ meta_group_new (MetaDisplay *display,
|
||||
g_hash_table_insert (display->groups_by_leader,
|
||||
&group->group_leader,
|
||||
group);
|
||||
|
||||
/* Fill these in the order we want them to be gotten */
|
||||
i = 0;
|
||||
initial_props[i++] = display->atom_wm_client_machine;
|
||||
initial_props[i++] = display->atom_net_wm_pid;
|
||||
initial_props[i++] = display->atom_net_startup_id;
|
||||
g_assert (N_INITIAL_PROPS == i);
|
||||
|
||||
meta_group_reload_properties (group, initial_props, N_INITIAL_PROPS);
|
||||
|
||||
meta_topic (META_DEBUG_GROUPS,
|
||||
"Created new group with leader 0x%lx\n",
|
||||
group->group_leader);
|
||||
|
||||
return group;
|
||||
}
|
||||
@@ -65,6 +77,10 @@ meta_group_unref (MetaGroup *group)
|
||||
group->refcount -= 1;
|
||||
if (group->refcount == 0)
|
||||
{
|
||||
meta_topic (META_DEBUG_GROUPS,
|
||||
"Destroying group with leader 0x%lx\n",
|
||||
group->group_leader);
|
||||
|
||||
g_assert (group->display->groups_by_leader != NULL);
|
||||
|
||||
g_hash_table_remove (group->display->groups_by_leader,
|
||||
@@ -77,6 +93,9 @@ meta_group_unref (MetaGroup *group)
|
||||
group->display->groups_by_leader = NULL;
|
||||
}
|
||||
|
||||
g_free (group->wm_client_machine);
|
||||
g_free (group->startup_id);
|
||||
|
||||
g_free (group);
|
||||
}
|
||||
}
|
||||
@@ -84,16 +103,26 @@ meta_group_unref (MetaGroup *group)
|
||||
MetaGroup*
|
||||
meta_window_get_group (MetaWindow *window)
|
||||
{
|
||||
if (window->cached_group == NULL &&
|
||||
window->xgroup_leader != None) /* some windows have no group */
|
||||
if (window->unmanaging)
|
||||
return NULL;
|
||||
|
||||
if (window->cached_group == NULL)
|
||||
{
|
||||
MetaGroup *group;
|
||||
|
||||
/* use window->xwindow if no window->xgroup_leader */
|
||||
|
||||
group = NULL;
|
||||
|
||||
if (window->display->groups_by_leader)
|
||||
group = g_hash_table_lookup (window->display->groups_by_leader,
|
||||
&window->xgroup_leader);
|
||||
{
|
||||
if (window->xgroup_leader != None)
|
||||
group = g_hash_table_lookup (window->display->groups_by_leader,
|
||||
&window->xgroup_leader);
|
||||
else
|
||||
group = g_hash_table_lookup (window->display->groups_by_leader,
|
||||
&window->xwindow);
|
||||
}
|
||||
|
||||
if (group != NULL)
|
||||
{
|
||||
@@ -102,24 +131,36 @@ meta_window_get_group (MetaWindow *window)
|
||||
}
|
||||
else
|
||||
{
|
||||
group = meta_group_new (window->display,
|
||||
window->xgroup_leader);
|
||||
|
||||
if (window->xgroup_leader != None)
|
||||
group = meta_group_new (window->display,
|
||||
window->xgroup_leader);
|
||||
else
|
||||
group = meta_group_new (window->display,
|
||||
window->xwindow);
|
||||
|
||||
window->cached_group = group;
|
||||
}
|
||||
|
||||
window->cached_group->windows = g_slist_prepend (window->cached_group->windows,
|
||||
window);
|
||||
|
||||
meta_topic (META_DEBUG_GROUPS,
|
||||
"Adding %s to group with leader 0x%lx\n",
|
||||
window->desc, group->group_leader);
|
||||
}
|
||||
|
||||
return window->cached_group;
|
||||
}
|
||||
|
||||
void
|
||||
meta_window_shutdown_group (MetaWindow *window)
|
||||
static void
|
||||
remove_window_from_group (MetaWindow *window)
|
||||
{
|
||||
if (window->cached_group != NULL)
|
||||
{
|
||||
meta_topic (META_DEBUG_GROUPS,
|
||||
"Removing %s from group with leader 0x%lx\n",
|
||||
window->desc, window->cached_group->group_leader);
|
||||
|
||||
window->cached_group->windows =
|
||||
g_slist_remove (window->cached_group->windows,
|
||||
window);
|
||||
@@ -128,6 +169,19 @@ meta_window_shutdown_group (MetaWindow *window)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
meta_window_group_leader_changed (MetaWindow *window)
|
||||
{
|
||||
remove_window_from_group (window);
|
||||
meta_window_get_group (window);
|
||||
}
|
||||
|
||||
void
|
||||
meta_window_shutdown_group (MetaWindow *window)
|
||||
{
|
||||
remove_window_from_group (window);
|
||||
}
|
||||
|
||||
MetaGroup*
|
||||
meta_display_lookup_group (MetaDisplay *display,
|
||||
Window group_leader)
|
||||
@@ -186,3 +240,19 @@ meta_group_update_layers (MetaGroup *group)
|
||||
|
||||
g_slist_free (frozen_stacks);
|
||||
}
|
||||
|
||||
const char*
|
||||
meta_group_get_startup_id (MetaGroup *group)
|
||||
{
|
||||
return group->startup_id;
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_group_property_notify (MetaGroup *group,
|
||||
XEvent *event)
|
||||
{
|
||||
meta_group_reload_property (group,
|
||||
event->xproperty.atom);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
MetaGroup* meta_window_get_group (MetaWindow *window);
|
||||
void meta_window_shutdown_group (MetaWindow *window);
|
||||
|
||||
void meta_window_group_leader_changed (MetaWindow *window);
|
||||
|
||||
/* note, can return NULL */
|
||||
MetaGroup* meta_display_lookup_group (MetaDisplay *display,
|
||||
Window group_leader);
|
||||
@@ -36,6 +38,11 @@ GSList* meta_group_list_windows (MetaGroup *group);
|
||||
|
||||
void meta_group_update_layers (MetaGroup *group);
|
||||
|
||||
const char* meta_group_get_startup_id (MetaGroup *group);
|
||||
|
||||
gboolean meta_group_property_notify (MetaGroup *group,
|
||||
XEvent *event);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
* 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include "iconcache.h"
|
||||
#include "ui.h"
|
||||
#include "errors.h"
|
||||
@@ -231,7 +232,7 @@ read_rgb_icon (MetaDisplay *display,
|
||||
gulong *best_mini;
|
||||
int mini_w, mini_h;
|
||||
|
||||
meta_error_trap_push (display);
|
||||
meta_error_trap_push_with_return (display);
|
||||
type = None;
|
||||
data = NULL;
|
||||
result = XGetWindowProperty (display->xdisplay,
|
||||
@@ -241,7 +242,7 @@ read_rgb_icon (MetaDisplay *display,
|
||||
False, XA_CARDINAL, &type, &format, &nitems,
|
||||
&bytes_after, ((guchar **)&data));
|
||||
|
||||
err = meta_error_trap_pop (display);
|
||||
err = meta_error_trap_pop_with_return (display, TRUE);
|
||||
|
||||
if (err != Success ||
|
||||
result != Success)
|
||||
@@ -406,7 +407,7 @@ try_pixmap_and_mask (MetaDisplay *display,
|
||||
w, h);
|
||||
}
|
||||
|
||||
meta_error_trap_pop (display);
|
||||
meta_error_trap_pop (display, FALSE);
|
||||
|
||||
if (mask)
|
||||
{
|
||||
@@ -470,7 +471,7 @@ get_kwm_win_icon (MetaDisplay *display,
|
||||
*pixmap = None;
|
||||
*mask = None;
|
||||
|
||||
meta_error_trap_push (display);
|
||||
meta_error_trap_push_with_return (display);
|
||||
icons = NULL;
|
||||
result = XGetWindowProperty (display->xdisplay, xwindow,
|
||||
display->atom_kwm_win_icon,
|
||||
@@ -480,7 +481,7 @@ get_kwm_win_icon (MetaDisplay *display,
|
||||
&type, &format, &nitems,
|
||||
&bytes_after, (guchar **)&icons);
|
||||
|
||||
err = meta_error_trap_pop (display);
|
||||
err = meta_error_trap_pop_with_return (display, TRUE);
|
||||
if (err != Success ||
|
||||
result != Success)
|
||||
return;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
12
src/libmetacity-private.pc.in
Normal file
12
src/libmetacity-private.pc.in
Normal file
@@ -0,0 +1,12 @@
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
libgnome_serverdir=@libexecdir@
|
||||
|
||||
Name: libmetacity-private
|
||||
Description: Metacity internals shared
|
||||
Requires: gtk+-2.0
|
||||
Version: @VERSION@
|
||||
Libs: -L${libdir} -lmetacity-private
|
||||
Cflags: -I${includedir}/metacity-1
|
||||
25
src/main.c
25
src/main.c
@@ -55,12 +55,13 @@ log_handler (const gchar *log_domain,
|
||||
gpointer user_data)
|
||||
{
|
||||
meta_warning ("Log level %d: %s\n", log_level, message);
|
||||
meta_print_backtrace ();
|
||||
}
|
||||
|
||||
static void
|
||||
usage (void)
|
||||
{
|
||||
g_print (_("metacity [--disable-sm] [--sm-save-file=FILENAME] [--display=DISPLAY] [--replace] [--version]\n"));
|
||||
g_print (_("metacity [--sm-disable] [--sm-client-id=ID] [--sm-save-file=FILENAME] [--display=DISPLAY] [--replace] [--version]\n"));
|
||||
exit (1);
|
||||
}
|
||||
|
||||
@@ -270,6 +271,22 @@ main (int argc, char **argv)
|
||||
#else
|
||||
meta_topic (META_DEBUG_XINERAMA, " (not using Solaris Xinerama)\n");
|
||||
#endif
|
||||
#ifdef HAVE_XSYNC
|
||||
meta_verbose ("Compiled with sync extension\n");
|
||||
#else
|
||||
meta_verbose ("Compiled without sync extension\n");
|
||||
#endif
|
||||
#ifdef HAVE_RANDR
|
||||
meta_verbose ("Compiled with randr extension\n");
|
||||
#else
|
||||
meta_verbose ("Compiled without randr extension\n");
|
||||
#endif
|
||||
#ifdef HAVE_STARTUP_NOTIFICATION
|
||||
meta_verbose ("Compiled with startup notification\n");
|
||||
#else
|
||||
meta_verbose ("Compiled without startup notification\n");
|
||||
#endif
|
||||
|
||||
|
||||
/* Load prefs */
|
||||
meta_prefs_init ();
|
||||
@@ -284,6 +301,9 @@ main (int argc, char **argv)
|
||||
g_log_set_handler (NULL,
|
||||
G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION,
|
||||
log_handler, NULL);
|
||||
g_log_set_handler (G_LOG_DOMAIN,
|
||||
G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION,
|
||||
log_handler, NULL);
|
||||
g_log_set_handler ("Gtk",
|
||||
G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION,
|
||||
log_handler, NULL);
|
||||
@@ -312,6 +332,9 @@ main (int argc, char **argv)
|
||||
/* Try some panic stuff, this is lame but we really
|
||||
* don't want users to lose their WM :-/
|
||||
*/
|
||||
if (!meta_ui_have_a_theme ())
|
||||
meta_ui_set_current_theme ("Simple", FALSE);
|
||||
|
||||
if (!meta_ui_have_a_theme ())
|
||||
meta_ui_set_current_theme ("Atlanta", FALSE);
|
||||
|
||||
|
||||
65
src/menu.c
65
src/menu.c
@@ -131,30 +131,36 @@ activate_cb (GtkWidget *menuitem, gpointer data)
|
||||
* The calling code owns the string, and is reponsible to free the
|
||||
* memory after use.
|
||||
*/
|
||||
static char *
|
||||
static char*
|
||||
get_workspace_name_with_accel (Display *display,
|
||||
int index)
|
||||
Window xroot,
|
||||
int index)
|
||||
{
|
||||
char *name;
|
||||
unsigned int number;
|
||||
const char *name;
|
||||
int number;
|
||||
|
||||
name = meta_core_get_workspace_name_with_index (display, index);
|
||||
name = meta_core_get_workspace_name_with_index (display, xroot, index);
|
||||
|
||||
g_assert (name != NULL);
|
||||
|
||||
/*
|
||||
* If the name is of the form "Workspace x" where x is an unsigned
|
||||
* integer, insert a '_' before the number if it is less than 10 and
|
||||
* return it
|
||||
*/
|
||||
if (sscanf (name, _("Workspace %u"), &number) == 1)
|
||||
number = 0;
|
||||
if (sscanf (name, _("Workspace %d"), &number) == 1)
|
||||
{
|
||||
char *new_name;
|
||||
|
||||
/*
|
||||
* Above name is a pointer into the Workspace struct. Here we make
|
||||
* a copy copy so we can have our wicked way with it.
|
||||
*/
|
||||
name = g_strdup_printf (_("Workspace %s%d"),
|
||||
number < 10 ? "_" : "",
|
||||
number);
|
||||
return name;
|
||||
new_name = g_strdup_printf (_("Workspace %s%d"),
|
||||
number < 10 ? "_" : "",
|
||||
number);
|
||||
return new_name;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -163,27 +169,29 @@ get_workspace_name_with_accel (Display *display,
|
||||
* add accelerators. Escape any _ characters so that the user's
|
||||
* workspace names do not get mangled.
|
||||
*/
|
||||
char *new_name, *source, *dest;
|
||||
source = name;
|
||||
char *new_name;
|
||||
const char *source;
|
||||
char *dest;
|
||||
|
||||
/*
|
||||
* Assume the worst case, that every character is a _
|
||||
*/
|
||||
dest = new_name = g_malloc0 (strlen (name) * 2);
|
||||
new_name = g_malloc0 (strlen (name) * 2 + 1);
|
||||
|
||||
/*
|
||||
* Now iterate down the strings, adding '_' to escape as we go
|
||||
*/
|
||||
dest = new_name;
|
||||
source = name;
|
||||
while (*source != '\0')
|
||||
{
|
||||
if (*source == '_')
|
||||
*dest++ = '_';
|
||||
*dest++ = *source++;
|
||||
}
|
||||
/*
|
||||
* We don't free *name as we don't own it, and pass ownership of
|
||||
* *new_name to the calling code.
|
||||
*/
|
||||
|
||||
return new_name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static GtkWidget*
|
||||
@@ -308,13 +316,26 @@ meta_window_menu_new (MetaFrames *frames,
|
||||
meta_verbose ("Creating %d-workspace menu current space %d\n",
|
||||
n_workspaces, active_workspace);
|
||||
|
||||
if (n_workspaces > 0)
|
||||
if (n_workspaces > 1)
|
||||
{
|
||||
GtkWidget *mi;
|
||||
Display *display;
|
||||
Window xroot;
|
||||
|
||||
display = gdk_x11_drawable_get_xdisplay (GTK_WIDGET (frames)->window);
|
||||
|
||||
display = gdk_x11_drawable_get_xdisplay(GTK_WIDGET(frames)->window);
|
||||
|
||||
#ifdef HAVE_GTK_MULTIHEAD
|
||||
{
|
||||
GdkScreen *screen;
|
||||
screen = gdk_drawable_get_screen (GTK_WIDGET (frames)->window);
|
||||
xroot = GDK_DRAWABLE_XID (gdk_screen_get_root_window (screen));
|
||||
}
|
||||
#else
|
||||
{
|
||||
xroot = gdk_x11_get_default_root_xwindow ();
|
||||
}
|
||||
#endif
|
||||
|
||||
i = 0;
|
||||
while (i < n_workspaces)
|
||||
{
|
||||
@@ -327,7 +348,7 @@ meta_window_menu_new (MetaFrames *frames,
|
||||
i + 1,
|
||||
&key, &mods);
|
||||
|
||||
name = get_workspace_name_with_accel (display, i);
|
||||
name = get_workspace_name_with_accel (display, xroot, i);
|
||||
if (ops & META_MENU_OP_UNSTICK)
|
||||
label = g_strdup_printf (_("Only on %s"), name);
|
||||
else
|
||||
|
||||
134
src/metacity-Xatomtype.h
Normal file
134
src/metacity-Xatomtype.h
Normal file
@@ -0,0 +1,134 @@
|
||||
/* $Xorg: Xatomtype.h,v 1.4 2001/02/09 02:03:38 xorgcvs Exp $ */
|
||||
|
||||
/***********************************************************
|
||||
|
||||
Copyright 1987, 1998 The Open Group
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and its
|
||||
documentation for any purpose is hereby granted without fee, provided that
|
||||
the above copyright notice appear in all copies and that both that
|
||||
copyright notice and this permission notice appear in supporting
|
||||
documentation.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the name of The Open Group shall not be
|
||||
used in advertising or otherwise to promote the sale, use or other dealings
|
||||
in this Software without prior written authorization from The Open Group.
|
||||
|
||||
|
||||
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
|
||||
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify, and distribute this software and its
|
||||
documentation for any purpose and without fee is hereby granted,
|
||||
provided that the above copyright notice appear in all copies and that
|
||||
both that copyright notice and this permission notice appear in
|
||||
supporting documentation, and that the name of Digital not be
|
||||
used in advertising or publicity pertaining to distribution of the
|
||||
software without specific, written prior permission.
|
||||
|
||||
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
||||
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
||||
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
|
||||
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
||||
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||
SOFTWARE.
|
||||
|
||||
******************************************************************/
|
||||
|
||||
#ifndef _XATOMTYPE_H_
|
||||
#define _XATOMTYPE_H_
|
||||
|
||||
/*
|
||||
* This files defines crock C structures for calling XGetWindowProperty and
|
||||
* XChangeProperty. All fields must be longs as the semantics of property
|
||||
* routines will handle conversion to and from actual 32 bit objects. If your
|
||||
* compiler doesn't treat &structoflongs the same as &arrayoflongs[0], you
|
||||
* will have some work to do.
|
||||
*/
|
||||
|
||||
#define BOOL long
|
||||
#define SIGNEDINT long
|
||||
#define UNSIGNEDINT unsigned long
|
||||
#define RESOURCEID unsigned long
|
||||
|
||||
|
||||
/* this structure may be extended, but do not change the order */
|
||||
typedef struct {
|
||||
UNSIGNEDINT flags;
|
||||
SIGNEDINT x, y, width, height; /* need to cvt; only for pre-ICCCM */
|
||||
SIGNEDINT minWidth, minHeight; /* need to cvt */
|
||||
SIGNEDINT maxWidth, maxHeight; /* need to cvt */
|
||||
SIGNEDINT widthInc, heightInc; /* need to cvt */
|
||||
SIGNEDINT minAspectX, minAspectY; /* need to cvt */
|
||||
SIGNEDINT maxAspectX, maxAspectY; /* need to cvt */
|
||||
SIGNEDINT baseWidth,baseHeight; /* need to cvt; ICCCM version 1 */
|
||||
SIGNEDINT winGravity; /* need to cvt; ICCCM version 1 */
|
||||
} xPropSizeHints;
|
||||
#define OldNumPropSizeElements 15 /* pre-ICCCM */
|
||||
#define NumPropSizeElements 18 /* ICCCM version 1 */
|
||||
|
||||
/* this structure may be extended, but do not change the order */
|
||||
/* RGB properties */
|
||||
typedef struct {
|
||||
RESOURCEID colormap;
|
||||
UNSIGNEDINT red_max;
|
||||
UNSIGNEDINT red_mult;
|
||||
UNSIGNEDINT green_max;
|
||||
UNSIGNEDINT green_mult;
|
||||
UNSIGNEDINT blue_max;
|
||||
UNSIGNEDINT blue_mult;
|
||||
UNSIGNEDINT base_pixel;
|
||||
RESOURCEID visualid; /* ICCCM version 1 */
|
||||
RESOURCEID killid; /* ICCCM version 1 */
|
||||
} xPropStandardColormap;
|
||||
#define OldNumPropStandardColormapElements 8 /* pre-ICCCM */
|
||||
#define NumPropStandardColormapElements 10 /* ICCCM version 1 */
|
||||
|
||||
|
||||
/* this structure may be extended, but do not change the order */
|
||||
typedef struct {
|
||||
UNSIGNEDINT flags;
|
||||
BOOL input; /* need to convert */
|
||||
SIGNEDINT initialState; /* need to cvt */
|
||||
RESOURCEID iconPixmap;
|
||||
RESOURCEID iconWindow;
|
||||
SIGNEDINT iconX; /* need to cvt */
|
||||
SIGNEDINT iconY; /* need to cvt */
|
||||
RESOURCEID iconMask;
|
||||
UNSIGNEDINT windowGroup;
|
||||
} xPropWMHints;
|
||||
#define NumPropWMHintsElements 9 /* number of elements in this structure */
|
||||
|
||||
/* this structure defines the icon size hints information */
|
||||
typedef struct {
|
||||
SIGNEDINT minWidth, minHeight; /* need to cvt */
|
||||
SIGNEDINT maxWidth, maxHeight; /* need to cvt */
|
||||
SIGNEDINT widthInc, heightInc; /* need to cvt */
|
||||
} xPropIconSize;
|
||||
#define NumPropIconSizeElements 6 /* number of elements in this structure */
|
||||
|
||||
/* this structure defines the window manager state information */
|
||||
typedef struct {
|
||||
SIGNEDINT state; /* need to cvt */
|
||||
RESOURCEID iconWindow;
|
||||
} xPropWMState;
|
||||
#define NumPropWMStateElements 2 /* number of elements in struct */
|
||||
|
||||
#undef BOOL
|
||||
#undef SIGNEDINT
|
||||
#undef UNSIGNEDINT
|
||||
#undef RESOURCEID
|
||||
|
||||
#endif /* _XATOMTYPE_H_ */
|
||||
@@ -1,6 +1,11 @@
|
||||
[Desktop Entry]
|
||||
_Name=Metacity
|
||||
Exec=metacity
|
||||
# name of loadable control center module
|
||||
X-GNOME-WMSettingsModule=metacity
|
||||
# name we put on the WM spec check window
|
||||
X-GNOME-WMName=Metacity
|
||||
# back compat only
|
||||
X-GnomeWMSettingsLibrary=metacity
|
||||
|
||||
[Window Manager]
|
||||
|
||||
@@ -3,6 +3,45 @@
|
||||
|
||||
<!-- General preferences -->
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/metacity/general/mouse_button_modifier</key>
|
||||
<applyto>/apps/metacity/general/mouse_button_modifier</applyto>
|
||||
<owner>metacity</owner>
|
||||
<type>string</type>
|
||||
<default><Alt></default>
|
||||
<locale name="C">
|
||||
<short>Modifier to use for modified window click actions</short>
|
||||
<long>
|
||||
Clicking a window while holding down this modifier key
|
||||
will move the window (left click), resize the window
|
||||
(middle click), or show the window menu (right click).
|
||||
Modifier is expressed as "<Alt>" or "<Super>"
|
||||
for example.
|
||||
</long>
|
||||
</locale>
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/metacity/general/button_layout</key>
|
||||
<applyto>/apps/metacity/general/button_layout</applyto>
|
||||
<owner>metacity</owner>
|
||||
<type>string</type>
|
||||
<default>menu:minimize,maximize,close</default>
|
||||
<locale name="C">
|
||||
<short>Arrangement of buttons on the titlebar</short>
|
||||
<long>
|
||||
Arrangement of buttons on the titlebar. The
|
||||
value should be a string, such as
|
||||
"menu:minimize,maximize,close"; the colon separates the
|
||||
left corner of the window from the right corner, and
|
||||
the button names are comma-separated. Duplicate buttons
|
||||
are not allowed. Unknown button names are silently ignored
|
||||
so that buttons can be added in future metacity versions
|
||||
without breaking older versions.
|
||||
</long>
|
||||
</locale>
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/metacity/general/focus_mode</key>
|
||||
<applyto>/apps/metacity/general/focus_mode</applyto>
|
||||
@@ -22,6 +61,23 @@
|
||||
</locale>
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/metacity/general/action_double_click_titlebar</key>
|
||||
<applyto>/apps/metacity/general/action_double_click_titlebar</applyto>
|
||||
<owner>metacity</owner>
|
||||
<type>string</type>
|
||||
<default>toggle_shade</default>
|
||||
<locale name="C">
|
||||
<short>Action on title bar double-click</short>
|
||||
<long>
|
||||
This option determines the effects of double-clicking on the
|
||||
title bar. Current valid options are 'toggle_shade', which will
|
||||
shade/unshade the window, and 'toggle_maximize' which will
|
||||
maximize/unmaximize the window.
|
||||
</long>
|
||||
</locale>
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/metacity/general/auto_raise</key>
|
||||
<applyto>/apps/metacity/general/auto_raise</applyto>
|
||||
@@ -58,7 +114,7 @@
|
||||
<applyto>/apps/metacity/general/theme</applyto>
|
||||
<owner>metacity</owner>
|
||||
<type>string</type>
|
||||
<default>Atlanta</default>
|
||||
<default>Simple</default>
|
||||
<locale name="C">
|
||||
<short>Current theme</short>
|
||||
<long>
|
||||
@@ -121,6 +177,86 @@
|
||||
</locale>
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/apps/metacity/visual_bell</key>
|
||||
<applyto>/apps/metacity/general/visual_bell</applyto>
|
||||
<owner>metacity</owner>
|
||||
<type>bool</type>
|
||||
<default>false</default>
|
||||
<locale name="C">
|
||||
<short>Enable Visual Bell</short>
|
||||
<long>Turns on a visual indication when an application or the system
|
||||
issues a 'bell' or 'beep'; useful for the hard-of-hearing and for use
|
||||
in noisy environments, or when 'audible bell' is off.
|
||||
</long>
|
||||
</locale>
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/metacity/general/audible_bell</key>
|
||||
<applyto>/apps/metacity/general/audible_bell</applyto>
|
||||
<owner>metacity</owner>
|
||||
<type>bool</type>
|
||||
<default>true</default>
|
||||
<locale name="C">
|
||||
<short>System Bell is Audible</short>
|
||||
<long>Determines whether applications or the system can generate audible
|
||||
'beeps'; may be used in conjunction with 'visual bell' to
|
||||
allow silent 'beeps'.
|
||||
</long>
|
||||
</locale>
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/metacity/general/visual_bell_type</key>
|
||||
<applyto>/apps/metacity/general/visual_bell_type</applyto>
|
||||
<owner>metacity</owner>
|
||||
<type>string</type>
|
||||
<default>fullscreen</default>
|
||||
<locale name="C">
|
||||
<short>Visual Bell Type</short>
|
||||
<long>
|
||||
Tells Metacity how to implement the visual indication that
|
||||
the system bell or another application 'bell' indicator has
|
||||
been rung. Currently there are two valid values, "fullscreen",
|
||||
which causes a fullscreen white-black flash, and "frame_flash" which
|
||||
causes the titlebar of the application which sent the bell signal to
|
||||
flash. If the application which sent the bell is unknown (as is
|
||||
usually the case for the default "system beep"), the currently
|
||||
focused window's titlebar is flashed.
|
||||
</long>
|
||||
</locale>
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/metacity/workspace_names/name</key>
|
||||
<applyto>/apps/metacity/workspace_names/name_1</applyto>
|
||||
<applyto>/apps/metacity/workspace_names/name_2</applyto>
|
||||
<applyto>/apps/metacity/workspace_names/name_3</applyto>
|
||||
<applyto>/apps/metacity/workspace_names/name_4</applyto>
|
||||
<applyto>/apps/metacity/workspace_names/name_5</applyto>
|
||||
<applyto>/apps/metacity/workspace_names/name_6</applyto>
|
||||
<applyto>/apps/metacity/workspace_names/name_7</applyto>
|
||||
<applyto>/apps/metacity/workspace_names/name_8</applyto>
|
||||
<applyto>/apps/metacity/workspace_names/name_9</applyto>
|
||||
<applyto>/apps/metacity/workspace_names/name_10</applyto>
|
||||
<applyto>/apps/metacity/workspace_names/name_11</applyto>
|
||||
<applyto>/apps/metacity/workspace_names/name_12</applyto>
|
||||
<applyto>/apps/metacity/workspace_names/name_13</applyto>
|
||||
<applyto>/apps/metacity/workspace_names/name_14</applyto>
|
||||
<applyto>/apps/metacity/workspace_names/name_15</applyto>
|
||||
<applyto>/apps/metacity/workspace_names/name_16</applyto>
|
||||
<owner>metacity</owner>
|
||||
<type>string</type>
|
||||
<default></default>
|
||||
<locale name="C">
|
||||
<short>Name of workspace</short>
|
||||
<long>
|
||||
The name of a workspace.
|
||||
</long>
|
||||
</locale>
|
||||
</schema>
|
||||
|
||||
<!-- Window Keybindings -->
|
||||
|
||||
<schema>
|
||||
@@ -232,7 +368,7 @@ you set
|
||||
<applyto>/apps/metacity/window_keybindings/toggle_shaded</applyto>
|
||||
<owner>metacity</owner>
|
||||
<type>string</type>
|
||||
<default>disabled</default>
|
||||
<default><Alt>F12</default>
|
||||
<locale name="C">
|
||||
<short>Toggle shaded state</short>
|
||||
<long>
|
||||
@@ -341,7 +477,7 @@ you set
|
||||
<type>string</type>
|
||||
<default>disabled</default>
|
||||
<locale name="C">
|
||||
<short>Toggle whether the window is on all workspaces</short>
|
||||
<short>Toggle window on all workspaces</short>
|
||||
<long>
|
||||
The keybinding used to toggle whether the window is on all
|
||||
workspaces or just one.
|
||||
@@ -738,7 +874,7 @@ you set
|
||||
<type>string</type>
|
||||
<!-- no default for this one -->
|
||||
<locale name="C">
|
||||
<short>Raise window if obscured, lowers it otherwise</short>
|
||||
<short>Raise obscured window, otherwise lower</short>
|
||||
<long>
|
||||
This keybinding changes whether a window is above or below
|
||||
other windows. If the window is covered by another window, it raises
|
||||
@@ -803,6 +939,51 @@ you set
|
||||
</locale>
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/metacity/window_keybindings/maximize_vertically</key>
|
||||
<applyto>/apps/metacity/window_keybindings/maximize_vertically</applyto>
|
||||
<owner>metacity</owner>
|
||||
<type>string</type>
|
||||
<!-- no default for this one -->
|
||||
<locale name="C">
|
||||
<short>Maximize window vertically</short>
|
||||
<long>
|
||||
This keybinding resizes a window to fill available vertical space.
|
||||
|
||||
The format looks like "<Control>a" or
|
||||
"<Shift><Alt>F1.
|
||||
|
||||
The parser is fairly liberal and allows lower or upper case,
|
||||
and also abbreviations such as "<Ctl>" and
|
||||
"<Ctrl>". If you set the option to the special string
|
||||
"disabled", then there will be no keybinding for this
|
||||
action.
|
||||
</long>
|
||||
</locale>
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/metacity/window_keybindings/maximize_horizontally</key>
|
||||
<applyto>/apps/metacity/window_keybindings/maximize_horizontally</applyto>
|
||||
<owner>metacity</owner>
|
||||
<type>string</type>
|
||||
<!-- no default for this one -->
|
||||
<locale name="C">
|
||||
<short>Maximize window horizontally</short>
|
||||
<long>
|
||||
This keybinding resizes a window to fill available horizontal space.
|
||||
|
||||
The format looks like "<Control>a" or
|
||||
"<Shift><Alt>F1.
|
||||
|
||||
The parser is fairly liberal and allows lower or upper case,
|
||||
and also abbreviations such as "<Ctl>" and
|
||||
"<Ctrl>". If you set the option to the special string
|
||||
"disabled", then there will be no keybinding for this
|
||||
action.
|
||||
</long>
|
||||
</locale>
|
||||
</schema>
|
||||
|
||||
<!-- Global Keybindings -->
|
||||
|
||||
@@ -814,11 +995,12 @@ you set
|
||||
<type>string</type>
|
||||
<default><Alt>Tab</default>
|
||||
<locale name="C">
|
||||
<short>Move focus between windows using popup display</short>
|
||||
<short>Move between windows with popup</short>
|
||||
<long>
|
||||
The keybinding used to move focus between windows, using
|
||||
a popup window.
|
||||
(Traditionally <Alt>Tab)
|
||||
(Traditionally <Alt>Tab) Holding the "shift" key
|
||||
while using this binding reverses the direction of movement.
|
||||
|
||||
The format looks like "<Control>a" or
|
||||
"<Shift><Alt>F1.
|
||||
@@ -831,7 +1013,32 @@ you set
|
||||
</long>
|
||||
</locale>
|
||||
</schema>
|
||||
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/metacity/global_keybindings/switch_windows_backward</key>
|
||||
<applyto>/apps/metacity/global_keybindings/switch_windows_backward</applyto>
|
||||
<owner>metacity</owner>
|
||||
<type>string</type>
|
||||
<default>disabled</default>
|
||||
<locale name="C">
|
||||
<short>Move focus backwards between windows using popup display</short>
|
||||
<long>
|
||||
The keybinding used to move focus backwards between windows, using
|
||||
a popup window. Holding "shift" together with this
|
||||
binding makes the direction go forward again.
|
||||
|
||||
The format looks like "<Control>a" or
|
||||
"<Shift><Alt>F1.
|
||||
|
||||
The parser is fairly liberal and allows lower or upper case,
|
||||
and also abbreviations such as "<Ctl>" and
|
||||
"<Ctrl>". If you set the option to the special string
|
||||
"disabled", then there will be no keybinding for this
|
||||
action.
|
||||
</long>
|
||||
</locale>
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/metacity/global_keybindings/switch_panels</key>
|
||||
<applyto>/apps/metacity/global_keybindings/switch_panels</applyto>
|
||||
@@ -839,7 +1046,7 @@ you set
|
||||
<type>string</type>
|
||||
<default><Control><Alt>Tab</default>
|
||||
<locale name="C">
|
||||
<short>Move focus between panels and the desktop using popup display</short>
|
||||
<short>Move between panels and the desktop with popup</short>
|
||||
<long>
|
||||
The keybinding used to move focus between panels and
|
||||
the desktop, using a popup window.
|
||||
@@ -856,6 +1063,30 @@ you set
|
||||
</locale>
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/metacity/global_keybindings/switch_panels_backward</key>
|
||||
<applyto>/apps/metacity/global_keybindings/switch_panels_backward</applyto>
|
||||
<owner>metacity</owner>
|
||||
<type>string</type>
|
||||
<default>disabled</default>
|
||||
<locale name="C">
|
||||
<short>Move backwards between panels and the desktop with popup</short>
|
||||
<long>
|
||||
The keybinding used to move focus backwards between panels
|
||||
and the desktop, using a popup window.
|
||||
|
||||
The format looks like "<Control>a" or
|
||||
"<Shift><Alt>F1.
|
||||
|
||||
The parser is fairly liberal and allows lower or upper case,
|
||||
and also abbreviations such as "<Ctl>" and
|
||||
"<Ctrl>". If you set the option to the special string
|
||||
"disabled", then there will be no keybinding for this
|
||||
action.
|
||||
</long>
|
||||
</locale>
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/metacity/global_keybindings/cycle_windows</key>
|
||||
<applyto>/apps/metacity/global_keybindings/cycle_windows</applyto>
|
||||
@@ -863,11 +1094,12 @@ you set
|
||||
<type>string</type>
|
||||
<default><Alt>Escape</default>
|
||||
<locale name="C">
|
||||
<short>Move focus between windows immediately</short>
|
||||
<short>Move between windows immediately</short>
|
||||
<long>
|
||||
The keybinding used to move focus between windows without
|
||||
a popup window.
|
||||
(Traditionally <Alt>Escape)
|
||||
(Traditionally <Alt>Escape) Holding the "shift" key
|
||||
while using this binding reverses the direction of movement.
|
||||
|
||||
The format looks like "<Control>a" or
|
||||
"<Shift><Alt>F1.
|
||||
@@ -880,7 +1112,32 @@ you set
|
||||
</long>
|
||||
</locale>
|
||||
</schema>
|
||||
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/metacity/global_keybindings/cycle_windows_backward</key>
|
||||
<applyto>/apps/metacity/global_keybindings/cycle_windows_backward</applyto>
|
||||
<owner>metacity</owner>
|
||||
<type>string</type>
|
||||
<default>disabled</default>
|
||||
<locale name="C">
|
||||
<short>Move backwards between windows immediately</short>
|
||||
<long>
|
||||
The keybinding used to move focus backwards between windows
|
||||
without a popup window. Holding "shift" together with this
|
||||
binding makes the direction go forward again.
|
||||
|
||||
The format looks like "<Control>a" or
|
||||
"<Shift><Alt>F1.
|
||||
|
||||
The parser is fairly liberal and allows lower or upper case,
|
||||
and also abbreviations such as "<Ctl>" and
|
||||
"<Ctrl>". If you set the option to the special string
|
||||
"disabled", then there will be no keybinding for this
|
||||
action.
|
||||
</long>
|
||||
</locale>
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/metacity/global_keybindings/cycle_panels</key>
|
||||
<applyto>/apps/metacity/global_keybindings/cycle_panels</applyto>
|
||||
@@ -888,7 +1145,7 @@ you set
|
||||
<type>string</type>
|
||||
<default><Control><Alt>Escape</default>
|
||||
<locale name="C">
|
||||
<short>Move focus between panels and the desktop immediately</short>
|
||||
<short>Move between panels and the desktop immediately</short>
|
||||
<long>
|
||||
The keybinding used to move focus between panels and
|
||||
the desktop, without a popup window.
|
||||
@@ -905,6 +1162,30 @@ you set
|
||||
</locale>
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/metacity/global_keybindings/cycle_panels_backward</key>
|
||||
<applyto>/apps/metacity/global_keybindings/cycle_panels_backward</applyto>
|
||||
<owner>metacity</owner>
|
||||
<type>string</type>
|
||||
<default><Control><Alt>Escape</default>
|
||||
<locale name="C">
|
||||
<short>Move backward between panels and the desktop immediately</short>
|
||||
<long>
|
||||
The keybinding used to move focus backwards between panels and
|
||||
the desktop, without a popup window.
|
||||
|
||||
The format looks like "<Control>a" or
|
||||
"<Shift><Alt>F1.
|
||||
|
||||
The parser is fairly liberal and allows lower or upper case,
|
||||
and also abbreviations such as "<Ctl>" and
|
||||
"<Ctrl>". If you set the option to the special string
|
||||
"disabled", then there will be no keybinding for this
|
||||
action.
|
||||
</long>
|
||||
</locale>
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/metacity/global_keybindings/show_desktop</key>
|
||||
<applyto>/apps/metacity/global_keybindings/show_desktop</applyto>
|
||||
@@ -1276,7 +1557,7 @@ you set
|
||||
<type>string</type>
|
||||
<default><Control><Alt>Up</default>
|
||||
<locale name="C">
|
||||
<short>Switch to workspace above the current space</short>
|
||||
<short>Switch to workspace above this one</short>
|
||||
<long>
|
||||
The keybinding that switches to the workspace above
|
||||
the current workspace.
|
||||
@@ -1301,7 +1582,7 @@ you set
|
||||
<type>string</type>
|
||||
<default><Control><Alt>Down</default>
|
||||
<locale name="C">
|
||||
<short>Switch to workspace below the current space</short>
|
||||
<short>Switch to workspace below this one</short>
|
||||
<long>
|
||||
The keybinding that switches to the workspace below
|
||||
the current workspace.
|
||||
@@ -1318,6 +1599,100 @@ you set
|
||||
</locale>
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/metacity/global_keybindings/panel_main_menu</key>
|
||||
<applyto>/apps/metacity/global_keybindings/panel_main_menu</applyto>
|
||||
<owner>metacity</owner>
|
||||
<type>string</type>
|
||||
<default><Alt>F1</default>
|
||||
<locale name="C">
|
||||
<short>Show the panel menu</short>
|
||||
<long>
|
||||
The keybinding which shows the panel's main menu.
|
||||
|
||||
The format looks like "<Control>a" or
|
||||
"<Shift><Alt>F1.
|
||||
|
||||
The parser is fairly liberal and allows lower or upper case,
|
||||
and also abbreviations such as "<Ctl>" and
|
||||
"<Ctrl>". If you set the option to the special string
|
||||
"disabled", then there will be no keybinding for this
|
||||
action.
|
||||
</long>
|
||||
</locale>
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/metacity/global_keybindings/panel_run_dialog</key>
|
||||
<applyto>/apps/metacity/global_keybindings/panel_run_dialog</applyto>
|
||||
<owner>metacity</owner>
|
||||
<type>string</type>
|
||||
<default><Alt>F2</default>
|
||||
<locale name="C">
|
||||
<short>Show the panel run dialog</short>
|
||||
<long>
|
||||
The keybinding which display's the panel's "Run Program" dialog
|
||||
box.
|
||||
|
||||
The format looks like "<Control>a" or
|
||||
"<Shift><Alt>F1.
|
||||
|
||||
The parser is fairly liberal and allows lower or upper case,
|
||||
and also abbreviations such as "<Ctl>" and
|
||||
"<Ctrl>". If you set the option to the special string
|
||||
"disabled", then there will be no keybinding for this
|
||||
action.
|
||||
</long>
|
||||
</locale>
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/metacity/global_keybindings/run_command_screenshot</key>
|
||||
<applyto>/apps/metacity/global_keybindings/run_command_screenshot</applyto>
|
||||
<owner>metacity</owner>
|
||||
<type>string</type>
|
||||
<default>Print</default>
|
||||
<locale name="C">
|
||||
<short>Take a screenshot</short>
|
||||
<long>
|
||||
The keybinding which invokes the panel's screenshot utility.
|
||||
|
||||
The format looks like "<Control>a" or
|
||||
"<Shift><Alt>F1.
|
||||
|
||||
The parser is fairly liberal and allows lower or upper case,
|
||||
and also abbreviations such as "<Ctl>" and
|
||||
"<Ctrl>". If you set the option to the special string
|
||||
"disabled", then there will be no keybinding for this
|
||||
action.
|
||||
</long>
|
||||
</locale>
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/metacity/global_keybindings/run_command_window_screenshot</key>
|
||||
<applyto>/apps/metacity/global_keybindings/run_command_window_screenshot</applyto>
|
||||
<owner>metacity</owner>
|
||||
<type>string</type>
|
||||
<default><Alt>Print</default>
|
||||
<locale name="C">
|
||||
<short>Take a screenshot of a window</short>
|
||||
<long>
|
||||
The keybinding which invokes the panel's screenshot utility
|
||||
to take a screenshot of a window.
|
||||
|
||||
The format looks like "<Control>a" or
|
||||
"<Shift><Alt>F1.
|
||||
|
||||
The parser is fairly liberal and allows lower or upper case,
|
||||
and also abbreviations such as "<Ctl>" and
|
||||
"<Ctrl>". If you set the option to the special string
|
||||
"disabled", then there will be no keybinding for this
|
||||
action.
|
||||
</long>
|
||||
</locale>
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/metacity/global_keybindings/run_command</key>
|
||||
<applyto>/apps/metacity/global_keybindings/run_command_1</applyto>
|
||||
@@ -1355,6 +1730,38 @@ you set
|
||||
|
||||
<!-- commands to run with the run_command keybindings -->
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/metacity/keybinding_commands/command_screenshot</key>
|
||||
<applyto>/apps/metacity/keybinding_commands/command_screenshot</applyto>
|
||||
<owner>metacity</owner>
|
||||
<type>string</type>
|
||||
<default>gnome-panel-screenshot</default>
|
||||
<locale name="C">
|
||||
<short>The screenshot command</short>
|
||||
<long>
|
||||
The /apps/metacity/global_keybindings/run_command_screenshot
|
||||
key defines a keybinding which causes the command specified
|
||||
by this setting to be invoked.
|
||||
</long>
|
||||
</locale>
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/metacity/keybinding_commands/command_window_screenshot</key>
|
||||
<applyto>/apps/metacity/keybinding_commands/command_window_screenshot</applyto>
|
||||
<owner>metacity</owner>
|
||||
<type>string</type>
|
||||
<default>gnome-panel-screenshot --window</default>
|
||||
<locale name="C">
|
||||
<short>The window screenshot command</short>
|
||||
<long>
|
||||
The /apps/metacity/global_keybindings/run_command_window_screenshot
|
||||
key defines a keybinding which causes the command specified
|
||||
by this setting to be invoked.
|
||||
</long>
|
||||
</locale>
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/metacity/keybinding_commands/command</key>
|
||||
<applyto>/apps/metacity/keybinding_commands/command_1</applyto>
|
||||
|
||||
137
src/place.c
137
src/place.c
@@ -2,6 +2,8 @@
|
||||
|
||||
/*
|
||||
* Copyright (C) 2001 Havoc Pennington
|
||||
* Copyright (C) 2002, 2003 Red Hat, Inc.
|
||||
* Copyright (C) 2003 Rob Adams
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
@@ -120,13 +122,13 @@ find_next_cascade (MetaWindow *window,
|
||||
* cascade_x, cascade_y are the target position
|
||||
* of NW corner of window frame.
|
||||
*/
|
||||
|
||||
/* FIXME this is bogus because we get the current xinerama
|
||||
* for the window based on its position, but we haven't
|
||||
* placed it yet.
|
||||
|
||||
/* FIXME should use xinerama with mouse pointer
|
||||
* (or better, xinerama where window was launched
|
||||
* determined via startup notification)
|
||||
*/
|
||||
meta_window_get_work_area (window, TRUE, &work_area);
|
||||
|
||||
meta_window_get_work_area_for_xinerama (window, 0, &work_area);
|
||||
|
||||
cascade_x = MAX (0, work_area.x);
|
||||
cascade_y = MAX (0, work_area.y);
|
||||
|
||||
@@ -363,14 +365,36 @@ topmost_cmp (gconstpointer a, gconstpointer b)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
center_tile_rect_in_area (MetaRectangle *rect,
|
||||
MetaRectangle *work_area)
|
||||
{
|
||||
int fluff;
|
||||
|
||||
/* The point here is to tile a window such that "extra"
|
||||
* space is equal on either side (i.e. so a full screen
|
||||
* of windows tiled this way would center the windows
|
||||
* as a group)
|
||||
*/
|
||||
|
||||
fluff = (work_area->width % rect->width) / 2;
|
||||
rect->x = work_area->x + fluff;
|
||||
fluff = (work_area->height % rect->height) / 3;
|
||||
rect->y = work_area->y + fluff;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
fit_rect_in_xinerama (MetaScreen *screen,
|
||||
fit_rect_in_xinerama (MetaWindow *window,
|
||||
MetaRectangle *rect)
|
||||
{
|
||||
int i;
|
||||
int best_index;
|
||||
int best_overlap;
|
||||
MetaScreen *screen;
|
||||
MetaRectangle work_area;
|
||||
const MetaXineramaScreenInfo *xsi;
|
||||
|
||||
screen = window->screen;
|
||||
|
||||
/* Find xinerama with best fit, then
|
||||
* shift rect to be entirely within it.
|
||||
@@ -409,17 +433,17 @@ fit_rect_in_xinerama (MetaScreen *screen,
|
||||
/* some overlap had to be better than -1 */
|
||||
g_assert (best_index >= 0);
|
||||
|
||||
xsi = &screen->xinerama_infos[best_index];
|
||||
meta_window_get_work_area_for_xinerama (window, best_index, &work_area);
|
||||
|
||||
if (rect->x < xsi->x_origin)
|
||||
rect->x = xsi->x_origin;
|
||||
if (rect->y < xsi->y_origin)
|
||||
rect->y = xsi->y_origin;
|
||||
if ((rect->x < work_area.x) || (rect->y < work_area.y) ||
|
||||
(rect->x >= work_area.x + work_area.width) ||
|
||||
(rect->y >= work_area.y + work_area.height))
|
||||
center_tile_rect_in_area (rect, &work_area);
|
||||
|
||||
/* Now return whether we are entirely within the xinerama screen */
|
||||
return
|
||||
((rect->x + rect->width) < (xsi->x_origin + xsi->width)) &&
|
||||
((rect->y + rect->height) < (xsi->y_origin + xsi->height));
|
||||
/* Now return whether we are entirely within the work area */
|
||||
return
|
||||
((rect->x + rect->width) < (work_area.x + work_area.width)) &&
|
||||
((rect->y + rect->height) < (work_area.y + work_area.height));
|
||||
}
|
||||
|
||||
/* Find the leftmost, then topmost, empty area on the workspace
|
||||
@@ -446,12 +470,12 @@ find_first_fit (MetaWindow *window,
|
||||
* the bottom of each existing window, and then to the right
|
||||
* of each existing window, aligned with the left/top of the
|
||||
* existing window in each of those cases.
|
||||
*/
|
||||
|
||||
*/
|
||||
int retval;
|
||||
GList *sorted;
|
||||
GList *tmp;
|
||||
MetaRectangle rect;
|
||||
MetaRectangle work_area;
|
||||
int i;
|
||||
|
||||
retval = FALSE;
|
||||
@@ -466,11 +490,16 @@ find_first_fit (MetaWindow *window,
|
||||
rect.height += fgeom->top_height + fgeom->bottom_height;
|
||||
}
|
||||
|
||||
/* Try origin of first Xinerama */
|
||||
rect.x = window->screen->xinerama_infos[0].x_origin;
|
||||
rect.y = window->screen->xinerama_infos[0].y_origin;
|
||||
/* Try center-tiling on first xinerama */
|
||||
/* FIXME should use xinerama with mouse pointer
|
||||
* (or better, xinerama where window was launched
|
||||
* determined via startup notification)
|
||||
*/
|
||||
meta_window_get_work_area_for_xinerama (window, 0, &work_area);
|
||||
|
||||
if (fit_rect_in_xinerama (window->screen, &rect) &&
|
||||
center_tile_rect_in_area (&rect, &work_area);
|
||||
|
||||
if (fit_rect_in_xinerama (window, &rect) &&
|
||||
!rectangle_overlaps_some_window (&rect, windows))
|
||||
{
|
||||
*new_x = rect.x;
|
||||
@@ -497,13 +526,13 @@ find_first_fit (MetaWindow *window,
|
||||
{
|
||||
MetaWindow *w = tmp->data;
|
||||
MetaRectangle outer_rect;
|
||||
|
||||
meta_window_get_outer_rect (w, &outer_rect);
|
||||
|
||||
meta_window_get_outer_rect (w, &outer_rect);
|
||||
|
||||
rect.x = outer_rect.x;
|
||||
rect.y = outer_rect.y + outer_rect.height;
|
||||
|
||||
if (fit_rect_in_xinerama (window->screen, &rect) &&
|
||||
if (fit_rect_in_xinerama (window, &rect) &&
|
||||
!rectangle_overlaps_some_window (&rect, sorted))
|
||||
{
|
||||
*new_x = rect.x;
|
||||
@@ -513,12 +542,12 @@ find_first_fit (MetaWindow *window,
|
||||
*new_x += fgeom->left_width;
|
||||
*new_y += fgeom->top_height;
|
||||
}
|
||||
|
||||
|
||||
retval = TRUE;
|
||||
|
||||
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
tmp = tmp->next;
|
||||
}
|
||||
|
||||
@@ -531,13 +560,13 @@ find_first_fit (MetaWindow *window,
|
||||
{
|
||||
MetaWindow *w = tmp->data;
|
||||
MetaRectangle outer_rect;
|
||||
|
||||
|
||||
meta_window_get_outer_rect (w, &outer_rect);
|
||||
|
||||
|
||||
rect.x = outer_rect.x + outer_rect.width;
|
||||
rect.y = outer_rect.y;
|
||||
|
||||
if (fit_rect_in_xinerama (window->screen, &rect) &&
|
||||
|
||||
if (fit_rect_in_xinerama (window, &rect) &&
|
||||
!rectangle_overlaps_some_window (&rect, sorted))
|
||||
{
|
||||
*new_x = rect.x;
|
||||
@@ -547,23 +576,24 @@ find_first_fit (MetaWindow *window,
|
||||
*new_x += fgeom->left_width;
|
||||
*new_y += fgeom->top_height;
|
||||
}
|
||||
|
||||
|
||||
retval = TRUE;
|
||||
|
||||
|
||||
goto out;
|
||||
}
|
||||
|
||||
tmp = tmp->next;
|
||||
}
|
||||
}
|
||||
|
||||
/* Origin of each Xinerama screen which isn't the first */
|
||||
tmp = tmp->next;
|
||||
}
|
||||
|
||||
/* Try center-tile on each Xinerama screen which isn't the first */
|
||||
i = 1;
|
||||
while (i < window->screen->n_xinerama_infos)
|
||||
{
|
||||
rect.x = window->screen->xinerama_infos[i].x_origin;
|
||||
rect.y = window->screen->xinerama_infos[i].y_origin;
|
||||
|
||||
if (fit_rect_in_xinerama (window->screen, &rect) &&
|
||||
meta_window_get_work_area_for_xinerama (window, i, &work_area);
|
||||
|
||||
center_tile_rect_in_area (&rect, &work_area);
|
||||
|
||||
if (fit_rect_in_xinerama (window, &rect) &&
|
||||
!rectangle_overlaps_some_window (&rect, windows))
|
||||
{
|
||||
*new_x = rect.x;
|
||||
@@ -578,6 +608,7 @@ find_first_fit (MetaWindow *window,
|
||||
|
||||
goto out;
|
||||
}
|
||||
|
||||
++i;
|
||||
}
|
||||
|
||||
@@ -602,17 +633,18 @@ constrain_placement (MetaWindow *window,
|
||||
int nw_x, nw_y;
|
||||
int offscreen_w, offscreen_h;
|
||||
MetaRectangle outer_rect;
|
||||
|
||||
|
||||
meta_window_get_outer_rect (window, &outer_rect);
|
||||
|
||||
|
||||
/* FIXME this is bogus because we get the current xinerama
|
||||
* for the window based on its position, but we haven't
|
||||
* placed it yet.
|
||||
*/
|
||||
meta_window_get_work_area (window, TRUE, &work_area);
|
||||
meta_window_get_work_area_current_xinerama (window, &work_area);
|
||||
|
||||
nw_x = work_area.x;
|
||||
nw_y = work_area.y;
|
||||
|
||||
if (window->frame)
|
||||
{
|
||||
nw_x += fgeom->left_width;
|
||||
@@ -849,6 +881,7 @@ meta_window_place (MetaWindow *window,
|
||||
constrain_placement (window, fgeom, x, y, &x, &y);
|
||||
|
||||
done_no_constraints:
|
||||
|
||||
*new_x = x;
|
||||
*new_y = y;
|
||||
}
|
||||
@@ -946,13 +979,11 @@ get_vertical_edges (MetaWindow *window,
|
||||
edges = g_new (int, n_edges);
|
||||
|
||||
/* workspace/screen edges */
|
||||
meta_window_get_work_area (window, FALSE, &work_area);
|
||||
meta_window_get_work_area_current_xinerama (window, &work_area);
|
||||
|
||||
edges[i] = work_area.x;
|
||||
++i;
|
||||
edges[i] =
|
||||
work_area.x +
|
||||
work_area.width;
|
||||
edges[i] = work_area.x + work_area.width;
|
||||
++i;
|
||||
edges[i] = 0;
|
||||
++i;
|
||||
@@ -1019,13 +1050,11 @@ get_horizontal_edges (MetaWindow *window,
|
||||
edges = g_new (int, n_edges);
|
||||
|
||||
/* workspace/screen edges */
|
||||
meta_window_get_work_area (window, FALSE, &work_area);
|
||||
meta_window_get_work_area_current_xinerama (window, &work_area);
|
||||
|
||||
edges[i] = work_area.y;
|
||||
++i;
|
||||
edges[i] =
|
||||
work_area.y +
|
||||
work_area.height;
|
||||
edges[i] = work_area.y + work_area.height;
|
||||
++i;
|
||||
edges[i] = 0;
|
||||
++i;
|
||||
|
||||
1004
src/prefs.c
1004
src/prefs.c
File diff suppressed because it is too large
Load Diff
193
src/prefs.h
193
src/prefs.h
@@ -28,7 +28,9 @@
|
||||
|
||||
typedef enum
|
||||
{
|
||||
META_PREF_MOUSE_BUTTON_MODS,
|
||||
META_PREF_FOCUS_MODE,
|
||||
META_PREF_ACTION_DOUBLE_CLICK_TITLEBAR,
|
||||
META_PREF_AUTO_RAISE,
|
||||
META_PREF_AUTO_RAISE_DELAY,
|
||||
META_PREF_THEME,
|
||||
@@ -38,7 +40,12 @@ typedef enum
|
||||
META_PREF_WINDOW_KEYBINDINGS,
|
||||
META_PREF_SCREEN_KEYBINDINGS,
|
||||
META_PREF_DISABLE_WORKAROUNDS,
|
||||
META_PREF_COMMANDS
|
||||
META_PREF_COMMANDS,
|
||||
META_PREF_BUTTON_LAYOUT,
|
||||
META_PREF_WORKSPACE_NAMES,
|
||||
META_PREF_VISUAL_BELL,
|
||||
META_PREF_AUDIBLE_BELL,
|
||||
META_PREF_VISUAL_BELL_TYPE
|
||||
} MetaPreference;
|
||||
|
||||
typedef void (* MetaPrefsChangedFunc) (MetaPreference pref,
|
||||
@@ -52,6 +59,7 @@ void meta_prefs_remove_listener (MetaPrefsChangedFunc func,
|
||||
void meta_prefs_init (void);
|
||||
const char* meta_preference_to_string (MetaPreference pref);
|
||||
|
||||
MetaVirtualModifier meta_prefs_get_mouse_button_mods (void);
|
||||
MetaFocusMode meta_prefs_get_focus_mode (void);
|
||||
const char* meta_prefs_get_theme (void);
|
||||
/* returns NULL if GTK default should be used */
|
||||
@@ -66,74 +74,111 @@ const char* meta_prefs_get_command (int i);
|
||||
|
||||
char* meta_prefs_get_gconf_key_for_command (int i);
|
||||
|
||||
void meta_prefs_get_button_layout (MetaButtonLayout *button_layout);
|
||||
MetaActionDoubleClickTitlebar meta_prefs_get_action_double_click_titlebar (void);
|
||||
|
||||
void meta_prefs_set_num_workspaces (int n_workspaces);
|
||||
|
||||
const char* meta_prefs_get_workspace_name (int i);
|
||||
void meta_prefs_change_workspace_name (int i,
|
||||
const char *name);
|
||||
|
||||
/* Screen bindings */
|
||||
#define META_KEYBINDING_WORKSPACE_1 "switch_to_workspace_1"
|
||||
#define META_KEYBINDING_WORKSPACE_2 "switch_to_workspace_2"
|
||||
#define META_KEYBINDING_WORKSPACE_3 "switch_to_workspace_3"
|
||||
#define META_KEYBINDING_WORKSPACE_4 "switch_to_workspace_4"
|
||||
#define META_KEYBINDING_WORKSPACE_5 "switch_to_workspace_5"
|
||||
#define META_KEYBINDING_WORKSPACE_6 "switch_to_workspace_6"
|
||||
#define META_KEYBINDING_WORKSPACE_7 "switch_to_workspace_7"
|
||||
#define META_KEYBINDING_WORKSPACE_8 "switch_to_workspace_8"
|
||||
#define META_KEYBINDING_WORKSPACE_9 "switch_to_workspace_9"
|
||||
#define META_KEYBINDING_WORKSPACE_10 "switch_to_workspace_10"
|
||||
#define META_KEYBINDING_WORKSPACE_11 "switch_to_workspace_11"
|
||||
#define META_KEYBINDING_WORKSPACE_12 "switch_to_workspace_12"
|
||||
#define META_KEYBINDING_WORKSPACE_LEFT "switch_to_workspace_left"
|
||||
#define META_KEYBINDING_WORKSPACE_RIGHT "switch_to_workspace_right"
|
||||
#define META_KEYBINDING_WORKSPACE_UP "switch_to_workspace_up"
|
||||
#define META_KEYBINDING_WORKSPACE_DOWN "switch_to_workspace_down"
|
||||
#define META_KEYBINDING_SWITCH_WINDOWS "switch_windows"
|
||||
#define META_KEYBINDING_SWITCH_PANELS "switch_panels"
|
||||
#define META_KEYBINDING_CYCLE_WINDOWS "cycle_windows"
|
||||
#define META_KEYBINDING_CYCLE_PANELS "cycle_panels"
|
||||
#define META_KEYBINDING_SHOW_DESKTOP "show_desktop"
|
||||
#define META_KEYBINDING_COMMAND_1 "run_command_1"
|
||||
#define META_KEYBINDING_COMMAND_2 "run_command_2"
|
||||
#define META_KEYBINDING_COMMAND_3 "run_command_3"
|
||||
#define META_KEYBINDING_COMMAND_4 "run_command_4"
|
||||
#define META_KEYBINDING_COMMAND_5 "run_command_5"
|
||||
#define META_KEYBINDING_COMMAND_6 "run_command_6"
|
||||
#define META_KEYBINDING_COMMAND_7 "run_command_7"
|
||||
#define META_KEYBINDING_COMMAND_8 "run_command_8"
|
||||
#define META_KEYBINDING_COMMAND_9 "run_command_9"
|
||||
#define META_KEYBINDING_COMMAND_10 "run_command_10"
|
||||
#define META_KEYBINDING_COMMAND_11 "run_command_11"
|
||||
#define META_KEYBINDING_COMMAND_12 "run_command_12"
|
||||
#define META_KEYBINDING_WORKSPACE_1 "switch_to_workspace_1"
|
||||
#define META_KEYBINDING_WORKSPACE_2 "switch_to_workspace_2"
|
||||
#define META_KEYBINDING_WORKSPACE_3 "switch_to_workspace_3"
|
||||
#define META_KEYBINDING_WORKSPACE_4 "switch_to_workspace_4"
|
||||
#define META_KEYBINDING_WORKSPACE_5 "switch_to_workspace_5"
|
||||
#define META_KEYBINDING_WORKSPACE_6 "switch_to_workspace_6"
|
||||
#define META_KEYBINDING_WORKSPACE_7 "switch_to_workspace_7"
|
||||
#define META_KEYBINDING_WORKSPACE_8 "switch_to_workspace_8"
|
||||
#define META_KEYBINDING_WORKSPACE_9 "switch_to_workspace_9"
|
||||
#define META_KEYBINDING_WORKSPACE_10 "switch_to_workspace_10"
|
||||
#define META_KEYBINDING_WORKSPACE_11 "switch_to_workspace_11"
|
||||
#define META_KEYBINDING_WORKSPACE_12 "switch_to_workspace_12"
|
||||
#define META_KEYBINDING_WORKSPACE_LEFT "switch_to_workspace_left"
|
||||
#define META_KEYBINDING_WORKSPACE_RIGHT "switch_to_workspace_right"
|
||||
#define META_KEYBINDING_WORKSPACE_UP "switch_to_workspace_up"
|
||||
#define META_KEYBINDING_WORKSPACE_DOWN "switch_to_workspace_down"
|
||||
#define META_KEYBINDING_SWITCH_WINDOWS "switch_windows"
|
||||
#define META_KEYBINDING_SWITCH_WINDOWS_BACKWARD "switch_windows_backward"
|
||||
#define META_KEYBINDING_SWITCH_PANELS "switch_panels"
|
||||
#define META_KEYBINDING_SWITCH_PANELS_BACKWARD "switch_panels_backward"
|
||||
#define META_KEYBINDING_CYCLE_WINDOWS "cycle_windows"
|
||||
#define META_KEYBINDING_CYCLE_WINDOWS_BACKWARD "cycle_windows_backward"
|
||||
#define META_KEYBINDING_CYCLE_PANELS "cycle_panels"
|
||||
#define META_KEYBINDING_CYCLE_PANELS_BACKWARD "cycle_panels_backward"
|
||||
#define META_KEYBINDING_SHOW_DESKTOP "show_desktop"
|
||||
#define META_KEYBINDING_PANEL_MAIN_MENU "panel_main_menu"
|
||||
#define META_KEYBINDING_PANEL_RUN_DIALOG "panel_run_dialog"
|
||||
#define META_KEYBINDING_COMMAND_1 "run_command_1"
|
||||
#define META_KEYBINDING_COMMAND_2 "run_command_2"
|
||||
#define META_KEYBINDING_COMMAND_3 "run_command_3"
|
||||
#define META_KEYBINDING_COMMAND_4 "run_command_4"
|
||||
#define META_KEYBINDING_COMMAND_5 "run_command_5"
|
||||
#define META_KEYBINDING_COMMAND_6 "run_command_6"
|
||||
#define META_KEYBINDING_COMMAND_7 "run_command_7"
|
||||
#define META_KEYBINDING_COMMAND_8 "run_command_8"
|
||||
#define META_KEYBINDING_COMMAND_9 "run_command_9"
|
||||
#define META_KEYBINDING_COMMAND_10 "run_command_10"
|
||||
#define META_KEYBINDING_COMMAND_11 "run_command_11"
|
||||
#define META_KEYBINDING_COMMAND_12 "run_command_12"
|
||||
#define META_KEYBINDING_COMMAND_13 "run_command_13"
|
||||
#define META_KEYBINDING_COMMAND_14 "run_command_14"
|
||||
#define META_KEYBINDING_COMMAND_15 "run_command_15"
|
||||
#define META_KEYBINDING_COMMAND_16 "run_command_16"
|
||||
#define META_KEYBINDING_COMMAND_17 "run_command_17"
|
||||
#define META_KEYBINDING_COMMAND_18 "run_command_18"
|
||||
#define META_KEYBINDING_COMMAND_19 "run_command_19"
|
||||
#define META_KEYBINDING_COMMAND_20 "run_command_20"
|
||||
#define META_KEYBINDING_COMMAND_21 "run_command_21"
|
||||
#define META_KEYBINDING_COMMAND_22 "run_command_22"
|
||||
#define META_KEYBINDING_COMMAND_23 "run_command_23"
|
||||
#define META_KEYBINDING_COMMAND_24 "run_command_24"
|
||||
#define META_KEYBINDING_COMMAND_25 "run_command_25"
|
||||
#define META_KEYBINDING_COMMAND_26 "run_command_26"
|
||||
#define META_KEYBINDING_COMMAND_27 "run_command_27"
|
||||
#define META_KEYBINDING_COMMAND_28 "run_command_28"
|
||||
#define META_KEYBINDING_COMMAND_29 "run_command_29"
|
||||
#define META_KEYBINDING_COMMAND_30 "run_command_30"
|
||||
#define META_KEYBINDING_COMMAND_31 "run_command_31"
|
||||
#define META_KEYBINDING_COMMAND_32 "run_command_32"
|
||||
#define META_KEYBINDING_COMMAND_SCREENSHOT "run_command_screenshot"
|
||||
#define META_KEYBINDING_COMMAND_WIN_SCREENSHOT "run_command_window_screenshot"
|
||||
|
||||
/* Window bindings */
|
||||
#define META_KEYBINDING_WINDOW_MENU "activate_window_menu"
|
||||
#define META_KEYBINDING_TOGGLE_FULLSCREEN "toggle_fullscreen"
|
||||
#define META_KEYBINDING_TOGGLE_MAXIMIZE "toggle_maximized"
|
||||
#define META_KEYBINDING_MAXIMIZE "maximize"
|
||||
#define META_KEYBINDING_UNMAXIMIZE "unmaximize"
|
||||
#define META_KEYBINDING_TOGGLE_SHADE "toggle_shaded"
|
||||
#define META_KEYBINDING_MINIMIZE "minimize"
|
||||
#define META_KEYBINDING_CLOSE "close"
|
||||
#define META_KEYBINDING_BEGIN_MOVE "begin_move"
|
||||
#define META_KEYBINDING_BEGIN_RESIZE "begin_resize"
|
||||
#define META_KEYBINDING_TOGGLE_STICKY "toggle_on_all_workspaces"
|
||||
#define META_KEYBINDING_MOVE_WORKSPACE_1 "move_to_workspace_1"
|
||||
#define META_KEYBINDING_MOVE_WORKSPACE_2 "move_to_workspace_2"
|
||||
#define META_KEYBINDING_MOVE_WORKSPACE_3 "move_to_workspace_3"
|
||||
#define META_KEYBINDING_MOVE_WORKSPACE_4 "move_to_workspace_4"
|
||||
#define META_KEYBINDING_MOVE_WORKSPACE_5 "move_to_workspace_5"
|
||||
#define META_KEYBINDING_MOVE_WORKSPACE_6 "move_to_workspace_6"
|
||||
#define META_KEYBINDING_MOVE_WORKSPACE_7 "move_to_workspace_7"
|
||||
#define META_KEYBINDING_MOVE_WORKSPACE_8 "move_to_workspace_8"
|
||||
#define META_KEYBINDING_MOVE_WORKSPACE_9 "move_to_workspace_9"
|
||||
#define META_KEYBINDING_MOVE_WORKSPACE_10 "move_to_workspace_10"
|
||||
#define META_KEYBINDING_MOVE_WORKSPACE_11 "move_to_workspace_11"
|
||||
#define META_KEYBINDING_MOVE_WORKSPACE_12 "move_to_workspace_12"
|
||||
#define META_KEYBINDING_MOVE_WORKSPACE_LEFT "move_to_workspace_left"
|
||||
#define META_KEYBINDING_MOVE_WORKSPACE_RIGHT "move_to_workspace_right"
|
||||
#define META_KEYBINDING_MOVE_WORKSPACE_UP "move_to_workspace_up"
|
||||
#define META_KEYBINDING_MOVE_WORKSPACE_DOWN "move_to_workspace_down"
|
||||
#define META_KEYBINDING_RAISE_OR_LOWER "raise_or_lower"
|
||||
#define META_KEYBINDING_RAISE "raise"
|
||||
#define META_KEYBINDING_LOWER "lower"
|
||||
#define META_KEYBINDING_WINDOW_MENU "activate_window_menu"
|
||||
#define META_KEYBINDING_TOGGLE_FULLSCREEN "toggle_fullscreen"
|
||||
#define META_KEYBINDING_TOGGLE_MAXIMIZE "toggle_maximized"
|
||||
#define META_KEYBINDING_MAXIMIZE "maximize"
|
||||
#define META_KEYBINDING_UNMAXIMIZE "unmaximize"
|
||||
#define META_KEYBINDING_TOGGLE_SHADE "toggle_shaded"
|
||||
#define META_KEYBINDING_MINIMIZE "minimize"
|
||||
#define META_KEYBINDING_CLOSE "close"
|
||||
#define META_KEYBINDING_BEGIN_MOVE "begin_move"
|
||||
#define META_KEYBINDING_BEGIN_RESIZE "begin_resize"
|
||||
#define META_KEYBINDING_TOGGLE_STICKY "toggle_on_all_workspaces"
|
||||
#define META_KEYBINDING_MOVE_WORKSPACE_1 "move_to_workspace_1"
|
||||
#define META_KEYBINDING_MOVE_WORKSPACE_2 "move_to_workspace_2"
|
||||
#define META_KEYBINDING_MOVE_WORKSPACE_3 "move_to_workspace_3"
|
||||
#define META_KEYBINDING_MOVE_WORKSPACE_4 "move_to_workspace_4"
|
||||
#define META_KEYBINDING_MOVE_WORKSPACE_5 "move_to_workspace_5"
|
||||
#define META_KEYBINDING_MOVE_WORKSPACE_6 "move_to_workspace_6"
|
||||
#define META_KEYBINDING_MOVE_WORKSPACE_7 "move_to_workspace_7"
|
||||
#define META_KEYBINDING_MOVE_WORKSPACE_8 "move_to_workspace_8"
|
||||
#define META_KEYBINDING_MOVE_WORKSPACE_9 "move_to_workspace_9"
|
||||
#define META_KEYBINDING_MOVE_WORKSPACE_10 "move_to_workspace_10"
|
||||
#define META_KEYBINDING_MOVE_WORKSPACE_11 "move_to_workspace_11"
|
||||
#define META_KEYBINDING_MOVE_WORKSPACE_12 "move_to_workspace_12"
|
||||
#define META_KEYBINDING_MOVE_WORKSPACE_LEFT "move_to_workspace_left"
|
||||
#define META_KEYBINDING_MOVE_WORKSPACE_RIGHT "move_to_workspace_right"
|
||||
#define META_KEYBINDING_MOVE_WORKSPACE_UP "move_to_workspace_up"
|
||||
#define META_KEYBINDING_MOVE_WORKSPACE_DOWN "move_to_workspace_down"
|
||||
#define META_KEYBINDING_RAISE_OR_LOWER "raise_or_lower"
|
||||
#define META_KEYBINDING_RAISE "raise"
|
||||
#define META_KEYBINDING_LOWER "lower"
|
||||
#define META_KEYBINDING_MAXIMIZE_VERTICALLY "maximize_vertically"
|
||||
#define META_KEYBINDING_MAXIMIZE_HORIZONTALLY "maximize_horizontally"
|
||||
|
||||
typedef enum _MetaKeyBindingAction
|
||||
{
|
||||
@@ -155,10 +200,16 @@ typedef enum _MetaKeyBindingAction
|
||||
META_KEYBINDING_ACTION_WORKSPACE_UP,
|
||||
META_KEYBINDING_ACTION_WORKSPACE_DOWN,
|
||||
META_KEYBINDING_ACTION_SWITCH_WINDOWS,
|
||||
META_KEYBINDING_ACTION_SWITCH_WINDOWS_BACKWARD,
|
||||
META_KEYBINDING_ACTION_SWITCH_PANELS,
|
||||
META_KEYBINDING_ACTION_SWITCH_PANELS_BACKWARD,
|
||||
META_KEYBINDING_ACTION_CYCLE_WINDOWS,
|
||||
META_KEYBINDING_ACTION_CYCLE_WINDOWS_BACKWARD,
|
||||
META_KEYBINDING_ACTION_CYCLE_PANELS,
|
||||
META_KEYBINDING_ACTION_CYCLE_PANELS_BACKWARD,
|
||||
META_KEYBINDING_ACTION_SHOW_DESKTOP,
|
||||
META_KEYBINDING_ACTION_PANEL_MAIN_MENU,
|
||||
META_KEYBINDING_ACTION_PANEL_RUN_DIALOG,
|
||||
META_KEYBINDING_ACTION_COMMAND_1,
|
||||
META_KEYBINDING_ACTION_COMMAND_2,
|
||||
META_KEYBINDING_ACTION_COMMAND_3,
|
||||
@@ -178,6 +229,8 @@ typedef struct
|
||||
const char *name;
|
||||
unsigned int keysym;
|
||||
MetaVirtualModifier modifiers;
|
||||
/* for keybindings that can have shift or not like Alt+Tab */
|
||||
gboolean add_shift;
|
||||
} MetaKeyPref;
|
||||
|
||||
void meta_prefs_get_screen_bindings (const MetaKeyPref **bindings,
|
||||
@@ -191,6 +244,18 @@ void meta_prefs_get_window_binding (const char *name,
|
||||
unsigned int *keysym,
|
||||
MetaVirtualModifier *modifiers);
|
||||
|
||||
typedef enum
|
||||
{
|
||||
META_VISUAL_BELL_INVALID = 0,
|
||||
META_VISUAL_BELL_FULLSCREEN_FLASH,
|
||||
META_VISUAL_BELL_FRAME_FLASH
|
||||
|
||||
} MetaVisualBellType;
|
||||
|
||||
gboolean meta_prefs_get_visual_bell (void);
|
||||
gboolean meta_prefs_bell_is_audible (void);
|
||||
MetaVisualBellType meta_prefs_get_visual_bell_type (void);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -79,8 +79,24 @@ meta_preview_class_init (MetaPreviewClass *class)
|
||||
static void
|
||||
meta_preview_init (MetaPreview *preview)
|
||||
{
|
||||
int i;
|
||||
|
||||
GTK_WIDGET_SET_FLAGS (preview, GTK_NO_WINDOW);
|
||||
|
||||
i = 0;
|
||||
while (i < MAX_BUTTONS_PER_CORNER)
|
||||
{
|
||||
preview->button_layout.left_buttons[i] = META_BUTTON_FUNCTION_LAST;
|
||||
preview->button_layout.right_buttons[i] = META_BUTTON_FUNCTION_LAST;
|
||||
++i;
|
||||
}
|
||||
|
||||
preview->button_layout.left_buttons[0] = META_BUTTON_FUNCTION_MENU;
|
||||
|
||||
preview->button_layout.right_buttons[0] = META_BUTTON_FUNCTION_MINIMIZE;
|
||||
preview->button_layout.right_buttons[1] = META_BUTTON_FUNCTION_MAXIMIZE;
|
||||
preview->button_layout.right_buttons[2] = META_BUTTON_FUNCTION_CLOSE;
|
||||
|
||||
preview->type = META_FRAME_TYPE_NORMAL;
|
||||
preview->flags =
|
||||
META_FRAME_ALLOWS_DELETE |
|
||||
@@ -218,7 +234,7 @@ meta_preview_expose (GtkWidget *widget,
|
||||
if (client_width < 0)
|
||||
client_width = 1;
|
||||
if (client_height < 0)
|
||||
client_height = 1;
|
||||
client_height = 1;
|
||||
|
||||
if (preview->theme)
|
||||
{
|
||||
@@ -235,6 +251,7 @@ meta_preview_expose (GtkWidget *widget,
|
||||
client_width, client_height,
|
||||
preview->layout,
|
||||
preview->text_height,
|
||||
&preview->button_layout,
|
||||
button_states,
|
||||
meta_preview_get_mini_icon (),
|
||||
meta_preview_get_icon ());
|
||||
@@ -267,6 +284,13 @@ meta_preview_size_request (GtkWidget *widget,
|
||||
req->width += child_requisition.width;
|
||||
req->height += child_requisition.height;
|
||||
}
|
||||
else
|
||||
{
|
||||
#define NO_CHILD_WIDTH 80
|
||||
#define NO_CHILD_HEIGHT 20
|
||||
req->width += NO_CHILD_WIDTH;
|
||||
req->height += NO_CHILD_HEIGHT;
|
||||
}
|
||||
|
||||
req->width += GTK_CONTAINER (widget)->border_width * 2;
|
||||
req->height += GTK_CONTAINER (widget)->border_width * 2;
|
||||
@@ -369,6 +393,17 @@ meta_preview_set_frame_flags (MetaPreview *preview,
|
||||
gtk_widget_queue_resize (GTK_WIDGET (preview));
|
||||
}
|
||||
|
||||
void
|
||||
meta_preview_set_button_layout (MetaPreview *preview,
|
||||
const MetaButtonLayout *button_layout)
|
||||
{
|
||||
g_return_if_fail (META_IS_PREVIEW (preview));
|
||||
|
||||
preview->button_layout = *button_layout;
|
||||
|
||||
gtk_widget_queue_draw (GTK_WIDGET (preview));
|
||||
}
|
||||
|
||||
#include "inlinepixbufs.h"
|
||||
|
||||
GdkPixbuf*
|
||||
|
||||
@@ -52,6 +52,7 @@ struct _MetaPreview
|
||||
int top_height;
|
||||
int bottom_height;
|
||||
|
||||
MetaButtonLayout button_layout;
|
||||
};
|
||||
|
||||
struct _MetaPreviewClass
|
||||
@@ -63,14 +64,17 @@ struct _MetaPreviewClass
|
||||
GtkType meta_preview_get_type (void) G_GNUC_CONST;
|
||||
GtkWidget* meta_preview_new (void);
|
||||
|
||||
void meta_preview_set_theme (MetaPreview *preview,
|
||||
MetaTheme *theme);
|
||||
void meta_preview_set_title (MetaPreview *preview,
|
||||
const char *title);
|
||||
void meta_preview_set_frame_type (MetaPreview *preview,
|
||||
MetaFrameType type);
|
||||
void meta_preview_set_frame_flags (MetaPreview *preview,
|
||||
MetaFrameFlags flags);
|
||||
void meta_preview_set_theme (MetaPreview *preview,
|
||||
MetaTheme *theme);
|
||||
void meta_preview_set_title (MetaPreview *preview,
|
||||
const char *title);
|
||||
void meta_preview_set_frame_type (MetaPreview *preview,
|
||||
MetaFrameType type);
|
||||
void meta_preview_set_frame_flags (MetaPreview *preview,
|
||||
MetaFrameFlags flags);
|
||||
void meta_preview_set_button_layout (MetaPreview *preview,
|
||||
const MetaButtonLayout *button_layout);
|
||||
|
||||
|
||||
GdkPixbuf* meta_preview_get_icon (void);
|
||||
GdkPixbuf* meta_preview_get_mini_icon (void);
|
||||
|
||||
@@ -26,23 +26,17 @@
|
||||
#include <gtk/gtklabel.h>
|
||||
#include <gtk/gtkframe.h>
|
||||
#include <gtk/gtkmain.h>
|
||||
#include <gdk/gdkx.h>
|
||||
|
||||
struct _MetaResizePopup
|
||||
{
|
||||
GtkWidget *size_window;
|
||||
GtkWidget *size_label;
|
||||
|
||||
GSList *vertical_tick_windows;
|
||||
GSList *horizontal_tick_windows;
|
||||
|
||||
GtkWidget *vertical_size_window;
|
||||
GtkWidget *horizontal_size_window;
|
||||
Display *display;
|
||||
int screen_number;
|
||||
|
||||
int vertical_size;
|
||||
int horizontal_size;
|
||||
|
||||
gboolean need_vertical_feedback;
|
||||
gboolean need_horizontal_feedback;
|
||||
|
||||
gboolean showing;
|
||||
|
||||
@@ -64,51 +58,20 @@ struct _MetaResizePopup
|
||||
};
|
||||
|
||||
MetaResizePopup*
|
||||
meta_ui_resize_popup_new (void)
|
||||
meta_ui_resize_popup_new (Display *display,
|
||||
int screen_number)
|
||||
{
|
||||
MetaResizePopup *popup;
|
||||
|
||||
popup = g_new0 (MetaResizePopup, 1);
|
||||
|
||||
popup->resize_gravity = -1;
|
||||
popup->display = display;
|
||||
popup->screen_number = screen_number;
|
||||
|
||||
return popup;
|
||||
}
|
||||
|
||||
static void
|
||||
clear_tick_labels (MetaResizePopup *popup)
|
||||
{
|
||||
if (popup->vertical_size_window)
|
||||
{
|
||||
gtk_widget_destroy (popup->vertical_size_window);
|
||||
popup->vertical_size_window = NULL;
|
||||
}
|
||||
|
||||
if (popup->horizontal_size_window)
|
||||
{
|
||||
gtk_widget_destroy (popup->horizontal_size_window);
|
||||
popup->horizontal_size_window = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
clear_tick_windows (MetaResizePopup *popup)
|
||||
{
|
||||
g_slist_foreach (popup->vertical_tick_windows,
|
||||
(GFunc) gtk_widget_destroy,
|
||||
NULL);
|
||||
|
||||
g_slist_free (popup->vertical_tick_windows);
|
||||
popup->vertical_tick_windows = NULL;
|
||||
|
||||
g_slist_foreach (popup->horizontal_tick_windows,
|
||||
(GFunc) gtk_widget_destroy,
|
||||
NULL);
|
||||
|
||||
g_slist_free (popup->horizontal_tick_windows);
|
||||
popup->horizontal_tick_windows = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
meta_ui_resize_popup_free (MetaResizePopup *popup)
|
||||
{
|
||||
@@ -116,9 +79,6 @@ meta_ui_resize_popup_free (MetaResizePopup *popup)
|
||||
|
||||
if (popup->size_window)
|
||||
gtk_widget_destroy (popup->size_window);
|
||||
|
||||
clear_tick_windows (popup);
|
||||
clear_tick_labels (popup);
|
||||
|
||||
g_free (popup);
|
||||
}
|
||||
@@ -130,12 +90,14 @@ ensure_size_window (MetaResizePopup *popup)
|
||||
|
||||
if (popup->size_window)
|
||||
return;
|
||||
|
||||
if (!(popup->need_vertical_feedback || popup->need_horizontal_feedback))
|
||||
return;
|
||||
|
||||
popup->size_window = gtk_window_new (GTK_WINDOW_POPUP);
|
||||
|
||||
#ifdef HAVE_GTK_MULTIHEAD
|
||||
gtk_window_set_screen (GTK_WINDOW (popup->size_window),
|
||||
gdk_display_get_screen (gdk_x11_lookup_xdisplay (popup->display),
|
||||
popup->screen_number));
|
||||
#endif
|
||||
|
||||
/* never shrink the size window */
|
||||
gtk_window_set_resizable (GTK_WINDOW (popup->size_window),
|
||||
TRUE);
|
||||
@@ -159,9 +121,6 @@ update_size_window (MetaResizePopup *popup)
|
||||
char *str;
|
||||
int x, y;
|
||||
int width, height;
|
||||
|
||||
if (!(popup->need_vertical_feedback || popup->need_horizontal_feedback))
|
||||
return;
|
||||
|
||||
g_return_if_fail (popup->size_window != NULL);
|
||||
|
||||
@@ -199,19 +158,6 @@ sync_showing (MetaResizePopup *popup)
|
||||
{
|
||||
if (popup->size_window)
|
||||
gtk_widget_show (popup->size_window);
|
||||
|
||||
if (popup->vertical_size_window)
|
||||
gtk_widget_show (popup->vertical_size_window);
|
||||
|
||||
if (popup->horizontal_size_window)
|
||||
gtk_widget_show (popup->horizontal_size_window);
|
||||
|
||||
g_slist_foreach (popup->horizontal_tick_windows,
|
||||
(GFunc) gtk_widget_show,
|
||||
NULL);
|
||||
g_slist_foreach (popup->vertical_tick_windows,
|
||||
(GFunc) gtk_widget_show,
|
||||
NULL);
|
||||
|
||||
if (popup->size_window && GTK_WIDGET_REALIZED (popup->size_window))
|
||||
gdk_window_raise (popup->size_window->window);
|
||||
@@ -220,594 +166,6 @@ sync_showing (MetaResizePopup *popup)
|
||||
{
|
||||
if (popup->size_window)
|
||||
gtk_widget_hide (popup->size_window);
|
||||
|
||||
if (popup->vertical_size_window)
|
||||
gtk_widget_hide (popup->vertical_size_window);
|
||||
|
||||
if (popup->horizontal_size_window)
|
||||
gtk_widget_hide (popup->horizontal_size_window);
|
||||
|
||||
g_slist_foreach (popup->horizontal_tick_windows,
|
||||
(GFunc) gtk_widget_hide,
|
||||
NULL);
|
||||
g_slist_foreach (popup->vertical_tick_windows,
|
||||
(GFunc) gtk_widget_hide,
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static GtkWidget*
|
||||
create_size_window (const char *str)
|
||||
{
|
||||
PangoContext *context;
|
||||
PangoLayout *layout;
|
||||
GdkGC *gc;
|
||||
GdkBitmap *bitmap;
|
||||
PangoRectangle rect;
|
||||
GdkColor color;
|
||||
GtkWidget *window;
|
||||
int w, h;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_POPUP);
|
||||
gtk_widget_set_app_paintable (window, TRUE);
|
||||
gtk_window_set_resizable (GTK_WINDOW (window),
|
||||
FALSE);
|
||||
|
||||
context = gdk_pango_context_get ();
|
||||
|
||||
#if 0
|
||||
/* bitmaps have no meaningful cmap */
|
||||
gdk_pango_context_set_colormap (context,
|
||||
gtk_widget_get_colormap (widget));
|
||||
#endif
|
||||
pango_context_set_base_dir (context,
|
||||
gtk_widget_get_direction (window) == GTK_TEXT_DIR_LTR ?
|
||||
PANGO_DIRECTION_LTR : PANGO_DIRECTION_RTL);
|
||||
pango_context_set_font_description (context,
|
||||
window->style->font_desc);
|
||||
pango_context_set_language (context, gtk_get_default_language ());
|
||||
|
||||
layout = pango_layout_new (context);
|
||||
pango_layout_set_text (layout, str, -1);
|
||||
|
||||
g_object_unref (G_OBJECT (context));
|
||||
|
||||
pango_layout_get_pixel_extents (layout, NULL, &rect);
|
||||
|
||||
w = rect.width;
|
||||
h = rect.height;
|
||||
gtk_widget_set_size_request (window, w, h);
|
||||
|
||||
bitmap = gdk_pixmap_new (NULL, w, h, 1);
|
||||
gc = gdk_gc_new (bitmap);
|
||||
color.pixel = 0;
|
||||
gdk_gc_set_foreground (gc, &color);
|
||||
gdk_draw_rectangle (bitmap, gc, TRUE, 0, 0, w, h);
|
||||
color.pixel = 1;
|
||||
gdk_gc_set_foreground (gc, &color);
|
||||
gdk_draw_layout (bitmap, gc, 0, 0, layout);
|
||||
|
||||
gtk_widget_shape_combine_mask (window,
|
||||
bitmap, 0, 0);
|
||||
|
||||
g_object_unref (G_OBJECT (bitmap));
|
||||
g_object_unref (G_OBJECT (gc));
|
||||
g_object_unref (G_OBJECT (layout));
|
||||
|
||||
/* After setting the size */
|
||||
gtk_widget_realize (window);
|
||||
gdk_window_set_background (window->window,
|
||||
&window->style->black);
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
static void
|
||||
place_vertical_size_window (MetaResizePopup *popup,
|
||||
int x,
|
||||
int y,
|
||||
double align)
|
||||
{
|
||||
int w, h;
|
||||
|
||||
return;
|
||||
|
||||
if (popup->vertical_size_window == NULL)
|
||||
{
|
||||
char *str;
|
||||
|
||||
str = g_strdup_printf ("%d", popup->vertical_size);
|
||||
|
||||
popup->vertical_size_window = create_size_window (str);
|
||||
|
||||
g_free (str);
|
||||
}
|
||||
|
||||
gtk_window_get_size (GTK_WINDOW (popup->vertical_size_window),
|
||||
&w, &h);
|
||||
|
||||
gtk_window_move (GTK_WINDOW (popup->vertical_size_window),
|
||||
x - w * align,
|
||||
y - h / 2);
|
||||
}
|
||||
|
||||
static void
|
||||
place_horizontal_size_window (MetaResizePopup *popup,
|
||||
int x,
|
||||
int y,
|
||||
double align)
|
||||
{
|
||||
int w, h;
|
||||
|
||||
return;
|
||||
|
||||
if (popup->horizontal_size_window == NULL)
|
||||
{
|
||||
char *str;
|
||||
|
||||
str = g_strdup_printf ("%d", popup->horizontal_size);
|
||||
|
||||
popup->horizontal_size_window = create_size_window (str);
|
||||
|
||||
g_free (str);
|
||||
}
|
||||
|
||||
gtk_window_get_size (GTK_WINDOW (popup->horizontal_size_window),
|
||||
&w, &h);
|
||||
|
||||
gtk_window_move (GTK_WINDOW (popup->horizontal_size_window),
|
||||
x - w / 2,
|
||||
y - h * align);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
tick_window_expose (GtkWidget *widget,
|
||||
GdkEventExpose *event,
|
||||
gpointer data)
|
||||
{
|
||||
int w, h;
|
||||
|
||||
gdk_window_get_size (widget->window, &w, &h);
|
||||
|
||||
#if 0
|
||||
gdk_draw_rectangle (widget->window,
|
||||
widget->style->white_gc,
|
||||
FALSE,
|
||||
0, 0,
|
||||
w - 1,
|
||||
h - 1);
|
||||
#endif
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static GtkWidget*
|
||||
create_tick (int w,
|
||||
int h)
|
||||
{
|
||||
GtkWidget *window;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_POPUP);
|
||||
gtk_widget_set_app_paintable (window, TRUE);
|
||||
|
||||
gtk_widget_set_size_request (window, w, h);
|
||||
|
||||
gtk_widget_realize (window);
|
||||
gdk_window_set_background (window->window,
|
||||
&window->style->black);
|
||||
|
||||
g_signal_connect (G_OBJECT (window), "expose_event",
|
||||
G_CALLBACK (tick_window_expose), NULL);
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
#define TICK_WIDTH 1
|
||||
#define TICK_LENGTH 7
|
||||
|
||||
static void
|
||||
add_vertical_tick (MetaResizePopup *popup,
|
||||
int x,
|
||||
int y)
|
||||
{
|
||||
GtkWidget *window;
|
||||
|
||||
/* Create a tick for the vertical resize column of
|
||||
* tick marks.
|
||||
*/
|
||||
|
||||
window = create_tick (TICK_LENGTH, TICK_WIDTH);
|
||||
|
||||
gtk_window_move (GTK_WINDOW (window),
|
||||
x, y);
|
||||
|
||||
popup->vertical_tick_windows =
|
||||
g_slist_prepend (popup->vertical_tick_windows,
|
||||
window);
|
||||
|
||||
/* create GdkWindow */
|
||||
gtk_widget_realize (window);
|
||||
|
||||
/* Be sure the size window is above it */
|
||||
if (popup->size_window && GTK_WIDGET_REALIZED (popup->size_window))
|
||||
gdk_window_raise (popup->size_window->window);
|
||||
}
|
||||
|
||||
static void
|
||||
add_horizontal_tick (MetaResizePopup *popup,
|
||||
int x,
|
||||
int y)
|
||||
{
|
||||
GtkWidget *window;
|
||||
|
||||
/* Create a tick for the vertical resize column of
|
||||
* tick marks.
|
||||
*/
|
||||
|
||||
window = create_tick (TICK_WIDTH, TICK_LENGTH);
|
||||
|
||||
gtk_window_move (GTK_WINDOW (window),
|
||||
x, y);
|
||||
|
||||
popup->horizontal_tick_windows =
|
||||
g_slist_prepend (popup->horizontal_tick_windows,
|
||||
window);
|
||||
|
||||
/* create GdkWindow */
|
||||
gtk_widget_realize (window);
|
||||
|
||||
/* Be sure the size window is above it */
|
||||
if (popup->size_window && GTK_WIDGET_REALIZED (popup->size_window))
|
||||
gdk_window_raise (popup->size_window->window);
|
||||
}
|
||||
|
||||
static void
|
||||
ensure_tick_windows (MetaResizePopup *popup)
|
||||
{
|
||||
int x, y;
|
||||
int max_x, max_y;
|
||||
|
||||
if (popup->resize_gravity < 0)
|
||||
return;
|
||||
|
||||
if (popup->horizontal_tick_windows != NULL ||
|
||||
popup->vertical_tick_windows != NULL)
|
||||
return;
|
||||
|
||||
/* FIXME the current implementation sucks too much to enable. */
|
||||
return;
|
||||
|
||||
max_x = gdk_screen_width ();
|
||||
max_y = gdk_screen_height ();
|
||||
|
||||
if (popup->need_vertical_feedback)
|
||||
{
|
||||
y = popup->tick_origin_y;
|
||||
|
||||
switch (popup->resize_gravity)
|
||||
{
|
||||
case NorthEastGravity:
|
||||
case EastGravity:
|
||||
case SouthEastGravity:
|
||||
/* Vertical tick column on the fixed East side */
|
||||
x = popup->x + popup->width + popup->frame_right;
|
||||
break;
|
||||
|
||||
case NorthWestGravity:
|
||||
case WestGravity:
|
||||
case SouthWestGravity:
|
||||
/* Vertical ticks on the fixed West side */
|
||||
x = popup->x - TICK_LENGTH - popup->frame_left;
|
||||
break;
|
||||
|
||||
case NorthGravity:
|
||||
case SouthGravity:
|
||||
case CenterGravity:
|
||||
/* Center the vertical ticks */
|
||||
x = popup->x + (popup->width - TICK_LENGTH) / 2;
|
||||
break;
|
||||
|
||||
default:
|
||||
/* gcc warnings */
|
||||
x = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (popup->resize_gravity)
|
||||
{
|
||||
case SouthGravity:
|
||||
case SouthEastGravity:
|
||||
case SouthWestGravity:
|
||||
while (y > 0)
|
||||
{
|
||||
add_vertical_tick (popup, x, y);
|
||||
y -= popup->height_inc;
|
||||
}
|
||||
break;
|
||||
|
||||
case NorthGravity:
|
||||
case NorthEastGravity:
|
||||
case NorthWestGravity:
|
||||
while (y < max_y)
|
||||
{
|
||||
add_vertical_tick (popup, x, y);
|
||||
y += popup->height_inc;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (popup->need_horizontal_feedback)
|
||||
{
|
||||
x = popup->tick_origin_x;
|
||||
|
||||
switch (popup->resize_gravity)
|
||||
{
|
||||
case SouthWestGravity:
|
||||
case SouthGravity:
|
||||
case SouthEastGravity:
|
||||
/* Horizontal tick column on the fixed South side */
|
||||
y = popup->y + popup->height + popup->frame_bottom;
|
||||
break;
|
||||
|
||||
case NorthWestGravity:
|
||||
case NorthGravity:
|
||||
case NorthEastGravity:
|
||||
/* Horizontal ticks on the fixed North side */
|
||||
y = popup->y - TICK_LENGTH - popup->frame_top;
|
||||
break;
|
||||
|
||||
case EastGravity:
|
||||
case WestGravity:
|
||||
case CenterGravity:
|
||||
/* Center the horizontal ticks */
|
||||
y = popup->y + (popup->height - TICK_LENGTH) / 2;
|
||||
break;
|
||||
|
||||
default:
|
||||
/* gcc warnings */
|
||||
y = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (popup->resize_gravity)
|
||||
{
|
||||
case EastGravity:
|
||||
case SouthEastGravity:
|
||||
case NorthEastGravity:
|
||||
while (x > 0)
|
||||
{
|
||||
add_horizontal_tick (popup, x, y);
|
||||
x -= popup->width_inc;
|
||||
}
|
||||
break;
|
||||
|
||||
case WestGravity:
|
||||
case SouthWestGravity:
|
||||
case NorthWestGravity:
|
||||
while (x < max_x)
|
||||
{
|
||||
add_horizontal_tick (popup, x, y);
|
||||
x += popup->width_inc;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
update_tick_labels (MetaResizePopup *popup)
|
||||
{
|
||||
int x, y;
|
||||
int left_edge, right_edge, top_edge, bottom_edge;
|
||||
|
||||
if (popup->resize_gravity < 0)
|
||||
return;
|
||||
|
||||
left_edge = popup->x - popup->frame_left;
|
||||
right_edge = popup->x + popup->width + popup->frame_right;
|
||||
top_edge = popup->y - popup->frame_top;
|
||||
bottom_edge = popup->y + popup->height + popup->frame_bottom;
|
||||
|
||||
if (popup->need_vertical_feedback)
|
||||
{
|
||||
int size_x, size_y;
|
||||
double size_align;
|
||||
|
||||
switch (popup->resize_gravity)
|
||||
{
|
||||
case NorthEastGravity:
|
||||
case EastGravity:
|
||||
case SouthEastGravity:
|
||||
x = popup->x + popup->width + popup->frame_right;
|
||||
size_x = x + TICK_LENGTH;
|
||||
size_align = 0.0;
|
||||
break;
|
||||
|
||||
case NorthWestGravity:
|
||||
case WestGravity:
|
||||
case SouthWestGravity:
|
||||
x = popup->x - TICK_LENGTH - popup->frame_left;
|
||||
size_x = x - TICK_LENGTH;
|
||||
size_align = 1.0;
|
||||
break;
|
||||
|
||||
case NorthGravity:
|
||||
case SouthGravity:
|
||||
case CenterGravity:
|
||||
x = popup->x + (popup->width - TICK_LENGTH) / 2;
|
||||
size_x = x - TICK_LENGTH / 2 - 1;
|
||||
size_align = 1.0;
|
||||
break;
|
||||
|
||||
default:
|
||||
/* gcc warnings */
|
||||
x = 0;
|
||||
size_x = 0;
|
||||
size_align = 0.5;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (popup->resize_gravity)
|
||||
{
|
||||
case SouthGravity:
|
||||
case SouthEastGravity:
|
||||
case SouthWestGravity:
|
||||
size_y = top_edge;
|
||||
break;
|
||||
|
||||
case NorthGravity:
|
||||
case NorthEastGravity:
|
||||
case NorthWestGravity:
|
||||
size_y = bottom_edge;
|
||||
break;
|
||||
|
||||
default:
|
||||
size_y = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
place_vertical_size_window (popup, size_x, size_y, size_align);
|
||||
}
|
||||
|
||||
if (popup->need_horizontal_feedback)
|
||||
{
|
||||
int size_x, size_y;
|
||||
double size_align;
|
||||
|
||||
switch (popup->resize_gravity)
|
||||
{
|
||||
case SouthWestGravity:
|
||||
case SouthGravity:
|
||||
case SouthEastGravity:
|
||||
y = popup->y + popup->height + popup->frame_bottom;
|
||||
size_y = y + TICK_LENGTH;
|
||||
size_align = 0.0;
|
||||
break;
|
||||
|
||||
case NorthWestGravity:
|
||||
case NorthGravity:
|
||||
case NorthEastGravity:
|
||||
y = popup->y - TICK_LENGTH - popup->frame_top;
|
||||
size_y = y - TICK_LENGTH;
|
||||
size_align = 1.0;
|
||||
break;
|
||||
|
||||
case EastGravity:
|
||||
case WestGravity:
|
||||
case CenterGravity:
|
||||
y = popup->y + (popup->height - TICK_LENGTH) / 2;
|
||||
size_y = y - TICK_LENGTH / 2 - 1;
|
||||
size_align = 1.0;
|
||||
break;
|
||||
|
||||
default:
|
||||
/* gcc warnings */
|
||||
y = 0;
|
||||
size_y = 0;
|
||||
size_align = 0.5;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (popup->resize_gravity)
|
||||
{
|
||||
case WestGravity:
|
||||
case NorthWestGravity:
|
||||
case SouthWestGravity:
|
||||
size_x = right_edge;
|
||||
break;
|
||||
|
||||
case EastGravity:
|
||||
case NorthEastGravity:
|
||||
case SouthEastGravity:
|
||||
size_x = left_edge;
|
||||
break;
|
||||
|
||||
default:
|
||||
size_x = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
place_horizontal_size_window (popup, size_x, size_y, size_align);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
get_tick_origin (int resize_gravity,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height,
|
||||
int min_width,
|
||||
int min_height,
|
||||
int frame_left,
|
||||
int frame_right,
|
||||
int frame_top,
|
||||
int frame_bottom,
|
||||
int *origin_x,
|
||||
int *origin_y)
|
||||
{
|
||||
*origin_x = 0;
|
||||
*origin_y = 0;
|
||||
|
||||
switch (resize_gravity)
|
||||
{
|
||||
/* If client is staying fixed on the east during resize, then we
|
||||
* have to move the west edge. Which means ticks originate
|
||||
* on the east.
|
||||
*/
|
||||
case NorthEastGravity:
|
||||
case EastGravity:
|
||||
case SouthEastGravity:
|
||||
*origin_x = x + width - min_width - frame_right + TICK_WIDTH / 2;
|
||||
break;
|
||||
|
||||
case NorthWestGravity:
|
||||
case WestGravity:
|
||||
case SouthWestGravity:
|
||||
*origin_x = x + min_width + frame_left - TICK_WIDTH / 2 - 1;
|
||||
break;
|
||||
|
||||
/* centered horizontally */
|
||||
case NorthGravity:
|
||||
case SouthGravity:
|
||||
case CenterGravity:
|
||||
/* Not going to draw horizontal ticks */
|
||||
*origin_x = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
switch (resize_gravity)
|
||||
{
|
||||
/* If client is staying fixed on the south during resize,
|
||||
* we have to move the north edge, so ticks originate on the
|
||||
* south.
|
||||
*/
|
||||
case SouthGravity:
|
||||
case SouthEastGravity:
|
||||
case SouthWestGravity:
|
||||
*origin_y = y + height - frame_top - min_height + TICK_WIDTH / 2;
|
||||
break;
|
||||
|
||||
/* staying fixed on the north */
|
||||
case NorthGravity:
|
||||
case NorthEastGravity:
|
||||
case NorthWestGravity:
|
||||
*origin_y = y + min_height + frame_bottom - TICK_WIDTH / 2 - 1;
|
||||
break;
|
||||
|
||||
/* centered vertically */
|
||||
case EastGravity:
|
||||
case WestGravity:
|
||||
case CenterGravity:
|
||||
*origin_y = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -830,53 +188,11 @@ meta_ui_resize_popup_set (MetaResizePopup *popup,
|
||||
int frame_bottom)
|
||||
{
|
||||
gboolean need_update_size;
|
||||
gboolean need_update_ticks;
|
||||
gboolean need_update_tick_labels;
|
||||
int tick_x, tick_y;
|
||||
int display_w, display_h;
|
||||
gboolean need_vertical, need_horizontal;
|
||||
|
||||
g_return_if_fail (popup != NULL);
|
||||
|
||||
need_update_size = FALSE;
|
||||
need_update_ticks = FALSE;
|
||||
need_update_tick_labels = FALSE;
|
||||
|
||||
switch (popup->resize_gravity)
|
||||
{
|
||||
case SouthGravity:
|
||||
case SouthEastGravity:
|
||||
case SouthWestGravity:
|
||||
case NorthGravity:
|
||||
case NorthEastGravity:
|
||||
case NorthWestGravity:
|
||||
need_vertical = TRUE;
|
||||
break;
|
||||
default:
|
||||
need_vertical = FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
if (height_inc <= (TICK_WIDTH + 1))
|
||||
need_vertical = FALSE;
|
||||
|
||||
switch (popup->resize_gravity)
|
||||
{
|
||||
case EastGravity:
|
||||
case SouthEastGravity:
|
||||
case NorthEastGravity:
|
||||
case WestGravity:
|
||||
case SouthWestGravity:
|
||||
case NorthWestGravity:
|
||||
need_horizontal = TRUE;
|
||||
break;
|
||||
default:
|
||||
need_horizontal = FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
if (popup->width_inc <= (TICK_WIDTH + 1))
|
||||
need_horizontal = FALSE;
|
||||
|
||||
display_w = width - base_width;
|
||||
if (width_inc > 0)
|
||||
@@ -893,33 +209,6 @@ meta_ui_resize_popup_set (MetaResizePopup *popup,
|
||||
display_w != popup->horizontal_size ||
|
||||
display_h != popup->vertical_size)
|
||||
need_update_size = TRUE;
|
||||
|
||||
get_tick_origin (resize_gravity, x, y, width, height,
|
||||
min_width, min_height,
|
||||
frame_left, frame_right,
|
||||
frame_top, frame_bottom,
|
||||
&tick_x, &tick_y);
|
||||
|
||||
if (popup->tick_origin_x != tick_x ||
|
||||
popup->tick_origin_y != tick_y ||
|
||||
popup->frame_left != frame_left ||
|
||||
popup->frame_right != frame_right ||
|
||||
popup->frame_top != frame_top ||
|
||||
popup->frame_bottom != frame_bottom)
|
||||
need_update_ticks = TRUE;
|
||||
|
||||
if (need_update_ticks ||
|
||||
display_w != popup->horizontal_size ||
|
||||
display_h != popup->vertical_size)
|
||||
need_update_tick_labels = TRUE;
|
||||
|
||||
if (need_horizontal != popup->need_horizontal_feedback ||
|
||||
need_vertical != popup->need_vertical_feedback)
|
||||
{
|
||||
need_update_size = TRUE;
|
||||
need_update_ticks = TRUE;
|
||||
need_update_tick_labels = TRUE;
|
||||
}
|
||||
|
||||
popup->resize_gravity = resize_gravity;
|
||||
popup->x = x;
|
||||
@@ -930,28 +219,12 @@ meta_ui_resize_popup_set (MetaResizePopup *popup,
|
||||
popup->min_height = min_height;
|
||||
popup->width_inc = width_inc;
|
||||
popup->height_inc = height_inc;
|
||||
popup->tick_origin_x = tick_x;
|
||||
popup->tick_origin_y = tick_y;
|
||||
popup->frame_left = frame_left;
|
||||
popup->frame_right = frame_right;
|
||||
popup->frame_top = frame_top;
|
||||
popup->frame_bottom = frame_bottom;
|
||||
popup->vertical_size = display_h;
|
||||
popup->horizontal_size = display_w;
|
||||
popup->need_vertical_feedback = need_vertical;
|
||||
popup->need_horizontal_feedback = need_horizontal;
|
||||
|
||||
if (need_update_tick_labels)
|
||||
{
|
||||
clear_tick_labels (popup);
|
||||
update_tick_labels (popup);
|
||||
}
|
||||
|
||||
if (need_update_ticks)
|
||||
{
|
||||
clear_tick_windows (popup);
|
||||
ensure_tick_windows (popup);
|
||||
}
|
||||
|
||||
if (need_update_size)
|
||||
{
|
||||
@@ -976,7 +249,6 @@ meta_ui_resize_popup_set_showing (MetaResizePopup *popup,
|
||||
if (popup->showing)
|
||||
{
|
||||
ensure_size_window (popup);
|
||||
ensure_tick_windows (popup);
|
||||
update_size_window (popup);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,8 @@
|
||||
#include <glib.h>
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
|
||||
MetaResizePopup* meta_ui_resize_popup_new (void);
|
||||
MetaResizePopup* meta_ui_resize_popup_new (Display *display,
|
||||
int screen_number);
|
||||
void meta_ui_resize_popup_free (MetaResizePopup *popup);
|
||||
void meta_ui_resize_popup_set (MetaResizePopup *popup,
|
||||
int resize_gravity,
|
||||
|
||||
@@ -8,10 +8,16 @@ if test -z "$CLIENT_DISPLAY"; then
|
||||
CLIENT_DISPLAY=:1
|
||||
fi
|
||||
|
||||
if test -z "$METACITY_DISPLAY"; then
|
||||
export METACITY_DISPLAY=$CLIENT_DISPLAY
|
||||
fi
|
||||
|
||||
if test -z "$SCREENS"; then
|
||||
SCREENS=1
|
||||
fi
|
||||
|
||||
MAX_SCREEN=`echo $SCREENS-1 | bc`
|
||||
|
||||
if test "$DEBUG" = none; then
|
||||
DEBUG=
|
||||
elif test -z "$DEBUG"; then
|
||||
@@ -42,6 +48,8 @@ if test -n "$XINERAMA"; then
|
||||
XINERAMA_FLAGS='+xinerama'
|
||||
fi
|
||||
|
||||
export EF_ALLOW_MALLOC_0=1
|
||||
|
||||
if test -z "$ONLY_WM"; then
|
||||
echo "Launching Xnest"
|
||||
Xnest -ac $XNEST_DISPLAY -scrns $SCREENS -geometry 640x480 -bw 15 $XINERAMA_FLAGS &
|
||||
@@ -50,13 +58,25 @@ if test -z "$ONLY_WM"; then
|
||||
|
||||
if test -n "$XMON_DIR"; then
|
||||
echo "Launching xmond"
|
||||
$XMON_DIR/xmonui | $XMON_DIR/xmond -server $XNEST_DISPLAY &
|
||||
$XMON_DIR/xmonui | $XMON_DIR/xmond -server localhost:$XNEST_DISPLAY &
|
||||
sleep 1
|
||||
fi
|
||||
|
||||
if test -n "$XSCOPE_DIR"; then
|
||||
## xscope doesn't like to die when it should, it backgrounds itself
|
||||
killall -9 xscope
|
||||
killall -9 xscope
|
||||
echo "Launching xscope"
|
||||
DISPLAY= $XSCOPE_DIR/xscope -o1 -i28 > xscoped-replies.txt &
|
||||
export METACITY_DISPLAY=localhost:28
|
||||
sleep 1
|
||||
fi
|
||||
|
||||
echo "Launching clients"
|
||||
if test -n "$TEST_CLIENT"; then
|
||||
DISPLAY=$CLIENT_DISPLAY $TEST_CLIENT &
|
||||
for I in `seq 0 $MAX_SCREEN`; do
|
||||
DISPLAY=$CLIENT_DISPLAY.$I $TEST_CLIENT &
|
||||
done
|
||||
fi
|
||||
|
||||
if test $CLIENTS != 0; then
|
||||
@@ -72,12 +92,18 @@ if test -z "$ONLY_WM"; then
|
||||
DISPLAY=$CLIENT_DISPLAY gnome-terminal --geometry 25x15 &
|
||||
done
|
||||
fi
|
||||
|
||||
if test -e ~/.Xmodmap; then
|
||||
DISPLAY=$CLIENT_DISPLAY xmodmap ~/.Xmodmap
|
||||
fi
|
||||
|
||||
usleep 50000
|
||||
|
||||
DISPLAY=$CLIENT_DISPLAY xsetroot -solid royalblue3
|
||||
for I in `seq 0 $MAX_SCREEN`; do
|
||||
DISPLAY=$CLIENT_DISPLAY.$I xsetroot -solid royalblue3
|
||||
done
|
||||
fi
|
||||
|
||||
if test -z "$ONLY_SETUP"; then
|
||||
METACITY_VERBOSE=1 METACITY_DEBUG=1 METACITY_USE_LOGFILE=1 METACITY_DEBUG_BUTTON_GRABS=1 METACITY_DISPLAY=$CLIENT_DISPLAY exec $DEBUG ./metacity $OPTIONS
|
||||
METACITY_VERBOSE=1 METACITY_USE_LOGFILE=1 METACITY_DEBUG_BUTTON_GRABS=1 exec $DEBUG ./metacity $OPTIONS
|
||||
fi
|
||||
|
||||
1107
src/screen.c
1107
src/screen.c
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user