source: trunk/third/metacity/README @ 18717

Revision 18717, 18.5 KB checked in by ghudson, 22 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r18716, which included commits to RCS files with non-trunk default branches.
Line 
1Metacity is not a meta-City as in an urban center, but rather
2Meta-ness as in the state of being meta. i.e. metacity : meta as
3opacity : opaque. Also it may have something to do with the Meta key
4on UNIX keyboards.
5
6The first release of Metacity was version 2.3. Metacity has no need for
7your petty hangups about version numbers.
8
9COMPILING METACITY
10===
11
12You need GTK+ 2.0, ideally the latest in the 2.0.x series.  For
13multihead/Xinerama support to work, you need GTK+ 2.2.  For
14startup notification to work you need libstartup-notification at
15http://www.freedesktop.org/software/startup-notification/ or on the
16GNOME ftp site. You also need GConf 1.2 (unless building a funky
17extra-small embedded metacity with --disable-gconf).
18
19REPORTING BUGS AND SUBMITTING PATCHES
20===
21
22Report new bugs on http://bugzilla.gnome.org. Please check for
23duplicates, *especially* if you are reporting a feature request.
24
25Please do *not* add "me too!" or "yes I really want this!" comments to
26feature requests in bugzilla. Please read
27http://pobox.com/~hp/features.html prior to adding any kind of flame
28about missing features or misfeatures.
29
30Feel free to send patches too; Metacity is relatively small and
31simple, so if you find a bug or want to add a feature it should be
32pretty easy.  Send me mail, or put the patch in bugzilla.
33
34See the HACKING file for some notes on hacking Metacity.
35
36SHRINKING METACITY
37===
38
39Not that metacity is huge (<400K binary last I checked), but about
40half of that is in the preferences handling, in static strings that
41aren't essential, and in the theme engine.
42
43You can strip about 70K from the metacity binary by compiling with
44options such as:
45
46 --disable-gconf
47 --disable-sm
48 --disable-verbose
49 --disable-startup-notification
50
51However the result is no good for desktop use, all prefs have to be
52hardcoded in the binary, for example. If you wanted to make a really
53small metacity, here's some additional stuff you might consider
54implementing:
55 
56 - add --disable-themes, which would replace theme.c and theme-parser.c
57   with a hardcoded implementation of the interface in theme.h,
58   should save about 80K. This should be fairly easy.
59
60 - add --disable-gtk, which would implement the interface in ui.h
61   without using GTK. This one is easier than you think because the
62   main part of the window manager doesn't use GTK directly, but is
63   still fairly hard to do.  You would probably have to give up some
64   of the features, such as window menus, as menus are pretty complex
65   to implement well.  So time may be better spent adding a GTK
66   configure script feature to build GTK with only a small core set of
67   functionality.
68
69METACITY FEATURES
70===
71
72 - Boring window manager for the adult in you. Many window managers
73   are like Marshmallow Froot Loops; Metacity is like Cheerios.
74
75 - Uses GTK+ 2.0 for drawing window frames. This means colors, fonts,
76   etc. come from GTK+ theme.
77
78 - Does not expose the concept of "window manager" to the user.  Some
79   of the features in the GNOME control panel and other parts of the
80   desktop happen to be implemented in metacity, such as changing your
81   window border theme, or changing your window navigation shorcuts,
82   but the user doesn't need to know this.
83
84 - Includes only the window manager; does not try to be a desktop
85   environment. The pager, configuration, etc. are all separate and
86   modular. The "libwnck" library (which I also wrote) is available
87   for writing metacity extensions, pagers, and so on. (But libwnck
88   isn't metacity specific, or GNOME-dependent; it requires only GTK,
89   and should work with KWin, fvwm2, and other EWMH-compliant WMs.)
90
91 - Has a simple theme system and a couple of extra themes come with it.
92   Change themes via gconf-editor or gconftool or GNOME themes control
93   panel:
94     gconftool-2 --type=string --set /apps/metacity/general/theme Crux
95     gconftool-2 --type=string --set /apps/metacity/general/theme Gorilla
96     gconftool-2 --type=string --set /apps/metacity/general/theme Atlanta
97     gconftool-2 --type=string --set /apps/metacity/general/theme Bright
98
99   See theme-format.txt for docs on the theme format. Use
100   metacity-theme-viewer to preview themes.
101
102 - Change number of workspaces via gconf-editor or gconftool:
103     gconftool-2 --type=int --set /apps/metacity/general/num_workspaces 5
104
105   Can also change workspaces from GNOME 2 pager.
106
107 - Change focus mode:
108     gconftool-2 --type=string --set /apps/metacity/general/focus_mode mouse
109     gconftool-2 --type=string --set /apps/metacity/general/focus_mode sloppy
110     gconftool-2 --type=string --set /apps/metacity/general/focus_mode click
111
112 - Global keybinding defaults include:   
113
114    Alt-Tab                forward cycle window focus
115    Alt-Shift-Tab          backward cycle focus
116    Alt-Ctrl-Tab           forward cycle focus among panels
117    Alt-Ctrl-Shift-Tab     backward cycle focus among panels
118    Alt-Escape             cycle window focus without a popup thingy
119    Ctrl-Alt-Left Arrow    previous workspace
120    Ctrl-Alt-Right Arrow   next workspace
121    Ctrl-Alt-D             minimize/unminimize all, to show desktop
122
123   Change keybindings for example:
124
125     unst gconftool-2 --type=string --set /apps/metacity/global_keybindings/switch_to_workspace_1 '<Alt>F1'
126   
127   Also try the GNOME keyboard shortcuts control panel, or
128   gconf-editor.
129
130   See metacity.schemas for all available bindings.
131
132 - Window keybindings:
133
134    Alt-space         window menu
135
136    Mnemonics work in the menu. That is, Alt-space then underlined
137    letter in the menu item works.
138
139    Choose Move from menu, and arrow keys to move the window.
140
141    While moving, hold down Control to move slower, and
142      Shift to snap to edges.
143
144    Choose Resize from menu, and nothing happens yet, but
145      eventually I might implement something.
146
147    Keybindings for things like maximize window, vertical maximize,
148    etc. can be bound, but may not all exist by default. See
149    metacity.schemas.
150
151 - Window mouse bindings:
152
153    Clicking anywhere on frame with button 1 will raise/focus window
154   
155    If you click a window control, such as the close button, then the
156     control will activate on button release if you are still over it
157     on release (as with most GUI toolkits)
158
159    If you click and drag borders with button 1 it resizes the window
160   
161    If you click and drag the titlebar with button 1 it moves the
162     window.
163
164    If you click anywhere on the frame with button 2 it lowers the
165     window.
166
167    If you click anywhere on the frame with button 3 it shows the
168     window menu.
169
170    If you hold down Super (windows key) and click inside a window, it
171     will move the window (buttons 1 and 2) or show menu (button 3).
172     Or you can configure a different modifier for this.
173
174    If you pick up a window with button 1 and then switch workspaces
175     the window will come with you to the new workspace, this is
176     a feature copied from Enlightenment.
177
178    If you hold down Shift while moving a window, the window snaps
179     to edges of other windows and the screen.
180
181 - Session management:
182
183    Metacity connects to the session manager and will set itself up to
184     be respawned. It theoretically restores sizes/positions/workspace
185     for session-aware applications.
186
187 - Metacity implements much of the new window manager spec from
188   freedesktop.org
189   (http://www.freedesktop.org/standards/wm-spec.html), and much of
190   the ICCCM. But then there are parts of each that it doesn't
191   implement, just because I haven't yet.
192
193 - Uses Pango to render text, so has cool i18n capabilities.
194   Supports UTF-8 window titles and such.
195
196 - There are simple animations for actions such as minimization,
197   to help users see what is happening. Should probably
198   have a few more of these and make them nicer.
199
200 - if you have the proper X setup, set the GDK_USE_XFT=1
201   environment variable to get antialiased window titles.
202
203 - considers the panel when placing windows and maximizing
204   them.
205
206 - handles the window manager selection from the ICCCM. Will exit if
207   another WM claims it, and can claim it from another WM if you pass
208   the --replace argument. So if you're running another
209   ICCCM-compliant WM, you can run "metacity --replace" to replace it
210   with Metacity.
211
212 - does basic colormap handling
213
214 - and much more! well, maybe not a lot more.
215
216HOW TO ADD EXTERNAL FEATURES
217===
218
219You can write a metacity "plugin" such as a pager, window list, icon
220box, task menu, or even things like "window matching" using the
221Extended Window Manager Hints. See http://www.freedesktop.org for the
222EWMH specification. An easy-to-use library called "libwnck" is
223available that uses the EWMH and is specifically designed for writing
224WM accessories.
225
226You might be interested in existing accessories such as "Devil's Pie"
227by Ross Burton, which add features to Metacity (or other
228EWMH-compliant WMs).
229
230METACITY BUGS, NON-FEATURES, AND CAVEATS
231===
232
233See bugzilla: http://bugzilla.gnome.org/query.cgi
234
235FAQ
236===
237
238Q: Will you add my feature?
239
240A: If it makes sense to turn on unconditionally, or is genuinely a
241   harmless preference that I would not be embarrassed to put in a
242   simple, uncluttered, user-friendly configuration dialog.
243
244   If the only rationale for your feature is that other window
245   managers have it, or that you are personally used to it, or
246   something like that, then I will not be impressed. Metacity is
247   firmly in the "choose good defaults" camp rather than the "offer 6
248   equally broken ways to do it, and let the user pick one" camp.
249
250   This is part of a "no crackrock" policy, despite some exceptions
251   I'm mildly embarrassed about. For example, multiple workspaces
252   probably constitute crackrock, they confuse most users and really
253   are not that useful if you have a decent tasklist and so on. But I
254   am too used to them to turn them off.  Or alternatively
255   iconification/tasklist is crack, and workspaces/pager are good. But
256   having both is certainly a bit wrong.  Sloppy focus is probably
257   crackrock too.
258
259   But don't think unlimited crack is OK just because I slipped up a
260   little. No slippery slope here.
261
262   Don't let this discourage patches and fixes - I love those. ;-)
263   Just be prepared to hear the above objections if your patch adds
264   some crack-ridden configuration option.
265
266   http://pobox.com/~hp/free-software-ui.html
267   http://pobox.com/~hp/features.html   
268
269Q: Will Metacity be part of GNOME?
270
271A: It is officially part of GNOME as of GNOME 2.2. Prior to that,
272   it was unofficially shipped as the default GNOME WM by several
273   OS vendors.
274
275Q: Is Metacity a Red Hat project?
276
277A: Metacity's original creation was in no way funded, endorsed, or
278   encouraged by Red Hat, Inc. - I'm guessing Red Hat would not
279   consider "insufficient number of window managers for Linux" an
280   urgent problem. Just a wild guess though.
281
282   Now that metacity is the default WM however, Red Hat supports some
283   bugfixing and other work.
284 
285Q: Why does Metacity remember the workspace/position of some apps
286   but not others across logout/login?
287
288A: Metacity only stores sizes/positions for apps that are session
289   managed. As far as I can determine, there is no way to attempt to
290   remember workspace/position for non-session-aware apps without
291   causing a lot of weird effects.
292
293   The reason is that you don't know which non-SM-aware apps were
294   launched by the session. When you initially log in, Metacity sees a
295   bunch of new windows appear. But it can't distinguish between
296   windows that were stored in your session, or windows you just
297   launched after logging in. If Metacity tried to guess that a window
298   was from the session, it could e.g. end up maximizing a dialog, or
299   put a window you just launched on another desktop or in a weird
300   place. And in fact I see a lot of bugs like this in window managers
301   that try to handle non-session-aware apps.
302
303   However, for session-aware apps, Metacity can tell that the
304   application instance is from the session and thus restore it
305   reliably, assuming the app properly restores the windows it had
306   open on session save.
307   
308   So the correct way to fix the situation is to make apps
309   session-aware. libSM has come with X for years, it's very
310   standardized, it's shared by GNOME and KDE - even twm is
311   session-aware. So anyone who won't take a patch to add SM is more
312   archaic than twm - and you should flame them. ;-)
313
314   Docs on session management:
315    ftp://ftp.x.org/pub/R6.4/xc/doc/hardcopy/SM/xsmp.PS.gz
316    ftp://ftp.x.org:21/pub/R6.4/xc/doc/hardcopy/SM/SMlib.PS.gz
317
318   See also the ICCCM section on SM. For GNOME apps, use the
319   GnomeClient object. For a simple example of using libSM directly,
320   twm/session.c in the twm source code is pretty easy to understand.
321
322Q: How about adding viewports in addition to workspaces?
323
324A: I could conceivably be convinced to use viewports _instead_ of
325   workspaces, though currently I'm not thinking that. But I don't
326   think it makes any sense to have both; it's just confusing. They
327   are functionally equivalent.
328
329   You may think this means that you won't have certain keybindings,
330   or something like that. This is a misconception. The only
331   _fundamental_ difference between viewports and workspaces is that
332   with viewports, windows can "overlap" and appear partially on
333   one and partially on another. All other differences that
334   traditionally exist in other window managers are accidental -
335   the features commonly associated with viewports can be implemented
336   for workspaces, and vice versa.
337
338   So I don't want to have two kinds of
339   workspace/desktop/viewport/whatever, but I'm willing to add
340   features traditionally associated with either kind if those
341   features make sense.
342
343Q: Why is the panel always on top?
344
345A: Because it's a better user interface, and until we made this not
346   configurable a bunch of apps were not getting fixed (the app
347   authors were just saying "put your panel on the bottom" instead of
348   properly supporting fullscreen mode, and such).
349
350   rationales.txt has the bugzilla URL for some flamefesting on this,
351   if you want to go back and relive the glory.
352   Read these and the bugzilla stuff before asking/commenting:
353     http://pobox.com/~hp/free-software-ui.html
354     http://pobox.com/~hp/features.html   
355
356Q: Why is there no edge flipping?
357
358A: This one is also in rationales.txt. Because "ouija board" UI, where
359   you just move the mouse around and the computer guesses what you
360   mean, has a lot of issues. This includes mouse focus, shade-hover
361   mode, edge flipping, autoraise, etc. Metacity has mouse focus and
362   autoraise as a compromise, but these features are all confusing for
363   many users, and cause problems with accessibility, fitt's law, and
364   so on.
365
366   Read these and the bugzilla stuff before asking/commenting:
367     http://pobox.com/~hp/free-software-ui.html
368     http://pobox.com/~hp/features.html   
369
370Q: Why no wireframe move/resize?
371
372A: Also in rationales.txt. Because it has low usability, and is a pain
373   to implement, and there's no reason opaque move/resize should be a
374   problem on any setup that can run a modern desktop worth a darn to
375   begin with.
376
377   Read these and the bugzilla stuff before asking/commenting:
378     http://pobox.com/~hp/free-software-ui.html
379     http://pobox.com/~hp/features.html   
380
381Q: Why no XYZ?
382
383A: You are probably getting the idea by now - check rationales.txt,
384   query/search bugzilla, and read http://pobox.com/~hp/features.html
385   and http://pobox.com/~hp/free-software-ui.html
386
387   Then sit down and answer the question for yourself.  Is the feature
388   good? What's the rationale for it? Answer "why" not just "why not."
389   Justify in terms of users as a whole, not just users like
390   yourself. How else can you solve the same problem? etc. If that
391   leads you to a strong opinion, then please, post the rationale for
392   discussion to an appropriate bugzilla bug, or to
393   usability@gnome.org.
394
395   Please don't just "me too!" on bugzilla bugs, please don't think
396   flames will get you anywhere, and please don't repeat rationale
397   that's already been offered.
398
399Q: Your dumb web pages you made me read talk about solving problems in
400   fundamental ways instead of adding preferences or workarounds.
401   What are some examples where metacity has done this?
402
403A: There are quite a few, though many opportunities remain.  Sometimes
404   the real fix involves application changes. The metacity approach is
405   that it's OK to require apps to change, though there are also
406   plenty of workarounds in metacity for battles considered too hard
407   to fight.
408
409   Here are some examples:
410
411   - fullscreen mode was introduced to allow position constraints,
412     panel-on-top, and other such things to apply to normal windows
413     while still allowing video players etc. to "just work"
414
415   - "whether to include minimized windows in Alt+Tab" was solved
416     by putting minimized windows at the *end* of the tab order.
417
418   - Whether to pop up a feedback display during Alt+Tab was solved by
419     having both Alt+Tab and Alt+Esc
420
421   - Whether to have a "kill" feature was solved by automatically
422     detecting and offering to kill stuck apps. Better, metacity
423     actually does "kill -9" on the process, it doesn't just
424     disconnect the process from the X server. You'll appreciate this
425     if you ever did a "kill" on Netscape 4, and watched it keep
426     eating 100% CPU even though the X server had booted it.
427
428   - The workspaces vs. viewports mess was avoided by adding
429     directional navigation and such to workspaces, see discussion
430     earlier in this file.
431
432   - Instead of configurable placement algorithms, there's just one
433     that works fairly well most of the time.
434
435   - To avoid excess CPU use during opaque move/resize, we rate limit
436     the updates to the application window's size.
437
438   - Instead of configurable "show size of window while resizing,"
439     it's only shown for windows where it matters, such as terminals.
440     (Only use-case given for all windows is for web designers
441     choosing their web browser size, but there are web sites and
442     desktop backgrounds that do this for you.)
443
444   - Using startup notification, applications open on the workspace
445     where you launched them, not the active workspace when their
446     window is opened.
447
448   - and much more.
449
450Q: I think metacity sucks.
451
452A: Feel free to use any WM you like. The reason metacity follows the
453   ICCCM and EWMH specifications is that it makes metacity a modular,
454   interchangeable part in the desktop. libwnck-based apps such as the
455   GNOME window list will work just fine with any EWMH-compliant WM.
456
457Q: Did you spend a lot of time on this?
458
459A: Originally the answer was no. Sadly the answer is now yes.
460
461Q: How can you claim that you are anti-crack, while still
462   writing a window manager?
463
464A: I have no comment on that.
Note: See TracBrowser for help on using the repository browser.