Sync up to upstream 2.25.144

Conflicts:

	configure.in
	src/core/main.c
	src/core/prefs.c
	src/core/window.c
	src/include/prefs.h
This commit is contained in:
Tomas Frydrych 2009-02-12 17:14:12 +00:00
commit 39a3bb2c7d
36 changed files with 25793 additions and 18572 deletions

144
ChangeLog
View File

@ -1,3 +1,147 @@
2009-02-01 Thomas Thurman <tthurman@gnome.org>
* NEWS: 2.25.144 release.
2009-02-01 Matt Kraai <kraai@ftbfs.org>
Set prop_hooks_table to NULL after freeing it.
* src/core/window-props.c:
2009-01-29 Thomas Thurman <tthurman@gnome.org>
Window properties are looked up in a hash table rather than
by iteration over an array. Saves ~44us per window, but
also makes the code cleaner.
* src/core/display-private.h:
* src/core/window-props.c:
2009-01-27 Matthias Claesen <mclasen@redhat.com>
* src/core/edge-resistance.c: some lists failed to keep track
of their contents and therefore didn't free correctly.
Closes #552303.
2009-01-27 Matthias Claesen <mclasen@redhat.com>
* src/core/prefs.c: Free name of old theme when new theme
is loaded. Closes #552973.
2009-01-27 Matthias Claesen <mclasen@redhat.com>
* src/ui/ui.c: free the result of gdk_text_property_to_utf8_list()
even when it returns no data.
2009-01-27 Owen Taylor <otaylor@redhat.com>
GtkStyle is specific to a particular colormap. Metacity
uses different colormaps for windows with different
visuals, so it must specialize the GtkStyle.
Closes #568365 and #513944.
* src/ui/frames.[ch]: Keep a GtkStyle for each MetaUIFrame, which is
obtained by calling gtk_style_attach() on the style for the
MetaFrames. When the style of the MetaFrames changes, reattach
everything. When we call gtk_style_set_background() pass in the
right style.
* src/ui/themes.[ch]: Create a _with_style() variant of functions that
previously took the style from widget->style passed in, so we
can draw with the right style for the colormap.
2009-01-27 Thomas Thurman <tthurman@gnome.org>
Added a gconf key to swap the meanings of the right and
middle buttons when the modifier key is held down.
Closes #437910. Thanks to Matt Kraai for looking over
the patch.
* src/core/display.c:
* src/core/prefs.c:
* src/include/prefs.h:
* src/metacity.schemas.in.in:
2009-01-27 Thomas Thurman <tthurman@gnome.org>
All the window properties are now handled using simple
window property handlers. Closes #549886.
* src/core/window-private.h:
* src/core/window-props.c:
* src/core/window.c:
2009-01-26 Thomas Thurman <tthurman@gnome.org>
More of the window properties are checked using simple
window property handlers. The ones which remain don't
actually look up the new value in the ordinary way, and
so are a little trickier to merge. Added an "initial"
flag to be on the safe side that the behaviour is the
same as before (so we don't do things when a window's
first mapped that we only used to do when a property
changed). Partial fix for bug #549886.
* src/core/window-props.c:
* src/core/window-props.h:
* src/core/window.c:
2009-01-25 Elijah Newren <newren gmail com>
* src/core/window.c: add support for _NET_WM_MOVERESIZE_CANCEL.
2009-01-10 Thomas Thurman <tthurman@gnome.org>
* src/ui/theme.[ch]: add meta_theme_draw_frame_by_name, which
is needed for the theme editor.
2008-12-26 Thomas Thurman <tthurman@gnome.org>
* configure.in: Post-release bump to 2.25.144.
2008-12-26 Thomas Thurman <tthurman@gnome.org>
* NEWS: 2.25.89 release.
2008-12-25 Thomas Thurman <tthurman@gnome.org>
* src/include/all-keybindings.h: alt-F10 toggles maximisation,
alt-F5 only restores. Also rename "unmaximize" to "restore".
* src/ui/frames.c: Rename "unmaximize" to "restore".
Closes #343824.
2008-12-25 Frederic Peters <fpeters@0d.be>
* src/core/main.c: (main): added call to g_thread_init(), as ORBit2
stopped doing it and Metacity is using gconf; closes #565517.
2008-12-24 Yanko Kaneti <yaneti@declera.com>
* src/metacity.schemas.in.in: add screenshot commands which had
mistakenly been removed; closes #564343, Launchpad bug 298463,
Red Hat bug 474635, and probably others.
2008-12-24 Thomas Thurman <tthurman@gnome.org>
* src/include/all-keybindings.h: fix move_to_corner_se
2008-12-21 Colin Walters <walters@verbum.org>
* src/core/window.c: windows which attempt to present themselves
but are offscreen end up demanding attention, unless they
are transient, when they move to the current workspace
as before. Closes #482354.
2008-12-19 Thomas Thurman <tthurman@gnome.org>
* src/ui/frames.c: when the user double-clicks the title bar,
end the grab op. Closes #401028.
2008-12-16 Thomas Thurman <tthurman@gnome.org>
* configure.in: Post-release bump to 2.25.89.
2008-12-16 Thomas Thurman <tthurman@gnome.org> 2008-12-16 Thomas Thurman <tthurman@gnome.org>
* NEWS: 2.25.55 release. * NEWS: 2.25.55 release.

38
NEWS
View File

@ -1,3 +1,41 @@
2.25.144
========
Thanks to Matthias Claesen, Matt Kraai, Elijah Newren, Owen Taylor, and Thomas
Thurman for improvements in this version.
- Optimise window property lookup (Thomas) (#549886)
- Fix slip in the above (Matt)
- Several memory leaks fixed (Matthias) (#552303, #552973, #552307)
- Fix longstanding crasher about colourmaps (Owen) (#568365)
- Alt+middle/right buttons can be switched (Thomas) (#437910)
- Support _NET_WM_MOVERESIZE_CANCEL (Elijah)
- minor fix paving the way for a theme editor (Thomas)
Translations
David Planella (ca), Jorge González (es), Mattias Põldaru (et), saudat
mohammed (ha), Yuval Tanny\n (he), Gabor Kelemen (hu), Onye, Sylvester (ig),
Changwoo Ryu (ko), Raivis Dejus (lv), Kjartan Maraas (nb), Daniel Nylander (sv),
Fajuyitan, Sunday Ayo (yo), 甘露 (Gan Lu) (zh_CN)
2.25.89
=======
Thanks to Yanko Kaneti, Frederic Peters, Thomas Thurman, and Colin Walters for
improvements in this version.
- The maximisation key is a toggle. (Thomas) (#343824)
- "Unmaximise" is now called "restore". (Thomas) (#343824)
- New thread handling call for gconf (Frederic) (#565517)
- Add screenshot commands back which had been removed (Yanko) (#565343)
- move_to_corner_se keybinding fixed (Thomas)
- Windows on other workspaces which attempt to present themselves
are marked as needing attention (Colin) (#482354)
- End the grab op when the user clicks the titlebar (Thomas) (#401028)
Translations
Jorge González (es)
2.25.55 2.25.55
======= =======

View File

@ -4,7 +4,7 @@ m4_define([metacity_major_version], [2])
m4_define([metacity_minor_version], [25]) m4_define([metacity_minor_version], [25])
# Fibonacci sequence for micro version numbering: # Fibonacci sequence for micro version numbering:
# 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987 # 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987
m4_define([metacity_micro_version], [55]) m4_define([metacity_micro_version], [144])
m4_define([mutter_version],[0.1]) m4_define([mutter_version],[0.1])
m4_define([metacity_version], m4_define([metacity_version],
[metacity_major_version.metacity_minor_version.metacity_micro_version~mutter_version]) [metacity_major_version.metacity_minor_version.metacity_micro_version~mutter_version])

View File

@ -1,3 +1,58 @@
2009-02-01 Gil Forcada <gforcada@gnome.org>
* ca.po: Updated Catalan translation by David Planella.
2009-01-31 Jorge Gonzalez <jorgegonz@svn.gnome.org>
* es.po: Updated Spanish translation
2009-01-31 Daniel Nylander <po@danielnylander.se>
* sv.po: Updated Swedish translation.
2009-01-29 Kjartan Maraas <kmaraas@gnome.org>
* nb.po: Updated Norwegian bokmål translation.
2009-01-29 Changwoo Ryu <cwryu@debian.org>
* ko.po: Updated Korean translation.
2009-01-24 Raivis DEjus <orvils@gmail.com>
* lv.po: Updated Latvian translation.
2009-01-22 Yair Hershkovitz <yairhr@gmail.com>
* he.po: Updated Hebrew translation.
2009-01-17 Thomas Thurman <tthurman@gnome.org>
* ig.po: Added Igbo translation by Sylvester Onye.
* yo.po Added Yoruba translation by Sunday Ayo Fajuyitan.
* ha.po: Added Hausa translation by Saudat Mohammed.
* LINGUAS: added Igbo, Yoruba and Hausa.
2009-01-17 Gabor Kelemen <kelemeng@gnome.hu>
* hu.po: Translation updated.
2009-01-09 Daniel Nylander <po@danielnylander.se>
* sv.po: Updated Swedish translation.
2009-01-03 甘露(Gan Lu) <rhythm.gan@gmail.com>
* zh_CN.po: Updated Chinese Simplified translation
2009-01-03 Priit Laes <plaes at svn dot gnome dot org>
* et.po: Translation updated by Mattias Põldaru
2008-12-26 Jorge Gonzalez <jorgegonz@svn.gnome.org>
* es.po: Updated Spanish translation.
2008-12-12 Luca Ferretti <elle.uca@libero.it> 2008-12-12 Luca Ferretti <elle.uca@libero.it>
* it.po: Imported updated translation from gnome-2-24 branch. * it.po: Imported updated translation from gnome-2-24 branch.

View File

@ -30,12 +30,14 @@ fr
ga ga
gl gl
gu gu
ha
he he
hi hi
hr hr
hu hu
hy hy
id id
ig
is is
it it
ja ja
@ -80,6 +82,7 @@ uk
vi vi
wa wa
xh xh
yo
zh_CN zh_CN
zh_HK zh_HK
zh_TW zh_TW

4189
po/ca.po

File diff suppressed because it is too large Load Diff

188
po/es.po
View File

@ -6,14 +6,14 @@
# Héctor García Álvarez <hector@scouts-es.org>, 2001. # Héctor García Álvarez <hector@scouts-es.org>, 2001.
# Pablo Gonzalo del Campo <pablodc@bigfoot.com>,2002,2003. # Pablo Gonzalo del Campo <pablodc@bigfoot.com>,2002,2003.
# Francisco Javier F. Serrador <serrador@cvs.gnome.org>, 2004, 2005, 2006. # Francisco Javier F. Serrador <serrador@cvs.gnome.org>, 2004, 2005, 2006.
# Jorge González <jorgegonz@svn.gnome.org>, 2007, 2008. # Jorge González <jorgegonz@svn.gnome.org>, 2007, 200, 2009.
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: metacity.HEAD\n" "Project-Id-Version: metacity.HEAD\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
"product=metacity&amp;component=general\n" "product=metacity&component=general\n"
"POT-Creation-Date: 2008-11-23 21:55+0000\n" "POT-Creation-Date: 2009-01-27 21:05+0000\n"
"PO-Revision-Date: 2008-11-23 23:23+0100\n" "PO-Revision-Date: 2009-01-31 20:10+0100\n"
"Last-Translator: Jorge González <jorgegonz@svn.gnome.org>\n" "Last-Translator: Jorge González <jorgegonz@svn.gnome.org>\n"
"Language-Team: Español <gnome-es-list@gnome.org>\n" "Language-Team: Español <gnome-es-list@gnome.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -182,12 +182,12 @@ msgstr "Activar la composición"
msgid "Turn compositing off" msgid "Turn compositing off"
msgstr "Desactivar la composición" msgstr "Desactivar la composición"
#: ../src/core/main.c:475 #: ../src/core/main.c:478
#, c-format #, c-format
msgid "Failed to scan themes directory: %s\n" msgid "Failed to scan themes directory: %s\n"
msgstr "Falló al inspeccionar el directorio de temas: %s\n" msgstr "Falló al inspeccionar el directorio de temas: %s\n"
#: ../src/core/main.c:491 #: ../src/core/main.c:494
#, c-format #, c-format
msgid "" msgid ""
"Could not find a theme! Be sure %s exists and contains the usual themes.\n" "Could not find a theme! Be sure %s exists and contains the usual themes.\n"
@ -195,7 +195,7 @@ msgstr ""
"No se ha podido encontrar un tema. Asegúrese de que %s existe y contiene los " "No se ha podido encontrar un tema. Asegúrese de que %s existe y contiene los "
"temas usuales.\n" "temas usuales.\n"
#: ../src/core/main.c:547 #: ../src/core/main.c:550
#, c-format #, c-format
msgid "Failed to restart: %s\n" msgid "Failed to restart: %s\n"
msgstr "No se pudo reiniciar: %s\n" msgstr "No se pudo reiniciar: %s\n"
@ -211,25 +211,25 @@ msgstr "No se pudo reiniciar: %s\n"
#. * (Empty comment follows so the translators don't see this.) #. * (Empty comment follows so the translators don't see this.)
#. #.
#. #.
#: ../src/core/prefs.c:499 ../src/core/prefs.c:654 #: ../src/core/prefs.c:505 ../src/core/prefs.c:660
#, c-format #, c-format
msgid "GConf key '%s' is set to an invalid value\n" msgid "GConf key '%s' is set to an invalid value\n"
msgstr "La clave GConf «%s» está configurada con un valor inválido\n" msgstr "La clave GConf «%s» está configurada con un valor inválido\n"
#: ../src/core/prefs.c:580 ../src/core/prefs.c:823 #: ../src/core/prefs.c:586 ../src/core/prefs.c:829
#, c-format #, c-format
msgid "%d stored in GConf key %s is out of range %d to %d\n" msgid "%d stored in GConf key %s is out of range %d to %d\n"
msgstr "" msgstr ""
"%d almacenado en la clave de GConf %s está fuera de rango %d hasta %d\n" "%d almacenado en la clave de GConf %s está fuera de rango %d hasta %d\n"
#: ../src/core/prefs.c:624 ../src/core/prefs.c:701 ../src/core/prefs.c:749 #: ../src/core/prefs.c:630 ../src/core/prefs.c:707 ../src/core/prefs.c:755
#: ../src/core/prefs.c:813 ../src/core/prefs.c:1106 ../src/core/prefs.c:1122 #: ../src/core/prefs.c:819 ../src/core/prefs.c:1112 ../src/core/prefs.c:1128
#: ../src/core/prefs.c:1139 ../src/core/prefs.c:1155 #: ../src/core/prefs.c:1145 ../src/core/prefs.c:1161
#, c-format #, c-format
msgid "GConf key \"%s\" is set to an invalid type\n" msgid "GConf key \"%s\" is set to an invalid type\n"
msgstr "La clave GConf «%s» está configurada con un tipo inválido\n" msgstr "La clave GConf «%s» está configurada con un tipo inválido\n"
#: ../src/core/prefs.c:1225 #: ../src/core/prefs.c:1231
msgid "" msgid ""
"Workarounds for broken applications disabled. Some applications may not " "Workarounds for broken applications disabled. Some applications may not "
"behave properly.\n" "behave properly.\n"
@ -237,14 +237,14 @@ msgstr ""
"Los arreglos para aplicaciones rotas se han deshabilitado. Algunas " "Los arreglos para aplicaciones rotas se han deshabilitado. Algunas "
"aplicaciones podrían no comportarse correctamente.\n" "aplicaciones podrían no comportarse correctamente.\n"
#: ../src/core/prefs.c:1296 #: ../src/core/prefs.c:1302
#, c-format #, c-format
msgid "Could not parse font description \"%s\" from GConf key %s\n" msgid "Could not parse font description \"%s\" from GConf key %s\n"
msgstr "" msgstr ""
"No se ha podido interpretar la descripción de la tipografía «%s» de la clave " "No se ha podido interpretar la descripción de la tipografía «%s» de la clave "
"GConf %s\n" "GConf %s\n"
#: ../src/core/prefs.c:1356 #: ../src/core/prefs.c:1362
#, c-format #, c-format
msgid "" msgid ""
"\"%s\" found in configuration database is not a valid value for mouse button " "\"%s\" found in configuration database is not a valid value for mouse button "
@ -253,18 +253,18 @@ msgstr ""
"«%s» encontrado en la base de datos de configuración no es un valor válido " "«%s» encontrado en la base de datos de configuración no es un valor válido "
"para el modificador del botón del ratón\n" "para el modificador del botón del ratón\n"
#: ../src/core/prefs.c:1771 #: ../src/core/prefs.c:1780
#, c-format #, c-format
msgid "Error setting number of workspaces to %d: %s\n" msgid "Error setting number of workspaces to %d: %s\n"
msgstr "" msgstr ""
"Ocurrió un error configurando la número de espacios de trabajo para %d: %s\n" "Ocurrió un error configurando la número de espacios de trabajo para %d: %s\n"
#: ../src/core/prefs.c:1960 ../src/core/prefs.c:2463 #: ../src/core/prefs.c:1969 ../src/core/prefs.c:2472
#, c-format #, c-format
msgid "Workspace %d" msgid "Workspace %d"
msgstr "Área de trabajo %d" msgstr "Área de trabajo %d"
#: ../src/core/prefs.c:1990 ../src/core/prefs.c:2168 #: ../src/core/prefs.c:1999 ../src/core/prefs.c:2177
#, c-format #, c-format
msgid "" msgid ""
"\"%s\" found in configuration database is not a valid value for keybinding " "\"%s\" found in configuration database is not a valid value for keybinding "
@ -273,14 +273,14 @@ msgstr ""
"«%s» encontrado en la base de datos de configuración no es un valor válido " "«%s» encontrado en la base de datos de configuración no es un valor válido "
"para la combinación de teclas «%s»\n" "para la combinación de teclas «%s»\n"
#: ../src/core/prefs.c:2544 #: ../src/core/prefs.c:2553
#, c-format #, c-format
msgid "Error setting name for workspace %d to \"%s\": %s\n" msgid "Error setting name for workspace %d to \"%s\": %s\n"
msgstr "" msgstr ""
"Ocurrió un error al establecer el nombre del área de trabajo %d como «%s»: %" "Ocurrió un error al establecer el nombre del área de trabajo %d como «%s»: %"
"s \n" "s \n"
#: ../src/core/prefs.c:2730 #: ../src/core/prefs.c:2751
#, c-format #, c-format
msgid "Error setting compositor status: %s\n" msgid "Error setting compositor status: %s\n"
msgstr "Error al establecer el estado del compositor: %s\n" msgstr "Error al establecer el estado del compositor: %s\n"
@ -468,7 +468,7 @@ msgid "Metacity"
msgstr "Metacity" msgstr "Metacity"
#. first time through #. first time through
#: ../src/core/window.c:5728 #: ../src/core/window.c:5626
#, c-format #, c-format
msgid "" msgid ""
"Window %s sets SM_CLIENT_ID on itself, instead of on the WM_CLIENT_LEADER " "Window %s sets SM_CLIENT_ID on itself, instead of on the WM_CLIENT_LEADER "
@ -484,7 +484,7 @@ msgstr ""
#. * MWM but not WM_NORMAL_HINTS are basically broken. We complain #. * MWM but not WM_NORMAL_HINTS are basically broken. We complain
#. * about these apps but make them work. #. * about these apps but make them work.
#. #.
#: ../src/core/window.c:6293 #: ../src/core/window.c:6191
#, c-format #, c-format
msgid "" msgid ""
"Window %s sets an MWM hint indicating it isn't resizable, but sets min size %" "Window %s sets an MWM hint indicating it isn't resizable, but sets min size %"
@ -494,17 +494,17 @@ msgstr ""
"redimensionable, pero configuró el tamaño mínimo a %d x %d y el tamaño " "redimensionable, pero configuró el tamaño mínimo a %d x %d y el tamaño "
"máximo a %d x %d ; esto no tiene mucho sentido.\n" "máximo a %d x %d ; esto no tiene mucho sentido.\n"
#: ../src/core/window-props.c:206 #: ../src/core/window-props.c:276
#, c-format #, c-format
msgid "Application set a bogus _NET_WM_PID %lu\n" msgid "Application set a bogus _NET_WM_PID %lu\n"
msgstr "La aplicación establecio un _NET_WM_PID %lu erróneo\n" msgstr "La aplicación establecio un _NET_WM_PID %lu erróneo\n"
#: ../src/core/window-props.c:338 #: ../src/core/window-props.c:411
#, c-format #, c-format
msgid "%s (on %s)" msgid "%s (on %s)"
msgstr "%s (on %s)" msgstr "%s (on %s)"
#: ../src/core/window-props.c:1422 #: ../src/core/window-props.c:1523
#, c-format #, c-format
msgid "Invalid WM_TRANSIENT_FOR window 0x%lx specified for %s.\n" msgid "Invalid WM_TRANSIENT_FOR window 0x%lx specified for %s.\n"
msgstr "" msgstr ""
@ -697,8 +697,8 @@ msgid "Maximize window"
msgstr "Maximizar la ventana" msgstr "Maximizar la ventana"
#: ../src/include/all-keybindings.h:268 #: ../src/include/all-keybindings.h:268
msgid "Unmaximize window" msgid "Restore window"
msgstr "Desmaximizar la ventana" msgstr "Restablecer la ventana"
#: ../src/include/all-keybindings.h:270 #: ../src/include/all-keybindings.h:270
msgid "Toggle shaded state" msgid "Toggle shaded state"
@ -907,16 +907,24 @@ msgid "Automatically raises the focused window"
msgstr "Elevar automáticamente la ventana que tiene el foco" msgstr "Elevar automáticamente la ventana que tiene el foco"
#: ../src/metacity.schemas.in.in.h:9 #: ../src/metacity.schemas.in.in.h:9
#| msgid ""
#| "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 \"&lt;Alt&gt;\" or \"&lt;"
#| "Super&gt;\" for example."
msgid "" msgid ""
"Clicking a window while holding down this modifier key will move the window " "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 " "(left click), resize the window (middle click), or show the window menu "
"(right click). Modifier is expressed as \"&lt;Alt&gt;\" or \"&lt;Super&gt;\" " "(right click). The left and right operations may be swapped using the "
"for example." "\"mouse_button_resize\" key. Modifier is expressed as \"&lt;Alt&gt;\" or "
"\"&lt;Super&gt;\" for example."
msgstr "" msgstr ""
"Al pulsar sobre una ventana manteniendo presionada esta tecla modificadora " "Al pulsar sobre una ventana manteniendo presionada esta tecla modificadora "
"se moverá la ventana (botón izquierdo), se redimensionará la ventana (botón " "se moverá la ventana (botón izquierdo), se redimensionará la ventana (botón "
"central), o se mostrará el menú de la ventana (botón derecho). El " "del medio) o se mostrará el menú de la ventana (botón derecho). Las "
"modificador se expresa por ejemplo como «&lt;Alt&gt;» o «&lt;Super&gt;»." "operaciones izquierda y derecha se pueden intercambiar usando la tecla "
"modificadora \"mouse_button_resize\". El modificador se expresa por ejemplo "
"como «&lt;Alt&gt;» o «&lt;Super&gt;»."
#: ../src/metacity.schemas.in.in.h:10 #: ../src/metacity.schemas.in.in.h:10
msgid "Commands to run in response to keybindings" msgid "Commands to run in response to keybindings"
@ -1051,6 +1059,17 @@ msgstr "Ejecuta un comando definido"
#: ../src/metacity.schemas.in.in.h:29 #: ../src/metacity.schemas.in.in.h:29
msgid "" msgid ""
"Set this to true to resize with the right button and show a menu with the "
"middle button while holding down the key given in \"mouse_button_modifier\"; "
"set it to false to make it work the opposite way around."
msgstr ""
"Establezca esto a «verdadero» para redimensionar con el botón derecho y "
"mostrar un menú con el botón del medio mientras se mantiene pulsada la tecla "
"dada en \"mouse_button_modifier\"; establézcalo a «falso» para hacer que se "
"comporte de forma contraria."
#: ../src/metacity.schemas.in.in.h:30
msgid ""
"Setting this option to false can lead to buggy behavior, so users are " "Setting this option to false can lead to buggy behavior, so users are "
"strongly discouraged from changing it from the default of true. Many actions " "strongly discouraged from changing it from the default of true. Many actions "
"(e.g. clicking in the client area, moving or resizing the window) normally " "(e.g. clicking in the client area, moving or resizing the window) normally "
@ -1091,7 +1110,7 @@ msgstr ""
"dígale que es _su_ problema (de él) por romper el gestor de ventanas y que " "dígale que es _su_ problema (de él) por romper el gestor de ventanas y que "
"deben cambiar la opción a «true» o vivir con el error que han solicitado." "deben cambiar la opción a «true» o vivir con el error que han solicitado."
#: ../src/metacity.schemas.in.in.h:30 #: ../src/metacity.schemas.in.in.h:31
msgid "" msgid ""
"Some applications disregard specifications in ways that result in window " "Some applications disregard specifications in ways that result in window "
"manager misfeatures. This option puts Metacity in a rigorously correct mode, " "manager misfeatures. This option puts Metacity in a rigorously correct mode, "
@ -1104,11 +1123,11 @@ msgstr ""
"usuario más consistente, supuesto que uno no necesita ejecutar ninguna " "usuario más consistente, supuesto que uno no necesita ejecutar ninguna "
"aplicación que se comporte mal." "aplicación que se comporte mal."
#: ../src/metacity.schemas.in.in.h:31 #: ../src/metacity.schemas.in.in.h:32
msgid "System Bell is Audible" msgid "System Bell is Audible"
msgstr "La campana del sistema es audible" msgstr "La campana del sistema es audible"
#: ../src/metacity.schemas.in.in.h:32 #: ../src/metacity.schemas.in.in.h:33
msgid "" msgid ""
"Tells Metacity how to implement the visual indication that the system bell " "Tells Metacity how to implement the visual indication that the system bell "
"or another application 'bell' indicator has been rung. Currently there are " "or another application 'bell' indicator has been rung. Currently there are "
@ -1127,7 +1146,7 @@ msgstr ""
"usualmente el caso para el «bip del sistema» predeterminado), la barra de " "usualmente el caso para el «bip del sistema» predeterminado), la barra de "
"títulos de la ventana actual que tenga el foco parpadeará." "títulos de la ventana actual que tenga el foco parpadeará."
#: ../src/metacity.schemas.in.in.h:33 #: ../src/metacity.schemas.in.in.h:34
msgid "" msgid ""
"The /apps/metacity/global_keybindings/run_command_N keys define keybindings " "The /apps/metacity/global_keybindings/run_command_N keys define keybindings "
"that correspond to these commands. Pressing the keybinding for run_command_N " "that correspond to these commands. Pressing the keybinding for run_command_N "
@ -1137,7 +1156,26 @@ msgstr ""
"combinaciones de teclas que corresponden a esos comandos. Al presionar la " "combinaciones de teclas que corresponden a esos comandos. Al presionar la "
"combinación de teclas para «run_command_N» se ejecutará el «command_N»." "combinación de teclas para «run_command_N» se ejecutará el «command_N»."
#: ../src/metacity.schemas.in.in.h:34 #: ../src/metacity.schemas.in.in.h:35
msgid ""
"The /apps/metacity/global_keybindings/run_command_screenshot key defines a "
"keybinding which causes the command specified by this setting to be invoked."
msgstr ""
"La clave /apps/metacity/global_keybindings/run_command_screenshot define una "
"combinación de teclas que hace que el comando especificado por esta "
"configuración se invoque."
#: ../src/metacity.schemas.in.in.h:36
msgid ""
"The /apps/metacity/global_keybindings/run_command_window_screenshot key "
"defines a keybinding which causes the command specified by this setting to "
"be invoked."
msgstr ""
"La clave /apps/metacity/global_keybindings/run_command_window_screenshot "
"define una combinación de teclas que hace que el comando especificado por "
"esta configuración se invoque."
#: ../src/metacity.schemas.in.in.h:37
msgid "" msgid ""
"The keybinding that runs the correspondingly-numbered command in /apps/" "The keybinding that runs the correspondingly-numbered command in /apps/"
"metacity/keybinding_commands The format looks like \"&lt;Control&gt;a\" or " "metacity/keybinding_commands The format looks like \"&lt;Control&gt;a\" or "
@ -1153,11 +1191,15 @@ msgstr ""
"Ctl&gt;» y «&lt;Ctrl&gt;». Si configura esta opción con la cadena especial " "Ctl&gt;» y «&lt;Ctrl&gt;». Si configura esta opción con la cadena especial "
"«disabled» entonces no habrá combinación de teclas para esa acción." "«disabled» entonces no habrá combinación de teclas para esa acción."
#: ../src/metacity.schemas.in.in.h:35 #: ../src/metacity.schemas.in.in.h:38
msgid "The name of a workspace." msgid "The name of a workspace."
msgstr "El nombre de un área de trabajo." msgstr "El nombre de un área de trabajo."
#: ../src/metacity.schemas.in.in.h:36 #: ../src/metacity.schemas.in.in.h:39
msgid "The screenshot command"
msgstr "El comando de captura de pantalla"
#: ../src/metacity.schemas.in.in.h:40
msgid "" msgid ""
"The theme determines the appearance of window borders, titlebar, and so " "The theme determines the appearance of window borders, titlebar, and so "
"forth." "forth."
@ -1165,7 +1207,7 @@ msgstr ""
"El tema determina la apariencia de los bordes de la ventana, el título y " "El tema determina la apariencia de los bordes de la ventana, el título y "
"demás." "demás."
#: ../src/metacity.schemas.in.in.h:37 #: ../src/metacity.schemas.in.in.h:41
msgid "" msgid ""
"The time delay before raising a window if auto_raise is set to true. The " "The time delay before raising a window if auto_raise is set to true. The "
"delay is given in thousandths of a second." "delay is given in thousandths of a second."
@ -1173,7 +1215,7 @@ msgstr ""
"El retardo antes de desplegar una ventana si «auto_rise» está configurado " "El retardo antes de desplegar una ventana si «auto_rise» está configurado "
"como verdadero. El retardo está especificado en milésimas de segundo." "como verdadero. El retardo está especificado en milésimas de segundo."
#: ../src/metacity.schemas.in.in.h:38 #: ../src/metacity.schemas.in.in.h:42
msgid "" msgid ""
"The window focus mode indicates how windows are activated. It has three " "The window focus mode indicates how windows are activated. It has three "
"possible values; \"click\" means windows must be clicked in order to focus " "possible values; \"click\" means windows must be clicked in order to focus "
@ -1188,7 +1230,11 @@ msgstr ""
"foco cuando el ratón entra en la ventana y lo pierden cuando el ratón sale " "foco cuando el ratón entra en la ventana y lo pierden cuando el ratón sale "
"de la ventana." "de la ventana."
#: ../src/metacity.schemas.in.in.h:39 #: ../src/metacity.schemas.in.in.h:43
msgid "The window screenshot command"
msgstr "El comando de captura de una ventana"
#: ../src/metacity.schemas.in.in.h:44
msgid "" msgid ""
"This option determines the effects of double-clicking on the title bar. " "This option determines the effects of double-clicking on the title bar. "
"Current valid options are 'toggle_shade', which will shade/unshade the " "Current valid options are 'toggle_shade', which will shade/unshade the "
@ -1208,7 +1254,7 @@ msgstr ""
"muestra la ventana de menú, «lower» que pone la ventana detrás de todas las " "muestra la ventana de menú, «lower» que pone la ventana detrás de todas las "
"demás y «none» que no hará nada." "demás y «none» que no hará nada."
#: ../src/metacity.schemas.in.in.h:40 #: ../src/metacity.schemas.in.in.h:45
msgid "" msgid ""
"This option determines the effects of middle-clicking on the title bar. " "This option determines the effects of middle-clicking on the title bar. "
"Current valid options are 'toggle_shade', which will shade/unshade the " "Current valid options are 'toggle_shade', which will shade/unshade the "
@ -1228,7 +1274,7 @@ msgstr ""
"muestra la ventana de menú, «lower» que pone la ventana detrás de todas las " "muestra la ventana de menú, «lower» que pone la ventana detrás de todas las "
"demás y «none» que no hará nada." "demás y «none» que no hará nada."
#: ../src/metacity.schemas.in.in.h:41 #: ../src/metacity.schemas.in.in.h:46
msgid "" msgid ""
"This option determines the effects of right-clicking on the title bar. " "This option determines the effects of right-clicking on the title bar. "
"Current valid options are 'toggle_shade', which will shade/unshade the " "Current valid options are 'toggle_shade', which will shade/unshade the "
@ -1248,7 +1294,7 @@ msgstr ""
"muestra la ventana de menú, «lower» que pone la ventana detrás de todas las " "muestra la ventana de menú, «lower» que pone la ventana detrás de todas las "
"demás y «none» que no hará nada." "demás y «none» que no hará nada."
#: ../src/metacity.schemas.in.in.h:42 #: ../src/metacity.schemas.in.in.h:47
msgid "" msgid ""
"This option provides additional control over how newly created windows get " "This option provides additional control over how newly created windows get "
"focus. It has two possible values; \"smart\" applies the user's normal focus " "focus. It has two possible values; \"smart\" applies the user's normal focus "
@ -1260,7 +1306,7 @@ msgstr ""
"aplica el modo de foco normal del usuario, y «strict» hace que las ventanas " "aplica el modo de foco normal del usuario, y «strict» hace que las ventanas "
"iniciadas desde un terminal no se les dé el foco." "iniciadas desde un terminal no se les dé el foco."
#: ../src/metacity.schemas.in.in.h:43 #: ../src/metacity.schemas.in.in.h:48
msgid "" msgid ""
"Turns on a visual indication when an application or the system issues a " "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 " "'bell' or 'beep'; useful for the hard-of-hearing and for use in noisy "
@ -1270,25 +1316,29 @@ msgstr ""
"«campanada» o un «bip» ; es muy útil para los ambientes ruidosos y para las " "«campanada» o un «bip» ; es muy útil para los ambientes ruidosos y para las "
"personas con dificultades auditivas." "personas con dificultades auditivas."
#: ../src/metacity.schemas.in.in.h:44 #: ../src/metacity.schemas.in.in.h:49
msgid "Use standard system font in window titles" msgid "Use standard system font in window titles"
msgstr "Usar tipografía estándar del sistema en los títulos de la ventana" msgstr "Usar tipografía estándar del sistema en los títulos de la ventana"
#: ../src/metacity.schemas.in.in.h:45 #: ../src/metacity.schemas.in.in.h:50
msgid "Visual Bell Type" msgid "Visual Bell Type"
msgstr "Tipo de campana visual" msgstr "Tipo de campana visual"
#: ../src/metacity.schemas.in.in.h:46 #: ../src/metacity.schemas.in.in.h:51
msgid "Whether raising should be a side-effect of other user interactions" msgid "Whether raising should be a side-effect of other user interactions"
msgstr "" msgstr ""
"Indica si elevar debe ser un efecto lateral de otras interacciones del " "Indica si elevar debe ser un efecto lateral de otras interacciones del "
"usuario" "usuario"
#: ../src/metacity.schemas.in.in.h:47 #: ../src/metacity.schemas.in.in.h:52
msgid "Whether to resize with the right button"
msgstr "Indica si se debe redimensionar con el botón derecho"
#: ../src/metacity.schemas.in.in.h:53
msgid "Window focus mode" msgid "Window focus mode"
msgstr "Modo de foco de la ventana" msgstr "Modo de foco de la ventana"
#: ../src/metacity.schemas.in.in.h:48 #: ../src/metacity.schemas.in.in.h:54
msgid "Window title font" msgid "Window title font"
msgstr "Tipografía del título de la ventana" msgstr "Tipografía del título de la ventana"
@ -1314,8 +1364,8 @@ msgid "Maximize Window"
msgstr "Maximizar la ventana" msgstr "Maximizar la ventana"
#: ../src/ui/frames.c:1089 #: ../src/ui/frames.c:1089
msgid "Unmaximize Window" msgid "Restore Window"
msgstr "Desmaximizar la ventana" msgstr "Restablecer la ventana"
#: ../src/ui/frames.c:1092 #: ../src/ui/frames.c:1092
msgid "Roll Up Window" msgid "Roll Up Window"
@ -1852,7 +1902,7 @@ msgstr ""
"No hay un estilo de marco para el tipo de ventana «%s» en el tema «%s», añada " "No hay un estilo de marco para el tipo de ventana «%s» en el tema «%s», añada "
"un elemento <window type=\"%s\" style_set=\"whatever\"/>" "un elemento <window type=\"%s\" style_set=\"whatever\"/>"
#: ../src/ui/theme.c:5237 ../src/ui/theme.c:5299 ../src/ui/theme.c:5362 #: ../src/ui/theme.c:5295 ../src/ui/theme.c:5357 ../src/ui/theme.c:5420
#, c-format #, c-format
msgid "" msgid ""
"User-defined constants must begin with a capital letter; \"%s\" does not" "User-defined constants must begin with a capital letter; \"%s\" does not"
@ -1860,7 +1910,7 @@ msgstr ""
"Las constantes definidas por el usuario deben comenzar con una letra " "Las constantes definidas por el usuario deben comenzar con una letra "
"mayúscula; «%s» no lo hace" "mayúscula; «%s» no lo hace"
#: ../src/ui/theme.c:5245 ../src/ui/theme.c:5307 ../src/ui/theme.c:5370 #: ../src/ui/theme.c:5303 ../src/ui/theme.c:5365 ../src/ui/theme.c:5428
#, c-format #, c-format
msgid "Constant \"%s\" has already been defined" msgid "Constant \"%s\" has already been defined"
msgstr "La constante «%s» ya ha sido definida" msgstr "La constante «%s» ya ha sido definida"
@ -2444,6 +2494,12 @@ msgstr ""
"%d expresiones de coordenadas interpretadas en %g segundos (%g segundos de " "%d expresiones de coordenadas interpretadas en %g segundos (%g segundos de "
"media)\n" "media)\n"
#~ msgid "Unmaximize window"
#~ msgstr "Desmaximizar la ventana"
#~ msgid "Unmaximize Window"
#~ msgstr "Desmaximizar la ventana"
#~ msgid "" #~ msgid ""
#~ "Many actions (e.g. clicking in the client area, moving or resizing the " #~ "Many actions (e.g. clicking in the client area, moving or resizing the "
#~ "window) normally raise the window as a side-effect. Setting this option " #~ "window) normally raise the window as a side-effect. Setting this option "
@ -2473,24 +2529,6 @@ msgstr ""
#~ msgid "Unknown attribute %s on <geometry> element" #~ msgid "Unknown attribute %s on <geometry> element"
#~ msgstr "Atributo desconocido %s en el elemento <geometry>" #~ msgstr "Atributo desconocido %s en el elemento <geometry>"
#~ msgid ""
#~ "The /apps/metacity/global_keybindings/run_command_screenshot key defines "
#~ "a keybinding which causes the command specified by this setting to be "
#~ "invoked."
#~ msgstr ""
#~ "La clave /apps/metacity/global_keybindings/run_command_screenshot define "
#~ "una combinación de teclas que hace que el comando especificado por esta "
#~ "configuración se invoque."
#~ msgid ""
#~ "The /apps/metacity/global_keybindings/run_command_window_screenshot key "
#~ "defines a keybinding which causes the command specified by this setting "
#~ "to be invoked."
#~ msgstr ""
#~ "La clave /apps/metacity/global_keybindings/run_command_window_screenshot "
#~ "define una combinación de teclas que hace que el comando especificado por "
#~ "esta configuración se invoque."
#~ msgid "" #~ msgid ""
#~ "The keybinding that switches to the workspace above the current " #~ "The keybinding that switches to the workspace above the current "
#~ "workspace. The format looks like \"&lt;Control&gt;a\" or \"&lt;Shift&gt;" #~ "workspace. The format looks like \"&lt;Control&gt;a\" or \"&lt;Shift&gt;"
@ -3446,12 +3484,6 @@ msgstr ""
#~ "Ctrl&gt;». Si configura esta opción con la cadena especial «disabled» " #~ "Ctrl&gt;». Si configura esta opción con la cadena especial «disabled» "
#~ "entonces no habrá combinación de teclas para esta acción." #~ "entonces no habrá combinación de teclas para esta acción."
#~ msgid "The screenshot command"
#~ msgstr "El comando de captura de pantalla"
#~ msgid "The window screenshot command"
#~ msgstr "El comando de captura de una ventana"
#~ msgid "" #~ msgid ""
#~ "This keybinding changes whether a window is above or below other windows. " #~ "This keybinding changes whether a window is above or below other windows. "
#~ "If the window is covered by another one, it raises the window above all " #~ "If the window is covered by another one, it raises the window above all "

452
po/et.po

File diff suppressed because it is too large Load Diff

3599
po/ha.po Normal file

File diff suppressed because it is too large Load Diff

4871
po/he.po

File diff suppressed because it is too large Load Diff

3058
po/hu.po

File diff suppressed because it is too large Load Diff

3513
po/ig.po Normal file

File diff suppressed because it is too large Load Diff

4367
po/ko.po

File diff suppressed because it is too large Load Diff

4125
po/lv.po

File diff suppressed because it is too large Load Diff

2742
po/nb.po

File diff suppressed because it is too large Load Diff

3420
po/sl.po

File diff suppressed because it is too large Load Diff

557
po/sv.po

File diff suppressed because it is too large Load Diff

3493
po/yo.po Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -50,7 +50,6 @@
typedef struct _MetaStack MetaStack; typedef struct _MetaStack MetaStack;
typedef struct _MetaUISlave MetaUISlave; typedef struct _MetaUISlave MetaUISlave;
typedef struct _MetaWindowPropHooks MetaWindowPropHooks;
typedef struct _MetaGroupPropHooks MetaGroupPropHooks; typedef struct _MetaGroupPropHooks MetaGroupPropHooks;
typedef struct MetaEdgeResistanceData MetaEdgeResistanceData; typedef struct MetaEdgeResistanceData MetaEdgeResistanceData;
@ -233,7 +232,8 @@ struct _MetaDisplay
MetaWindow *window_with_menu; MetaWindow *window_with_menu;
/* Managed by window-props.c */ /* Managed by window-props.c */
MetaWindowPropHooks *prop_hooks; gpointer *prop_hooks_table;
GHashTable *prop_hooks;
/* Managed by group-props.c */ /* Managed by group-props.c */
MetaGroupPropHooks *group_prop_hooks; MetaGroupPropHooks *group_prop_hooks;

View File

@ -1682,7 +1682,7 @@ event_callback (XEvent *event,
if (!unmodified) if (!unmodified)
begin_move = TRUE; begin_move = TRUE;
} }
else if (!unmodified && event->xbutton.button == 2) else if (!unmodified && event->xbutton.button == meta_prefs_get_mouse_button_resize())
{ {
if (window->has_resize_func) if (window->has_resize_func)
{ {
@ -1731,7 +1731,7 @@ event_callback (XEvent *event,
event->xbutton.y_root); event->xbutton.y_root);
} }
} }
else if (event->xbutton.button == 3) else if (event->xbutton.button == meta_prefs_get_mouse_button_menu())
{ {
if (meta_prefs_get_raise_on_click ()) if (meta_prefs_get_raise_on_click ())
meta_window_raise (window); meta_window_raise (window);

View File

@ -985,8 +985,8 @@ meta_display_compute_resistance_and_snapping_edges (MetaDisplay *display)
cur_window_iter = cur_window_iter->next; cur_window_iter = cur_window_iter->next;
} }
/* Put 'em in bottom to top order */ /* Put 'em in bottom to top order */
rem_windows = g_slist_reverse (obscuring_windows); rem_windows = obscuring_windows = g_slist_reverse (obscuring_windows);
rem_win_stacking = g_slist_reverse (window_stacking); rem_win_stacking = window_stacking = g_slist_reverse (window_stacking);
/* /*
* 3rd: loop over the windows again, this time getting the edges from * 3rd: loop over the windows again, this time getting the edges from

View File

@ -479,6 +479,9 @@ main (int argc, char **argv)
guint i; guint i;
GOptionContext *ctx; GOptionContext *ctx;
if (!g_thread_supported ())
g_thread_init (NULL);
if (setlocale (LC_ALL, "") == NULL) if (setlocale (LC_ALL, "") == NULL)
meta_warning ("Locale not understood by C library, internationalization will not work\n"); meta_warning ("Locale not understood by C library, internationalization will not work\n");

View File

@ -102,6 +102,7 @@ static gboolean gnome_animations = TRUE;
static char *cursor_theme = NULL; static char *cursor_theme = NULL;
static int cursor_size = 24; static int cursor_size = 24;
static gboolean compositing_manager = FALSE; static gboolean compositing_manager = FALSE;
static gboolean resize_with_right_button = FALSE;
static MetaVisualBellType visual_bell_type = META_VISUAL_BELL_FULLSCREEN_FLASH; static MetaVisualBellType visual_bell_type = META_VISUAL_BELL_FULLSCREEN_FLASH;
static MetaButtonLayout button_layout; static MetaButtonLayout button_layout;
@ -421,6 +422,11 @@ static MetaBoolPreference preferences_bool[] =
&compositing_manager, &compositing_manager,
FALSE, FALSE,
}, },
{ "/apps/metacity/general/resize_with_right_button",
META_PREF_RESIZE_WITH_RIGHT_BUTTON,
&resize_with_right_button,
FALSE,
},
#ifdef WITH_CLUTTER #ifdef WITH_CLUTTER
{ "/apps/metacity/general/clutter_disabled", { "/apps/metacity/general/clutter_disabled",
META_PREF_CLUTTER_DISABLED, META_PREF_CLUTTER_DISABLED,
@ -1395,6 +1401,8 @@ theme_name_handler (MetaPreference pref,
const gchar *string_value, const gchar *string_value,
gboolean *inform_listeners) gboolean *inform_listeners)
{ {
g_free (current_theme);
/* Fallback crackrock */ /* Fallback crackrock */
if (string_value == NULL) if (string_value == NULL)
current_theme = g_strdup ("Atlanta"); current_theme = g_strdup ("Atlanta");
@ -1808,6 +1816,9 @@ meta_preference_to_string (MetaPreference pref)
case META_PREF_COMPOSITING_MANAGER: case META_PREF_COMPOSITING_MANAGER:
return "COMPOSITING_MANAGER"; return "COMPOSITING_MANAGER";
case META_PREF_RESIZE_WITH_RIGHT_BUTTON:
return "RESIZE_WITH_RIGHT_BUTTON";
#ifdef WITH_CLUTTER #ifdef WITH_CLUTTER
case META_PREF_CLUTTER_DISABLED: case META_PREF_CLUTTER_DISABLED:
return "CLUTTER_DISABLED"; return "CLUTTER_DISABLED";
@ -2792,6 +2803,18 @@ meta_prefs_get_compositing_manager (void)
return compositing_manager; return compositing_manager;
} }
guint
meta_prefs_get_mouse_button_resize (void)
{
return resize_with_right_button ? 3: 2;
}
guint
meta_prefs_get_mouse_button_menu (void)
{
return resize_with_right_button ? 2: 3;
}
void void
meta_prefs_set_compositing_manager (gboolean whether) meta_prefs_set_compositing_manager (gboolean whether)
{ {

View File

@ -623,4 +623,7 @@ void meta_window_unset_demands_attention (MetaWindow *window);
void meta_window_update_icon_now (MetaWindow *window); void meta_window_update_icon_now (MetaWindow *window);
void meta_window_update_role (MetaWindow *window);
void meta_window_update_net_wm_type (MetaWindow *window);
#endif #endif

View File

@ -9,13 +9,15 @@
* Note that all the meta_window_reload_propert* functions require a * Note that all the meta_window_reload_propert* functions require a
* round trip to the server. * round trip to the server.
* *
* \bug Not all the properties have moved over from their original * The guts of this system are in meta_display_init_window_prop_hooks().
* handler in window.c yet. * Reading this function will give you insight into how this all fits
* together.
*/ */
/* /*
* Copyright (C) 2001, 2002, 2003 Red Hat, Inc. * Copyright (C) 2001, 2002, 2003 Red Hat, Inc.
* Copyright (C) 2004, 2005 Elijah Newren * Copyright (C) 2004, 2005 Elijah Newren
* Copyright (C) 2009 Thomas Thurman
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
@ -50,59 +52,64 @@
#define HOST_NAME_MAX 255 #define HOST_NAME_MAX 255
#endif #endif
typedef void (* InitValueFunc) (MetaDisplay *display,
Atom property,
MetaPropValue *value);
typedef void (* ReloadValueFunc) (MetaWindow *window, typedef void (* ReloadValueFunc) (MetaWindow *window,
MetaPropValue *value); MetaPropValue *value,
gboolean initial);
struct _MetaWindowPropHooks typedef struct MetaWindowPropHooks
{ {
Atom property; Atom property;
InitValueFunc init_func; MetaPropValueType type;
ReloadValueFunc reload_func; ReloadValueFunc reload_func;
}; } MetaWindowPropHooks;
static void init_prop_value (MetaDisplay *display, static void init_prop_value (MetaDisplay *display,
Atom property, Atom property,
MetaPropValue *value); MetaPropValue *value);
static void reload_prop_value (MetaWindow *window, static void reload_prop_value (MetaWindow *window,
MetaPropValue *value); MetaPropValue *value,
gboolean initial);
static MetaWindowPropHooks* find_hooks (MetaDisplay *display, static MetaWindowPropHooks* find_hooks (MetaDisplay *display,
Atom property); Atom property);
void void
meta_window_reload_property (MetaWindow *window, meta_window_reload_property (MetaWindow *window,
Atom property) Atom property,
gboolean initial)
{ {
meta_window_reload_properties (window, &property, 1); meta_window_reload_properties (window, &property, 1, initial);
} }
void void
meta_window_reload_properties (MetaWindow *window, meta_window_reload_properties (MetaWindow *window,
const Atom *properties, const Atom *properties,
int n_properties) int n_properties,
gboolean initial)
{ {
meta_window_reload_properties_from_xwindow (window, meta_window_reload_properties_from_xwindow (window,
window->xwindow, window->xwindow,
properties, properties,
n_properties); n_properties,
initial);
} }
void void
meta_window_reload_property_from_xwindow (MetaWindow *window, meta_window_reload_property_from_xwindow (MetaWindow *window,
Window xwindow, Window xwindow,
Atom property) Atom property,
gboolean initial)
{ {
meta_window_reload_properties_from_xwindow (window, xwindow, &property, 1); meta_window_reload_properties_from_xwindow (window, xwindow, &property, 1,
initial);
} }
void void
meta_window_reload_properties_from_xwindow (MetaWindow *window, meta_window_reload_properties_from_xwindow (MetaWindow *window,
Window xwindow, Window xwindow,
const Atom *properties, const Atom *properties,
int n_properties) int n_properties,
gboolean initial)
{ {
int i; int i;
MetaPropValue *values; MetaPropValue *values;
@ -125,7 +132,7 @@ meta_window_reload_properties_from_xwindow (MetaWindow *window,
i = 0; i = 0;
while (i < n_properties) while (i < n_properties)
{ {
reload_prop_value (window, &values[i]); reload_prop_value (window, &values[i], initial);
++i; ++i;
} }
@ -141,39 +148,35 @@ init_prop_value (MetaDisplay *display,
Atom property, Atom property,
MetaPropValue *value) MetaPropValue *value)
{ {
MetaWindowPropHooks *hooks; MetaWindowPropHooks *hooks = find_hooks (display, property);
if (!hooks || hooks->type == META_PROP_VALUE_INVALID)
{
value->type = META_PROP_VALUE_INVALID; value->type = META_PROP_VALUE_INVALID;
value->atom = None; value->atom = None;
}
hooks = find_hooks (display, property); else
if (hooks && hooks->init_func != NULL) {
(* hooks->init_func) (display, property, value); value->type = hooks->type;
value->atom = property;
}
} }
static void static void
reload_prop_value (MetaWindow *window, reload_prop_value (MetaWindow *window,
MetaPropValue *value) MetaPropValue *value,
gboolean initial)
{ {
MetaWindowPropHooks *hooks; MetaWindowPropHooks *hooks = find_hooks (window->display, value->atom);
hooks = find_hooks (window->display, value->atom);
if (hooks && hooks->reload_func != NULL) if (hooks && hooks->reload_func != NULL)
(* hooks->reload_func) (window, value); (* hooks->reload_func) (window, value, initial);
}
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 static void
reload_wm_client_machine (MetaWindow *window, reload_wm_client_machine (MetaWindow *window,
MetaPropValue *value) MetaPropValue *value,
gboolean initial)
{ {
g_free (window->wm_client_machine); g_free (window->wm_client_machine);
window->wm_client_machine = NULL; window->wm_client_machine = NULL;
@ -186,17 +189,68 @@ reload_wm_client_machine (MetaWindow *window,
} }
static void static void
init_net_wm_pid (MetaDisplay *display, complain_about_broken_client (MetaWindow *window,
Atom property, MetaPropValue *value,
MetaPropValue *value) gboolean initial)
{ {
value->type = META_PROP_VALUE_CARDINAL; meta_warning ("Broken client! Window %s changed client leader window or SM client ID\n",
value->atom = display->atom__NET_WM_PID; window->desc);
}
static void
reload_net_wm_window_type (MetaWindow *window,
MetaPropValue *value,
gboolean initial)
{
meta_window_update_net_wm_type (window);
}
static void
reload_icon (MetaWindow *window,
Atom atom)
{
meta_icon_cache_property_changed (&window->icon_cache,
window->display,
atom);
meta_window_queue(window, META_QUEUE_UPDATE_ICON);
}
static void
reload_net_wm_icon (MetaWindow *window,
MetaPropValue *value,
gboolean initial)
{
reload_icon (window, window->display->atom__NET_WM_ICON);
}
static void
reload_kwm_win_icon (MetaWindow *window,
MetaPropValue *value,
gboolean initial)
{
reload_icon (window, window->display->atom__KWM_WIN_ICON);
}
static void
reload_struts (MetaWindow *window,
MetaPropValue *value,
gboolean initial)
{
meta_window_update_struts (window);
}
static void
reload_wm_window_role (MetaWindow *window,
MetaPropValue *value,
gboolean initial)
{
meta_window_update_role (window);
} }
static void static void
reload_net_wm_pid (MetaWindow *window, reload_net_wm_pid (MetaWindow *window,
MetaPropValue *value) MetaPropValue *value,
gboolean initial)
{ {
if (value->type != META_PROP_VALUE_INVALID) if (value->type != META_PROP_VALUE_INVALID)
{ {
@ -214,18 +268,10 @@ reload_net_wm_pid (MetaWindow *window,
} }
} }
static void
init_net_wm_user_time (MetaDisplay *display,
Atom property,
MetaPropValue *value)
{
value->type = META_PROP_VALUE_CARDINAL;
value->atom = display->atom__NET_WM_USER_TIME;
}
static void static void
reload_net_wm_user_time (MetaWindow *window, reload_net_wm_user_time (MetaWindow *window,
MetaPropValue *value) MetaPropValue *value,
gboolean initial)
{ {
if (value->type != META_PROP_VALUE_INVALID) if (value->type != META_PROP_VALUE_INVALID)
{ {
@ -234,18 +280,10 @@ reload_net_wm_user_time (MetaWindow *window,
} }
} }
static void
init_net_wm_user_time_window (MetaDisplay *display,
Atom property,
MetaPropValue *value)
{
value->type = META_PROP_VALUE_WINDOW;
value->atom = display->atom__NET_WM_USER_TIME_WINDOW;
}
static void static void
reload_net_wm_user_time_window (MetaWindow *window, reload_net_wm_user_time_window (MetaWindow *window,
MetaPropValue *value) MetaPropValue *value,
gboolean initial)
{ {
if (value->type != META_PROP_VALUE_INVALID) if (value->type != META_PROP_VALUE_INVALID)
{ {
@ -293,7 +331,8 @@ reload_net_wm_user_time_window (MetaWindow *window,
meta_window_reload_property_from_xwindow ( meta_window_reload_property_from_xwindow (
window, window,
window->user_time_window, window->user_time_window,
window->display->atom__NET_WM_USER_TIME); window->display->atom__NET_WM_USER_TIME,
initial);
} }
} }
} }
@ -388,18 +427,10 @@ set_window_title (MetaWindow *window,
g_object_notify (G_OBJECT (window), "title"); g_object_notify (G_OBJECT (window), "title");
} }
static void
init_net_wm_name (MetaDisplay *display,
Atom property,
MetaPropValue *value)
{
value->type = META_PROP_VALUE_UTF8;
value->atom = display->atom__NET_WM_NAME;
}
static void static void
reload_net_wm_name (MetaWindow *window, reload_net_wm_name (MetaWindow *window,
MetaPropValue *value) MetaPropValue *value,
gboolean initial)
{ {
if (value->type != META_PROP_VALUE_INVALID) if (value->type != META_PROP_VALUE_INVALID)
{ {
@ -413,22 +444,15 @@ reload_net_wm_name (MetaWindow *window,
{ {
set_window_title (window, NULL); set_window_title (window, NULL);
window->using_net_wm_name = FALSE; window->using_net_wm_name = FALSE;
if (!initial)
meta_window_reload_property (window, XA_WM_NAME, FALSE);
} }
} }
static void
init_wm_name (MetaDisplay *display,
Atom property,
MetaPropValue *value)
{
value->type = META_PROP_VALUE_TEXT_PROPERTY;
value->atom = XA_WM_NAME;
}
static void static void
reload_wm_name (MetaWindow *window, reload_wm_name (MetaWindow *window,
MetaPropValue *value) MetaPropValue *value,
gboolean initial)
{ {
if (window->using_net_wm_name) if (window->using_net_wm_name)
{ {
@ -463,18 +487,10 @@ set_icon_title (MetaWindow *window,
window->using_net_wm_visible_icon_name = modified; window->using_net_wm_visible_icon_name = modified;
} }
static void
init_net_wm_icon_name (MetaDisplay *display,
Atom property,
MetaPropValue *value)
{
value->type = META_PROP_VALUE_UTF8;
value->atom = display->atom__NET_WM_ICON_NAME;
}
static void static void
reload_net_wm_icon_name (MetaWindow *window, reload_net_wm_icon_name (MetaWindow *window,
MetaPropValue *value) MetaPropValue *value,
gboolean initial)
{ {
if (value->type != META_PROP_VALUE_INVALID) if (value->type != META_PROP_VALUE_INVALID)
{ {
@ -488,22 +504,15 @@ reload_net_wm_icon_name (MetaWindow *window,
{ {
set_icon_title (window, NULL); set_icon_title (window, NULL);
window->using_net_wm_icon_name = FALSE; window->using_net_wm_icon_name = FALSE;
if (!initial)
meta_window_reload_property (window, XA_WM_ICON_NAME, FALSE);
} }
} }
static void
init_wm_icon_name (MetaDisplay *display,
Atom property,
MetaPropValue *value)
{
value->type = META_PROP_VALUE_TEXT_PROPERTY;
value->atom = XA_WM_ICON_NAME;
}
static void static void
reload_wm_icon_name (MetaWindow *window, reload_wm_icon_name (MetaWindow *window,
MetaPropValue *value) MetaPropValue *value,
gboolean initial)
{ {
if (window->using_net_wm_icon_name) if (window->using_net_wm_icon_name)
{ {
@ -525,18 +534,10 @@ reload_wm_icon_name (MetaWindow *window,
} }
} }
static void
init_net_wm_state (MetaDisplay *display,
Atom property,
MetaPropValue *value)
{
value->type = META_PROP_VALUE_ATOM_LIST;
value->atom = display->atom__NET_WM_STATE;
}
static void static void
reload_net_wm_state (MetaWindow *window, reload_net_wm_state (MetaWindow *window,
MetaPropValue *value) MetaPropValue *value,
gboolean initial)
{ {
int i; int i;
@ -544,6 +545,13 @@ reload_net_wm_state (MetaWindow *window,
* clients don't change the property. * clients don't change the property.
*/ */
if (!initial) {
/* no, they DON'T change the property */
meta_verbose ("Ignoring _NET_WM_STATE: we should be the one who set "
"the property in the first place\n");
return;
}
window->shaded = FALSE; window->shaded = FALSE;
window->maximized_horizontally = FALSE; window->maximized_horizontally = FALSE;
window->maximized_vertically = FALSE; window->maximized_vertically = FALSE;
@ -594,18 +602,10 @@ reload_net_wm_state (MetaWindow *window,
meta_window_recalc_window_type (window); meta_window_recalc_window_type (window);
} }
static void
init_mwm_hints (MetaDisplay *display,
Atom property,
MetaPropValue *value)
{
value->type = META_PROP_VALUE_MOTIF_HINTS;
value->atom = display->atom__MOTIF_WM_HINTS;
}
static void static void
reload_mwm_hints (MetaWindow *window, reload_mwm_hints (MetaWindow *window,
MetaPropValue *value) MetaPropValue *value,
gboolean initial)
{ {
MotifWmHints *hints; MotifWmHints *hints;
gboolean old_decorated = window->decorated; gboolean old_decorated = window->decorated;
@ -731,18 +731,10 @@ reload_mwm_hints (MetaWindow *window,
} }
} }
static void
init_wm_class (MetaDisplay *display,
Atom property,
MetaPropValue *value)
{
value->type = META_PROP_VALUE_CLASS_HINT;
value->atom = XA_WM_CLASS;
}
static void static void
reload_wm_class (MetaWindow *window, reload_wm_class (MetaWindow *window,
MetaPropValue *value) MetaPropValue *value,
gboolean initial)
{ {
if (window->res_class) if (window->res_class)
g_free (window->res_class); g_free (window->res_class);
@ -767,18 +759,10 @@ reload_wm_class (MetaWindow *window,
window->res_name ? window->res_name : "none"); window->res_name ? window->res_name : "none");
} }
static void
init_net_wm_desktop (MetaDisplay *display,
Atom property,
MetaPropValue *value)
{
value->type = META_PROP_VALUE_CARDINAL;
value->atom = display->atom__NET_WM_DESKTOP;
}
static void static void
reload_net_wm_desktop (MetaWindow *window, reload_net_wm_desktop (MetaWindow *window,
MetaPropValue *value) MetaPropValue *value,
gboolean initial)
{ {
if (value->type != META_PROP_VALUE_INVALID) if (value->type != META_PROP_VALUE_INVALID)
{ {
@ -790,18 +774,10 @@ reload_net_wm_desktop (MetaWindow *window,
} }
} }
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 static void
reload_net_startup_id (MetaWindow *window, reload_net_startup_id (MetaWindow *window,
MetaPropValue *value) MetaPropValue *value,
gboolean initial)
{ {
guint32 timestamp = window->net_wm_user_time; guint32 timestamp = window->net_wm_user_time;
MetaWorkspace *workspace = NULL; MetaWorkspace *workspace = NULL;
@ -836,18 +812,10 @@ reload_net_startup_id (MetaWindow *window,
window->desc); window->desc);
} }
static void
init_update_counter (MetaDisplay *display,
Atom property,
MetaPropValue *value)
{
value->type = META_PROP_VALUE_SYNC_COUNTER;
value->atom = display->atom__NET_WM_SYNC_REQUEST_COUNTER;
}
static void static void
reload_update_counter (MetaWindow *window, reload_update_counter (MetaWindow *window,
MetaPropValue *value) MetaPropValue *value,
gboolean initial)
{ {
if (value->type != META_PROP_VALUE_INVALID) if (value->type != META_PROP_VALUE_INVALID)
{ {
@ -861,17 +829,6 @@ reload_update_counter (MetaWindow *window,
} }
} }
static void
init_normal_hints (MetaDisplay *display,
Atom property,
MetaPropValue *value)
{
value->type = META_PROP_VALUE_SIZE_HINTS;
value->atom = XA_WM_NORMAL_HINTS;
}
#define FLAG_TOGGLED_ON(old,new,flag) \ #define FLAG_TOGGLED_ON(old,new,flag) \
(((old)->flags & (flag)) == 0 && \ (((old)->flags & (flag)) == 0 && \
((new)->flags & (flag)) != 0) ((new)->flags & (flag)) != 0)
@ -1276,7 +1233,8 @@ meta_set_normal_hints (MetaWindow *window,
static void static void
reload_normal_hints (MetaWindow *window, reload_normal_hints (MetaWindow *window,
MetaPropValue *value) MetaPropValue *value,
gboolean initial)
{ {
if (value->type != META_PROP_VALUE_INVALID) if (value->type != META_PROP_VALUE_INVALID)
{ {
@ -1291,22 +1249,16 @@ reload_normal_hints (MetaWindow *window,
spew_size_hints_differences (&old_hints, &window->size_hints); spew_size_hints_differences (&old_hints, &window->size_hints);
meta_window_recalc_features (window); meta_window_recalc_features (window);
if (!initial)
meta_window_queue(window, META_QUEUE_MOVE_RESIZE);
} }
} }
static void
init_wm_protocols (MetaDisplay *display,
Atom property,
MetaPropValue *value)
{
value->type = META_PROP_VALUE_ATOM_LIST;
value->atom = display->atom_WM_PROTOCOLS;
}
static void static void
reload_wm_protocols (MetaWindow *window, reload_wm_protocols (MetaWindow *window,
MetaPropValue *value) MetaPropValue *value,
gboolean initial)
{ {
int i; int i;
@ -1337,18 +1289,10 @@ reload_wm_protocols (MetaWindow *window,
window->desc); window->desc);
} }
static void
init_wm_hints (MetaDisplay *display,
Atom property,
MetaPropValue *value)
{
value->type = META_PROP_VALUE_WM_HINTS;
value->atom = XA_WM_HINTS;
}
static void static void
reload_wm_hints (MetaWindow *window, reload_wm_hints (MetaWindow *window,
MetaPropValue *value) MetaPropValue *value,
gboolean initial)
{ {
Window old_group_leader; Window old_group_leader;
@ -1402,18 +1346,10 @@ reload_wm_hints (MetaWindow *window,
meta_window_queue (window, META_QUEUE_UPDATE_ICON | META_QUEUE_MOVE_RESIZE); meta_window_queue (window, META_QUEUE_UPDATE_ICON | META_QUEUE_MOVE_RESIZE);
} }
static void
init_transient_for (MetaDisplay *display,
Atom property,
MetaPropValue *value)
{
value->type = META_PROP_VALUE_WINDOW;
value->atom = XA_WM_TRANSIENT_FOR;
}
static void static void
reload_transient_for (MetaWindow *window, reload_transient_for (MetaWindow *window,
MetaPropValue *value) MetaPropValue *value,
gboolean initial)
{ {
window->xtransient_for = None; window->xtransient_for = None;
@ -1459,184 +1395,90 @@ reload_transient_for (MetaWindow *window,
meta_window_queue (window, META_QUEUE_MOVE_RESIZE); meta_window_queue (window, META_QUEUE_MOVE_RESIZE);
} }
#define N_HOOKS 26 /**
* Initialises the property hooks system. Each row in the table named "hooks"
* represents an action to take when a property is found on a newly-created
* window, or when a property changes its value.
*
* The first column shows which atom the row concerns.
* The second gives the type of the property data. The property will be
* queried for its new value, unless the type is given as
* META_PROP_VALUE_INVALID, in which case nothing will be queried.
* The third column gives the name of a callback which gets called with the
* new value. (If the new value was not retrieved because the second column
* was META_PROP_VALUE_INVALID, the callback still gets called anyway.)
* This value may be NULL, in which case no callback will be called.
*/
void void
meta_display_init_window_prop_hooks (MetaDisplay *display) meta_display_init_window_prop_hooks (MetaDisplay *display)
{ {
int i; MetaWindowPropHooks hooks[] = {
MetaWindowPropHooks *hooks; { display->atom_WM_STATE, META_PROP_VALUE_INVALID, NULL },
{ display->atom_WM_CLIENT_MACHINE, META_PROP_VALUE_STRING, reload_wm_client_machine },
{ display->atom__NET_WM_PID, META_PROP_VALUE_CARDINAL, reload_net_wm_pid },
{ display->atom__NET_WM_USER_TIME, META_PROP_VALUE_CARDINAL, reload_net_wm_user_time },
{ display->atom__NET_WM_NAME, META_PROP_VALUE_UTF8, reload_net_wm_name },
{ XA_WM_NAME, META_PROP_VALUE_TEXT_PROPERTY, reload_wm_name },
{ display->atom__NET_WM_ICON, META_PROP_VALUE_INVALID, reload_net_wm_icon },
{ display->atom__KWM_WIN_ICON, META_PROP_VALUE_INVALID, reload_kwm_win_icon },
{ display->atom__NET_WM_ICON_NAME, META_PROP_VALUE_UTF8, reload_net_wm_icon_name },
{ XA_WM_ICON_NAME, META_PROP_VALUE_TEXT_PROPERTY, reload_wm_icon_name },
{ display->atom__NET_WM_STATE, META_PROP_VALUE_ATOM_LIST, reload_net_wm_state },
{ display->atom__MOTIF_WM_HINTS, META_PROP_VALUE_MOTIF_HINTS, reload_mwm_hints },
{ display->atom__NET_WM_ICON_GEOMETRY, META_PROP_VALUE_INVALID, NULL },
{ XA_WM_CLASS, META_PROP_VALUE_CLASS_HINT, reload_wm_class },
{ display->atom_WM_CLIENT_LEADER, META_PROP_VALUE_INVALID, complain_about_broken_client },
{ display->atom_SM_CLIENT_ID, META_PROP_VALUE_INVALID, complain_about_broken_client },
{ display->atom_WM_WINDOW_ROLE, META_PROP_VALUE_INVALID, reload_wm_window_role },
{ display->atom__NET_WM_WINDOW_TYPE, META_PROP_VALUE_INVALID, reload_net_wm_window_type },
{ display->atom__NET_WM_DESKTOP, META_PROP_VALUE_CARDINAL, reload_net_wm_desktop },
{ display->atom__NET_WM_STRUT, META_PROP_VALUE_INVALID, reload_struts },
{ display->atom__NET_WM_STRUT_PARTIAL, META_PROP_VALUE_INVALID, reload_struts },
{ display->atom__NET_STARTUP_ID, META_PROP_VALUE_UTF8, reload_net_startup_id },
{ display->atom__NET_WM_SYNC_REQUEST_COUNTER, META_PROP_VALUE_SYNC_COUNTER, reload_update_counter },
{ XA_WM_NORMAL_HINTS, META_PROP_VALUE_SIZE_HINTS, reload_normal_hints },
{ display->atom_WM_PROTOCOLS, META_PROP_VALUE_ATOM_LIST, reload_wm_protocols },
{ XA_WM_HINTS, META_PROP_VALUE_WM_HINTS, reload_wm_hints },
{ XA_WM_TRANSIENT_FOR, META_PROP_VALUE_WINDOW, reload_transient_for },
{ display->atom__NET_WM_USER_TIME_WINDOW, META_PROP_VALUE_WINDOW, reload_net_wm_user_time_window },
{ 0 },
};
MetaWindowPropHooks *table = g_memdup (hooks, sizeof (hooks)),
*cursor = table;
g_assert (display->prop_hooks == NULL); g_assert (display->prop_hooks == NULL);
display->prop_hooks = g_new0 (MetaWindowPropHooks, N_HOOKS); display->prop_hooks_table = (gpointer) table;
hooks = display->prop_hooks; display->prop_hooks = g_hash_table_new (NULL, NULL);
i = 0; while (cursor->property)
hooks[i].property = display->atom_WM_STATE;
hooks[i].init_func = NULL;
hooks[i].reload_func = NULL;
++i;
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 = init_net_wm_pid;
hooks[i].reload_func = reload_net_wm_pid;
++i;
hooks[i].property = display->atom__NET_WM_USER_TIME;
hooks[i].init_func = init_net_wm_user_time;
hooks[i].reload_func = reload_net_wm_user_time;
++i;
hooks[i].property = display->atom__NET_WM_NAME;
hooks[i].init_func = init_net_wm_name;
hooks[i].reload_func = reload_net_wm_name;
++i;
hooks[i].property = XA_WM_NAME;
hooks[i].init_func = init_wm_name;
hooks[i].reload_func = reload_wm_name;
++i;
hooks[i].property = display->atom__NET_WM_ICON_NAME;
hooks[i].init_func = init_net_wm_icon_name;
hooks[i].reload_func = reload_net_wm_icon_name;
++i;
hooks[i].property = XA_WM_ICON_NAME;
hooks[i].init_func = init_wm_icon_name;
hooks[i].reload_func = reload_wm_icon_name;
++i;
hooks[i].property = display->atom__NET_WM_STATE;
hooks[i].init_func = init_net_wm_state;
hooks[i].reload_func = reload_net_wm_state;
++i;
hooks[i].property = display->atom__MOTIF_WM_HINTS;
hooks[i].init_func = init_mwm_hints;
hooks[i].reload_func = reload_mwm_hints;
++i;
hooks[i].property = display->atom__NET_WM_ICON_GEOMETRY;
hooks[i].init_func = NULL;
hooks[i].reload_func = NULL;
++i;
hooks[i].property = XA_WM_CLASS;
hooks[i].init_func = init_wm_class;
hooks[i].reload_func = reload_wm_class;
++i;
hooks[i].property = display->atom_WM_CLIENT_LEADER;
hooks[i].init_func = NULL;
hooks[i].reload_func = NULL;
++i;
hooks[i].property = display->atom_SM_CLIENT_ID;
hooks[i].init_func = NULL;
hooks[i].reload_func = NULL;
++i;
hooks[i].property = display->atom_WM_WINDOW_ROLE;
hooks[i].init_func = NULL;
hooks[i].reload_func = NULL;
++i;
hooks[i].property = display->atom__NET_WM_WINDOW_TYPE;
hooks[i].init_func = NULL;
hooks[i].reload_func = NULL;
++i;
hooks[i].property = display->atom__NET_WM_DESKTOP;
hooks[i].init_func = init_net_wm_desktop;
hooks[i].reload_func = reload_net_wm_desktop;
++i;
hooks[i].property = display->atom__NET_WM_STRUT;
hooks[i].init_func = NULL;
hooks[i].reload_func = NULL;
++i;
hooks[i].property = display->atom__NET_WM_STRUT_PARTIAL;
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;
hooks[i].property = display->atom__NET_WM_SYNC_REQUEST_COUNTER;
hooks[i].init_func = init_update_counter;
hooks[i].reload_func = reload_update_counter;
++i;
hooks[i].property = XA_WM_NORMAL_HINTS;
hooks[i].init_func = init_normal_hints;
hooks[i].reload_func = reload_normal_hints;
++i;
hooks[i].property = display->atom_WM_PROTOCOLS;
hooks[i].init_func = init_wm_protocols;
hooks[i].reload_func = reload_wm_protocols;
++i;
hooks[i].property = XA_WM_HINTS;
hooks[i].init_func = init_wm_hints;
hooks[i].reload_func = reload_wm_hints;
++i;
hooks[i].property = XA_WM_TRANSIENT_FOR;
hooks[i].init_func = init_transient_for;
hooks[i].reload_func = reload_transient_for;
++i;
hooks[i].property = display->atom__NET_WM_USER_TIME_WINDOW;
hooks[i].init_func = init_net_wm_user_time_window;
hooks[i].reload_func = reload_net_wm_user_time_window;
++i;
if (i != N_HOOKS)
{ {
g_error ("Initialized %d hooks should have been %d\n", i, N_HOOKS); /* Atoms are safe to use with GINT_TO_POINTER because it's safe with
* anything 32 bits or less, and atoms are 32 bits with the top three
* bits clear. (Scheifler & Gettys, 2e, p372)
*/
g_hash_table_insert (display->prop_hooks,
GINT_TO_POINTER (cursor->property),
cursor);
cursor++;
} }
} }
void void
meta_display_free_window_prop_hooks (MetaDisplay *display) meta_display_free_window_prop_hooks (MetaDisplay *display)
{ {
g_assert (display->prop_hooks != NULL); g_hash_table_unref (display->prop_hooks);
g_free (display->prop_hooks);
display->prop_hooks = NULL; display->prop_hooks = NULL;
g_free (display->prop_hooks_table);
display->prop_hooks_table = NULL;
} }
static MetaWindowPropHooks* static MetaWindowPropHooks*
find_hooks (MetaDisplay *display, find_hooks (MetaDisplay *display,
Atom property) Atom property)
{ {
int i; return g_hash_table_lookup (display->prop_hooks,
GINT_TO_POINTER (property));
/* FIXME we could sort the array and do binary search or
* something
*/
i = 0;
while (i < N_HOOKS)
{
if (display->prop_hooks[i].property == property)
return &display->prop_hooks[i];
++i;
}
return NULL;
} }

View File

@ -43,7 +43,8 @@
* \param property A single X atom. * \param property A single X atom.
*/ */
void meta_window_reload_property (MetaWindow *window, void meta_window_reload_property (MetaWindow *window,
Atom property); Atom property,
gboolean initial);
/** /**
@ -57,7 +58,8 @@ void meta_window_reload_property (MetaWindow *window,
*/ */
void meta_window_reload_properties (MetaWindow *window, void meta_window_reload_properties (MetaWindow *window,
const Atom *properties, const Atom *properties,
int n_properties); int n_properties,
gboolean initial);
/** /**
* Requests the current values of a single property for a given * Requests the current values of a single property for a given
@ -72,7 +74,8 @@ void meta_window_reload_properties (MetaWindow *window,
void meta_window_reload_property_from_xwindow void meta_window_reload_property_from_xwindow
(MetaWindow *window, (MetaWindow *window,
Window xwindow, Window xwindow,
Atom property); Atom property,
gboolean initial);
/** /**
* Requests the current values of a set of properties for a given * Requests the current values of a set of properties for a given
@ -89,7 +92,8 @@ void meta_window_reload_properties_from_xwindow
(MetaWindow *window, (MetaWindow *window,
Window xwindow, Window xwindow,
const Atom *properties, const Atom *properties,
int n_properties); int n_properties,
gboolean initial);
/** /**
* Initialises the hooks used for the reload_propert* functions * Initialises the hooks used for the reload_propert* functions

View File

@ -61,8 +61,6 @@ static int destroying_windows_disallowed = 0;
static void update_sm_hints (MetaWindow *window); static void update_sm_hints (MetaWindow *window);
static void update_role (MetaWindow *window);
static void update_net_wm_type (MetaWindow *window);
static void update_net_frame_extents (MetaWindow *window); static void update_net_frame_extents (MetaWindow *window);
static void recalc_window_type (MetaWindow *window); static void recalc_window_type (MetaWindow *window);
static void recalc_window_features (MetaWindow *window); static void recalc_window_features (MetaWindow *window);
@ -795,12 +793,14 @@ meta_window_new_with_attrs (MetaDisplay *display,
initial_props[i++] = display->atom__NET_WM_FULLSCREEN_MONITORS; initial_props[i++] = display->atom__NET_WM_FULLSCREEN_MONITORS;
g_assert (N_INITIAL_PROPS == i); g_assert (N_INITIAL_PROPS == i);
meta_window_reload_properties (window, initial_props, N_INITIAL_PROPS); meta_window_reload_properties (window, initial_props, N_INITIAL_PROPS, TRUE);
if (!window->override_redirect) if (!window->override_redirect)
update_sm_hints (window); /* must come after transient_for */ update_sm_hints (window); /* must come after transient_for */
update_role (window);
update_net_wm_type (window); meta_window_update_role (window);
meta_window_update_net_wm_type (window);
if (!window->override_redirect) if (!window->override_redirect)
meta_window_update_icon_now (window); meta_window_update_icon_now (window);
@ -3269,8 +3269,23 @@ window_activate (MetaWindow *window,
/* Get window on current or given workspace */ /* Get window on current or given workspace */
if (workspace == NULL) if (workspace == NULL)
workspace = window->screen->active_workspace; workspace = window->screen->active_workspace;
if (!meta_window_located_on_workspace (window, workspace))
/* For non-transient windows, we just set up a pulsing indicator,
rather than move windows or workspaces.
See http://bugzilla.gnome.org/show_bug.cgi?id=482354 */
if (window->xtransient_for == None &&
!meta_window_located_on_workspace (window, workspace))
{
meta_window_set_demands_attention (window);
/* We've marked it as demanding, don't need to do anything else. */
return;
}
else if (window->xtransient_for != None)
{
/* Move transients to current workspace - preference dialogs should appear over
the source window. */
meta_window_change_workspace (window, workspace); meta_window_change_workspace (window, workspace);
}
if (window->shaded) if (window->shaded)
meta_window_unshade (window, timestamp); meta_window_unshade (window, timestamp);
@ -5135,6 +5150,7 @@ meta_window_change_workspace_by_index (MetaWindow *window,
#define _NET_WM_MOVERESIZE_MOVE 8 #define _NET_WM_MOVERESIZE_MOVE 8
#define _NET_WM_MOVERESIZE_SIZE_KEYBOARD 9 #define _NET_WM_MOVERESIZE_SIZE_KEYBOARD 9
#define _NET_WM_MOVERESIZE_MOVE_KEYBOARD 10 #define _NET_WM_MOVERESIZE_MOVE_KEYBOARD 10
#define _NET_WM_MOVERESIZE_CANCEL 11
gboolean gboolean
meta_window_client_message (MetaWindow *window, meta_window_client_message (MetaWindow *window,
@ -5467,11 +5483,18 @@ meta_window_client_message (MetaWindow *window,
case _NET_WM_MOVERESIZE_MOVE_KEYBOARD: case _NET_WM_MOVERESIZE_MOVE_KEYBOARD:
op = META_GRAB_OP_KEYBOARD_MOVING; op = META_GRAB_OP_KEYBOARD_MOVING;
break; break;
case _NET_WM_MOVERESIZE_CANCEL:
/* handled below */
break;
default: default:
break; break;
} }
if (op != META_GRAB_OP_NONE && if (action == _NET_WM_MOVERESIZE_CANCEL)
{
meta_display_end_grab_op (window->display, timestamp);
}
else if (op != META_GRAB_OP_NONE &&
((window->has_move_func && op == META_GRAB_OP_KEYBOARD_MOVING) || ((window->has_move_func && op == META_GRAB_OP_KEYBOARD_MOVING) ||
(window->has_resize_func && op == META_GRAB_OP_KEYBOARD_RESIZING_UNKNOWN))) (window->has_resize_func && op == META_GRAB_OP_KEYBOARD_RESIZING_UNKNOWN)))
{ {
@ -5799,21 +5822,7 @@ static gboolean
process_property_notify (MetaWindow *window, process_property_notify (MetaWindow *window,
XPropertyEvent *event) XPropertyEvent *event)
{ {
/* First, property notifies to ignore because we shouldn't honor Window xid = window->xwindow;
* new values
*/
if (event->atom == window->display->atom__NET_WM_STATE)
{
meta_verbose ("Property notify on %s for _NET_WM_STATE, ignoring (we should be the one who set the property in the first place)\n",
window->desc);
return TRUE;
}
/* Second, property notifies we want to use.
* FIXME once we move entirely to the window-props.h framework, we
* can just call reload on the property in the event and get rid of
* this if-else chain.
*/
if (meta_is_verbose ()) /* avoid looking up the name if we don't have to */ if (meta_is_verbose ()) /* avoid looking up the name if we don't have to */
{ {
@ -5825,123 +5834,14 @@ process_property_notify (MetaWindow *window,
XFree (property_name); XFree (property_name);
} }
if (event->atom == XA_WM_NAME) if (event->atom == window->display->atom__NET_WM_USER_TIME &&
window->user_time_window)
{ {
/* don't bother reloading WM_NAME if using _NET_WM_NAME already */
if (!window->using_net_wm_name)
meta_window_reload_property (window, XA_WM_NAME);
}
else if (event->atom == window->display->atom__NET_WM_NAME)
{
meta_window_reload_property (window, window->display->atom__NET_WM_NAME);
/* if _NET_WM_NAME was unset, reload WM_NAME */
if (!window->using_net_wm_name)
meta_window_reload_property (window, XA_WM_NAME);
}
else if (event->atom == XA_WM_ICON_NAME)
{
/* don't bother reloading WM_ICON_NAME if using _NET_WM_ICON_NAME already */
if (!window->using_net_wm_icon_name)
meta_window_reload_property (window, XA_WM_ICON_NAME);
}
else if (event->atom == window->display->atom__NET_WM_ICON_NAME)
{
meta_window_reload_property (window, window->display->atom__NET_WM_ICON_NAME);
/* if _NET_WM_ICON_NAME was unset, reload WM_ICON_NAME */
if (!window->using_net_wm_icon_name)
meta_window_reload_property (window, XA_WM_ICON_NAME);
}
else if (event->atom == XA_WM_NORMAL_HINTS)
{
meta_window_reload_property (window, XA_WM_NORMAL_HINTS);
/* See if we need to constrain current size */
meta_window_queue(window, META_QUEUE_MOVE_RESIZE);
}
else if (event->atom == window->display->atom_WM_PROTOCOLS)
{
meta_window_reload_property (window, window->display->atom_WM_PROTOCOLS);
}
else if (event->atom == XA_WM_HINTS)
{
meta_window_reload_property (window, XA_WM_HINTS);
}
else if (event->atom == window->display->atom__MOTIF_WM_HINTS)
{
meta_window_reload_property (window,
window->display->atom__MOTIF_WM_HINTS);
}
else if (event->atom == XA_WM_CLASS)
{
meta_window_reload_property (window, XA_WM_CLASS);
}
else if (event->atom == XA_WM_TRANSIENT_FOR)
{
meta_window_reload_property (window, XA_WM_TRANSIENT_FOR);
}
else if (event->atom ==
window->display->atom_WM_WINDOW_ROLE)
{
update_role (window);
}
else if (event->atom ==
window->display->atom_WM_CLIENT_LEADER ||
event->atom ==
window->display->atom_SM_CLIENT_ID)
{
meta_warning ("Broken client! Window %s changed client leader window or SM client ID\n", window->desc);
}
else if (event->atom ==
window->display->atom__NET_WM_WINDOW_TYPE)
{
update_net_wm_type (window);
}
else if (event->atom == window->display->atom__NET_WM_ICON)
{
meta_icon_cache_property_changed (&window->icon_cache,
window->display,
event->atom);
meta_window_queue(window, META_QUEUE_UPDATE_ICON);
}
else if (event->atom == window->display->atom__KWM_WIN_ICON)
{
meta_icon_cache_property_changed (&window->icon_cache,
window->display,
event->atom);
meta_window_queue(window, META_QUEUE_UPDATE_ICON);
}
else if ((event->atom == window->display->atom__NET_WM_STRUT) ||
(event->atom == window->display->atom__NET_WM_STRUT_PARTIAL))
{
meta_window_update_struts (window);
}
else if (event->atom == window->display->atom__NET_STARTUP_ID)
{
meta_window_reload_property (window,
window->display->atom__NET_STARTUP_ID);
}
else if (event->atom == window->display->atom__NET_WM_SYNC_REQUEST_COUNTER)
{
meta_window_reload_property (window,
window->display->atom__NET_WM_SYNC_REQUEST_COUNTER);
}
else if (event->atom == window->display->atom__NET_WM_USER_TIME)
{
Window xid;
Atom atom__NET_WM_USER_TIME;
atom__NET_WM_USER_TIME = window->display->atom__NET_WM_USER_TIME;
if (window->user_time_window)
xid = window->user_time_window; xid = window->user_time_window;
else
xid = window->xwindow;
meta_window_reload_property_from_xwindow (window,
xid,
atom__NET_WM_USER_TIME);
} }
meta_window_reload_property (window, event->atom, FALSE);
return TRUE; return TRUE;
} }
@ -6130,8 +6030,8 @@ update_sm_hints (MetaWindow *window)
window->sm_client_id ? window->sm_client_id : "none"); window->sm_client_id ? window->sm_client_id : "none");
} }
static void void
update_role (MetaWindow *window) meta_window_update_role (MetaWindow *window)
{ {
char *str; char *str;
@ -6151,8 +6051,8 @@ update_role (MetaWindow *window)
window->desc, window->role ? window->role : "null"); window->desc, window->role ? window->role : "null");
} }
static void void
update_net_wm_type (MetaWindow *window) meta_window_update_net_wm_type (MetaWindow *window)
{ {
int n_atoms; int n_atoms;
Atom *atoms; Atom *atoms;
@ -6217,7 +6117,7 @@ update_net_wm_type (MetaWindow *window)
meta_XFree (str); meta_XFree (str);
} }
recalc_window_type (window); meta_window_recalc_window_type (window);
} }
static void static void

View File

@ -258,14 +258,14 @@ keybind (activate_window_menu, handle_activate_window_menu, 0,
keybind (toggle_fullscreen, handle_toggle_fullscreen, 0, BINDING_PER_WINDOW, keybind (toggle_fullscreen, handle_toggle_fullscreen, 0, BINDING_PER_WINDOW,
NULL, NULL,
_("Toggle fullscreen mode")) _("Toggle fullscreen mode"))
keybind (toggle_maximized, handle_toggle_maximized, 0, BINDING_PER_WINDOW, NULL, keybind (toggle_maximized, handle_toggle_maximized, 0, BINDING_PER_WINDOW, "<Alt>F10",
_("Toggle maximization state")) _("Toggle maximization state"))
keybind (toggle_above, handle_toggle_above, 0, BINDING_PER_WINDOW, NULL, keybind (toggle_above, handle_toggle_above, 0, BINDING_PER_WINDOW, NULL,
_("Toggle whether a window will always be visible over other windows")) _("Toggle whether a window will always be visible over other windows"))
keybind (maximize, handle_maximize, 0, BINDING_PER_WINDOW, "<Alt>F10", keybind (maximize, handle_maximize, 0, BINDING_PER_WINDOW, NULL,
_("Maximize window")) _("Maximize window"))
keybind (unmaximize, handle_unmaximize, 0, BINDING_PER_WINDOW, "<Alt>F5", keybind (unmaximize, handle_unmaximize, 0, BINDING_PER_WINDOW, "<Alt>F5",
_("Unmaximize window")) _("Restore window"))
keybind (toggle_shaded, handle_toggle_shaded, 0, BINDING_PER_WINDOW, NULL, keybind (toggle_shaded, handle_toggle_shaded, 0, BINDING_PER_WINDOW, NULL,
_("Toggle shaded state")) _("Toggle shaded state"))
keybind (minimize, handle_minimize, 0, BINDING_PER_WINDOW, "<Alt>F9", keybind (minimize, handle_minimize, 0, BINDING_PER_WINDOW, "<Alt>F9",
@ -362,7 +362,7 @@ keybind (move_to_corner_ne, handle_move_to_corner_ne, 0,
keybind (move_to_corner_sw, handle_move_to_corner_sw, 0, keybind (move_to_corner_sw, handle_move_to_corner_sw, 0,
BINDING_PER_WINDOW, NULL, BINDING_PER_WINDOW, NULL,
_("Move window to south-west (bottom left) corner")) _("Move window to south-west (bottom left) corner"))
keybind (move_to_corner_nw, handle_move_to_corner_se, 0, keybind (move_to_corner_se, handle_move_to_corner_se, 0,
BINDING_PER_WINDOW, NULL, BINDING_PER_WINDOW, NULL,
_("Move window to south-east (bottom right) corner")) _("Move window to south-east (bottom right) corner"))

View File

@ -59,6 +59,7 @@ typedef enum
META_PREF_CURSOR_THEME, META_PREF_CURSOR_THEME,
META_PREF_CURSOR_SIZE, META_PREF_CURSOR_SIZE,
META_PREF_COMPOSITING_MANAGER, META_PREF_COMPOSITING_MANAGER,
META_PREF_RESIZE_WITH_RIGHT_BUTTON,
#ifdef WITH_CLUTTER #ifdef WITH_CLUTTER
META_PREF_CLUTTER_DISABLED, META_PREF_CLUTTER_DISABLED,
META_PREF_CLUTTER_PLUGINS, META_PREF_CLUTTER_PLUGINS,
@ -79,6 +80,8 @@ void meta_prefs_init (void);
const char* meta_preference_to_string (MetaPreference pref); const char* meta_preference_to_string (MetaPreference pref);
MetaVirtualModifier meta_prefs_get_mouse_button_mods (void); MetaVirtualModifier meta_prefs_get_mouse_button_mods (void);
guint meta_prefs_get_mouse_button_resize (void);
guint meta_prefs_get_mouse_button_menu (void);
MetaFocusMode meta_prefs_get_focus_mode (void); MetaFocusMode meta_prefs_get_focus_mode (void);
MetaFocusNewWindows meta_prefs_get_focus_new_windows (void); MetaFocusNewWindows meta_prefs_get_focus_new_windows (void);
gboolean meta_prefs_get_raise_on_click (void); gboolean meta_prefs_get_raise_on_click (void);

View File

@ -15,12 +15,31 @@
Clicking a window while holding down this modifier key Clicking a window while holding down this modifier key
will move the window (left click), resize the window will move the window (left click), resize the window
(middle click), or show the window menu (right click). (middle click), or show the window menu (right click).
The left and right operations may be swapped
using the "mouse_button_resize" key.
Modifier is expressed as "&lt;Alt&gt;" or "&lt;Super&gt;" Modifier is expressed as "&lt;Alt&gt;" or "&lt;Super&gt;"
for example. for example.
</long> </long>
</locale> </locale>
</schema> </schema>
<schema>
<key>/schemas/apps/metacity/general/resize_with_right_button</key>
<applyto>/apps/metacity/general/resize_with_right_button</applyto>
<owner>metacity</owner>
<type>bool</type>
<default>false</default>
<locale name="C">
<short>Whether to resize with the right button</short>
<long>
Set this to true to resize with the right button and show a menu
with the middle button while holding down the key given in
"mouse_button_modifier"; set it to false to make it work the
opposite way around.
</long>
</locale>
</schema>
<schema> <schema>
<key>/schemas/apps/metacity/general/button_layout</key> <key>/schemas/apps/metacity/general/button_layout</key>
<applyto>/apps/metacity/general/button_layout</applyto> <applyto>/apps/metacity/general/button_layout</applyto>
@ -514,6 +533,38 @@
</locale> </locale>
</schema> </schema>
<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-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-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>
<!-- Schemas below are generated by schema-bindings.c when this file <!-- Schemas below are generated by schema-bindings.c when this file
becomes metacity.schemas.in becomes metacity.schemas.in
--> -->

View File

@ -68,6 +68,9 @@ static gboolean meta_frames_enter_notify_event (GtkWidget *widget,
static gboolean meta_frames_leave_notify_event (GtkWidget *widget, static gboolean meta_frames_leave_notify_event (GtkWidget *widget,
GdkEventCrossing *event); GdkEventCrossing *event);
static void meta_frames_attach_style (MetaFrames *frames,
MetaUIFrame *frame);
static void meta_frames_paint_to_drawable (MetaFrames *frames, static void meta_frames_paint_to_drawable (MetaFrames *frames,
MetaUIFrame *frame, MetaUIFrame *frame,
GdkDrawable *drawable, GdkDrawable *drawable,
@ -420,6 +423,18 @@ meta_frames_button_layout_changed (MetaFrames *frames)
queue_draw_func, frames); queue_draw_func, frames);
} }
static void
reattach_style_func (gpointer key, gpointer value, gpointer data)
{
MetaUIFrame *frame;
MetaFrames *frames;
frames = META_FRAMES (data);
frame = value;
meta_frames_attach_style (frames, frame);
}
static void static void
meta_frames_style_set (GtkWidget *widget, meta_frames_style_set (GtkWidget *widget,
GtkStyle *prev_style) GtkStyle *prev_style)
@ -430,6 +445,9 @@ meta_frames_style_set (GtkWidget *widget,
meta_frames_font_changed (frames); meta_frames_font_changed (frames);
g_hash_table_foreach (frames->frames,
reattach_style_func, frames);
GTK_WIDGET_CLASS (parent_class)->style_set (widget, prev_style); GTK_WIDGET_CLASS (parent_class)->style_set (widget, prev_style);
} }
@ -561,6 +579,24 @@ meta_frames_new (int screen_number)
NULL); NULL);
} }
/* In order to use a style with a window it has to be attached to that
* window. Actually, the colormaps just have to match, but since GTK+
* already takes care of making sure that its cheap to attach a style
* to multiple windows with the same colormap, we can just go ahead
* and attach separately for each window.
*/
static void
meta_frames_attach_style (MetaFrames *frames,
MetaUIFrame *frame)
{
if (frame->style != NULL)
gtk_style_detach (frame->style);
/* Weirdly, gtk_style_attach() steals a reference count from the style passed in */
gtk_style_ref (GTK_WIDGET (frames)->style);
frame->style = gtk_style_attach (GTK_WIDGET (frames)->style, frame->window);
}
void void
meta_frames_manage_window (MetaFrames *frames, meta_frames_manage_window (MetaFrames *frames,
Window xwindow, Window xwindow,
@ -576,6 +612,9 @@ meta_frames_manage_window (MetaFrames *frames,
gdk_window_set_user_data (frame->window, frames); gdk_window_set_user_data (frame->window, frames);
frame->style = NULL;
meta_frames_attach_style (frames, frame);
/* Don't set event mask here, it's in frame.c */ /* Don't set event mask here, it's in frame.c */
frame->xwindow = xwindow; frame->xwindow = xwindow;
@ -626,6 +665,8 @@ meta_frames_unmanage_window (MetaFrames *frames,
g_hash_table_remove (frames->frames, &frame->xwindow); g_hash_table_remove (frames->frames, &frame->xwindow);
gtk_style_detach (frame->style);
gdk_window_destroy (frame->window); gdk_window_destroy (frame->window);
if (frame->layout) if (frame->layout)
@ -1086,7 +1127,7 @@ show_tip_now (MetaFrames *frames)
tiptext = _("Maximize Window"); tiptext = _("Maximize Window");
break; break;
case META_FRAME_CONTROL_UNMAXIMIZE: case META_FRAME_CONTROL_UNMAXIMIZE:
tiptext = _("Unmaximize Window"); tiptext = _("Restore Window");
break; break;
case META_FRAME_CONTROL_SHADE: case META_FRAME_CONTROL_SHADE:
tiptext = _("Roll Up Window"); tiptext = _("Roll Up Window");
@ -1388,6 +1429,7 @@ meta_frames_button_press_event (GtkWidget *widget,
event->button == 1 && event->button == 1 &&
event->type == GDK_2BUTTON_PRESS) event->type == GDK_2BUTTON_PRESS)
{ {
meta_core_end_grab_op (gdk_display, event->time);
return meta_frame_double_click_event (frame, event); return meta_frame_double_click_event (frame, event);
} }
@ -2434,7 +2476,8 @@ meta_frames_paint_to_drawable (MetaFrames *frames,
gdk_window_begin_paint_rect (drawable, &areas[i]); gdk_window_begin_paint_rect (drawable, &areas[i]);
meta_theme_draw_frame (meta_theme_get_current (), meta_theme_draw_frame_with_style (meta_theme_get_current (),
frame->style,
widget, widget,
drawable, drawable,
NULL, /* &areas[i], */ NULL, /* &areas[i], */
@ -2459,7 +2502,8 @@ meta_frames_paint_to_drawable (MetaFrames *frames,
{ {
/* Not a window; happens about 1/3 of the time */ /* Not a window; happens about 1/3 of the time */
meta_theme_draw_frame (meta_theme_get_current (), meta_theme_draw_frame_with_style (meta_theme_get_current (),
frame->style,
widget, widget,
drawable, drawable,
NULL, NULL,
@ -2524,7 +2568,7 @@ meta_frames_set_window_background (MetaFrames *frames,
} }
else else
{ {
gtk_style_set_background (GTK_WIDGET (frames)->style, gtk_style_set_background (frame->style,
frame->window, GTK_STATE_NORMAL); frame->window, GTK_STATE_NORMAL);
} }
} }

View File

@ -75,6 +75,7 @@ struct _MetaUIFrame
{ {
Window xwindow; Window xwindow;
GdkWindow *window; GdkWindow *window;
GtkStyle *style;
MetaFrameStyle *cache_style; MetaFrameStyle *cache_style;
PangoLayout *layout; PangoLayout *layout;
int text_height; int text_height;

View File

@ -3457,6 +3457,7 @@ fill_env (MetaPositionExprEnv *env,
static void static void
meta_draw_op_draw_with_env (const MetaDrawOp *op, meta_draw_op_draw_with_env (const MetaDrawOp *op,
GtkStyle *style_gtk,
GtkWidget *widget, GtkWidget *widget,
GdkDrawable *drawable, GdkDrawable *drawable,
const GdkRectangle *clip, const GdkRectangle *clip,
@ -3649,7 +3650,7 @@ meta_draw_op_draw_with_env (const MetaDrawOp *op,
rwidth = parse_size_unchecked (op->data.gtk_arrow.width, env); rwidth = parse_size_unchecked (op->data.gtk_arrow.width, env);
rheight = parse_size_unchecked (op->data.gtk_arrow.height, env); rheight = parse_size_unchecked (op->data.gtk_arrow.height, env);
gtk_paint_arrow (widget->style, gtk_paint_arrow (style_gtk,
drawable, drawable,
op->data.gtk_arrow.state, op->data.gtk_arrow.state,
op->data.gtk_arrow.shadow, op->data.gtk_arrow.shadow,
@ -3671,7 +3672,7 @@ meta_draw_op_draw_with_env (const MetaDrawOp *op,
rwidth = parse_size_unchecked (op->data.gtk_box.width, env); rwidth = parse_size_unchecked (op->data.gtk_box.width, env);
rheight = parse_size_unchecked (op->data.gtk_box.height, env); rheight = parse_size_unchecked (op->data.gtk_box.height, env);
gtk_paint_box (widget->style, gtk_paint_box (style_gtk,
drawable, drawable,
op->data.gtk_box.state, op->data.gtk_box.state,
op->data.gtk_box.shadow, op->data.gtk_box.shadow,
@ -3690,7 +3691,7 @@ meta_draw_op_draw_with_env (const MetaDrawOp *op,
ry1 = parse_y_position_unchecked (op->data.gtk_vline.y1, env); ry1 = parse_y_position_unchecked (op->data.gtk_vline.y1, env);
ry2 = parse_y_position_unchecked (op->data.gtk_vline.y2, env); ry2 = parse_y_position_unchecked (op->data.gtk_vline.y2, env);
gtk_paint_vline (widget->style, gtk_paint_vline (style_gtk,
drawable, drawable,
op->data.gtk_vline.state, op->data.gtk_vline.state,
(GdkRectangle*) clip, (GdkRectangle*) clip,
@ -3752,8 +3753,8 @@ meta_draw_op_draw_with_env (const MetaDrawOp *op,
d_rect.width = parse_size_unchecked (op->data.op_list.width, env); d_rect.width = parse_size_unchecked (op->data.op_list.width, env);
d_rect.height = parse_size_unchecked (op->data.op_list.height, env); d_rect.height = parse_size_unchecked (op->data.op_list.height, env);
meta_draw_op_list_draw (op->data.op_list.op_list, meta_draw_op_list_draw_with_style (op->data.op_list.op_list,
widget, drawable, clip, info, style_gtk, widget, drawable, clip, info,
d_rect); d_rect);
} }
break; break;
@ -3794,8 +3795,8 @@ meta_draw_op_draw_with_env (const MetaDrawOp *op,
tile.y = ry - tile_yoffset; tile.y = ry - tile_yoffset;
while (tile.y < (ry + rheight)) while (tile.y < (ry + rheight))
{ {
meta_draw_op_list_draw (op->data.tile.op_list, meta_draw_op_list_draw_with_style (op->data.tile.op_list,
widget, drawable, &new_clip, info, style_gtk, widget, drawable, &new_clip, info,
tile); tile);
tile.y += tile.height; tile.y += tile.height;
@ -3810,7 +3811,8 @@ meta_draw_op_draw_with_env (const MetaDrawOp *op,
} }
void void
meta_draw_op_draw (const MetaDrawOp *op, meta_draw_op_draw_with_style (const MetaDrawOp *op,
GtkStyle *style_gtk,
GtkWidget *widget, GtkWidget *widget,
GdkDrawable *drawable, GdkDrawable *drawable,
const GdkRectangle *clip, const GdkRectangle *clip,
@ -3819,14 +3821,28 @@ meta_draw_op_draw (const MetaDrawOp *op,
{ {
MetaPositionExprEnv env; MetaPositionExprEnv env;
g_return_if_fail (style_gtk->colormap == gdk_drawable_get_colormap (drawable));
fill_env (&env, info, logical_region); fill_env (&env, info, logical_region);
meta_draw_op_draw_with_env (op, widget, drawable, clip, meta_draw_op_draw_with_env (op, style_gtk, widget, drawable, clip,
info, logical_region, info, logical_region,
&env); &env);
} }
void
meta_draw_op_draw (const MetaDrawOp *op,
GtkWidget *widget,
GdkDrawable *drawable,
const GdkRectangle *clip,
const MetaDrawInfo *info,
MetaRectangle logical_region)
{
meta_draw_op_draw_with_style (op, widget->style, widget,
drawable, clip, info, logical_region);
}
MetaDrawOpList* MetaDrawOpList*
meta_draw_op_list_new (int n_preallocs) meta_draw_op_list_new (int n_preallocs)
{ {
@ -3875,7 +3891,8 @@ meta_draw_op_list_unref (MetaDrawOpList *op_list)
} }
void void
meta_draw_op_list_draw (const MetaDrawOpList *op_list, meta_draw_op_list_draw_with_style (const MetaDrawOpList *op_list,
GtkStyle *style_gtk,
GtkWidget *widget, GtkWidget *widget,
GdkDrawable *drawable, GdkDrawable *drawable,
const GdkRectangle *clip, const GdkRectangle *clip,
@ -3887,6 +3904,8 @@ meta_draw_op_list_draw (const MetaDrawOpList *op_list,
GdkRectangle orig_clip; GdkRectangle orig_clip;
MetaPositionExprEnv env; MetaPositionExprEnv env;
g_return_if_fail (style_gtk->colormap == gdk_drawable_get_colormap (drawable));
if (op_list->n_ops == 0) if (op_list->n_ops == 0)
return; return;
@ -3934,13 +3953,26 @@ meta_draw_op_list_draw (const MetaDrawOpList *op_list,
active_clip.height > 0) active_clip.height > 0)
{ {
meta_draw_op_draw_with_env (op, meta_draw_op_draw_with_env (op,
widget, drawable, &active_clip, info, style_gtk, widget, drawable, &active_clip, info,
rect, rect,
&env); &env);
} }
} }
} }
void
meta_draw_op_list_draw (const MetaDrawOpList *op_list,
GtkWidget *widget,
GdkDrawable *drawable,
const GdkRectangle *clip,
const MetaDrawInfo *info,
MetaRectangle rect)
{
meta_draw_op_list_draw_with_style (op_list, widget->style, widget,
drawable, clip, info, rect);
}
void void
meta_draw_op_list_append (MetaDrawOpList *op_list, meta_draw_op_list_append (MetaDrawOpList *op_list,
MetaDrawOp *op) MetaDrawOp *op)
@ -4243,7 +4275,8 @@ button_rect (MetaButtonType type,
} }
void void
meta_frame_style_draw (MetaFrameStyle *style, meta_frame_style_draw_with_style (MetaFrameStyle *style,
GtkStyle *style_gtk,
GtkWidget *widget, GtkWidget *widget,
GdkDrawable *drawable, GdkDrawable *drawable,
int x_offset, int x_offset,
@ -4268,6 +4301,8 @@ meta_frame_style_draw (MetaFrameStyle *style,
PangoRectangle extents; PangoRectangle extents;
MetaDrawInfo draw_info; MetaDrawInfo draw_info;
g_return_if_fail (style_gtk->colormap == gdk_drawable_get_colormap (drawable));
titlebar_rect.x = 0; titlebar_rect.x = 0;
titlebar_rect.y = 0; titlebar_rect.y = 0;
titlebar_rect.width = fgeom->width; titlebar_rect.width = fgeom->width;
@ -4418,7 +4453,8 @@ meta_frame_style_draw (MetaFrameStyle *style,
{ {
MetaRectangle m_rect; MetaRectangle m_rect;
m_rect = meta_rect (rect.x, rect.y, rect.width, rect.height); m_rect = meta_rect (rect.x, rect.y, rect.width, rect.height);
meta_draw_op_list_draw (op_list, meta_draw_op_list_draw_with_style (op_list,
style_gtk,
widget, widget,
drawable, drawable,
&combined_clip, &combined_clip,
@ -4460,7 +4496,8 @@ meta_frame_style_draw (MetaFrameStyle *style,
MetaRectangle m_rect; MetaRectangle m_rect;
m_rect = meta_rect (rect.x, rect.y, m_rect = meta_rect (rect.x, rect.y,
rect.width, rect.height); rect.width, rect.height);
meta_draw_op_list_draw (op_list, meta_draw_op_list_draw_with_style (op_list,
style_gtk,
widget, widget,
drawable, drawable,
&combined_clip, &combined_clip,
@ -4488,6 +4525,29 @@ meta_frame_style_draw (MetaFrameStyle *style,
} }
} }
void
meta_frame_style_draw (MetaFrameStyle *style,
GtkWidget *widget,
GdkDrawable *drawable,
int x_offset,
int y_offset,
const GdkRectangle *clip,
const MetaFrameGeometry *fgeom,
int client_width,
int client_height,
PangoLayout *title_layout,
int text_height,
MetaButtonState button_states[META_BUTTON_TYPE_LAST],
GdkPixbuf *mini_icon,
GdkPixbuf *icon)
{
meta_frame_style_draw_with_style (style, widget->style, widget,
drawable, x_offset, y_offset,
clip, fgeom, client_width, client_height,
title_layout, text_height,
button_states, mini_icon, icon);
}
MetaFrameStyleSet* MetaFrameStyleSet*
meta_frame_style_set_new (MetaFrameStyleSet *parent) meta_frame_style_set_new (MetaFrameStyleSet *parent)
{ {
@ -5035,7 +5095,8 @@ meta_theme_get_title_scale (MetaTheme *theme,
} }
void void
meta_theme_draw_frame (MetaTheme *theme, meta_theme_draw_frame_with_style (MetaTheme *theme,
GtkStyle *style_gtk,
GtkWidget *widget, GtkWidget *widget,
GdkDrawable *drawable, GdkDrawable *drawable,
const GdkRectangle *clip, const GdkRectangle *clip,
@ -5059,6 +5120,81 @@ meta_theme_draw_frame (MetaTheme *theme,
style = theme_get_style (theme, type, flags); style = theme_get_style (theme, type, flags);
/* Parser is not supposed to allow this currently */
if (style == NULL)
return;
meta_frame_layout_calc_geometry (style->layout,
text_height,
flags,
client_width, client_height,
button_layout,
&fgeom,
theme);
meta_frame_style_draw_with_style (style,
style_gtk,
widget,
drawable,
x_offset, y_offset,
clip,
&fgeom,
client_width, client_height,
title_layout,
text_height,
button_states,
mini_icon, icon);
}
void
meta_theme_draw_frame (MetaTheme *theme,
GtkWidget *widget,
GdkDrawable *drawable,
const GdkRectangle *clip,
int x_offset,
int y_offset,
MetaFrameType type,
MetaFrameFlags flags,
int client_width,
int client_height,
PangoLayout *title_layout,
int text_height,
const MetaButtonLayout *button_layout,
MetaButtonState button_states[META_BUTTON_TYPE_LAST],
GdkPixbuf *mini_icon,
GdkPixbuf *icon)
{
meta_theme_draw_frame_with_style (theme, widget->style, widget,
drawable, clip, x_offset, y_offset, type,flags,
client_width, client_height,
title_layout, text_height,
button_layout, button_states,
mini_icon, icon);
}
void
meta_theme_draw_frame_by_name (MetaTheme *theme,
GtkWidget *widget,
GdkDrawable *drawable,
const GdkRectangle *clip,
int x_offset,
int y_offset,
const gchar *style_name,
MetaFrameFlags flags,
int client_width,
int client_height,
PangoLayout *title_layout,
int text_height,
const MetaButtonLayout *button_layout,
MetaButtonState button_states[META_BUTTON_TYPE_LAST],
GdkPixbuf *mini_icon,
GdkPixbuf *icon)
{
MetaFrameGeometry fgeom;
MetaFrameStyle *style;
style = meta_theme_lookup_style (theme, style_name);
/* Parser is not supposed to allow this currently */ /* Parser is not supposed to allow this currently */
if (style == NULL) if (style == NULL)
return; return;
@ -5084,6 +5220,16 @@ meta_theme_draw_frame (MetaTheme *theme,
mini_icon, icon); mini_icon, icon);
} }
void void
meta_theme_get_frame_borders (MetaTheme *theme, meta_theme_get_frame_borders (MetaTheme *theme,
MetaFrameType type, MetaFrameType type,

View File

@ -901,6 +901,15 @@ void meta_draw_op_draw (const MetaDrawOp *op,
/* logical region being drawn */ /* logical region being drawn */
MetaRectangle logical_region); MetaRectangle logical_region);
void meta_draw_op_draw_with_style (const MetaDrawOp *op,
GtkStyle *style_gtk,
GtkWidget *widget,
GdkDrawable *drawable,
const GdkRectangle *clip,
const MetaDrawInfo *info,
/* logical region being drawn */
MetaRectangle logical_region);
MetaDrawOpList* meta_draw_op_list_new (int n_preallocs); MetaDrawOpList* meta_draw_op_list_new (int n_preallocs);
void meta_draw_op_list_ref (MetaDrawOpList *op_list); void meta_draw_op_list_ref (MetaDrawOpList *op_list);
void meta_draw_op_list_unref (MetaDrawOpList *op_list); void meta_draw_op_list_unref (MetaDrawOpList *op_list);
@ -910,6 +919,13 @@ void meta_draw_op_list_draw (const MetaDrawOpList *op_list,
const GdkRectangle *clip, const GdkRectangle *clip,
const MetaDrawInfo *info, const MetaDrawInfo *info,
MetaRectangle rect); MetaRectangle rect);
void meta_draw_op_list_draw_with_style (const MetaDrawOpList *op_list,
GtkStyle *style_gtk,
GtkWidget *widget,
GdkDrawable *drawable,
const GdkRectangle *clip,
const MetaDrawInfo *info,
MetaRectangle rect);
void meta_draw_op_list_append (MetaDrawOpList *op_list, void meta_draw_op_list_append (MetaDrawOpList *op_list,
MetaDrawOp *op); MetaDrawOp *op);
gboolean meta_draw_op_list_validate (MetaDrawOpList *op_list, gboolean meta_draw_op_list_validate (MetaDrawOpList *op_list,
@ -951,6 +967,23 @@ void meta_frame_style_draw (MetaFrameStyle *style,
GdkPixbuf *icon); GdkPixbuf *icon);
void meta_frame_style_draw_with_style (MetaFrameStyle *style,
GtkStyle *style_gtk,
GtkWidget *widget,
GdkDrawable *drawable,
int x_offset,
int y_offset,
const GdkRectangle *clip,
const MetaFrameGeometry *fgeom,
int client_width,
int client_height,
PangoLayout *title_layout,
int text_height,
MetaButtonState button_states[META_BUTTON_TYPE_LAST],
GdkPixbuf *mini_icon,
GdkPixbuf *icon);
gboolean meta_frame_style_validate (MetaFrameStyle *style, gboolean meta_frame_style_validate (MetaFrameStyle *style,
guint current_theme_version, guint current_theme_version,
GError **error); GError **error);
@ -1000,6 +1033,41 @@ void meta_theme_draw_frame (MetaTheme *theme,
GdkPixbuf *mini_icon, GdkPixbuf *mini_icon,
GdkPixbuf *icon); GdkPixbuf *icon);
void meta_theme_draw_frame_by_name (MetaTheme *theme,
GtkWidget *widget,
GdkDrawable *drawable,
const GdkRectangle *clip,
int x_offset,
int y_offset,
const gchar *style_name,
MetaFrameFlags flags,
int client_width,
int client_height,
PangoLayout *title_layout,
int text_height,
const MetaButtonLayout *button_layout,
MetaButtonState button_states[META_BUTTON_TYPE_LAST],
GdkPixbuf *mini_icon,
GdkPixbuf *icon);
void meta_theme_draw_frame_with_style (MetaTheme *theme,
GtkStyle *style_gtk,
GtkWidget *widget,
GdkDrawable *drawable,
const GdkRectangle *clip,
int x_offset,
int y_offset,
MetaFrameType type,
MetaFrameFlags flags,
int client_width,
int client_height,
PangoLayout *title_layout,
int text_height,
const MetaButtonLayout *button_layout,
MetaButtonState button_states[META_BUTTON_TYPE_LAST],
GdkPixbuf *mini_icon,
GdkPixbuf *icon);
void meta_theme_get_frame_borders (MetaTheme *theme, void meta_theme_get_frame_borders (MetaTheme *theme,
MetaFrameType type, MetaFrameType type,
int text_height, int text_height,

View File

@ -672,10 +672,12 @@ meta_text_property_to_utf8 (Display *xdisplay,
&list); &list);
if (count == 0) if (count == 0)
return NULL; retval = NULL;
else
{
retval = list[0]; retval = list[0];
list[0] = g_strdup (""); /* something to free */ list[0] = g_strdup (""); /* something to free */
}
g_strfreev (list); g_strfreev (list);