Compare commits
52 Commits
Author | SHA1 | Date | |
---|---|---|---|
66406b3035 | |||
042ddc5637 | |||
5b04ab4473 | |||
16b86ae7f7 | |||
49400657ca | |||
30bc8bc6ce | |||
ac18f41ed1 | |||
60c05a0dac | |||
c47de98c88 | |||
f1aada0fae | |||
4de492eb20 | |||
9ca00d5cce | |||
b98e4e37ad | |||
8b64a951c9 | |||
c2a0719e44 | |||
8cb7a450ae | |||
6fb857cb23 | |||
fc87a635b2 | |||
81930ca76e | |||
da65738901 | |||
4528e1216a | |||
d56ecde39b | |||
4148a5cc6a | |||
8a6a568aca | |||
12cc0cee29 | |||
878b1012b4 | |||
a78fec7951 | |||
a24c512caa | |||
c669a3892e | |||
ba4f008d40 | |||
b0a099935b | |||
aba39ef953 | |||
ebf8c460e1 | |||
25d3432eee | |||
cd7a74fbcd | |||
c64188c67f | |||
4c2371f2e7 | |||
ff6c31dcc0 | |||
1b649c18ed | |||
93037e4c6b | |||
ed358c8f4b | |||
a22859a64a | |||
c44438b19f | |||
b58366d3ad | |||
6900128b2f | |||
c0b4d68390 | |||
0d794f28f0 | |||
e389eff79d | |||
41adbdda12 | |||
2d6555ca4d | |||
044d58951e | |||
9c97e8999e |
22
NEWS
22
NEWS
@ -1,3 +1,25 @@
|
||||
3.5.2
|
||||
=====
|
||||
* keybindings: Remove 'toggle-recording' binding [Florian; #674376]
|
||||
* Switch to gtk-doc syntax [Jasper; #673752]
|
||||
* shaped-texture: never slice shape mask texture [Robert; #674731]
|
||||
* Make Mutter stop relying on Cogl including a GL header [Neil; #672711]
|
||||
* Make support for "XFree86" Xinerama mandatory [Owen; #674727]
|
||||
* meta_window_move_frame(): fix crash when frame is NULL [Owen; #675254]
|
||||
* Fix memory leaks [Pavel; #672640]
|
||||
* Code cleanups [Jasper; #671104 #674876 #676052]
|
||||
* Look for themes in XDG user data dir [Jasper; #675316]
|
||||
* Remove frame pixel caching [Jasper; #675111]
|
||||
* stack: Ignore keep-on-top property on maximized windows [Florian; #673581]
|
||||
* Misc. fixes [Javier, Jasper, Owen, Rico]
|
||||
|
||||
Contributors:
|
||||
Robert Bragg, Javier Járdon, Florian Müllner, Neil Roberts, Jasper St. Pierre,
|
||||
Owen Taylor, Rico Tzschichholz, Pavel Vasin
|
||||
|
||||
Translations:
|
||||
Praveen Illa [te], Luca Ferretti [it], Daniel Mustieles [es]
|
||||
|
||||
3.4.1
|
||||
=====
|
||||
* API change: the meta_display_add_keybinding() function added in 3.4
|
||||
|
73
configure.in
73
configure.in
@ -1,8 +1,8 @@
|
||||
AC_PREREQ(2.50)
|
||||
|
||||
m4_define([mutter_major_version], [3])
|
||||
m4_define([mutter_minor_version], [4])
|
||||
m4_define([mutter_micro_version], [1])
|
||||
m4_define([mutter_minor_version], [5])
|
||||
m4_define([mutter_micro_version], [2])
|
||||
|
||||
m4_define([mutter_version],
|
||||
[mutter_major_version.mutter_minor_version.mutter_micro_version])
|
||||
@ -212,60 +212,31 @@ AC_PATH_XTRA
|
||||
|
||||
ALL_X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
|
||||
|
||||
# Check for Xinerama extension (Solaris impl or Xfree impl)
|
||||
# Check for Xinerama extension - we only support the "XFree86" style,
|
||||
# and not the older Solaris-only version; recent Solaris supports the
|
||||
# XFree86 style.
|
||||
mutter_save_cppflags="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
|
||||
|
||||
AC_ARG_ENABLE(xinerama,
|
||||
AC_HELP_STRING([--disable-xinerama],
|
||||
[disable mutter's use of the Xinerama extension]),
|
||||
try_xinerama=$enable_xinerama,try_xinerama=yes)
|
||||
|
||||
use_solaris_xinerama=no
|
||||
use_xfree_xinerama=no
|
||||
if test "${try_xinerama}" != no; then
|
||||
case "$host" in
|
||||
*-*-solaris*)
|
||||
# Check for solaris
|
||||
use_solaris_xinerama=yes
|
||||
AC_CHECK_LIB(Xext, XineramaGetInfo,
|
||||
use_solaris_xinerama=yes, use_solaris_xinerama=no,
|
||||
$ALL_X_LIBS)
|
||||
if test "x$use_solaris_xinerama" = "xyes"; then
|
||||
AC_CHECK_HEADER(X11/extensions/xinerama.h,
|
||||
if test -z "`echo $ALL_X_LIBS | grep "\-lXext" 2> /dev/null`"; then
|
||||
X_EXTRA_LIBS="-lXext $X_EXTRA_LIBS"
|
||||
fi
|
||||
AC_DEFINE(HAVE_SOLARIS_XINERAMA, , [Have Solaris-style Xinerama])
|
||||
AC_DEFINE(HAVE_XINERAMA, , [Have some version of Xinerama]),
|
||||
use_solaris_xinerama=no,
|
||||
[#include <X11/Xlib.h>])
|
||||
fi
|
||||
AC_MSG_CHECKING(for Xinerama support on Solaris)
|
||||
AC_MSG_RESULT($use_solaris_xinerama);
|
||||
;;
|
||||
*)
|
||||
# Check for XFree
|
||||
use_xfree_xinerama=yes
|
||||
AC_CHECK_LIB(Xinerama, XineramaQueryExtension,
|
||||
[AC_CHECK_HEADER(X11/extensions/Xinerama.h,
|
||||
X_EXTRA_LIBS="-lXinerama $X_EXTRA_LIBS"
|
||||
if test -z "`echo $ALL_X_LIBS | grep "\-lXext" 2> /dev/null`"; then
|
||||
X_EXTRA_LIBS="-lXext $X_EXTRA_LIBS"
|
||||
fi
|
||||
AC_DEFINE(HAVE_XFREE_XINERAMA, , [Have XFree86-style Xinerama])
|
||||
AC_DEFINE(HAVE_XINERAMA,, [Have some version of Xinerama]),
|
||||
use_xfree_xinerama=no,
|
||||
[#include <X11/Xlib.h>])],
|
||||
use_xfree_xinerama=no, -lXext $ALL_X_LIBS)
|
||||
AC_MSG_CHECKING(for Xinerama support on XFree86)
|
||||
AC_MSG_RESULT($use_xfree_xinerama);
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
have_xinerama=yes
|
||||
AC_CHECK_LIB(Xinerama, XineramaQueryExtension,
|
||||
[AC_CHECK_HEADER(X11/extensions/Xinerama.h,
|
||||
[X_EXTRA_LIBS="-lXinerama $X_EXTRA_LIBS"
|
||||
if test -z "`echo $ALL_X_LIBS | grep "\-lXext" 2> /dev/null`"; then
|
||||
X_EXTRA_LIBS="-lXext $X_EXTRA_LIBS"
|
||||
fi],
|
||||
have_xinerama=no,
|
||||
[#include <X11/Xlib.h>])],
|
||||
have_xinerama=no, -lXext $ALL_X_LIBS)
|
||||
AC_MSG_CHECKING(for Xinerama support)
|
||||
AC_MSG_RESULT($have_xinerama)
|
||||
|
||||
CPPFLAGS="$mutter_save_cppflags"
|
||||
|
||||
if test x$have_xinerama = xno; then
|
||||
AC_MSG_ERROR([Xinerama extension was not found])
|
||||
fi
|
||||
|
||||
SHAPE_LIBS=
|
||||
found_shape=no
|
||||
AC_CHECK_LIB(Xext, XShapeQueryExtension,
|
||||
@ -496,8 +467,6 @@ mutter-$VERSION
|
||||
source code location: ${srcdir}
|
||||
compiler: ${CC}
|
||||
|
||||
XFree86 Xinerama: ${use_xfree_xinerama}
|
||||
Solaris Xinerama: ${use_solaris_xinerama}
|
||||
Startup notification: ${have_startup_notification}
|
||||
libcanberra: ${have_libcanberra}
|
||||
Introspection: ${found_introspection}
|
||||
|
287
po/es.po
287
po/es.po
@ -14,7 +14,7 @@ msgstr ""
|
||||
"Project-Id-Version: mutter.master\n"
|
||||
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
|
||||
"product=mutter&keywords=I18N+L10N&component=general\n"
|
||||
"POT-Creation-Date: 2012-03-11 21:56+0000\n"
|
||||
"POT-Creation-Date: 2012-05-31 12:16+0000\n"
|
||||
"PO-Revision-Date: 2012-03-12 14:17+0100\n"
|
||||
"Last-Translator: Daniel Mustieles <daniel.mustieles@gmail.com>\n"
|
||||
"Language-Team: Español <gnome-es-list@gnome.org>\n"
|
||||
@ -46,7 +46,7 @@ msgstr ""
|
||||
"Ya existe un gestor de composición ejecutándose en la monitor %i, pantalla «%"
|
||||
"s»."
|
||||
|
||||
#: ../src/core/bell.c:307
|
||||
#: ../src/core/bell.c:320
|
||||
msgid "Bell event"
|
||||
msgstr "Evento de campana"
|
||||
|
||||
@ -80,12 +80,12 @@ msgstr "_Esperar"
|
||||
msgid "_Force Quit"
|
||||
msgstr "_Forzar la salida"
|
||||
|
||||
#: ../src/core/display.c:361
|
||||
#: ../src/core/display.c:380
|
||||
#, c-format
|
||||
msgid "Missing %s extension required for compositing"
|
||||
msgstr "Falta la extensión %s requerida para la composición"
|
||||
|
||||
#: ../src/core/display.c:427
|
||||
#: ../src/core/display.c:446
|
||||
#, c-format
|
||||
msgid "Failed to open X Window System display '%s'\n"
|
||||
msgstr "Ocurrió un error al abrir la pantalla de X Window System «%s»\n"
|
||||
@ -99,36 +99,36 @@ msgstr ""
|
||||
"Algún otro programa ya está usando la clave %s con el modificador %x como "
|
||||
"una vinculación\n"
|
||||
|
||||
#: ../src/core/main.c:206
|
||||
#: ../src/core/main.c:197
|
||||
msgid "Disable connection to session manager"
|
||||
msgstr "Desactivar conexión al gestor de sesión"
|
||||
|
||||
#: ../src/core/main.c:212
|
||||
#: ../src/core/main.c:203
|
||||
msgid "Replace the running window manager"
|
||||
msgstr "Reemplazar el gestor de ventanas en ejecución"
|
||||
|
||||
#: ../src/core/main.c:218
|
||||
#: ../src/core/main.c:209
|
||||
msgid "Specify session management ID"
|
||||
msgstr "Especificar el ID se gestión de sesión"
|
||||
|
||||
#: ../src/core/main.c:223
|
||||
#: ../src/core/main.c:214
|
||||
msgid "X Display to use"
|
||||
msgstr "Pantalla X que usar"
|
||||
|
||||
#: ../src/core/main.c:229
|
||||
#: ../src/core/main.c:220
|
||||
msgid "Initialize session from savefile"
|
||||
msgstr "Inicializar sesión desde el archivo de salvaguarda"
|
||||
|
||||
#: ../src/core/main.c:235
|
||||
#: ../src/core/main.c:226
|
||||
msgid "Make X calls synchronous"
|
||||
msgstr "Hacer que las llamadas a las X sean síncronas"
|
||||
|
||||
#: ../src/core/main.c:504
|
||||
#: ../src/core/main.c:497
|
||||
#, c-format
|
||||
msgid "Failed to scan themes directory: %s\n"
|
||||
msgstr "Falló al inspeccionar la carpeta de temas: %s\n"
|
||||
|
||||
#: ../src/core/main.c:520
|
||||
#: ../src/core/main.c:513
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Could not find a theme! Be sure %s exists and contains the usual themes.\n"
|
||||
@ -159,7 +159,7 @@ msgstr "Imprimir versión"
|
||||
msgid "Comma-separated list of compositor plugins"
|
||||
msgstr "Lista de complementos del compositor separados por comas"
|
||||
|
||||
#: ../src/core/prefs.c:1077
|
||||
#: ../src/core/prefs.c:1064
|
||||
msgid ""
|
||||
"Workarounds for broken applications disabled. Some applications may not "
|
||||
"behave properly.\n"
|
||||
@ -167,14 +167,14 @@ msgstr ""
|
||||
"Los arreglos para aplicaciones rotas se han deshabilitado. Algunas "
|
||||
"aplicaciones podrían no comportarse correctamente.\n"
|
||||
|
||||
#: ../src/core/prefs.c:1152
|
||||
#: ../src/core/prefs.c:1139
|
||||
#, c-format
|
||||
msgid "Could not parse font description \"%s\" from GSettings key %s\n"
|
||||
msgstr ""
|
||||
"No se pudo analizar la descripción de la tipografía «%s» de la clave "
|
||||
"GSettings %s\n"
|
||||
|
||||
#: ../src/core/prefs.c:1218
|
||||
#: ../src/core/prefs.c:1205
|
||||
#, c-format
|
||||
msgid ""
|
||||
"\"%s\" found in configuration database is not a valid value for mouse button "
|
||||
@ -183,7 +183,7 @@ msgstr ""
|
||||
"«%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"
|
||||
|
||||
#: ../src/core/prefs.c:1736
|
||||
#: ../src/core/prefs.c:1723
|
||||
#, c-format
|
||||
msgid ""
|
||||
"\"%s\" found in configuration database is not a valid value for keybinding "
|
||||
@ -192,17 +192,17 @@ msgstr ""
|
||||
"«%s» encontrado en la base de datos de configuración no es un valor válido "
|
||||
"para la combinación de teclas «%s»\n"
|
||||
|
||||
#: ../src/core/prefs.c:1833
|
||||
#: ../src/core/prefs.c:1820
|
||||
#, c-format
|
||||
msgid "Workspace %d"
|
||||
msgstr "Área de trabajo %d"
|
||||
|
||||
#: ../src/core/screen.c:730
|
||||
#: ../src/core/screen.c:652
|
||||
#, c-format
|
||||
msgid "Screen %d on display '%s' is invalid\n"
|
||||
msgstr "La ventana %d en la pantalla «%s» no es válida\n"
|
||||
|
||||
#: ../src/core/screen.c:746
|
||||
#: ../src/core/screen.c:668
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Screen %d on display \"%s\" already has a window manager; try using the --"
|
||||
@ -211,7 +211,7 @@ msgstr ""
|
||||
"La ventana %d en la pantalla «%s» ya tiene un gestor de ventanas, intente "
|
||||
"usar la opción «--replace» para reemplazar el gestor de ventanas activo.\n"
|
||||
|
||||
#: ../src/core/screen.c:773
|
||||
#: ../src/core/screen.c:695
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Could not acquire window manager selection on screen %d display \"%s\"\n"
|
||||
@ -219,12 +219,12 @@ msgstr ""
|
||||
"No se ha podido obtener la selección del gestor de ventanas en la ventana %d "
|
||||
"en la pantalla «%s»\n"
|
||||
|
||||
#: ../src/core/screen.c:828
|
||||
#: ../src/core/screen.c:750
|
||||
#, c-format
|
||||
msgid "Screen %d on display \"%s\" already has a window manager\n"
|
||||
msgstr "La ventana %d en la pantalla «%s» ya tiene un gestor de ventanas\n"
|
||||
|
||||
#: ../src/core/screen.c:1013
|
||||
#: ../src/core/screen.c:935
|
||||
#, c-format
|
||||
msgid "Could not release screen %d on display \"%s\"\n"
|
||||
msgstr "No se ha podido liberar el monitor %d en la pantalla «%s»\n"
|
||||
@ -323,7 +323,7 @@ msgid "Window manager error: "
|
||||
msgstr "Error del gestor de ventanas: "
|
||||
|
||||
#. first time through
|
||||
#: ../src/core/window.c:7224
|
||||
#: ../src/core/window.c:7234
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Window %s sets SM_CLIENT_ID on itself, instead of on the WM_CLIENT_LEADER "
|
||||
@ -339,7 +339,7 @@ msgstr ""
|
||||
#. * MWM but not WM_NORMAL_HINTS are basically broken. We complain
|
||||
#. * about these apps but make them work.
|
||||
#.
|
||||
#: ../src/core/window.c:7887
|
||||
#: ../src/core/window.c:7899
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Window %s sets an MWM hint indicating it isn't resizable, but sets min size %"
|
||||
@ -349,23 +349,23 @@ msgstr ""
|
||||
"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"
|
||||
|
||||
#: ../src/core/window-props.c:309
|
||||
#: ../src/core/window-props.c:310
|
||||
#, c-format
|
||||
msgid "Application set a bogus _NET_WM_PID %lu\n"
|
||||
msgstr "La aplicación establecio un _NET_WM_PID %lu erróneo\n"
|
||||
|
||||
#: ../src/core/window-props.c:426
|
||||
#: ../src/core/window-props.c:429
|
||||
#, c-format
|
||||
msgid "%s (on %s)"
|
||||
msgstr "%s (on %s)"
|
||||
|
||||
#: ../src/core/window-props.c:1481
|
||||
#: ../src/core/window-props.c:1484
|
||||
#, c-format
|
||||
msgid "Invalid WM_TRANSIENT_FOR window 0x%lx specified for %s.\n"
|
||||
msgstr ""
|
||||
"WM_TRANSIENT_FOR inválido para la ventana 0x%lx especificada para %s.\n"
|
||||
"WM_TRANSIENT_FOR no válido para la ventana 0x%lx especificada para %s.\n"
|
||||
|
||||
#: ../src/core/window-props.c:1492
|
||||
#: ../src/core/window-props.c:1495
|
||||
#, c-format
|
||||
msgid "WM_TRANSIENT_FOR window 0x%lx for %s would create loop.\n"
|
||||
msgstr "WM_TRANSIENT_FOR ventana 0x%lx para %s crearía un bucle.\n"
|
||||
@ -388,14 +388,14 @@ msgstr ""
|
||||
#: ../src/core/xprops.c:411
|
||||
#, c-format
|
||||
msgid "Property %s on window 0x%lx contained invalid UTF-8\n"
|
||||
msgstr "La propiedad %s en la ventana 0x%lx contiene UTF-8 inválido\n"
|
||||
msgstr "La propiedad %s en la ventana 0x%lx contiene UTF-8 no válido\n"
|
||||
|
||||
#: ../src/core/xprops.c:494
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Property %s on window 0x%lx contained invalid UTF-8 for item %d in the list\n"
|
||||
msgstr ""
|
||||
"La propiedad %s en la ventana 0x%lx contiene UTF-8 inválido para el elemento "
|
||||
"La propiedad %s en la ventana 0x%lx contiene UTF-8 no válido para el elemento "
|
||||
"%d de la lista\n"
|
||||
|
||||
#: ../src/mutter.desktop.in.h:1 ../src/mutter-wm.desktop.in.h:1
|
||||
@ -435,24 +435,12 @@ msgstr ""
|
||||
"y se mueven junto con la ventana padre."
|
||||
|
||||
#: ../src/org.gnome.mutter.gschema.xml.in.h:5
|
||||
msgid "Live Hidden Windows"
|
||||
msgstr "Ventanas activas ocultas"
|
||||
|
||||
#: ../src/org.gnome.mutter.gschema.xml.in.h:6
|
||||
msgid ""
|
||||
"Determines whether hidden windows (i.e., minimized windows and windows on "
|
||||
"other workspaces than the current one) should be kept alive."
|
||||
msgstr ""
|
||||
"Determina si las ventanas ocultas (e.g., ventanas minimizadas y ventanas en "
|
||||
"otros escritorios distintos del actual) deberían mantenerse activas."
|
||||
|
||||
#: ../src/org.gnome.mutter.gschema.xml.in.h:7
|
||||
msgid "Enable edge tiling when dropping windows on screen edges"
|
||||
msgstr ""
|
||||
"Activar el mosaico en los bordes al arrastrar ventanas a los bordes de la "
|
||||
"ventana"
|
||||
|
||||
#: ../src/org.gnome.mutter.gschema.xml.in.h:8
|
||||
#: ../src/org.gnome.mutter.gschema.xml.in.h:6
|
||||
msgid ""
|
||||
"If enabled, dropping windows on vertical screen edges maximizes them "
|
||||
"vertically and resizes them horizontally to cover half of the available "
|
||||
@ -463,11 +451,11 @@ msgstr ""
|
||||
"mitad del área disponible. Arrastrar ventanas al borde superior de la "
|
||||
"pantalla las maximiza por completo."
|
||||
|
||||
#: ../src/org.gnome.mutter.gschema.xml.in.h:9
|
||||
#: ../src/org.gnome.mutter.gschema.xml.in.h:7
|
||||
msgid "Workspaces are managed dynamically"
|
||||
msgstr "Las áreas de trabajo se gestionan dinámicamente"
|
||||
|
||||
#: ../src/org.gnome.mutter.gschema.xml.in.h:10
|
||||
#: ../src/org.gnome.mutter.gschema.xml.in.h:8
|
||||
msgid ""
|
||||
"Determines whether workspaces are managed dynamically or whether there's a "
|
||||
"static number of workspaces (determined by the num-workspaces key in org."
|
||||
@ -477,11 +465,11 @@ msgstr ""
|
||||
"número estático de áreas de trabajo (determinado por la clave «num-"
|
||||
"workspaces» en «org.gnome.desktop.wm.preferences»)."
|
||||
|
||||
#: ../src/org.gnome.mutter.gschema.xml.in.h:11
|
||||
#: ../src/org.gnome.mutter.gschema.xml.in.h:9
|
||||
msgid "Workspaces only on primary"
|
||||
msgstr "Áreas de trabajo sólo en el primario"
|
||||
|
||||
#: ../src/org.gnome.mutter.gschema.xml.in.h:12
|
||||
#: ../src/org.gnome.mutter.gschema.xml.in.h:10
|
||||
msgid ""
|
||||
"Determines whether workspace switching should happen for windows on all "
|
||||
"monitors or only for windows on the primary monitor."
|
||||
@ -489,11 +477,11 @@ msgstr ""
|
||||
"Determina si el cambio entre áreas de trabajo debería suceder para las "
|
||||
"ventanas en todos los monitores o sólo para ventanas en el monitor primario."
|
||||
|
||||
#: ../src/org.gnome.mutter.gschema.xml.in.h:13
|
||||
#: ../src/org.gnome.mutter.gschema.xml.in.h:11
|
||||
msgid "No tab popup"
|
||||
msgstr "No hay pestaña emergente"
|
||||
|
||||
#: ../src/org.gnome.mutter.gschema.xml.in.h:14
|
||||
#: ../src/org.gnome.mutter.gschema.xml.in.h:12
|
||||
msgid ""
|
||||
"Determines whether the use of popup and highlight frame should be disabled "
|
||||
"for window cycling."
|
||||
@ -501,11 +489,11 @@ msgstr ""
|
||||
"Determina si el uso de ventanas emergentes y marcos resaltados se debe "
|
||||
"desactivar al cambiar entre ventanas."
|
||||
|
||||
#: ../src/org.gnome.mutter.gschema.xml.in.h:15
|
||||
#: ../src/org.gnome.mutter.gschema.xml.in.h:13
|
||||
msgid "Draggable border width"
|
||||
msgstr "Anchura arrastrable del borde"
|
||||
|
||||
#: ../src/org.gnome.mutter.gschema.xml.in.h:16
|
||||
#: ../src/org.gnome.mutter.gschema.xml.in.h:14
|
||||
msgid ""
|
||||
"The amount of total draggable borders. If the theme's visible borders are "
|
||||
"not enough, invisible borders will be added to meet this value."
|
||||
@ -513,11 +501,11 @@ msgstr ""
|
||||
"La cantidad total de borde arrastrable. Si los bordes visibles del tema no "
|
||||
"son suficientes, se añadirán bordes invisibles para satisfacer este valor."
|
||||
|
||||
#: ../src/org.gnome.mutter.gschema.xml.in.h:17
|
||||
#: ../src/org.gnome.mutter.gschema.xml.in.h:15
|
||||
msgid "Select window from tab popup"
|
||||
msgstr "Seleccionar ventana de la pestaña emergente"
|
||||
|
||||
#: ../src/org.gnome.mutter.gschema.xml.in.h:18
|
||||
#: ../src/org.gnome.mutter.gschema.xml.in.h:16
|
||||
msgid "Cancel tab popup"
|
||||
msgstr "Cancelar pestaña emergente"
|
||||
|
||||
@ -526,50 +514,6 @@ msgstr "Cancelar pestaña emergente"
|
||||
msgid "Usage: %s\n"
|
||||
msgstr "Uso: %s\n"
|
||||
|
||||
#: ../src/ui/frames.c:1158
|
||||
msgid "Close Window"
|
||||
msgstr "Cerrar la ventana"
|
||||
|
||||
#: ../src/ui/frames.c:1161
|
||||
msgid "Window Menu"
|
||||
msgstr "Menú de la ventana"
|
||||
|
||||
#: ../src/ui/frames.c:1164
|
||||
msgid "Minimize Window"
|
||||
msgstr "Minimizar la ventana"
|
||||
|
||||
#: ../src/ui/frames.c:1167
|
||||
msgid "Maximize Window"
|
||||
msgstr "Maximizar la ventana"
|
||||
|
||||
#: ../src/ui/frames.c:1170
|
||||
msgid "Restore Window"
|
||||
msgstr "Restablecer la ventana"
|
||||
|
||||
#: ../src/ui/frames.c:1173
|
||||
msgid "Roll Up Window"
|
||||
msgstr "Enrollar ventana"
|
||||
|
||||
#: ../src/ui/frames.c:1176
|
||||
msgid "Unroll Window"
|
||||
msgstr "Desenrollar ventana"
|
||||
|
||||
#: ../src/ui/frames.c:1179
|
||||
msgid "Keep Window On Top"
|
||||
msgstr "Mantener la ventana encima"
|
||||
|
||||
#: ../src/ui/frames.c:1182
|
||||
msgid "Remove Window From Top"
|
||||
msgstr "Quitar ventana de encima"
|
||||
|
||||
#: ../src/ui/frames.c:1185
|
||||
msgid "Always On Visible Workspace"
|
||||
msgstr "Siempre en el área de trabajo visible"
|
||||
|
||||
#: ../src/ui/frames.c:1188
|
||||
msgid "Put Window On Only One Workspace"
|
||||
msgstr "Poner la ventana sólo en un área de trabajo"
|
||||
|
||||
#. Translators: Translate this string the same way as you do in libwnck!
|
||||
#: ../src/ui/menu.c:69
|
||||
msgid "Mi_nimize"
|
||||
@ -769,49 +713,49 @@ msgstr "Mod5"
|
||||
msgid "%d x %d"
|
||||
msgstr "%d x %d"
|
||||
|
||||
#: ../src/ui/theme.c:253
|
||||
#: ../src/ui/theme.c:234
|
||||
msgid "top"
|
||||
msgstr "superior"
|
||||
|
||||
#: ../src/ui/theme.c:255
|
||||
#: ../src/ui/theme.c:236
|
||||
msgid "bottom"
|
||||
msgstr "inferior"
|
||||
|
||||
#: ../src/ui/theme.c:257
|
||||
#: ../src/ui/theme.c:238
|
||||
msgid "left"
|
||||
msgstr "izquierda"
|
||||
|
||||
#: ../src/ui/theme.c:259
|
||||
#: ../src/ui/theme.c:240
|
||||
msgid "right"
|
||||
msgstr "derecha"
|
||||
|
||||
#: ../src/ui/theme.c:286
|
||||
#: ../src/ui/theme.c:268
|
||||
#, c-format
|
||||
msgid "frame geometry does not specify \"%s\" dimension"
|
||||
msgstr "La geometría del marco no especifica la dimensión «%s»"
|
||||
|
||||
#: ../src/ui/theme.c:305
|
||||
#: ../src/ui/theme.c:287
|
||||
#, c-format
|
||||
msgid "frame geometry does not specify dimension \"%s\" for border \"%s\""
|
||||
msgstr ""
|
||||
"La geometría del marco no especifica la dimensión «%s» para el borde «%s»"
|
||||
|
||||
#: ../src/ui/theme.c:342
|
||||
#: ../src/ui/theme.c:324
|
||||
#, c-format
|
||||
msgid "Button aspect ratio %g is not reasonable"
|
||||
msgstr "La proporción del botón %g no es razonable"
|
||||
|
||||
#: ../src/ui/theme.c:354
|
||||
#: ../src/ui/theme.c:336
|
||||
#, c-format
|
||||
msgid "Frame geometry does not specify size of buttons"
|
||||
msgstr "La geometría del marco no especifica el tamaño de los botones"
|
||||
|
||||
#: ../src/ui/theme.c:1067
|
||||
#: ../src/ui/theme.c:1049
|
||||
#, c-format
|
||||
msgid "Gradients should have at least two colors"
|
||||
msgstr "Los degradados deben tener al menos dos colores"
|
||||
|
||||
#: ../src/ui/theme.c:1219
|
||||
#: ../src/ui/theme.c:1201
|
||||
#, c-format
|
||||
msgid ""
|
||||
"GTK custom color specification must have color name and fallback in "
|
||||
@ -821,7 +765,7 @@ msgstr ""
|
||||
"alternativo entre paréntesis, ejemplo: gtk:custom(foo,bar); no se pudo "
|
||||
"analizar «%s»"
|
||||
|
||||
#: ../src/ui/theme.c:1235
|
||||
#: ../src/ui/theme.c:1217
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Invalid character '%c' in color_name parameter of gtk:custom, only A-Za-z0-9-"
|
||||
@ -830,7 +774,7 @@ msgstr ""
|
||||
"Caracter «%c» no válido en el parámetro «color_name» de «gtk:custom», sólo «A-Za-"
|
||||
"z0-9-_» son válidos"
|
||||
|
||||
#: ../src/ui/theme.c:1249
|
||||
#: ../src/ui/theme.c:1231
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Gtk:custom format is \"gtk:custom(color_name,fallback)\", \"%s\" does not "
|
||||
@ -839,7 +783,7 @@ msgstr ""
|
||||
"El formato de «gtk:custom» es «gtk:custom(nombre_de_color,"
|
||||
"nombre_alternativo)», «%s» no respeta el formato"
|
||||
|
||||
#: ../src/ui/theme.c:1294
|
||||
#: ../src/ui/theme.c:1276
|
||||
#, c-format
|
||||
msgid ""
|
||||
"GTK color specification must have the state in brackets, e.g. gtk:fg[NORMAL] "
|
||||
@ -849,7 +793,7 @@ msgstr ""
|
||||
"ejemplo. gtk:fg[NORMAL] donde NORMAL es el estado ; no se ha podido "
|
||||
"interpretar «%s»"
|
||||
|
||||
#: ../src/ui/theme.c:1308
|
||||
#: ../src/ui/theme.c:1290
|
||||
#, c-format
|
||||
msgid ""
|
||||
"GTK color specification must have a close bracket after the state, e.g. gtk:"
|
||||
@ -859,18 +803,18 @@ msgstr ""
|
||||
"estado, ejemplo. gtk:fg[NORMAL] donde NORMAL es el estado ; no se ha podido "
|
||||
"interpretar «%s»"
|
||||
|
||||
#: ../src/ui/theme.c:1319
|
||||
#: ../src/ui/theme.c:1301
|
||||
#, c-format
|
||||
msgid "Did not understand state \"%s\" in color specification"
|
||||
msgstr "No se entiende el estado «%s» en la especificación del color"
|
||||
|
||||
#: ../src/ui/theme.c:1332
|
||||
#: ../src/ui/theme.c:1314
|
||||
#, c-format
|
||||
msgid "Did not understand color component \"%s\" in color specification"
|
||||
msgstr ""
|
||||
"No se entiende el componente de color «%s» en la especificación del color"
|
||||
|
||||
#: ../src/ui/theme.c:1361
|
||||
#: ../src/ui/theme.c:1343
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Blend format is \"blend/bg_color/fg_color/alpha\", \"%s\" does not fit the "
|
||||
@ -879,17 +823,17 @@ msgstr ""
|
||||
"El formato de blend es «blend/bg_color/fg_color/alfa», «%s» no cumple con el "
|
||||
"formato"
|
||||
|
||||
#: ../src/ui/theme.c:1372
|
||||
#: ../src/ui/theme.c:1354
|
||||
#, c-format
|
||||
msgid "Could not parse alpha value \"%s\" in blended color"
|
||||
msgstr "No se ha podido interpretar el valor alfa «%s» en el color mezclado"
|
||||
|
||||
#: ../src/ui/theme.c:1382
|
||||
#: ../src/ui/theme.c:1364
|
||||
#, c-format
|
||||
msgid "Alpha value \"%s\" in blended color is not between 0.0 and 1.0"
|
||||
msgstr "El valor alfa «%s» en el color mezclado no está entre 0.0 y 1.0"
|
||||
|
||||
#: ../src/ui/theme.c:1429
|
||||
#: ../src/ui/theme.c:1411
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Shade format is \"shade/base_color/factor\", \"%s\" does not fit the format"
|
||||
@ -897,31 +841,31 @@ msgstr ""
|
||||
"El formato de sombreado es «shade/base_color/factor», «%s» no coincide con el "
|
||||
"formato"
|
||||
|
||||
#: ../src/ui/theme.c:1440
|
||||
#: ../src/ui/theme.c:1422
|
||||
#, c-format
|
||||
msgid "Could not parse shade factor \"%s\" in shaded color"
|
||||
msgstr ""
|
||||
"No se ha podido interpretar el factor de sombreado «%s» en el color del "
|
||||
"sombreado"
|
||||
|
||||
#: ../src/ui/theme.c:1450
|
||||
#: ../src/ui/theme.c:1432
|
||||
#, c-format
|
||||
msgid "Shade factor \"%s\" in shaded color is negative"
|
||||
msgstr "El factor de sombreado «%s» en el color sombreado es negativo"
|
||||
|
||||
#: ../src/ui/theme.c:1479
|
||||
#: ../src/ui/theme.c:1461
|
||||
#, c-format
|
||||
msgid "Could not parse color \"%s\""
|
||||
msgstr "No se ha podido interpretar el color «%s»"
|
||||
|
||||
#: ../src/ui/theme.c:1790
|
||||
#: ../src/ui/theme.c:1778
|
||||
#, c-format
|
||||
msgid "Coordinate expression contains character '%s' which is not allowed"
|
||||
msgstr ""
|
||||
"La expresión de coordenadas contenía un carácter «%s» en cual no está "
|
||||
"permitido"
|
||||
|
||||
#: ../src/ui/theme.c:1817
|
||||
#: ../src/ui/theme.c:1805
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Coordinate expression contains floating point number '%s' which could not be "
|
||||
@ -930,32 +874,32 @@ msgstr ""
|
||||
"La expresión de coordenadas contenía un número de coma flotante «%s» en cual "
|
||||
"no pudo ser analizado"
|
||||
|
||||
#: ../src/ui/theme.c:1831
|
||||
#: ../src/ui/theme.c:1819
|
||||
#, c-format
|
||||
msgid "Coordinate expression contains integer '%s' which could not be parsed"
|
||||
msgstr ""
|
||||
"La expresión de coordenadas contenía un entero «%s» que no pudo ser analizado"
|
||||
|
||||
#: ../src/ui/theme.c:1953
|
||||
#: ../src/ui/theme.c:1940
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Coordinate expression contained unknown operator at the start of this text: "
|
||||
"\"%s\""
|
||||
msgstr ""
|
||||
"La expresión de coordenadas contenía un operador inválido al inicio de su "
|
||||
"La expresión de coordenadas contenía un operador no válido al inicio de su "
|
||||
"texto: «%s»"
|
||||
|
||||
#: ../src/ui/theme.c:2010
|
||||
#: ../src/ui/theme.c:1997
|
||||
#, c-format
|
||||
msgid "Coordinate expression was empty or not understood"
|
||||
msgstr "La expresión de coordenadas estaba vacía o no fue entendida"
|
||||
|
||||
#: ../src/ui/theme.c:2121 ../src/ui/theme.c:2131 ../src/ui/theme.c:2165
|
||||
#: ../src/ui/theme.c:2110 ../src/ui/theme.c:2120 ../src/ui/theme.c:2154
|
||||
#, c-format
|
||||
msgid "Coordinate expression results in division by zero"
|
||||
msgstr "La expresión de coordenadas resultó en un error de división por cero"
|
||||
|
||||
#: ../src/ui/theme.c:2173
|
||||
#: ../src/ui/theme.c:2162
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Coordinate expression tries to use mod operator on a floating-point number"
|
||||
@ -963,7 +907,7 @@ msgstr ""
|
||||
"La expresión de coordenadas intentó usar un operador mod con un número de "
|
||||
"coma flotante"
|
||||
|
||||
#: ../src/ui/theme.c:2229
|
||||
#: ../src/ui/theme.c:2218
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Coordinate expression has an operator \"%s\" where an operand was expected"
|
||||
@ -971,19 +915,19 @@ msgstr ""
|
||||
"La expresión de coordenadas tiene un operador «%s» donde se esperaba un "
|
||||
"operando"
|
||||
|
||||
#: ../src/ui/theme.c:2238
|
||||
#: ../src/ui/theme.c:2227
|
||||
#, c-format
|
||||
msgid "Coordinate expression had an operand where an operator was expected"
|
||||
msgstr ""
|
||||
"La expresión de coordenadas tiene un operando donde se esperaba un operador"
|
||||
|
||||
#: ../src/ui/theme.c:2246
|
||||
#: ../src/ui/theme.c:2235
|
||||
#, c-format
|
||||
msgid "Coordinate expression ended with an operator instead of an operand"
|
||||
msgstr ""
|
||||
"La expresión de coordenadas termina con una operador en vez de un operando"
|
||||
|
||||
#: ../src/ui/theme.c:2256
|
||||
#: ../src/ui/theme.c:2245
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Coordinate expression has operator \"%c\" following operator \"%c\" with no "
|
||||
@ -992,42 +936,42 @@ msgstr ""
|
||||
"La expresión de coordenadas tiene el operador «%c» seguido del operador «%c» "
|
||||
"sin un operando entre ellos"
|
||||
|
||||
#: ../src/ui/theme.c:2407 ../src/ui/theme.c:2452
|
||||
#: ../src/ui/theme.c:2396 ../src/ui/theme.c:2441
|
||||
#, c-format
|
||||
msgid "Coordinate expression had unknown variable or constant \"%s\""
|
||||
msgstr ""
|
||||
"La expresión de coordenadas tenía una variable o constante desconocida «%s»"
|
||||
|
||||
#: ../src/ui/theme.c:2506
|
||||
#: ../src/ui/theme.c:2495
|
||||
#, c-format
|
||||
msgid "Coordinate expression parser overflowed its buffer."
|
||||
msgstr "El parser de la expresión de coordenadas desbordó su búfer."
|
||||
|
||||
#: ../src/ui/theme.c:2535
|
||||
#: ../src/ui/theme.c:2524
|
||||
#, c-format
|
||||
msgid "Coordinate expression had a close parenthesis with no open parenthesis"
|
||||
msgstr ""
|
||||
"La expresión de coordenadas tenía un paréntesis cerrado sin un paréntesis "
|
||||
"abierto"
|
||||
|
||||
#: ../src/ui/theme.c:2599
|
||||
#: ../src/ui/theme.c:2588
|
||||
#, c-format
|
||||
msgid "Coordinate expression had an open parenthesis with no close parenthesis"
|
||||
msgstr ""
|
||||
"La expresión de coordenadas tenía un paréntesis abierto sin un paréntesis "
|
||||
"cerrado"
|
||||
|
||||
#: ../src/ui/theme.c:2610
|
||||
#: ../src/ui/theme.c:2599
|
||||
#, c-format
|
||||
msgid "Coordinate expression doesn't seem to have any operators or operands"
|
||||
msgstr "La expresión de coordenadas no parece tener ni operadores ni operandos"
|
||||
|
||||
#: ../src/ui/theme.c:2822 ../src/ui/theme.c:2842 ../src/ui/theme.c:2862
|
||||
#: ../src/ui/theme.c:2812 ../src/ui/theme.c:2832 ../src/ui/theme.c:2852
|
||||
#, c-format
|
||||
msgid "Theme contained an expression that resulted in an error: %s\n"
|
||||
msgstr "El tema contenía una expresión que ha resultado en un error: %s\n"
|
||||
|
||||
#: ../src/ui/theme.c:4533
|
||||
#: ../src/ui/theme.c:4498
|
||||
#, c-format
|
||||
msgid ""
|
||||
"<button function=\"%s\" state=\"%s\" draw_ops=\"whatever\"/> must be "
|
||||
@ -1036,25 +980,25 @@ msgstr ""
|
||||
"<button function=\"%s\" state=\"%s\" draw_ops=\"whatever\"/> debe ser "
|
||||
"especificado para este estilo de marco"
|
||||
|
||||
#: ../src/ui/theme.c:5066 ../src/ui/theme.c:5091
|
||||
#: ../src/ui/theme.c:5009 ../src/ui/theme.c:5034
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Missing <frame state=\"%s\" resize=\"%s\" focus=\"%s\" style=\"whatever\"/>"
|
||||
msgstr ""
|
||||
"Falta <frame state=\"%s\" resize=\"%s\" focus=\"%s\" style=\"whatever\"/>"
|
||||
|
||||
#: ../src/ui/theme.c:5139
|
||||
#: ../src/ui/theme.c:5082
|
||||
#, c-format
|
||||
msgid "Failed to load theme \"%s\": %s\n"
|
||||
msgstr "Ocurrió un error al cargar el tema «%s»: %s\n"
|
||||
|
||||
#: ../src/ui/theme.c:5275 ../src/ui/theme.c:5282 ../src/ui/theme.c:5289
|
||||
#: ../src/ui/theme.c:5296 ../src/ui/theme.c:5303
|
||||
#: ../src/ui/theme.c:5218 ../src/ui/theme.c:5225 ../src/ui/theme.c:5232
|
||||
#: ../src/ui/theme.c:5239 ../src/ui/theme.c:5246
|
||||
#, c-format
|
||||
msgid "No <%s> set for theme \"%s\""
|
||||
msgstr "No se configuró <%s> para el tema «%s»"
|
||||
|
||||
#: ../src/ui/theme.c:5311
|
||||
#: ../src/ui/theme.c:5254
|
||||
#, c-format
|
||||
msgid ""
|
||||
"No frame style set for window type \"%s\" in theme \"%s\", add a <window "
|
||||
@ -1063,7 +1007,7 @@ msgstr ""
|
||||
"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\"/>"
|
||||
|
||||
#: ../src/ui/theme.c:5709 ../src/ui/theme.c:5771 ../src/ui/theme.c:5834
|
||||
#: ../src/ui/theme.c:5650 ../src/ui/theme.c:5712 ../src/ui/theme.c:5775
|
||||
#, c-format
|
||||
msgid ""
|
||||
"User-defined constants must begin with a capital letter; \"%s\" does not"
|
||||
@ -1071,7 +1015,7 @@ msgstr ""
|
||||
"Las constantes definidas por el usuario deben comenzar con una letra "
|
||||
"mayúscula; «%s» no lo hace"
|
||||
|
||||
#: ../src/ui/theme.c:5717 ../src/ui/theme.c:5779 ../src/ui/theme.c:5842
|
||||
#: ../src/ui/theme.c:5658 ../src/ui/theme.c:5720 ../src/ui/theme.c:5783
|
||||
#, c-format
|
||||
msgid "Constant \"%s\" has already been defined"
|
||||
msgstr "La constante «%s» ya ha sido definida"
|
||||
@ -1097,7 +1041,7 @@ msgstr "El atributo «%s» se ha repetido dos veces en el mismo elemento <%s>"
|
||||
#: ../src/ui/theme-parser.c:503 ../src/ui/theme-parser.c:552
|
||||
#, c-format
|
||||
msgid "Attribute \"%s\" is invalid on <%s> element in this context"
|
||||
msgstr "El atributo «%s» es inválido en el elemento <%s> en este contexto"
|
||||
msgstr "El atributo «%s» es no válido en el elemento <%s> en este contexto"
|
||||
|
||||
#: ../src/ui/theme-parser.c:594
|
||||
#, c-format
|
||||
@ -1147,7 +1091,7 @@ msgid ""
|
||||
"Invalid title scale \"%s\" (must be one of xx-small,x-small,small,medium,"
|
||||
"large,x-large,xx-large)\n"
|
||||
msgstr ""
|
||||
"Escala de título inválida «%s» (debe ser una de xx-small,x-small,small,medium,"
|
||||
"Escala de título no válida «%s» (debe ser una de xx-small,x-small,small,medium,"
|
||||
"large,x-large,xx-large)\n"
|
||||
|
||||
#: ../src/ui/theme-parser.c:1019 ../src/ui/theme-parser.c:1082
|
||||
@ -1462,7 +1406,7 @@ msgstr "No se permite texto dentro del elemento <%s>"
|
||||
msgid "<%s> specified twice for this theme"
|
||||
msgstr "<%s> especificado dos veces para este tema"
|
||||
|
||||
#: ../src/ui/theme-parser.c:4348
|
||||
#: ../src/ui/theme-parser.c:4334
|
||||
#, c-format
|
||||
msgid "Failed to find a valid file for theme %s\n"
|
||||
msgstr "Falló al encontrar un archivo válido para el tema%s\n"
|
||||
@ -1669,6 +1613,49 @@ msgstr ""
|
||||
"%d expresiones de coordenadas interpretadas en %g segundos (%g segundos de "
|
||||
"media)\n"
|
||||
|
||||
#~ msgid "Live Hidden Windows"
|
||||
#~ msgstr "Ventanas activas ocultas"
|
||||
|
||||
#~ msgid ""
|
||||
#~ "Determines whether hidden windows (i.e., minimized windows and windows on "
|
||||
#~ "other workspaces than the current one) should be kept alive."
|
||||
#~ msgstr ""
|
||||
#~ "Determina si las ventanas ocultas (e.g., ventanas minimizadas y ventanas "
|
||||
#~ "en otros escritorios distintos del actual) deberían mantenerse activas."
|
||||
|
||||
#~ msgid "Close Window"
|
||||
#~ msgstr "Cerrar la ventana"
|
||||
|
||||
#~ msgid "Window Menu"
|
||||
#~ msgstr "Menú de la ventana"
|
||||
|
||||
#~ msgid "Minimize Window"
|
||||
#~ msgstr "Minimizar la ventana"
|
||||
|
||||
#~ msgid "Maximize Window"
|
||||
#~ msgstr "Maximizar la ventana"
|
||||
|
||||
#~ msgid "Restore Window"
|
||||
#~ msgstr "Restablecer la ventana"
|
||||
|
||||
#~ msgid "Roll Up Window"
|
||||
#~ msgstr "Enrollar ventana"
|
||||
|
||||
#~ msgid "Unroll Window"
|
||||
#~ msgstr "Desenrollar ventana"
|
||||
|
||||
#~ msgid "Keep Window On Top"
|
||||
#~ msgstr "Mantener la ventana encima"
|
||||
|
||||
#~ msgid "Remove Window From Top"
|
||||
#~ msgstr "Quitar ventana de encima"
|
||||
|
||||
#~ msgid "Always On Visible Workspace"
|
||||
#~ msgstr "Siempre en el área de trabajo visible"
|
||||
|
||||
#~ msgid "Put Window On Only One Workspace"
|
||||
#~ msgstr "Poner la ventana sólo en un área de trabajo"
|
||||
|
||||
#~ msgid "Switch to workspace 1"
|
||||
#~ msgstr "Cambiar al área de trabajo 1"
|
||||
|
||||
|
@ -222,7 +222,7 @@ INTROSPECTION_GIRS = Meta-$(api_version).gir
|
||||
|
||||
Meta-$(api_version).gir: libmutter.la
|
||||
@META_GIR@_INCLUDES = GObject-2.0 GDesktopEnums-3.0 Gdk-3.0 Gtk-3.0 Clutter-1.0 xlib-2.0 xfixes-4.0
|
||||
@META_GIR@_PACKAGES = clutter-1.0 gtk+-3.0
|
||||
@META_GIR@_EXPORT_PACKAGES = libmutter
|
||||
@META_GIR@_CFLAGS = $(INCLUDES)
|
||||
@META_GIR@_LIBS = libmutter.la
|
||||
@META_GIR@_FILES = \
|
||||
|
@ -871,29 +871,6 @@ meta_compositor_unmaximize_window (MetaCompositor *compositor,
|
||||
meta_window_actor_unmaximize (window_actor, old_rect, new_rect);
|
||||
}
|
||||
|
||||
void
|
||||
meta_compositor_update_workspace_geometry (MetaCompositor *compositor,
|
||||
MetaWorkspace *workspace)
|
||||
{
|
||||
#if 0
|
||||
/* FIXME -- should do away with this function in favour of MetaWorkspace
|
||||
* signal.
|
||||
*/
|
||||
MetaScreen *screen = meta_workspace_get_screen (workspace);
|
||||
MetaCompScreen *info;
|
||||
MetaPluginManager *mgr;
|
||||
|
||||
DEBUG_TRACE ("meta_compositor_update_workspace_geometry\n");
|
||||
info = meta_screen_get_compositor_data (screen);
|
||||
mgr = info->plugin_mgr;
|
||||
|
||||
if (!mgr || !workspace)
|
||||
return;
|
||||
|
||||
meta_plugin_manager_update_workspace (mgr, workspace);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
meta_compositor_switch_workspace (MetaCompositor *compositor,
|
||||
MetaScreen *screen,
|
||||
|
@ -66,10 +66,6 @@ gboolean meta_plugin_manager_event_maximize (MetaPluginManager *mgr,
|
||||
gint target_y,
|
||||
gint target_width,
|
||||
gint target_height);
|
||||
void meta_plugin_manager_update_workspaces (MetaPluginManager *mgr);
|
||||
|
||||
void meta_plugin_manager_update_workspace (MetaPluginManager *mgr,
|
||||
MetaWorkspace *w);
|
||||
|
||||
gboolean meta_plugin_manager_switch_workspace (MetaPluginManager *mgr,
|
||||
gint from,
|
||||
|
@ -396,7 +396,7 @@ meta_plugin_begin_modal (MetaPlugin *plugin,
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_plugin_end_modal
|
||||
* meta_plugin_end_modal:
|
||||
* @plugin: a #MetaPlugin
|
||||
* @timestamp: the time used for releasing grabs
|
||||
*
|
||||
|
@ -1,11 +1,13 @@
|
||||
/*
|
||||
* shaped texture
|
||||
*
|
||||
* An actor to draw a texture clipped to a list of rectangles
|
||||
* An actor to draw a masked texture.
|
||||
*
|
||||
* Authored By Neil Roberts <neil@linux.intel.com>
|
||||
* and Jasper St. Pierre <jstpierre@mecheye.net>
|
||||
*
|
||||
* Copyright (C) 2008 Intel Corporation
|
||||
* Copyright (C) 2012 Red Hat, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
@ -30,13 +32,11 @@
|
||||
|
||||
#include <meta/meta-shaped-texture.h>
|
||||
#include "meta-texture-tower.h"
|
||||
#include "meta-texture-rectangle.h"
|
||||
|
||||
#include <clutter/clutter.h>
|
||||
#include <cogl/cogl.h>
|
||||
#include <cogl/cogl-texture-pixmap-x11.h>
|
||||
#include <gdk/gdk.h> /* for gdk_rectangle_intersect() */
|
||||
#include <string.h>
|
||||
|
||||
static void meta_shaped_texture_dispose (GObject *object);
|
||||
|
||||
@ -54,8 +54,6 @@ static void meta_shaped_texture_get_preferred_height (ClutterActor *self,
|
||||
gfloat *min_height_p,
|
||||
gfloat *natural_height_p);
|
||||
|
||||
static void meta_shaped_texture_dirty_mask (MetaShapedTexture *stex);
|
||||
|
||||
static gboolean meta_shaped_texture_get_paint_volume (ClutterActor *self, ClutterPaintVolume *volume);
|
||||
|
||||
G_DEFINE_TYPE (MetaShapedTexture, meta_shaped_texture,
|
||||
@ -75,13 +73,8 @@ struct _MetaShapedTexturePrivate
|
||||
CoglHandle material_unshaped;
|
||||
|
||||
cairo_region_t *clip_region;
|
||||
cairo_region_t *shape_region;
|
||||
|
||||
cairo_region_t *overlay_region;
|
||||
cairo_path_t *overlay_path;
|
||||
|
||||
guint tex_width, tex_height;
|
||||
guint mask_width, mask_height;
|
||||
|
||||
guint create_mipmaps : 1;
|
||||
};
|
||||
@ -110,9 +103,6 @@ meta_shaped_texture_init (MetaShapedTexture *self)
|
||||
|
||||
priv = self->priv = META_SHAPED_TEXTURE_GET_PRIVATE (self);
|
||||
|
||||
priv->shape_region = NULL;
|
||||
priv->overlay_path = NULL;
|
||||
priv->overlay_region = NULL;
|
||||
priv->paint_tower = meta_texture_tower_new ();
|
||||
priv->texture = COGL_INVALID_HANDLE;
|
||||
priv->mask_texture = COGL_INVALID_HANDLE;
|
||||
@ -129,8 +119,6 @@ meta_shaped_texture_dispose (GObject *object)
|
||||
meta_texture_tower_free (priv->paint_tower);
|
||||
priv->paint_tower = NULL;
|
||||
|
||||
meta_shaped_texture_dirty_mask (self);
|
||||
|
||||
if (priv->material != COGL_INVALID_HANDLE)
|
||||
{
|
||||
cogl_handle_unref (priv->material);
|
||||
@ -147,186 +135,12 @@ meta_shaped_texture_dispose (GObject *object)
|
||||
priv->texture = COGL_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
meta_shaped_texture_set_shape_region (self, NULL);
|
||||
meta_shaped_texture_set_mask_texture (self, COGL_INVALID_HANDLE);
|
||||
meta_shaped_texture_set_clip_region (self, NULL);
|
||||
meta_shaped_texture_set_overlay_path (self, NULL, NULL);
|
||||
|
||||
G_OBJECT_CLASS (meta_shaped_texture_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_shaped_texture_dirty_mask (MetaShapedTexture *stex)
|
||||
{
|
||||
MetaShapedTexturePrivate *priv = stex->priv;
|
||||
|
||||
if (priv->mask_texture != COGL_INVALID_HANDLE)
|
||||
{
|
||||
cogl_handle_unref (priv->mask_texture);
|
||||
priv->mask_texture = COGL_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
if (priv->material != COGL_INVALID_HANDLE)
|
||||
cogl_material_set_layer (priv->material, 1, COGL_INVALID_HANDLE);
|
||||
}
|
||||
|
||||
static void
|
||||
install_overlay_path (MetaShapedTexture *stex,
|
||||
guchar *mask_data,
|
||||
int tex_width,
|
||||
int tex_height,
|
||||
int stride)
|
||||
{
|
||||
MetaShapedTexturePrivate *priv = stex->priv;
|
||||
int i, n_rects;
|
||||
cairo_t *cr;
|
||||
cairo_rectangle_int_t rect;
|
||||
cairo_surface_t *surface;
|
||||
|
||||
if (priv->overlay_region == NULL)
|
||||
return;
|
||||
|
||||
surface = cairo_image_surface_create_for_data (mask_data,
|
||||
CAIRO_FORMAT_A8,
|
||||
tex_width,
|
||||
tex_height,
|
||||
stride);
|
||||
|
||||
cr = cairo_create (surface);
|
||||
cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
|
||||
|
||||
n_rects = cairo_region_num_rectangles (priv->overlay_region);
|
||||
for (i = 0; i < n_rects; i++)
|
||||
{
|
||||
cairo_region_get_rectangle (priv->overlay_region, i, &rect);
|
||||
cairo_rectangle (cr, rect.x, rect.y, rect.width, rect.height);
|
||||
}
|
||||
|
||||
cairo_fill_preserve (cr);
|
||||
if (priv->overlay_path == NULL)
|
||||
{
|
||||
/* If we have an overlay region but not an overlay path, then we
|
||||
* just need to clear the rectangles in the overlay region. */
|
||||
goto out;
|
||||
}
|
||||
|
||||
cairo_clip (cr);
|
||||
|
||||
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
|
||||
cairo_set_source_rgba (cr, 1, 1, 1, 1);
|
||||
|
||||
cairo_append_path (cr, priv->overlay_path);
|
||||
cairo_fill (cr);
|
||||
|
||||
out:
|
||||
cairo_destroy (cr);
|
||||
cairo_surface_destroy (surface);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_shaped_texture_ensure_mask (MetaShapedTexture *stex)
|
||||
{
|
||||
MetaShapedTexturePrivate *priv = stex->priv;
|
||||
CoglHandle paint_tex;
|
||||
guint tex_width, tex_height;
|
||||
|
||||
paint_tex = priv->texture;
|
||||
|
||||
if (paint_tex == COGL_INVALID_HANDLE)
|
||||
return;
|
||||
|
||||
tex_width = cogl_texture_get_width (paint_tex);
|
||||
tex_height = cogl_texture_get_height (paint_tex);
|
||||
|
||||
/* If the mask texture we have was created for a different size then
|
||||
recreate it */
|
||||
if (priv->mask_texture != COGL_INVALID_HANDLE
|
||||
&& (priv->mask_width != tex_width || priv->mask_height != tex_height))
|
||||
meta_shaped_texture_dirty_mask (stex);
|
||||
|
||||
/* If we don't have a mask texture yet then create one */
|
||||
if (priv->mask_texture == COGL_INVALID_HANDLE)
|
||||
{
|
||||
guchar *mask_data;
|
||||
int i;
|
||||
int n_rects;
|
||||
int stride;
|
||||
GLenum paint_gl_target;
|
||||
|
||||
/* If we have no shape region and no (or an empty) overlay region, we
|
||||
* don't need to create a full mask texture, so quit early. */
|
||||
if (priv->shape_region == NULL &&
|
||||
(priv->overlay_region == NULL ||
|
||||
cairo_region_num_rectangles (priv->overlay_region) == 0))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
stride = cairo_format_stride_for_width (CAIRO_FORMAT_A8, tex_width);
|
||||
|
||||
/* Create data for an empty image */
|
||||
mask_data = g_malloc0 (stride * tex_height);
|
||||
|
||||
n_rects = cairo_region_num_rectangles (priv->shape_region);
|
||||
|
||||
/* Fill in each rectangle. */
|
||||
for (i = 0; i < n_rects; i ++)
|
||||
{
|
||||
cairo_rectangle_int_t rect;
|
||||
cairo_region_get_rectangle (priv->shape_region, i, &rect);
|
||||
|
||||
gint x1 = rect.x, x2 = x1 + rect.width;
|
||||
gint y1 = rect.y, y2 = y1 + rect.height;
|
||||
guchar *p;
|
||||
|
||||
/* Clip the rectangle to the size of the texture */
|
||||
x1 = CLAMP (x1, 0, (gint) tex_width - 1);
|
||||
x2 = CLAMP (x2, x1, (gint) tex_width);
|
||||
y1 = CLAMP (y1, 0, (gint) tex_height - 1);
|
||||
y2 = CLAMP (y2, y1, (gint) tex_height);
|
||||
|
||||
/* Fill the rectangle */
|
||||
for (p = mask_data + y1 * stride + x1;
|
||||
y1 < y2;
|
||||
y1++, p += stride)
|
||||
memset (p, 255, x2 - x1);
|
||||
}
|
||||
|
||||
install_overlay_path (stex, mask_data, tex_width, tex_height, stride);
|
||||
|
||||
cogl_texture_get_gl_texture (paint_tex, NULL, &paint_gl_target);
|
||||
|
||||
#ifdef GL_TEXTURE_RECTANGLE_ARB
|
||||
if (paint_gl_target == GL_TEXTURE_RECTANGLE_ARB)
|
||||
{
|
||||
priv->mask_texture
|
||||
= meta_texture_rectangle_new (tex_width, tex_height,
|
||||
0, /* flags */
|
||||
/* data format */
|
||||
COGL_PIXEL_FORMAT_A_8,
|
||||
/* internal GL format */
|
||||
GL_ALPHA,
|
||||
/* internal cogl format */
|
||||
COGL_PIXEL_FORMAT_A_8,
|
||||
/* rowstride */
|
||||
stride,
|
||||
mask_data);
|
||||
}
|
||||
else
|
||||
#endif /* GL_TEXTURE_RECTANGLE_ARB */
|
||||
priv->mask_texture = cogl_texture_new_from_data (tex_width, tex_height,
|
||||
COGL_TEXTURE_NONE,
|
||||
COGL_PIXEL_FORMAT_A_8,
|
||||
COGL_PIXEL_FORMAT_ANY,
|
||||
stride,
|
||||
mask_data);
|
||||
|
||||
g_free (mask_data);
|
||||
|
||||
priv->mask_width = tex_width;
|
||||
priv->mask_height = tex_height;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
meta_shaped_texture_paint (ClutterActor *actor)
|
||||
{
|
||||
@ -376,9 +190,9 @@ meta_shaped_texture_paint (ClutterActor *actor)
|
||||
if (tex_width == 0 || tex_height == 0) /* no contents yet */
|
||||
return;
|
||||
|
||||
if (priv->shape_region == NULL)
|
||||
if (priv->mask_texture == COGL_INVALID_HANDLE)
|
||||
{
|
||||
/* No region means an unclipped shape. Use a single-layer texture. */
|
||||
/* Use a single-layer texture if we don't have a mask. */
|
||||
|
||||
if (priv->material_unshaped == COGL_INVALID_HANDLE)
|
||||
{
|
||||
@ -391,8 +205,6 @@ meta_shaped_texture_paint (ClutterActor *actor)
|
||||
}
|
||||
else
|
||||
{
|
||||
meta_shaped_texture_ensure_mask (stex);
|
||||
|
||||
if (priv->material == COGL_INVALID_HANDLE)
|
||||
{
|
||||
if (G_UNLIKELY (material_template == COGL_INVALID_HANDLE))
|
||||
@ -483,7 +295,7 @@ meta_shaped_texture_pick (ClutterActor *actor,
|
||||
MetaShapedTexturePrivate *priv = stex->priv;
|
||||
|
||||
/* If there is no region then use the regular pick */
|
||||
if (priv->shape_region == NULL)
|
||||
if (priv->mask_texture == COGL_INVALID_HANDLE)
|
||||
CLUTTER_ACTOR_CLASS (meta_shaped_texture_parent_class)
|
||||
->pick (actor, color);
|
||||
else if (clutter_actor_should_pick_paint (actor))
|
||||
@ -503,8 +315,6 @@ meta_shaped_texture_pick (ClutterActor *actor,
|
||||
if (tex_width == 0 || tex_height == 0) /* no contents yet */
|
||||
return;
|
||||
|
||||
meta_shaped_texture_ensure_mask (stex);
|
||||
|
||||
cogl_set_source_color4ub (color->red, color->green, color->blue,
|
||||
color->alpha);
|
||||
|
||||
@ -595,8 +405,8 @@ meta_shaped_texture_set_create_mipmaps (MetaShapedTexture *stex,
|
||||
}
|
||||
|
||||
void
|
||||
meta_shaped_texture_set_shape_region (MetaShapedTexture *stex,
|
||||
cairo_region_t *region)
|
||||
meta_shaped_texture_set_mask_texture (MetaShapedTexture *stex,
|
||||
CoglHandle mask_texture)
|
||||
{
|
||||
MetaShapedTexturePrivate *priv;
|
||||
|
||||
@ -604,19 +414,18 @@ meta_shaped_texture_set_shape_region (MetaShapedTexture *stex,
|
||||
|
||||
priv = stex->priv;
|
||||
|
||||
if (priv->shape_region != NULL)
|
||||
if (priv->mask_texture != COGL_INVALID_HANDLE)
|
||||
{
|
||||
cairo_region_destroy (priv->shape_region);
|
||||
priv->shape_region = NULL;
|
||||
cogl_handle_unref (priv->mask_texture);
|
||||
priv->mask_texture = COGL_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
if (region != NULL)
|
||||
if (mask_texture != COGL_INVALID_HANDLE)
|
||||
{
|
||||
cairo_region_reference (region);
|
||||
priv->shape_region = region;
|
||||
priv->mask_texture = mask_texture;
|
||||
cogl_handle_ref (priv->mask_texture);
|
||||
}
|
||||
|
||||
meta_shaped_texture_dirty_mask (stex);
|
||||
clutter_actor_queue_redraw (CLUTTER_ACTOR (stex));
|
||||
}
|
||||
|
||||
@ -735,48 +544,6 @@ meta_shaped_texture_get_texture (MetaShapedTexture *stex)
|
||||
return stex->priv->texture;
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_shaped_texture_set_overlay_path:
|
||||
* @stex: a #MetaShapedTexture
|
||||
* @overlay_region: A region containing the parts of the mask to overlay.
|
||||
* All rectangles in this region are wiped clear to full transparency,
|
||||
* and the overlay path is clipped to this region.
|
||||
* @overlay_path: (transfer full): This path will be painted onto the mask
|
||||
* texture with a fully opaque source. Due to the lack of refcounting
|
||||
* in #cairo_path_t, ownership of the path is assumed.
|
||||
*/
|
||||
void
|
||||
meta_shaped_texture_set_overlay_path (MetaShapedTexture *stex,
|
||||
cairo_region_t *overlay_region,
|
||||
cairo_path_t *overlay_path)
|
||||
{
|
||||
MetaShapedTexturePrivate *priv;
|
||||
|
||||
g_return_if_fail (META_IS_SHAPED_TEXTURE (stex));
|
||||
|
||||
priv = stex->priv;
|
||||
|
||||
if (priv->overlay_region != NULL)
|
||||
{
|
||||
cairo_region_destroy (priv->overlay_region);
|
||||
priv->overlay_region = NULL;
|
||||
}
|
||||
|
||||
if (priv->overlay_path != NULL)
|
||||
{
|
||||
cairo_path_destroy (priv->overlay_path);
|
||||
priv->overlay_path = NULL;
|
||||
}
|
||||
|
||||
cairo_region_reference (overlay_region);
|
||||
priv->overlay_region = overlay_region;
|
||||
|
||||
/* cairo_path_t does not have refcounting. */
|
||||
priv->overlay_path = overlay_path;
|
||||
|
||||
meta_shaped_texture_dirty_mask (stex);
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_shaped_texture_set_clip_region:
|
||||
* @stex: a #MetaShapedTexture
|
||||
|
@ -5,7 +5,7 @@
|
||||
*
|
||||
* Authored By Neil Roberts <neil@linux.intel.com>
|
||||
*
|
||||
* Copyright (C) 2011 Intel Corporation
|
||||
* Copyright (C) 2011, 2012 Intel Corporation
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
@ -25,94 +25,77 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#define CLUTTER_ENABLE_EXPERIMENTAL_API
|
||||
#define COGL_ENABLE_EXPERIMENTAL_API
|
||||
|
||||
#include <clutter/clutter.h>
|
||||
#include "meta-texture-rectangle.h"
|
||||
|
||||
#ifdef GL_TEXTURE_RECTANGLE_ARB
|
||||
|
||||
static void (* pf_glGetIntegerv) (GLenum pname, GLint *params);
|
||||
static void (* pf_glTexImage2D) (GLenum target, GLint level,
|
||||
GLint internalFormat,
|
||||
GLsizei width, GLsizei height,
|
||||
GLint border, GLenum format, GLenum type,
|
||||
const GLvoid *pixels);
|
||||
static void (* pf_glGenTextures) (GLsizei n, GLuint *textures);
|
||||
static void (* pf_glDeleteTextures) (GLsizei n, const GLuint *texture);
|
||||
static void (* pf_glBindTexture) (GLenum target, GLuint texture);
|
||||
|
||||
static void
|
||||
rectangle_texture_destroy_cb (void *user_data)
|
||||
{
|
||||
GLuint tex = GPOINTER_TO_UINT (user_data);
|
||||
|
||||
pf_glDeleteTextures (1, &tex);
|
||||
}
|
||||
|
||||
#endif /* GL_TEXTURE_RECTANGLE_ARB */
|
||||
|
||||
CoglHandle
|
||||
CoglTexture *
|
||||
meta_texture_rectangle_new (unsigned int width,
|
||||
unsigned int height,
|
||||
CoglTextureFlags flags,
|
||||
CoglPixelFormat format,
|
||||
GLenum internal_gl_format,
|
||||
GLenum internal_format,
|
||||
CoglPixelFormat internal_format,
|
||||
unsigned int rowstride,
|
||||
const guint8 *data)
|
||||
const guint8 *data,
|
||||
GError **error)
|
||||
{
|
||||
CoglHandle cogl_tex = COGL_INVALID_HANDLE;
|
||||
ClutterBackend *backend =
|
||||
clutter_get_default_backend ();
|
||||
CoglContext *context =
|
||||
clutter_backend_get_cogl_context (backend);
|
||||
CoglTextureRectangle *tex_rect;
|
||||
|
||||
#ifdef GL_TEXTURE_RECTANGLE_ARB
|
||||
tex_rect = cogl_texture_rectangle_new_with_size (context,
|
||||
width, height,
|
||||
internal_format,
|
||||
error);
|
||||
if (tex_rect == NULL)
|
||||
return NULL;
|
||||
|
||||
static CoglUserDataKey user_data_key;
|
||||
GLint old_binding;
|
||||
GLuint tex;
|
||||
|
||||
if (pf_glGenTextures == NULL)
|
||||
{
|
||||
pf_glGetIntegerv = (void *) cogl_get_proc_address ("glGetIntegerv");
|
||||
pf_glTexImage2D = (void *) cogl_get_proc_address ("glTexImage2D");
|
||||
pf_glGenTextures = (void *) cogl_get_proc_address ("glGenTextures");
|
||||
pf_glDeleteTextures = (void *) cogl_get_proc_address ("glDeleteTextures");
|
||||
pf_glBindTexture = (void *) cogl_get_proc_address ("glBindTexture");
|
||||
}
|
||||
|
||||
pf_glGenTextures (1, &tex);
|
||||
pf_glGetIntegerv (GL_TEXTURE_BINDING_RECTANGLE_ARB, &old_binding);
|
||||
pf_glBindTexture (GL_TEXTURE_RECTANGLE_ARB, tex);
|
||||
pf_glTexImage2D (GL_TEXTURE_RECTANGLE_ARB, 0,
|
||||
internal_gl_format, width, height,
|
||||
0, internal_gl_format,
|
||||
GL_UNSIGNED_BYTE, NULL);
|
||||
pf_glBindTexture (GL_TEXTURE_RECTANGLE_ARB, old_binding);
|
||||
|
||||
cogl_tex = cogl_texture_new_from_foreign (tex,
|
||||
GL_TEXTURE_RECTANGLE_ARB,
|
||||
width, height,
|
||||
0, 0, /* no waste */
|
||||
internal_format);
|
||||
|
||||
/* Cogl won't destroy the GL texture when a foreign texture is used
|
||||
so we need to destroy it manually. We can set a destroy
|
||||
notification callback to do this transparently */
|
||||
cogl_object_set_user_data (cogl_tex,
|
||||
&user_data_key,
|
||||
GUINT_TO_POINTER (tex),
|
||||
rectangle_texture_destroy_cb);
|
||||
|
||||
/* Use cogl_texture_set_region instead of uploading the data
|
||||
directly with GL calls so that we can let Cogl deal with setting
|
||||
the pixel store parameters and handling format conversion */
|
||||
if (data)
|
||||
cogl_texture_set_region (cogl_tex,
|
||||
0, 0, /* src x/y */
|
||||
0, 0, /* dst x/y */
|
||||
width, height, /* dst width/height */
|
||||
width, height, /* src width/height */
|
||||
cogl_texture_set_region (COGL_TEXTURE (tex_rect),
|
||||
0, 0, /* src_x/y */
|
||||
0, 0, /* dst_x/y */
|
||||
width, height, /* dst_width/height */
|
||||
width, height, /* width/height */
|
||||
format,
|
||||
rowstride,
|
||||
data);
|
||||
|
||||
#endif /* GL_TEXTURE_RECTANGLE_ARB */
|
||||
|
||||
return cogl_tex;
|
||||
return COGL_TEXTURE (tex_rect);
|
||||
}
|
||||
|
||||
static void
|
||||
texture_rectangle_check_cb (CoglTexture *sub_texture,
|
||||
const float *sub_texture_coords,
|
||||
const float *meta_coords,
|
||||
void *user_data)
|
||||
{
|
||||
gboolean *result = user_data;
|
||||
|
||||
if (cogl_is_texture_rectangle (sub_texture))
|
||||
*result = TRUE;
|
||||
}
|
||||
|
||||
/* Determines if the given texture is using a rectangle texture as its
|
||||
* primitive texture type. Eventually this function could be replaced
|
||||
* with cogl_texture_get_type if Cogl makes that public.
|
||||
*
|
||||
* http://git.gnome.org/browse/cogl/commit/?h=8012eee31
|
||||
*/
|
||||
gboolean
|
||||
meta_texture_rectangle_check (CoglTexture *texture)
|
||||
{
|
||||
gboolean result = FALSE;
|
||||
|
||||
cogl_meta_texture_foreach_in_region (COGL_META_TEXTURE (texture),
|
||||
0.0f, 0.0f, /* tx_1 / ty_1 */
|
||||
1.0f, 1.0f, /* tx_2 / ty_2 */
|
||||
COGL_PIPELINE_WRAP_MODE_REPEAT,
|
||||
COGL_PIPELINE_WRAP_MODE_REPEAT,
|
||||
texture_rectangle_check_cb,
|
||||
&result);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -30,15 +30,17 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
CoglHandle
|
||||
CoglTexture *
|
||||
meta_texture_rectangle_new (unsigned int width,
|
||||
unsigned int height,
|
||||
CoglTextureFlags flags,
|
||||
CoglPixelFormat format,
|
||||
GLenum internal_gl_format,
|
||||
GLenum internal_format,
|
||||
CoglPixelFormat internal_format,
|
||||
unsigned int rowstride,
|
||||
const guint8 *data);
|
||||
const guint8 *data,
|
||||
GError **error);
|
||||
|
||||
gboolean
|
||||
meta_texture_rectangle_check (CoglTexture *texture);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -98,18 +98,6 @@ meta_texture_tower_free (MetaTextureTower *tower)
|
||||
g_slice_free (MetaTextureTower, tower);
|
||||
}
|
||||
|
||||
#ifdef GL_TEXTURE_RECTANGLE_ARB
|
||||
static gboolean
|
||||
texture_is_rectangle (CoglHandle texture)
|
||||
{
|
||||
GLuint gl_tex;
|
||||
GLenum gl_target;
|
||||
|
||||
cogl_texture_get_gl_texture (texture, &gl_tex, &gl_target);
|
||||
return gl_target == GL_TEXTURE_RECTANGLE_ARB;
|
||||
}
|
||||
#endif /* GL_TEXTURE_RECTANGLE_ARB */
|
||||
|
||||
/**
|
||||
* meta_texture_tower_set_base_texture:
|
||||
* @tower: a #MetaTextureTower
|
||||
@ -354,13 +342,11 @@ get_paint_level (int width, int height)
|
||||
return (int)(0.5 + lambda);
|
||||
}
|
||||
|
||||
#ifdef GL_TEXTURE_RECTANGLE_ARB
|
||||
static gboolean
|
||||
is_power_of_two (int x)
|
||||
{
|
||||
return (x & (x - 1)) == 0;
|
||||
}
|
||||
#endif /* GL_TEXTURE_RECTANGLE_ARB */
|
||||
|
||||
static void
|
||||
texture_tower_create_texture (MetaTextureTower *tower,
|
||||
@ -368,25 +354,23 @@ texture_tower_create_texture (MetaTextureTower *tower,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
#ifdef GL_TEXTURE_RECTANGLE_ARB
|
||||
if ((!is_power_of_two (width) || !is_power_of_two (height)) &&
|
||||
texture_is_rectangle (tower->textures[level - 1]))
|
||||
meta_texture_rectangle_check (tower->textures[level - 1]))
|
||||
{
|
||||
tower->textures[level] =
|
||||
meta_texture_rectangle_new (width, height,
|
||||
0, /* flags */
|
||||
/* data format */
|
||||
TEXTURE_FORMAT,
|
||||
/* internal GL format */
|
||||
GL_RGBA,
|
||||
/* internal cogl format */
|
||||
TEXTURE_FORMAT,
|
||||
/* rowstride */
|
||||
width * 4,
|
||||
/* data */
|
||||
NULL,
|
||||
/* error */
|
||||
NULL);
|
||||
}
|
||||
else
|
||||
#endif /* GL_TEXTURE_RECTANGLE_ARB */
|
||||
{
|
||||
tower->textures[level] = cogl_texture_new_with_size (width, height,
|
||||
COGL_TEXTURE_NO_AUTO_MIPMAP,
|
||||
@ -562,7 +546,7 @@ texture_tower_revalidate_client (MetaTextureTower *tower,
|
||||
4 * dest_width,
|
||||
dest_data);
|
||||
|
||||
if (dest_height < source_texture_height)
|
||||
if (dest_texture_height < source_texture_height)
|
||||
{
|
||||
g_free (source_tmp1);
|
||||
g_free (source_tmp2);
|
||||
|
@ -13,6 +13,7 @@
|
||||
#define COGL_ENABLE_EXPERIMENTAL_API
|
||||
#include <cogl/cogl-texture-pixmap-x11.h>
|
||||
#include <gdk/gdk.h> /* for gdk_rectangle_union() */
|
||||
#include <string.h>
|
||||
|
||||
#include <meta/display.h>
|
||||
#include <meta/errors.h>
|
||||
@ -24,6 +25,8 @@
|
||||
#include "compositor-private.h"
|
||||
#include "meta-shadow-factory-private.h"
|
||||
#include "meta-window-actor-private.h"
|
||||
#include "meta-texture-rectangle.h"
|
||||
#include "region-utils.h"
|
||||
|
||||
enum {
|
||||
POSITION_CHANGED,
|
||||
@ -123,15 +126,10 @@ enum
|
||||
PROP_META_WINDOW = 1,
|
||||
PROP_META_SCREEN,
|
||||
PROP_X_WINDOW,
|
||||
PROP_X_WINDOW_ATTRIBUTES,
|
||||
PROP_NO_SHADOW,
|
||||
PROP_SHADOW_CLASS
|
||||
};
|
||||
|
||||
#define DEFAULT_SHADOW_RADIUS 12
|
||||
#define DEFAULT_SHADOW_X_OFFSET 0
|
||||
#define DEFAULT_SHADOW_Y_OFFSET 8
|
||||
|
||||
static void meta_window_actor_dispose (GObject *object);
|
||||
static void meta_window_actor_finalize (GObject *object);
|
||||
static void meta_window_actor_constructed (GObject *object);
|
||||
@ -750,70 +748,41 @@ meta_window_actor_has_shadow (MetaWindowActor *self)
|
||||
* Always put a shadow around windows with a frame - This should override
|
||||
* the restriction about not putting a shadow around ARGB windows.
|
||||
*/
|
||||
if (priv->window)
|
||||
{
|
||||
if (meta_window_get_frame (priv->window))
|
||||
{
|
||||
meta_verbose ("Window 0x%x has shadow because it has a frame\n",
|
||||
(guint)priv->xwindow);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
if (meta_window_get_frame (priv->window))
|
||||
return TRUE;
|
||||
|
||||
/*
|
||||
* Do not add shadows to ARGB windows; eventually we should generate a
|
||||
* shadow from the input shape for such windows.
|
||||
*/
|
||||
if (priv->argb32 || priv->opacity != 0xff)
|
||||
{
|
||||
meta_verbose ("Window 0x%x has no shadow as it is ARGB\n",
|
||||
(guint)priv->xwindow);
|
||||
return FALSE;
|
||||
}
|
||||
return FALSE;
|
||||
|
||||
/*
|
||||
* Add shadows to override redirect windows (e.g., Gtk menus).
|
||||
*/
|
||||
if (priv->window->override_redirect)
|
||||
{
|
||||
meta_verbose ("Window 0x%x has shadow because it is override redirect.\n",
|
||||
(guint)priv->xwindow);
|
||||
return TRUE;
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
/*
|
||||
* Don't put shadow around DND icon windows
|
||||
*/
|
||||
if (window_type == META_WINDOW_DND ||
|
||||
window_type == META_WINDOW_DESKTOP)
|
||||
{
|
||||
meta_verbose ("Window 0x%x has no shadow as it is DND or Desktop\n",
|
||||
(guint)priv->xwindow);
|
||||
return FALSE;
|
||||
}
|
||||
return FALSE;
|
||||
|
||||
if (window_type == META_WINDOW_MENU
|
||||
#if 0
|
||||
|| window_type == META_WINDOW_DROPDOWN_MENU
|
||||
#endif
|
||||
)
|
||||
{
|
||||
meta_verbose ("Window 0x%x has shadow as it is a menu\n",
|
||||
(guint)priv->xwindow);
|
||||
return TRUE;
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
#if 0
|
||||
if (window_type == META_WINDOW_TOOLTIP)
|
||||
{
|
||||
meta_verbose ("Window 0x%x has shadow as it is a tooltip\n",
|
||||
(guint)priv->xwindow);
|
||||
return TRUE;
|
||||
}
|
||||
return TRUE;
|
||||
#endif
|
||||
|
||||
meta_verbose ("Window 0x%x has no shadow as it fell through\n",
|
||||
(guint)priv->xwindow);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -1715,7 +1684,7 @@ meta_window_actor_get_obscured_region (MetaWindowActor *self)
|
||||
#if 0
|
||||
/* Print out a region; useful for debugging */
|
||||
static void
|
||||
dump_region (cairo_region_t *region)
|
||||
print_region (cairo_region_t *region)
|
||||
{
|
||||
int n_rects;
|
||||
int i;
|
||||
@ -1733,6 +1702,26 @@ dump_region (cairo_region_t *region)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
/* Dump a region to a PNG file; useful for debugging */
|
||||
static void
|
||||
see_region (cairo_region_t *region,
|
||||
int width,
|
||||
int height,
|
||||
char *filename)
|
||||
{
|
||||
cairo_surface_t *surface = cairo_image_surface_create (CAIRO_FORMAT_A8, width, height);
|
||||
cairo_t *cr = cairo_create (surface);
|
||||
|
||||
gdk_cairo_region (cr, region);
|
||||
cairo_fill (cr);
|
||||
|
||||
cairo_surface_write_to_png (surface, filename);
|
||||
cairo_destroy (cr);
|
||||
cairo_surface_destroy (surface);
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* meta_window_actor_set_visible_region:
|
||||
* @self: a #MetaWindowActor
|
||||
@ -2023,121 +2012,196 @@ meta_window_actor_sync_visibility (MetaWindowActor *self)
|
||||
}
|
||||
}
|
||||
|
||||
static inline void
|
||||
set_integral_bounding_rect (cairo_rectangle_int_t *rect,
|
||||
double x, double y,
|
||||
double width, double height)
|
||||
{
|
||||
rect->x = floor(x);
|
||||
rect->y = floor(y);
|
||||
rect->width = ceil(x + width) - rect->x;
|
||||
rect->height = ceil(y + height) - rect->y;
|
||||
}
|
||||
#define TAU (2*M_PI)
|
||||
|
||||
static void
|
||||
update_corners (MetaWindowActor *self,
|
||||
MetaFrameBorders *borders)
|
||||
install_corners (MetaWindow *window,
|
||||
MetaFrameBorders *borders,
|
||||
cairo_t *cr)
|
||||
{
|
||||
MetaWindowActorPrivate *priv = self->priv;
|
||||
MetaRectangle outer;
|
||||
cairo_rectangle_int_t corner_rects[4];
|
||||
cairo_region_t *corner_region;
|
||||
cairo_path_t *corner_path;
|
||||
float top_left, top_right, bottom_left, bottom_right;
|
||||
float x, y;
|
||||
int x, y;
|
||||
MetaRectangle outer;
|
||||
|
||||
/* need these to build a path */
|
||||
cairo_t *cr;
|
||||
cairo_surface_t *surface;
|
||||
|
||||
if (!priv->window->frame)
|
||||
{
|
||||
meta_shaped_texture_set_overlay_path (META_SHAPED_TEXTURE (priv->actor),
|
||||
NULL, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
meta_window_get_outer_rect (priv->window, &outer);
|
||||
|
||||
meta_frame_get_corner_radiuses (priv->window->frame,
|
||||
meta_frame_get_corner_radiuses (window->frame,
|
||||
&top_left,
|
||||
&top_right,
|
||||
&bottom_left,
|
||||
&bottom_right);
|
||||
|
||||
/* Unfortunately, cairo does not allow us to create a context
|
||||
* without a surface. Create a 0x0 image surface to "paint to"
|
||||
* so we can get the path. */
|
||||
surface = cairo_image_surface_create (CAIRO_FORMAT_A8,
|
||||
0, 0);
|
||||
|
||||
cr = cairo_create (surface);
|
||||
meta_window_get_outer_rect (window, &outer);
|
||||
|
||||
/* top left */
|
||||
x = borders->invisible.left;
|
||||
y = borders->invisible.top;
|
||||
|
||||
set_integral_bounding_rect (&corner_rects[0],
|
||||
x, y, top_left, top_left);
|
||||
|
||||
cairo_arc (cr,
|
||||
x + top_left,
|
||||
y + top_left,
|
||||
top_left,
|
||||
0, M_PI*2);
|
||||
|
||||
2 * TAU / 4,
|
||||
3 * TAU / 4);
|
||||
|
||||
/* top right */
|
||||
x = borders->invisible.left + outer.width - top_right;
|
||||
y = borders->invisible.top;
|
||||
|
||||
set_integral_bounding_rect (&corner_rects[1],
|
||||
x, y, top_right, top_right);
|
||||
|
||||
cairo_arc (cr,
|
||||
x,
|
||||
y + top_right,
|
||||
top_right,
|
||||
0, M_PI*2);
|
||||
3 * TAU / 4,
|
||||
4 * TAU / 4);
|
||||
|
||||
/* bottom right */
|
||||
x = borders->invisible.left + outer.width - bottom_right;
|
||||
y = borders->invisible.top + outer.height - bottom_right;
|
||||
|
||||
set_integral_bounding_rect (&corner_rects[2],
|
||||
x, y, bottom_right, bottom_right);
|
||||
|
||||
cairo_arc (cr,
|
||||
x,
|
||||
y,
|
||||
bottom_right,
|
||||
0, M_PI*2);
|
||||
0 * TAU / 4,
|
||||
1 * TAU / 4);
|
||||
|
||||
/* bottom left */
|
||||
x = borders->invisible.left;
|
||||
y = borders->invisible.top + outer.height - bottom_left;
|
||||
|
||||
set_integral_bounding_rect (&corner_rects[3],
|
||||
x, y, bottom_left, bottom_left);
|
||||
|
||||
cairo_arc (cr,
|
||||
x + bottom_left,
|
||||
y,
|
||||
bottom_left,
|
||||
0, M_PI*2);
|
||||
1 * TAU / 4,
|
||||
2 * TAU / 4);
|
||||
|
||||
corner_path = cairo_copy_path (cr);
|
||||
cairo_set_source_rgba (cr, 1, 1, 1, 1);
|
||||
cairo_fill (cr);
|
||||
}
|
||||
|
||||
static cairo_region_t *
|
||||
scan_visible_region (guchar *mask_data,
|
||||
int stride,
|
||||
cairo_region_t *scan_area)
|
||||
{
|
||||
int i, n_rects = cairo_region_num_rectangles (scan_area);
|
||||
MetaRegionBuilder builder;
|
||||
|
||||
meta_region_builder_init (&builder);
|
||||
|
||||
for (i = 0; i < n_rects; i++)
|
||||
{
|
||||
int x, y;
|
||||
cairo_rectangle_int_t rect;
|
||||
|
||||
cairo_region_get_rectangle (scan_area, i, &rect);
|
||||
|
||||
for (y = rect.y; y < (rect.y + rect.height); y++)
|
||||
{
|
||||
for (x = rect.x; x < (rect.x + rect.width); x++)
|
||||
{
|
||||
int w = x;
|
||||
while (mask_data[y * stride + w] == 255 && w < (rect.x + rect.width))
|
||||
w++;
|
||||
|
||||
if (w > 0)
|
||||
{
|
||||
meta_region_builder_add_rectangle (&builder, x, y, w - x, 1);
|
||||
x = w;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return meta_region_builder_finish (&builder);
|
||||
}
|
||||
|
||||
static void
|
||||
build_and_scan_frame_mask (MetaWindowActor *self,
|
||||
MetaFrameBorders *borders,
|
||||
cairo_rectangle_int_t *client_area,
|
||||
cairo_region_t *shape_region)
|
||||
{
|
||||
MetaWindowActorPrivate *priv = self->priv;
|
||||
guchar *mask_data;
|
||||
guint tex_width, tex_height;
|
||||
CoglHandle paint_tex, mask_texture;
|
||||
int stride;
|
||||
cairo_t *cr;
|
||||
cairo_surface_t *surface;
|
||||
|
||||
paint_tex = meta_shaped_texture_get_texture (META_SHAPED_TEXTURE (priv->actor));
|
||||
if (paint_tex == COGL_INVALID_HANDLE)
|
||||
return;
|
||||
|
||||
tex_width = cogl_texture_get_width (paint_tex);
|
||||
tex_height = cogl_texture_get_height (paint_tex);
|
||||
|
||||
stride = cairo_format_stride_for_width (CAIRO_FORMAT_A8, tex_width);
|
||||
|
||||
/* Create data for an empty image */
|
||||
mask_data = g_malloc0 (stride * tex_height);
|
||||
|
||||
surface = cairo_image_surface_create_for_data (mask_data,
|
||||
CAIRO_FORMAT_A8,
|
||||
tex_width,
|
||||
tex_height,
|
||||
stride);
|
||||
cr = cairo_create (surface);
|
||||
|
||||
gdk_cairo_region (cr, shape_region);
|
||||
cairo_fill (cr);
|
||||
|
||||
if (priv->window->frame != NULL)
|
||||
{
|
||||
cairo_region_t *frame_paint_region, *scanned_region;
|
||||
cairo_rectangle_int_t rect = { 0, 0, tex_width, tex_height };
|
||||
|
||||
/* Make sure we don't paint the frame over the client window. */
|
||||
frame_paint_region = cairo_region_create_rectangle (&rect);
|
||||
cairo_region_subtract_rectangle (frame_paint_region, client_area);
|
||||
|
||||
gdk_cairo_region (cr, frame_paint_region);
|
||||
cairo_clip (cr);
|
||||
|
||||
install_corners (priv->window, borders, cr);
|
||||
|
||||
cairo_surface_flush (surface);
|
||||
scanned_region = scan_visible_region (mask_data, stride, frame_paint_region);
|
||||
cairo_region_union (shape_region, scanned_region);
|
||||
cairo_region_destroy (scanned_region);
|
||||
}
|
||||
|
||||
cairo_surface_destroy (surface);
|
||||
cairo_destroy (cr);
|
||||
cairo_surface_destroy (surface);
|
||||
|
||||
corner_region = cairo_region_create_rectangles (corner_rects, 4);
|
||||
if (meta_texture_rectangle_check (paint_tex))
|
||||
{
|
||||
mask_texture = meta_texture_rectangle_new (tex_width, tex_height,
|
||||
COGL_PIXEL_FORMAT_A_8,
|
||||
COGL_PIXEL_FORMAT_A_8,
|
||||
stride,
|
||||
mask_data,
|
||||
NULL /* error */);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Note: we don't allow slicing for this texture because we
|
||||
* need to use it with multi-texturing which doesn't support
|
||||
* sliced textures */
|
||||
mask_texture = cogl_texture_new_from_data (tex_width, tex_height,
|
||||
COGL_TEXTURE_NO_SLICING,
|
||||
COGL_PIXEL_FORMAT_A_8,
|
||||
COGL_PIXEL_FORMAT_ANY,
|
||||
stride,
|
||||
mask_data);
|
||||
}
|
||||
|
||||
meta_shaped_texture_set_overlay_path (META_SHAPED_TEXTURE (priv->actor),
|
||||
corner_region, corner_path);
|
||||
|
||||
cairo_region_destroy (corner_region);
|
||||
meta_shaped_texture_set_mask_texture (META_SHAPED_TEXTURE (priv->actor),
|
||||
mask_texture);
|
||||
cogl_handle_unref (mask_texture);
|
||||
|
||||
g_free (mask_data);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -2148,53 +2212,30 @@ check_needs_reshape (MetaWindowActor *self)
|
||||
MetaDisplay *display = meta_screen_get_display (screen);
|
||||
MetaFrameBorders borders;
|
||||
cairo_region_t *region;
|
||||
cairo_rectangle_int_t client_area;
|
||||
|
||||
if (!priv->needs_reshape)
|
||||
return;
|
||||
|
||||
meta_shaped_texture_set_shape_region (META_SHAPED_TEXTURE (priv->actor), NULL);
|
||||
meta_window_actor_clear_shape_region (self);
|
||||
|
||||
meta_frame_calc_borders (priv->window->frame, &borders);
|
||||
|
||||
region = meta_window_get_frame_bounds (priv->window);
|
||||
if (region != NULL)
|
||||
{
|
||||
/* This returns the window's internal frame bounds region,
|
||||
* so we need to copy it because we modify it below. */
|
||||
region = cairo_region_copy (region);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* If we have no region, we have no frame. We have no frame,
|
||||
* so just use the bounding region instead */
|
||||
region = cairo_region_copy (priv->bounding_region);
|
||||
}
|
||||
client_area.x = borders.total.left;
|
||||
client_area.y = borders.total.top;
|
||||
client_area.width = priv->window->rect.width;
|
||||
client_area.height = priv->window->rect.height;
|
||||
|
||||
meta_shaped_texture_set_mask_texture (META_SHAPED_TEXTURE (priv->actor), COGL_INVALID_HANDLE);
|
||||
meta_window_actor_clear_shape_region (self);
|
||||
|
||||
#ifdef HAVE_SHAPE
|
||||
if (priv->window->has_shape)
|
||||
{
|
||||
/* Translate the set of XShape rectangles that we
|
||||
* get from the X server to a cairo_region. */
|
||||
Display *xdisplay = meta_display_get_xdisplay (display);
|
||||
XRectangle *rects;
|
||||
int n_rects, ordering;
|
||||
cairo_rectangle_int_t client_area;
|
||||
|
||||
client_area.width = priv->window->rect.width;
|
||||
client_area.height = priv->window->rect.height;
|
||||
|
||||
if (priv->window->frame)
|
||||
{
|
||||
client_area.x = borders.total.left;
|
||||
client_area.y = borders.total.top;
|
||||
}
|
||||
else
|
||||
{
|
||||
client_area.x = 0;
|
||||
client_area.y = 0;
|
||||
}
|
||||
|
||||
/* Punch out client area. */
|
||||
cairo_region_subtract_rectangle (region, &client_area);
|
||||
cairo_rectangle_int_t *cairo_rects = NULL;
|
||||
|
||||
meta_error_trap_push (display);
|
||||
rects = XShapeGetRectangles (xdisplay,
|
||||
@ -2207,28 +2248,38 @@ check_needs_reshape (MetaWindowActor *self)
|
||||
if (rects)
|
||||
{
|
||||
int i;
|
||||
cairo_rects = g_new (cairo_rectangle_int_t, n_rects);
|
||||
for (i = 0; i < n_rects; i ++)
|
||||
{
|
||||
cairo_rectangle_int_t rect = { rects[i].x + client_area.x,
|
||||
rects[i].y + client_area.y,
|
||||
rects[i].width,
|
||||
rects[i].height };
|
||||
cairo_region_union_rectangle (region, &rect);
|
||||
cairo_rects[i].x = rects[i].x + client_area.x;
|
||||
cairo_rects[i].y = rects[i].y + client_area.y;
|
||||
cairo_rects[i].width = rects[i].width;
|
||||
cairo_rects[i].height = rects[i].height;
|
||||
}
|
||||
XFree (rects);
|
||||
}
|
||||
|
||||
region = cairo_region_create_rectangles (cairo_rects, n_rects);
|
||||
g_free (cairo_rects);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
/* If we don't have a shape on the server, that means that
|
||||
* we have an implicit shape of one rectangle covering the
|
||||
* entire window. */
|
||||
region = cairo_region_create_rectangle (&client_area);
|
||||
}
|
||||
|
||||
meta_shaped_texture_set_shape_region (META_SHAPED_TEXTURE (priv->actor),
|
||||
region);
|
||||
|
||||
/* This takes the region, generates a mask using GTK+
|
||||
* and scans the mask looking for all opaque pixels,
|
||||
* adding it to region.
|
||||
*/
|
||||
build_and_scan_frame_mask (self, &borders, &client_area, region);
|
||||
meta_window_actor_update_shape_region (self, region);
|
||||
|
||||
cairo_region_destroy (region);
|
||||
|
||||
update_corners (self, &borders);
|
||||
|
||||
priv->needs_reshape = FALSE;
|
||||
meta_window_actor_invalidate_shadow (self);
|
||||
}
|
||||
|
@ -209,7 +209,6 @@ meta_window_group_paint (ClutterActor *actor)
|
||||
if (META_IS_WINDOW_ACTOR (l->data))
|
||||
{
|
||||
MetaWindowActor *window_actor = l->data;
|
||||
window_actor = l->data;
|
||||
meta_window_actor_reset_visible_regions (window_actor);
|
||||
}
|
||||
else if (META_IS_BACKGROUND_ACTOR (l->data))
|
||||
|
@ -112,8 +112,6 @@ struct _MetaDefaultPluginPrivate
|
||||
ClutterActor *desktop2;
|
||||
|
||||
MetaPluginInfo info;
|
||||
|
||||
gboolean debug_mode : 1;
|
||||
};
|
||||
|
||||
/*
|
||||
@ -182,34 +180,6 @@ meta_default_plugin_get_property (GObject *object,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
start (MetaPlugin *plugin)
|
||||
{
|
||||
MetaDefaultPluginPrivate *priv = META_DEFAULT_PLUGIN (plugin)->priv;
|
||||
|
||||
guint destroy_timeout = DESTROY_TIMEOUT;
|
||||
guint minimize_timeout = MINIMIZE_TIMEOUT;
|
||||
guint maximize_timeout = MAXIMIZE_TIMEOUT;
|
||||
guint map_timeout = MAP_TIMEOUT;
|
||||
guint switch_timeout = SWITCH_TIMEOUT;
|
||||
|
||||
if (meta_plugin_debug_mode (plugin))
|
||||
{
|
||||
g_debug ("Plugin %s: Entering debug mode.", priv->info.name);
|
||||
|
||||
priv->debug_mode = TRUE;
|
||||
|
||||
/*
|
||||
* Double the effect duration to make them easier to observe.
|
||||
*/
|
||||
destroy_timeout *= 2;
|
||||
minimize_timeout *= 2;
|
||||
maximize_timeout *= 2;
|
||||
map_timeout *= 2;
|
||||
switch_timeout *= 2;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
meta_default_plugin_class_init (MetaDefaultPluginClass *klass)
|
||||
{
|
||||
@ -221,7 +191,6 @@ meta_default_plugin_class_init (MetaDefaultPluginClass *klass)
|
||||
gobject_class->set_property = meta_default_plugin_set_property;
|
||||
gobject_class->get_property = meta_default_plugin_get_property;
|
||||
|
||||
plugin_class->start = start;
|
||||
plugin_class->map = map;
|
||||
plugin_class->minimize = minimize;
|
||||
plugin_class->maximize = maximize;
|
||||
|
@ -43,34 +43,17 @@
|
||||
/* Optimium performance seems to be with MAX_CHUNK_RECTANGLES=4; 8 is about 10% slower.
|
||||
* But using 8 may be more robust to systems with slow malloc(). */
|
||||
#define MAX_CHUNK_RECTANGLES 8
|
||||
#define MAX_LEVELS 16
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* To merge regions in binary tree order, we need to keep track of
|
||||
* the regions that we've already merged together at different
|
||||
* levels of the tree. We fill in an array in the pattern:
|
||||
*
|
||||
* |a |
|
||||
* |b |a |
|
||||
* |c | |ab |
|
||||
* |d |c |ab |
|
||||
* |e | | |abcd|
|
||||
*/
|
||||
cairo_region_t *levels[MAX_LEVELS];
|
||||
int n_levels;
|
||||
} MetaRegionBuilder;
|
||||
|
||||
static void
|
||||
void
|
||||
meta_region_builder_init (MetaRegionBuilder *builder)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < MAX_LEVELS; i++)
|
||||
for (i = 0; i < META_REGION_BUILDER_MAX_LEVELS; i++)
|
||||
builder->levels[i] = NULL;
|
||||
builder->n_levels = 1;
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
meta_region_builder_add_rectangle (MetaRegionBuilder *builder,
|
||||
int x,
|
||||
int y,
|
||||
@ -95,7 +78,7 @@ meta_region_builder_add_rectangle (MetaRegionBuilder *builder,
|
||||
{
|
||||
if (builder->levels[i] == NULL)
|
||||
{
|
||||
if (i < MAX_LEVELS)
|
||||
if (i < META_REGION_BUILDER_MAX_LEVELS)
|
||||
{
|
||||
builder->levels[i] = builder->levels[i - 1];
|
||||
builder->levels[i - 1] = NULL;
|
||||
@ -115,7 +98,7 @@ meta_region_builder_add_rectangle (MetaRegionBuilder *builder,
|
||||
}
|
||||
}
|
||||
|
||||
static cairo_region_t *
|
||||
cairo_region_t *
|
||||
meta_region_builder_finish (MetaRegionBuilder *builder)
|
||||
{
|
||||
cairo_region_t *result = NULL;
|
||||
|
@ -63,6 +63,32 @@ struct _MetaRegionIterator {
|
||||
cairo_rectangle_int_t next_rectangle;
|
||||
};
|
||||
|
||||
typedef struct _MetaRegionBuilder MetaRegionBuilder;
|
||||
|
||||
#define META_REGION_BUILDER_MAX_LEVELS 16
|
||||
struct _MetaRegionBuilder {
|
||||
/* To merge regions in binary tree order, we need to keep track of
|
||||
* the regions that we've already merged together at different
|
||||
* levels of the tree. We fill in an array in the pattern:
|
||||
*
|
||||
* |a |
|
||||
* |b |a |
|
||||
* |c | |ab |
|
||||
* |d |c |ab |
|
||||
* |e | | |abcd|
|
||||
*/
|
||||
cairo_region_t *levels[META_REGION_BUILDER_MAX_LEVELS];
|
||||
int n_levels;
|
||||
};
|
||||
|
||||
void meta_region_builder_init (MetaRegionBuilder *builder);
|
||||
void meta_region_builder_add_rectangle (MetaRegionBuilder *builder,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height);
|
||||
cairo_region_t * meta_region_builder_finish (MetaRegionBuilder *builder);
|
||||
|
||||
void meta_region_iterator_init (MetaRegionIterator *iter,
|
||||
cairo_region_t *region);
|
||||
gboolean meta_region_iterator_at_end (MetaRegionIterator *iter);
|
||||
|
@ -23,7 +23,8 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file bell.c Ring the bell or flash the screen
|
||||
* SECTION:Bell
|
||||
* @short_description: Ring the bell or flash the screen
|
||||
*
|
||||
* Sometimes, X programs "ring the bell", whatever that means. Mutter lets
|
||||
* the user configure the bell to be audible or visible (aka visual), and
|
||||
@ -57,6 +58,10 @@
|
||||
#endif
|
||||
|
||||
/**
|
||||
* bell_flash_screen:
|
||||
* @display: The display which owns the screen (rather redundant)
|
||||
* @screen: The screen to flash
|
||||
*
|
||||
* Flashes one entire screen. This is done by making a window the size of the
|
||||
* whole screen (or reusing the old one, if it's still around), mapping it,
|
||||
* painting it white and then black, and then unmapping it. We set saveunder so
|
||||
@ -65,14 +70,12 @@
|
||||
* Unlike frame flashes, we don't do fullscreen flashes with a timeout; rather,
|
||||
* we do them in one go, because we don't have to rely on the theme code
|
||||
* redrawing the frame for us in order to do the flash.
|
||||
*
|
||||
* \param display The display which owns the screen (rather redundant)
|
||||
* \param screen The screen to flash
|
||||
*
|
||||
* \bug The way I read it, this appears not to do the flash
|
||||
*/
|
||||
/*
|
||||
* Bug: The way I read it, this appears not to do the flash
|
||||
* the first time we flash a particular display. Am I wrong?
|
||||
*
|
||||
* \bug This appears to destroy our current XSync status.
|
||||
* Bug: This appears to destroy our current XSync status.
|
||||
*/
|
||||
static void
|
||||
bell_flash_screen (MetaDisplay *display,
|
||||
@ -137,14 +140,15 @@ bell_flash_screen (MetaDisplay *display,
|
||||
}
|
||||
|
||||
/**
|
||||
* bell_flash_fullscreen:
|
||||
* @display: The display the event came in on
|
||||
* @xkb_ev: The bell event
|
||||
*
|
||||
* Flashes one screen, or all screens, in response to a bell event.
|
||||
* If the event is on a particular window, flash the screen that
|
||||
* window is on. Otherwise, flash every screen on this display.
|
||||
*
|
||||
* If the configure script found we had no XKB, this does not exist.
|
||||
*
|
||||
* \param display The display the event came in on
|
||||
* \param xkb_ev The bell event
|
||||
*/
|
||||
#ifdef HAVE_XKB
|
||||
static void
|
||||
@ -182,17 +186,21 @@ bell_flash_fullscreen (MetaDisplay *display,
|
||||
}
|
||||
|
||||
/**
|
||||
* bell_unflash_frame:
|
||||
* @data: The frame to unflash, cast to a gpointer so it can go into
|
||||
* a callback function.
|
||||
*
|
||||
* Makes a frame be not flashed; this is the timeout half of
|
||||
* bell_flash_window_frame(). This is done simply by clearing the
|
||||
* flash flag and queuing a redraw of the frame.
|
||||
*
|
||||
* If the configure script found we had no XKB, this does not exist.
|
||||
*
|
||||
* \param data The frame to unflash, cast to a gpointer so it can go into
|
||||
* a callback function.
|
||||
* \return Always FALSE, so we don't get called again.
|
||||
*
|
||||
* \bug This is the parallel to bell_flash_window_frame(), so it should
|
||||
* Returns: Always FALSE, so we don't get called again.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Bug: This is the parallel to bell_flash_window_frame(), so it should
|
||||
* really be called meta_bell_unflash_window_frame().
|
||||
*/
|
||||
static gboolean
|
||||
@ -205,6 +213,9 @@ bell_unflash_frame (gpointer data)
|
||||
}
|
||||
|
||||
/**
|
||||
* bell_flash_window_frame:
|
||||
* @window: The window to flash
|
||||
*
|
||||
* Makes a frame flash and then return to normal shortly afterwards.
|
||||
* This is done by setting a flag so that the theme
|
||||
* code will temporarily draw the frame as focussed if it's unfocussed and
|
||||
@ -212,8 +223,6 @@ bell_unflash_frame (gpointer data)
|
||||
* that the flag can be unset and the frame re-redrawn.
|
||||
*
|
||||
* If the configure script found we had no XKB, this does not exist.
|
||||
*
|
||||
* \param window The window to flash
|
||||
*/
|
||||
static void
|
||||
bell_flash_window_frame (MetaWindow *window)
|
||||
@ -231,11 +240,12 @@ bell_flash_window_frame (MetaWindow *window)
|
||||
}
|
||||
|
||||
/**
|
||||
* bell_flash_frame:
|
||||
* @display: The display the bell event came in on
|
||||
* @xkb_ev: The bell event we just received
|
||||
*
|
||||
* Flashes the frame of the focussed window. If there is no focussed window,
|
||||
* flashes the screen.
|
||||
*
|
||||
* \param display The display the bell event came in on
|
||||
* \param xkb_ev The bell event we just received
|
||||
*/
|
||||
static void
|
||||
bell_flash_frame (MetaDisplay *display,
|
||||
@ -261,15 +271,18 @@ bell_flash_frame (MetaDisplay *display,
|
||||
}
|
||||
|
||||
/**
|
||||
* bell_visual_notify:
|
||||
* @display: The display the bell event came in on
|
||||
* @xkb_ev: The bell event we just received
|
||||
*
|
||||
* Gives the user some kind of visual bell substitute, in response to a
|
||||
* bell event. What this is depends on the "visual bell type" pref.
|
||||
*
|
||||
* If the configure script found we had no XKB, this does not exist.
|
||||
*
|
||||
* \param display The display the bell event came in on
|
||||
* \param xkb_ev The bell event we just received
|
||||
*
|
||||
* \bug This should be merged with meta_bell_notify().
|
||||
*/
|
||||
|
||||
/*
|
||||
* Bug: This should be merged with meta_bell_notify().
|
||||
*/
|
||||
static void
|
||||
bell_visual_notify (MetaDisplay *display,
|
||||
@ -407,12 +420,13 @@ meta_bell_shutdown (MetaDisplay *display)
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_bell_notify_frame_destroy:
|
||||
* @frame: The frame which is being destroyed
|
||||
*
|
||||
* Deals with a frame being destroyed. This is important because if we're
|
||||
* using a visual bell, we might be flashing the edges of the frame, and
|
||||
* so we'd have a timeout function waiting ready to un-flash them. If the
|
||||
* frame's going away, we can tell the timeout not to bother.
|
||||
*
|
||||
* \param frame The frame which is being destroyed
|
||||
*/
|
||||
void
|
||||
meta_bell_notify_frame_destroy (MetaFrame *frame)
|
||||
|
@ -1,17 +1,5 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/**
|
||||
* \file bell.h Ring the bell or flash the screen
|
||||
*
|
||||
* Sometimes, X programs "ring the bell", whatever that means. Mutter lets
|
||||
* the user configure the bell to be audible or visible (aka visual), and
|
||||
* if it's visual it can be configured to be frame-flash or fullscreen-flash.
|
||||
* We never get told about audible bells; X handles them just fine by itself.
|
||||
*
|
||||
* The visual bell was the result of a discussion in Bugzilla here:
|
||||
* <http://bugzilla.gnome.org/show_bug.cgi?id=99886>.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2002 Sun Microsystems Inc.
|
||||
*
|
||||
|
@ -625,7 +625,6 @@ meta_rectangle_get_minimal_spanning_set_for_region (
|
||||
*temp_rect = *basic_rect;
|
||||
ret = g_list_prepend (NULL, temp_rect);
|
||||
|
||||
strut_iter = all_struts;
|
||||
for (strut_iter = all_struts; strut_iter; strut_iter = strut_iter->next)
|
||||
{
|
||||
GList *rect_iter;
|
||||
|
@ -25,9 +25,10 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file display.c Handles operations on an X display.
|
||||
* SECTION:MetaDisplay
|
||||
* @short_description: Handles operations on an X display.
|
||||
*
|
||||
* The display is represented as a MetaDisplay struct.
|
||||
* The display is represented as a #MetaDisplay struct.
|
||||
*/
|
||||
|
||||
#define _XOPEN_SOURCE 600 /* for gethostname() */
|
||||
@ -53,12 +54,6 @@
|
||||
#include <X11/cursorfont.h>
|
||||
#include "mutter-enum-types.h"
|
||||
|
||||
#ifdef HAVE_SOLARIS_XINERAMA
|
||||
#include <X11/extensions/xinerama.h>
|
||||
#endif
|
||||
#ifdef HAVE_XFREE_XINERAMA
|
||||
#include <X11/extensions/Xinerama.h>
|
||||
#endif
|
||||
#ifdef HAVE_RANDR
|
||||
#include <X11/extensions/Xrandr.h>
|
||||
#endif
|
||||
@ -87,7 +82,7 @@
|
||||
g == META_GRAB_OP_KEYBOARD_ESCAPING_GROUP)
|
||||
|
||||
/**
|
||||
* \defgroup pings Pings
|
||||
* SECTION:pings
|
||||
*
|
||||
* Sometimes we want to see whether a window is responding,
|
||||
* so we send it a "ping" message and see whether it sends us back a "pong"
|
||||
@ -102,13 +97,13 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* MetaPingData:
|
||||
*
|
||||
* Describes a ping on a window. When we send a ping to a window, we build
|
||||
* one of these structs, and it eventually gets passed to the timeout function
|
||||
* or to the function which handles the response from the window. If the window
|
||||
* does or doesn't respond to the ping, we use this information to deal with
|
||||
* these facts; we have a handler function for each.
|
||||
*
|
||||
* \ingroup pings
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
@ -150,7 +145,7 @@ enum {
|
||||
|
||||
static guint display_signals [LAST_SIGNAL] = { 0 };
|
||||
|
||||
/**
|
||||
/*
|
||||
* The display we're managing. This is a singleton object. (Historically,
|
||||
* this was a list of displays, but there was never any way to add more
|
||||
* than one element to it.) The goofy name is because we don't want it
|
||||
@ -185,7 +180,7 @@ static void prefs_changed_callback (MetaPreference pref,
|
||||
|
||||
static void sanity_check_timestamps (MetaDisplay *display,
|
||||
guint32 known_good_timestamp);
|
||||
|
||||
|
||||
MetaGroup* get_focussed_group (MetaDisplay *display);
|
||||
|
||||
static void
|
||||
@ -295,10 +290,10 @@ meta_display_class_init (MetaDisplayClass *klass)
|
||||
|
||||
|
||||
/**
|
||||
* Destructor for MetaPingData structs. Will destroy the
|
||||
* event source for the struct as well.
|
||||
* ping_data_free:
|
||||
*
|
||||
* \ingroup pings
|
||||
* Destructor for #MetaPingData structs. Will destroy the
|
||||
* event source for the struct as well.
|
||||
*/
|
||||
static void
|
||||
ping_data_free (MetaPingData *ping_data)
|
||||
@ -311,14 +306,12 @@ ping_data_free (MetaPingData *ping_data)
|
||||
}
|
||||
|
||||
/**
|
||||
* remove_pending_pings_for_window:
|
||||
* @display: The display the window appears on
|
||||
* @xwindow: The X ID of the window whose pings we should remove
|
||||
*
|
||||
* Frees every pending ping structure for the given X window on the
|
||||
* given display. This means that we also destroy the timeouts.
|
||||
*
|
||||
* \param display The display the window appears on
|
||||
* \param xwindow The X ID of the window whose pings we should remove
|
||||
*
|
||||
* \ingroup pings
|
||||
*
|
||||
*/
|
||||
static void
|
||||
remove_pending_pings_for_window (MetaDisplay *display, Window xwindow)
|
||||
@ -417,14 +410,14 @@ meta_display_init (MetaDisplay *disp)
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_display_open:
|
||||
*
|
||||
* Opens a new display, sets it up, initialises all the X extensions
|
||||
* we will need, and adds it to the list of displays.
|
||||
*
|
||||
* \return True if the display was opened successfully, and False
|
||||
* Returns: %TRUE if the display was opened successfully, and %FALSE
|
||||
* otherwise-- that is, if the display doesn't exist or it already
|
||||
* has a window manager.
|
||||
*
|
||||
* \ingroup main
|
||||
*/
|
||||
gboolean
|
||||
meta_display_open (void)
|
||||
@ -474,6 +467,8 @@ meta_display_open (void)
|
||||
buf[sizeof(buf)-1] = '\0';
|
||||
the_display->hostname = g_strdup (buf);
|
||||
}
|
||||
else
|
||||
the_display->hostname = NULL;
|
||||
the_display->error_trap_synced_at_last_pop = TRUE;
|
||||
the_display->error_traps = 0;
|
||||
the_display->error_trap_handler = NULL;
|
||||
@ -1051,6 +1046,7 @@ meta_display_close (MetaDisplay *display,
|
||||
meta_display_free_window_prop_hooks (display);
|
||||
meta_display_free_group_prop_hooks (display);
|
||||
|
||||
g_free (display->hostname);
|
||||
g_free (display->name);
|
||||
|
||||
meta_display_shutdown_keys (display);
|
||||
@ -1168,14 +1164,16 @@ meta_display_ungrab (MetaDisplay *display)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the singleton MetaDisplay if "xdisplay" matches the X display it's
|
||||
* managing; otherwise gives a warning and returns NULL. When we were claiming
|
||||
* meta_display_for_x_display:
|
||||
* @xdisplay: An X display
|
||||
*
|
||||
* Returns the singleton MetaDisplay if @xdisplay matches the X display it's
|
||||
* managing; otherwise gives a warning and returns %NULL. When we were claiming
|
||||
* to be able to manage multiple displays, this was supposed to find the
|
||||
* display out of the list which matched that display. Now it's merely an
|
||||
* extra sanity check.
|
||||
*
|
||||
* \param xdisplay An X display
|
||||
* \return The singleton X display, or NULL if "xdisplay" isn't the one
|
||||
* Returns: The singleton X display, or %NULL if @xdisplay isn't the one
|
||||
* we're managing.
|
||||
*/
|
||||
MetaDisplay*
|
||||
@ -1191,9 +1189,11 @@ meta_display_for_x_display (Display *xdisplay)
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_get_display:
|
||||
*
|
||||
* Accessor for the singleton MetaDisplay.
|
||||
*
|
||||
* \return The only MetaDisplay there is. This can be NULL, but only
|
||||
* Returns: The only #MetaDisplay there is. This can be %NULL, but only
|
||||
* during startup.
|
||||
*/
|
||||
MetaDisplay*
|
||||
@ -1601,19 +1601,18 @@ handle_net_restack_window (MetaDisplay* display,
|
||||
#endif
|
||||
|
||||
/**
|
||||
* event_callback:
|
||||
* @event: The event that just happened
|
||||
* @data: The #MetaDisplay that events are coming from, cast to a gpointer
|
||||
* so that it can be sent to a callback
|
||||
*
|
||||
* This is the most important function in the whole program. It is the heart,
|
||||
* it is the nexus, it is the Grand Central Station of Mutter's world.
|
||||
* When we create a MetaDisplay, we ask GDK to pass *all* events for *all*
|
||||
* When we create a #MetaDisplay, we ask GDK to pass *all* events for *all*
|
||||
* windows to this function. So every time anything happens that we might
|
||||
* want to know about, this function gets called. You see why it gets a bit
|
||||
* busy around here. Most of this function is a ginormous switch statement
|
||||
* dealing with all the kinds of events that might turn up.
|
||||
*
|
||||
* \param event The event that just happened
|
||||
* \param data The MetaDisplay that events are coming from, cast to a gpointer
|
||||
* so that it can be sent to a callback
|
||||
*
|
||||
* \ingroup main
|
||||
*/
|
||||
static gboolean
|
||||
event_callback (XEvent *event,
|
||||
@ -4197,21 +4196,23 @@ meta_display_set_cursor_theme (const char *theme,
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Stores whether syncing is currently enabled.
|
||||
*/
|
||||
static gboolean is_syncing = FALSE;
|
||||
|
||||
/**
|
||||
* meta_is_syncing:
|
||||
*
|
||||
* Returns whether X synchronisation is currently enabled.
|
||||
*
|
||||
* \return true if we must wait for events whenever we send X requests;
|
||||
* false otherwise.
|
||||
*
|
||||
* \bug This is *only* called by meta_display_open, but by that time
|
||||
* FIXME: This is *only* called by meta_display_open(), but by that time
|
||||
* we have already turned syncing on or off on startup, and we don't
|
||||
* have any way to do so while Mutter is running, so it's rather
|
||||
* pointless.
|
||||
*
|
||||
* Returns: %TRUE if we must wait for events whenever we send X requests;
|
||||
* %FALSE otherwise.
|
||||
*/
|
||||
gboolean
|
||||
meta_is_syncing (void)
|
||||
@ -4220,10 +4221,9 @@ meta_is_syncing (void)
|
||||
}
|
||||
|
||||
/**
|
||||
* A handy way to turn on synchronisation on or off for every display.
|
||||
* meta_set_syncing:
|
||||
*
|
||||
* \bug Of course there is only one display ever anyway, so this can
|
||||
* be rather hugely simplified.
|
||||
* A handy way to turn on synchronisation on or off for every display.
|
||||
*/
|
||||
void
|
||||
meta_set_syncing (gboolean setting)
|
||||
@ -4236,26 +4236,25 @@ meta_set_syncing (gboolean setting)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* How long, in milliseconds, we should wait after pinging a window
|
||||
* before deciding it's not going to get back to us.
|
||||
*/
|
||||
#define PING_TIMEOUT_DELAY 5000
|
||||
|
||||
/**
|
||||
* meta_display_ping_timeout:
|
||||
* @data: All the information about this ping. It is a #MetaPingData
|
||||
* cast to a #gpointer in order to be passable to a timeout function.
|
||||
* This function will also free this parameter.
|
||||
*
|
||||
* Does whatever it is we decided to do when a window didn't respond
|
||||
* to a ping. We also remove the ping from the display's list of
|
||||
* pending pings. This function is called by the event loop when the timeout
|
||||
* times out which we created at the start of the ping.
|
||||
*
|
||||
* \param data All the information about this ping. It is a MetaPingData
|
||||
* cast to a void* in order to be passable to a timeout function.
|
||||
* This function will also free this parameter.
|
||||
*
|
||||
* \return Always returns false, because this function is called as a
|
||||
* timeout and we don't want to run the timer again.
|
||||
*
|
||||
* \ingroup pings
|
||||
* Returns: Always returns %FALSE, because this function is called as a
|
||||
* timeout and we don't want to run the timer again.
|
||||
*/
|
||||
static gboolean
|
||||
meta_display_ping_timeout (gpointer data)
|
||||
@ -4282,6 +4281,17 @@ meta_display_ping_timeout (gpointer data)
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_display_ping_window:
|
||||
* @display: The #MetaDisplay that the window is on
|
||||
* @window: The #MetaWindow to send the ping to
|
||||
* @timestamp: The timestamp of the ping. Used for uniqueness.
|
||||
* Cannot be CurrentTime; use a real timestamp!
|
||||
* @ping_reply_func: The callback to call if we get a response.
|
||||
* @ping_timeout_func: The callback to call if we don't get a response.
|
||||
* @user_data: Arbitrary data that will be passed to the callback
|
||||
* function. (In practice it's often a pointer to
|
||||
* the window.)
|
||||
*
|
||||
* Sends a ping request to a window. The window must respond to
|
||||
* the request within a certain amount of time. If it does, we
|
||||
* will call one callback; if the time passes and we haven't had
|
||||
@ -4291,20 +4301,9 @@ meta_display_ping_timeout (gpointer data)
|
||||
* This function returns straight away after setting things up;
|
||||
* the callbacks will be called from the event loop.
|
||||
*
|
||||
* \param display The MetaDisplay that the window is on
|
||||
* \param window The MetaWindow to send the ping to
|
||||
* \param timestamp The timestamp of the ping. Used for uniqueness.
|
||||
* Cannot be CurrentTime; use a real timestamp!
|
||||
* \param ping_reply_func The callback to call if we get a response.
|
||||
* \param ping_timeout_func The callback to call if we don't get a response.
|
||||
* \param user_data Arbitrary data that will be passed to the callback
|
||||
* function. (In practice it's often a pointer to
|
||||
* the window.)
|
||||
* FIXME: This should probably be a method on windows, rather than displays
|
||||
* for one of their windows.
|
||||
*
|
||||
* \bug This should probably be a method on windows, rather than displays
|
||||
* for one of their windows.
|
||||
*
|
||||
* \ingroup pings
|
||||
*/
|
||||
void
|
||||
meta_display_ping_window (MetaDisplay *display,
|
||||
@ -4412,16 +4411,15 @@ process_request_frame_extents (MetaDisplay *display,
|
||||
}
|
||||
|
||||
/**
|
||||
* process_pong_message:
|
||||
* @display: the display we got the pong from
|
||||
* @event: the #XEvent which is a pong; we can tell which
|
||||
* ping it corresponds to because it bears the
|
||||
* same timestamp.
|
||||
*
|
||||
* Process the pong (the response message) from the ping we sent
|
||||
* to the window. This involves removing the timeout, calling the
|
||||
* reply handler function, and freeing memory.
|
||||
*
|
||||
* \param display the display we got the pong from
|
||||
* \param event the XEvent which is a pong; we can tell which
|
||||
* ping it corresponds to because it bears the
|
||||
* same timestamp.
|
||||
*
|
||||
* \ingroup pings
|
||||
*/
|
||||
static void
|
||||
process_pong_message (MetaDisplay *display,
|
||||
@ -4468,18 +4466,17 @@ process_pong_message (MetaDisplay *display,
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_display_window_has_pending_pings:
|
||||
* @display: The #MetaDisplay of the window.
|
||||
* @window: The #MetaWindow whose pings we want to know about.
|
||||
*
|
||||
* Finds whether a window has any pings waiting on it.
|
||||
*
|
||||
* \param display The MetaDisplay of the window.
|
||||
* \param window The MetaWindow whose pings we want to know about.
|
||||
* FIXME: This should probably be a method on windows, rather than displays
|
||||
* for one of their windows.
|
||||
*
|
||||
* \return True if there is at least one ping which has been sent
|
||||
* to the window without getting a response; false otherwise.
|
||||
*
|
||||
* \bug This should probably be a method on windows, rather than displays
|
||||
* for one of their windows.
|
||||
*
|
||||
* \ingroup pings
|
||||
* Returns: %TRUE if there is at least one ping which has been sent
|
||||
* to the window without getting a response; %FALSE otherwise.
|
||||
*/
|
||||
gboolean
|
||||
meta_display_window_has_pending_pings (MetaDisplay *display,
|
||||
|
@ -2972,17 +2972,6 @@ handle_panel (MetaDisplay *display,
|
||||
meta_error_trap_pop (display);
|
||||
}
|
||||
|
||||
static void
|
||||
handle_toggle_recording (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding,
|
||||
gpointer dummy)
|
||||
{
|
||||
g_signal_emit_by_name (screen, "toggle-recording");
|
||||
}
|
||||
|
||||
static void
|
||||
handle_activate_window_menu (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
@ -3886,13 +3875,6 @@ init_builtin_key_bindings (MetaDisplay *display)
|
||||
META_KEYBINDING_ACTION_PANEL_RUN_DIALOG,
|
||||
handle_panel, META_KEYBINDING_ACTION_PANEL_RUN_DIALOG);
|
||||
|
||||
add_builtin_keybinding (display,
|
||||
"toggle-recording",
|
||||
mutter_keybindings,
|
||||
META_KEY_BINDING_NONE,
|
||||
META_KEYBINDING_ACTION_TOGGLE_RECORDING,
|
||||
handle_toggle_recording, 0);
|
||||
|
||||
add_builtin_keybinding (display,
|
||||
"set-spew-mark",
|
||||
common_keybindings,
|
||||
|
@ -23,18 +23,19 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file
|
||||
* Program startup.
|
||||
* SECTION:main
|
||||
* @short_description: Program startup.
|
||||
*
|
||||
* Functions which parse the command-line arguments, create the display,
|
||||
* kick everything off and then close down Mutter when it's time to go.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \mainpage
|
||||
*
|
||||
*
|
||||
*
|
||||
* Mutter - a boring window manager for the adult in you
|
||||
*
|
||||
* Many window managers are like Marshmallow Froot Loops; Mutter
|
||||
* is like Cheerios.
|
||||
* is like Frosted Flakes: it's still plain old corn, but dusted
|
||||
* with some sugar.
|
||||
*
|
||||
* The best way to get a handle on how the whole system fits together
|
||||
* is discussed in doc/code-overview.txt; if you're looking for functions
|
||||
@ -77,12 +78,12 @@
|
||||
#include <girepository.h>
|
||||
#endif
|
||||
|
||||
/**
|
||||
/*
|
||||
* The exit code we'll return to our parent process when we eventually die.
|
||||
*/
|
||||
static MetaExitCode meta_exit_code = META_EXIT_SUCCESS;
|
||||
|
||||
/**
|
||||
/*
|
||||
* Handle on the main loop, so that we have an easy way of shutting Mutter
|
||||
* down.
|
||||
*/
|
||||
@ -92,14 +93,15 @@ static void prefs_changed_callback (MetaPreference pref,
|
||||
gpointer data);
|
||||
|
||||
/**
|
||||
* log_handler:
|
||||
* @log_domain: the domain the error occurred in (we ignore this)
|
||||
* @log_level: the log level so that we can filter out less
|
||||
* important messages
|
||||
* @message: the message to log
|
||||
* @user_data: arbitrary data (we ignore this)
|
||||
*
|
||||
* Prints log messages. If Mutter was compiled with backtrace support,
|
||||
* also prints a backtrace (see meta_print_backtrace()).
|
||||
*
|
||||
* \param log_domain the domain the error occurred in (we ignore this)
|
||||
* \param log_level the log level so that we can filter out less
|
||||
* important messages
|
||||
* \param message the message to log
|
||||
* \param user_data arbitrary data (we ignore this)
|
||||
*/
|
||||
static void
|
||||
log_handler (const gchar *log_domain,
|
||||
@ -112,10 +114,12 @@ log_handler (const gchar *log_domain,
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_print_compilation_info:
|
||||
*
|
||||
* Prints a list of which configure script options were used to
|
||||
* build this copy of Mutter. This is actually always called
|
||||
* on startup, but it's all no-op unless we're in verbose mode
|
||||
* (see meta_set_verbose).
|
||||
* (see meta_set_verbose()).
|
||||
*/
|
||||
static void
|
||||
meta_print_compilation_info (void)
|
||||
@ -125,21 +129,6 @@ meta_print_compilation_info (void)
|
||||
#else
|
||||
meta_verbose ("Compiled without shape extension\n");
|
||||
#endif
|
||||
#ifdef HAVE_XINERAMA
|
||||
meta_topic (META_DEBUG_XINERAMA, "Compiled with Xinerama extension\n");
|
||||
#else
|
||||
meta_topic (META_DEBUG_XINERAMA, "Compiled without Xinerama extension\n");
|
||||
#endif
|
||||
#ifdef HAVE_XFREE_XINERAMA
|
||||
meta_topic (META_DEBUG_XINERAMA, " (using XFree86 Xinerama)\n");
|
||||
#else
|
||||
meta_topic (META_DEBUG_XINERAMA, " (not using XFree86 Xinerama)\n");
|
||||
#endif
|
||||
#ifdef HAVE_SOLARIS_XINERAMA
|
||||
meta_topic (META_DEBUG_XINERAMA, " (using Solaris Xinerama)\n");
|
||||
#else
|
||||
meta_topic (META_DEBUG_XINERAMA, " (not using Solaris Xinerama)\n");
|
||||
#endif
|
||||
#ifdef HAVE_XSYNC
|
||||
meta_verbose ("Compiled with sync extension\n");
|
||||
#else
|
||||
@ -158,12 +147,14 @@ meta_print_compilation_info (void)
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_print_self_identity:
|
||||
*
|
||||
* Prints the version number, the current timestamp (not the
|
||||
* build date), the locale, the character encoding, and a list
|
||||
* of configure script options that were used to build this
|
||||
* copy of Mutter. This is actually always called
|
||||
* on startup, but it's all no-op unless we're in verbose mode
|
||||
* (see meta_set_verbose).
|
||||
* (see meta_set_verbose()).
|
||||
*/
|
||||
static void
|
||||
meta_print_self_identity (void)
|
||||
@ -188,7 +179,7 @@ meta_print_self_identity (void)
|
||||
meta_print_compilation_info ();
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* The set of possible options that can be set on Mutter's
|
||||
* command line.
|
||||
*/
|
||||
@ -327,10 +318,12 @@ meta_clutter_init (void)
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_select_display:
|
||||
*
|
||||
* Selects which display Mutter should use. It first tries to use
|
||||
* display_name as the display. If display_name is NULL then
|
||||
* @display_name as the display. If @display_name is %NULL then
|
||||
* try to use the environment variable MUTTER_DISPLAY. If that
|
||||
* also is NULL, use the default - :0.0
|
||||
* also is %NULL, use the default - :0.0
|
||||
*/
|
||||
static void
|
||||
meta_select_display (gchar *display_name)
|
||||
@ -560,13 +553,14 @@ meta_run (void)
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_quit:
|
||||
* @code: The success or failure code to return to the calling process.
|
||||
*
|
||||
* Stops Mutter. This tells the event loop to stop processing; it is
|
||||
* rather dangerous to use this because this will leave the user with
|
||||
* no window manager. We generally do this only if, for example, the
|
||||
* session manager asks us to; we assume the session manager knows
|
||||
* what it's talking about.
|
||||
*
|
||||
* \param code The success or failure code to return to the calling process.
|
||||
*/
|
||||
void
|
||||
meta_quit (MetaExitCode code)
|
||||
@ -579,13 +573,14 @@ meta_quit (MetaExitCode code)
|
||||
}
|
||||
|
||||
/**
|
||||
* prefs_changed_callback:
|
||||
* @pref Which preference has changed
|
||||
* @data Arbitrary data (which we ignore)
|
||||
*
|
||||
* Called on pref changes. (One of several functions of its kind and purpose.)
|
||||
*
|
||||
* \bug Why are these particular prefs handled in main.c and not others?
|
||||
* Should they be?
|
||||
*
|
||||
* \param pref Which preference has changed
|
||||
* \param data Arbitrary data (which we ignore)
|
||||
* FIXME: Why are these particular prefs handled in main.c and not others?
|
||||
* Should they be?
|
||||
*/
|
||||
static void
|
||||
prefs_changed_callback (MetaPreference pref,
|
||||
|
@ -53,7 +53,6 @@
|
||||
#define KEY_GNOME_CURSOR_SIZE "cursor-size"
|
||||
|
||||
#define KEY_OVERLAY_KEY "overlay-key"
|
||||
#define KEY_LIVE_HIDDEN_WINDOWS "live-hidden-windows"
|
||||
#define KEY_WORKSPACES_ONLY_ON_PRIMARY "workspaces-only-on-primary"
|
||||
#define KEY_NO_TAB_POPUP "no-tab-popup"
|
||||
|
||||
@ -104,7 +103,6 @@ static MetaButtonLayout button_layout;
|
||||
/* NULL-terminated array */
|
||||
static char **workspace_names = NULL;
|
||||
|
||||
static gboolean live_hidden_windows = FALSE;
|
||||
static gboolean workspaces_only_on_primary = FALSE;
|
||||
|
||||
static gboolean no_tab_popup = FALSE;
|
||||
@ -165,36 +163,30 @@ typedef struct
|
||||
gboolean *target;
|
||||
} MetaBoolPreference;
|
||||
|
||||
|
||||
/**
|
||||
* MetaStringPreference:
|
||||
* @handler: (allow-none): A handler. Many of the string preferences
|
||||
* aren't stored as strings and need parsing; others of them have
|
||||
* default values which can't be solved in the general case. If you
|
||||
* include a function pointer here, it will be called instead of writing
|
||||
* the string value out to the target variable.
|
||||
* The function will be passed to g_settings_get_mapped() and should
|
||||
* return %TRUE if the mapping was successful and %FALSE otherwise.
|
||||
* In the former case the function is expected to handle the result
|
||||
* of the conversion itself and call queue_changed() appropriately;
|
||||
* in particular the @result (out) parameter as returned by
|
||||
* g_settings_get_mapped() will be ignored in all cases.
|
||||
* This may be %NULL. If it is, see "target", below.
|
||||
* @target: (allow-none): Where to write the incoming string.
|
||||
* This must be %NULL if the handler is non-%NULL.
|
||||
* If the incoming string is %NULL, no change will be made.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
MetaBasePreference base;
|
||||
|
||||
/**
|
||||
* A handler. Many of the string preferences aren't stored as
|
||||
* strings and need parsing; others of them have default values
|
||||
* which can't be solved in the general case. If you include a
|
||||
* function pointer here, it will be called instead of writing
|
||||
* the string value out to the target variable.
|
||||
*
|
||||
* The function will be passed to g_settings_get_mapped() and should
|
||||
* return %TRUE if the mapping was successful and %FALSE otherwise.
|
||||
* In the former case the function is expected to handle the result
|
||||
* of the conversion itself and call queue_changed() appropriately;
|
||||
* in particular the @result (out) parameter as returned by
|
||||
* g_settings_get_mapped() will be ignored in all cases.
|
||||
*
|
||||
* This may be NULL. If it is, see "target", below.
|
||||
*/
|
||||
GSettingsGetMapping handler;
|
||||
|
||||
/**
|
||||
* Where to write the incoming string.
|
||||
*
|
||||
* This must be NULL if the handler is non-NULL.
|
||||
* If the incoming string is NULL, no change will be made.
|
||||
*/
|
||||
gchar **target;
|
||||
|
||||
} MetaStringPreference;
|
||||
|
||||
typedef struct
|
||||
@ -351,13 +343,6 @@ static MetaBoolPreference preferences_bool[] =
|
||||
},
|
||||
&edge_tiling,
|
||||
},
|
||||
{
|
||||
{ KEY_LIVE_HIDDEN_WINDOWS,
|
||||
SCHEMA_MUTTER,
|
||||
META_PREF_LIVE_HIDDEN_WINDOWS,
|
||||
},
|
||||
&live_hidden_windows,
|
||||
},
|
||||
{
|
||||
{ "workspaces-only-on-primary",
|
||||
SCHEMA_MUTTER,
|
||||
@ -931,9 +916,9 @@ do_override (char *key,
|
||||
|
||||
|
||||
/**
|
||||
* meta_prefs_override_preference_schema
|
||||
* meta_prefs_override_preference_schema:
|
||||
* @key: the preference name
|
||||
* @schema: new schema for preference %key
|
||||
* @schema: new schema for preference @key
|
||||
*
|
||||
* Specify a schema whose keys are used to override the standard Metacity
|
||||
* keys. This might be used if a plugin expected a different value for
|
||||
@ -1062,6 +1047,8 @@ bindings_changed (GSettings *settings,
|
||||
}
|
||||
|
||||
/**
|
||||
* maybe_give_disable_workaround_warning:
|
||||
*
|
||||
* Special case: give a warning the first time disable_workarounds
|
||||
* is turned on.
|
||||
*/
|
||||
@ -1617,9 +1604,6 @@ meta_preference_to_string (MetaPreference pref)
|
||||
case META_PREF_FORCE_FULLSCREEN:
|
||||
return "FORCE_FULLSCREEN";
|
||||
|
||||
case META_PREF_LIVE_HIDDEN_WINDOWS:
|
||||
return "LIVE_HIDDEN_WINDOWS";
|
||||
|
||||
case META_PREF_WORKSPACES_ONLY_ON_PRIMARY:
|
||||
return "WORKSPACES_ONLY_ON_PRIMARY";
|
||||
|
||||
@ -2004,7 +1988,8 @@ meta_prefs_remove_keybinding (const char *name)
|
||||
|
||||
/**
|
||||
* meta_prefs_get_keybindings:
|
||||
* Return: (element-type MetaKeyPref) (transfer container):
|
||||
*
|
||||
* Returns: (element-type MetaKeyPref) (transfer container):
|
||||
*/
|
||||
GList *
|
||||
meta_prefs_get_keybindings ()
|
||||
@ -2130,27 +2115,6 @@ meta_prefs_get_force_fullscreen (void)
|
||||
return force_fullscreen;
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_prefs_get_live_hidden_windows (void)
|
||||
{
|
||||
#if 0
|
||||
return live_hidden_windows;
|
||||
#else
|
||||
return TRUE;
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
meta_prefs_set_live_hidden_windows (gboolean whether)
|
||||
{
|
||||
MetaBasePreference *pref;
|
||||
|
||||
find_pref (preferences_bool, sizeof(MetaBoolPreference),
|
||||
KEY_LIVE_HIDDEN_WINDOWS, &pref);
|
||||
g_settings_set_boolean (SETTINGS (pref->schema), KEY_LIVE_HIDDEN_WINDOWS,
|
||||
whether);
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_prefs_get_workspaces_only_on_primary (void)
|
||||
{
|
||||
|
@ -156,8 +156,6 @@ void meta_screen_manage_all_windows (MetaScreen *scree
|
||||
void meta_screen_foreach_window (MetaScreen *screen,
|
||||
MetaScreenWindowFunc func,
|
||||
gpointer data);
|
||||
void meta_screen_queue_frame_redraws (MetaScreen *screen);
|
||||
void meta_screen_queue_window_resizes (MetaScreen *screen);
|
||||
|
||||
void meta_screen_set_cursor (MetaScreen *screen,
|
||||
MetaCursor cursor);
|
||||
|
@ -41,12 +41,8 @@
|
||||
#include <meta/compositor.h>
|
||||
#include "mutter-enum-types.h"
|
||||
|
||||
#ifdef HAVE_SOLARIS_XINERAMA
|
||||
#include <X11/extensions/xinerama.h>
|
||||
#endif
|
||||
#ifdef HAVE_XFREE_XINERAMA
|
||||
#include <X11/extensions/Xinerama.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_RANDR
|
||||
#include <X11/extensions/Xrandr.h>
|
||||
#endif
|
||||
@ -83,7 +79,6 @@ enum
|
||||
enum
|
||||
{
|
||||
RESTACKED,
|
||||
TOGGLE_RECORDING,
|
||||
WORKSPACE_ADDED,
|
||||
WORKSPACE_REMOVED,
|
||||
WORKSPACE_SWITCHED,
|
||||
@ -230,14 +225,6 @@ meta_screen_class_init (MetaScreenClass *klass)
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 1, G_TYPE_POINTER);
|
||||
|
||||
screen_signals[TOGGLE_RECORDING] =
|
||||
g_signal_new ("toggle-recording",
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
screen_signals[WORKAREAS_CHANGED] =
|
||||
g_signal_new ("workareas-changed",
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
@ -487,7 +474,6 @@ reload_monitor_infos (MetaScreen *screen)
|
||||
screen->monitor_infos[1].rect.width = screen->rect.width / 2;
|
||||
}
|
||||
|
||||
#ifdef HAVE_XFREE_XINERAMA
|
||||
if (screen->n_monitor_infos == 0 &&
|
||||
XineramaIsActive (display->xdisplay))
|
||||
{
|
||||
@ -557,74 +543,10 @@ reload_monitor_infos (MetaScreen *screen)
|
||||
else if (screen->n_monitor_infos > 0)
|
||||
{
|
||||
meta_topic (META_DEBUG_XINERAMA,
|
||||
"No XFree86 Xinerama extension or XFree86 Xinerama inactive on display %s\n",
|
||||
"No Xinerama extension or Xinerama inactive on display %s\n",
|
||||
display->name);
|
||||
}
|
||||
#else
|
||||
meta_topic (META_DEBUG_XINERAMA,
|
||||
"Mutter compiled without XFree86 Xinerama support\n");
|
||||
#endif /* HAVE_XFREE_XINERAMA */
|
||||
|
||||
#ifdef HAVE_SOLARIS_XINERAMA
|
||||
/* This code from GDK, Copyright (C) 2002 Sun Microsystems */
|
||||
if (screen->n_monitor_infos == 0 &&
|
||||
XineramaGetState (screen->display->xdisplay,
|
||||
screen->number))
|
||||
{
|
||||
XRectangle monitors[MAXFRAMEBUFFERS];
|
||||
unsigned char hints[16];
|
||||
int result;
|
||||
int n_monitors;
|
||||
int i;
|
||||
|
||||
n_monitors = 0;
|
||||
result = XineramaGetInfo (screen->display->xdisplay,
|
||||
screen->number,
|
||||
monitors, hints,
|
||||
&n_monitors);
|
||||
/* Yes I know it should be Success but the current implementation
|
||||
* returns the num of monitor
|
||||
*/
|
||||
if (result > 0)
|
||||
{
|
||||
g_assert (n_monitors > 0);
|
||||
|
||||
screen->monitor_infos = g_new0 (MetaMonitorInfo, n_monitors);
|
||||
screen->n_monitor_infos = n_monitors;
|
||||
|
||||
i = 0;
|
||||
while (i < n_monitors)
|
||||
{
|
||||
screen->monitor_infos[i].number = i;
|
||||
screen->monitor_infos[i].rect.x = monitors[i].x;
|
||||
screen->monitor_infos[i].rect.y = monitors[i].y;
|
||||
screen->monitor_infos[i].rect.width = monitors[i].width;
|
||||
screen->monitor_infos[i].rect.height = monitors[i].height;
|
||||
|
||||
meta_topic (META_DEBUG_XINERAMA,
|
||||
"Monitor %d is %d,%d %d x %d\n",
|
||||
screen->monitor_infos[i].number,
|
||||
screen->monitor_infos[i].rect.x,
|
||||
screen->monitor_infos[i].rect.y,
|
||||
screen->monitor_infos[i].rect.width,
|
||||
screen->monitor_infos[i].rect.height);
|
||||
|
||||
++i;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (screen->n_monitor_infos == 0)
|
||||
{
|
||||
meta_topic (META_DEBUG_XINERAMA,
|
||||
"No Solaris Xinerama extension or Solaris Xinerama inactive on display %s\n",
|
||||
display->name);
|
||||
}
|
||||
#else
|
||||
meta_topic (META_DEBUG_XINERAMA,
|
||||
"Mutter compiled without Solaris Xinerama support\n");
|
||||
#endif /* HAVE_SOLARIS_XINERAMA */
|
||||
|
||||
|
||||
/* If no Xinerama, fill in the single screen info so
|
||||
* we can use the field unconditionally
|
||||
*/
|
||||
@ -1294,31 +1216,6 @@ meta_screen_foreach_window (MetaScreen *screen,
|
||||
g_slist_free (winlist);
|
||||
}
|
||||
|
||||
static void
|
||||
queue_draw (MetaScreen *screen, MetaWindow *window, gpointer data)
|
||||
{
|
||||
if (window->frame)
|
||||
meta_frame_queue_draw (window->frame);
|
||||
}
|
||||
|
||||
void
|
||||
meta_screen_queue_frame_redraws (MetaScreen *screen)
|
||||
{
|
||||
meta_screen_foreach_window (screen, queue_draw, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
queue_resize (MetaScreen *screen, MetaWindow *window, gpointer data)
|
||||
{
|
||||
meta_window_queue (window, META_QUEUE_MOVE_RESIZE);
|
||||
}
|
||||
|
||||
void
|
||||
meta_screen_queue_window_resizes (MetaScreen *screen)
|
||||
{
|
||||
meta_screen_foreach_window (screen, queue_resize, NULL);
|
||||
}
|
||||
|
||||
int
|
||||
meta_screen_get_n_workspaces (MetaScreen *screen)
|
||||
{
|
||||
@ -3463,9 +3360,10 @@ meta_screen_get_screen_number (MetaScreen *screen)
|
||||
|
||||
/**
|
||||
* meta_screen_get_display:
|
||||
* Retrieve the display associated with screen.
|
||||
* @screen: A #MetaScreen
|
||||
*
|
||||
* Retrieve the display associated with screen.
|
||||
*
|
||||
* Returns: (transfer none): Display
|
||||
*/
|
||||
MetaDisplay *
|
||||
|
@ -394,6 +394,8 @@ meta_stack_tracker_free (MetaStackTracker *tracker)
|
||||
g_queue_foreach (tracker->queued_requests, (GFunc)meta_stack_op_free, NULL);
|
||||
g_queue_free (tracker->queued_requests);
|
||||
tracker->queued_requests = NULL;
|
||||
|
||||
g_free (tracker);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1,7 +1,8 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/**
|
||||
* \file stack.c Which windows cover which other windows
|
||||
* SECTION:stack
|
||||
* @short_description: Which windows cover which other windows
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -340,7 +341,7 @@ get_standalone_layer (MetaWindow *window)
|
||||
windows_on_different_monitor (window,
|
||||
window->display->expected_focus_window))))
|
||||
layer = META_LAYER_FULLSCREEN;
|
||||
else if (window->wm_state_above)
|
||||
else if (window->wm_state_above && !META_WINDOW_MAXIMIZED (window))
|
||||
layer = META_LAYER_TOP;
|
||||
else
|
||||
layer = META_LAYER_NORMAL;
|
||||
@ -799,6 +800,8 @@ apply_constraints (Constraint **constraints,
|
||||
}
|
||||
|
||||
/**
|
||||
* stack_do_window_deletions:
|
||||
*
|
||||
* Go through "deleted" and take the matching windows
|
||||
* out of "windows".
|
||||
*/
|
||||
@ -899,6 +902,8 @@ stack_do_window_additions (MetaStack *stack)
|
||||
}
|
||||
|
||||
/**
|
||||
* stack_do_relayer:
|
||||
*
|
||||
* Update the layers that windows are in
|
||||
*/
|
||||
static void
|
||||
@ -944,6 +949,8 @@ stack_do_relayer (MetaStack *stack)
|
||||
}
|
||||
|
||||
/**
|
||||
* stack_do_constrain:
|
||||
*
|
||||
* Update stack_position and layer to reflect transiency
|
||||
* constraints
|
||||
*/
|
||||
@ -976,6 +983,8 @@ stack_do_constrain (MetaStack *stack)
|
||||
}
|
||||
|
||||
/**
|
||||
* stack_do_resort:
|
||||
*
|
||||
* Sort stack->sorted with layers having priority over stack_position.
|
||||
*/
|
||||
static void
|
||||
@ -994,6 +1003,8 @@ stack_do_resort (MetaStack *stack)
|
||||
}
|
||||
|
||||
/**
|
||||
* stack_ensure_sorted:
|
||||
*
|
||||
* Puts the stack into canonical form.
|
||||
*
|
||||
* Honour the removed and added lists of the stack, and then recalculate
|
||||
@ -1013,6 +1024,8 @@ stack_ensure_sorted (MetaStack *stack)
|
||||
}
|
||||
|
||||
/**
|
||||
* raise_window_relative_to_managed_windows:
|
||||
*
|
||||
* This function is used to avoid raising a window above popup
|
||||
* menus and other such things.
|
||||
*
|
||||
@ -1113,6 +1126,8 @@ raise_window_relative_to_managed_windows (MetaScreen *screen,
|
||||
}
|
||||
|
||||
/**
|
||||
* stack_sync_to_server:
|
||||
*
|
||||
* Order the windows on the X server to be the same as in our structure.
|
||||
* We do this using XRestackWindows if we don't know the previous order,
|
||||
* or XConfigureWindow on a few particular windows if we do and can figure
|
||||
|
244
src/core/stack.h
244
src/core/stack.h
@ -1,23 +1,5 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/**
|
||||
* \file stack.h Which windows cover which other windows
|
||||
*
|
||||
* There are two factors that determine window position.
|
||||
*
|
||||
* One is window->stack_position, which is a unique integer
|
||||
* indicating how windows are ordered with respect to one
|
||||
* another. The ordering here transcends layers; it isn't changed
|
||||
* as the window is moved among layers. This allows us to move several
|
||||
* windows from one layer to another, while preserving the relative
|
||||
* order of the moved windows. Also, it allows us to restore
|
||||
* the stacking order from a saved session.
|
||||
*
|
||||
* However when actually stacking windows on the screen, the
|
||||
* layer overrides the stack_position; windows are first sorted
|
||||
* by layer, then by stack_position within each layer.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2001 Havoc Pennington
|
||||
* Copyright (C) 2005 Elijah Newren
|
||||
@ -41,6 +23,25 @@
|
||||
#ifndef META_STACK_H
|
||||
#define META_STACK_H
|
||||
|
||||
/**
|
||||
* SECTION:stack
|
||||
* @short_description: Which windows cover which other windows
|
||||
*
|
||||
* There are two factors that determine window position.
|
||||
*
|
||||
* One is window->stack_position, which is a unique integer
|
||||
* indicating how windows are ordered with respect to one
|
||||
* another. The ordering here transcends layers; it isn't changed
|
||||
* as the window is moved among layers. This allows us to move several
|
||||
* windows from one layer to another, while preserving the relative
|
||||
* order of the moved windows. Also, it allows us to restore
|
||||
* the stacking order from a saved session.
|
||||
*
|
||||
* However when actually stacking windows on the screen, the
|
||||
* layer overrides the stack_position; windows are first sorted
|
||||
* by layer, then by stack_position within each layer.
|
||||
*/
|
||||
|
||||
#include "screen-private.h"
|
||||
|
||||
/**
|
||||
@ -123,192 +124,214 @@ struct _MetaStack
|
||||
};
|
||||
|
||||
/**
|
||||
* meta_stack_new:
|
||||
* @screen: The MetaScreen which will be the parent of this stack.
|
||||
*
|
||||
* Creates and initialises a MetaStack.
|
||||
*
|
||||
* \param screen The MetaScreen which will be the parent of this stack.
|
||||
* \return The new screen.
|
||||
* Returns: The new screen.
|
||||
*/
|
||||
MetaStack *meta_stack_new (MetaScreen *screen);
|
||||
|
||||
/**
|
||||
* Destroys and frees a MetaStack.
|
||||
* meta_stack_free:
|
||||
* @stack: The stack to destroy.
|
||||
*
|
||||
* \param stack The stack to destroy.
|
||||
* Destroys and frees a MetaStack.
|
||||
*/
|
||||
void meta_stack_free (MetaStack *stack);
|
||||
|
||||
/**
|
||||
* meta_stack_add:
|
||||
* @stack: The stack to add it to
|
||||
* @window: The window to add
|
||||
*
|
||||
* Adds a window to the local stack. It is a fatal error to call this
|
||||
* function on a window which already exists on the stack of any screen.
|
||||
*
|
||||
* \param window The window to add
|
||||
* \param stack The stack to add it to
|
||||
*/
|
||||
void meta_stack_add (MetaStack *stack,
|
||||
MetaWindow *window);
|
||||
|
||||
/**
|
||||
* meta_stack_remove:
|
||||
* @stack: The stack to remove it from
|
||||
* @window: The window to remove
|
||||
*
|
||||
* Removes a window from the local stack. It is a fatal error to call this
|
||||
* function on a window which exists on the stack of any screen.
|
||||
*
|
||||
* \param window The window to remove
|
||||
* \param stack The stack to remove it from
|
||||
*/
|
||||
void meta_stack_remove (MetaStack *stack,
|
||||
MetaWindow *window);
|
||||
/**
|
||||
* meta_stack_update_layer:
|
||||
* @stack: The stack to recalculate
|
||||
* @window: Dummy parameter
|
||||
*
|
||||
* Recalculates the correct layer for all windows in the stack,
|
||||
* and moves them about accordingly.
|
||||
*
|
||||
* \param window Dummy parameter
|
||||
* \param stack The stack to recalculate
|
||||
* \bug What's with the dummy parameter?
|
||||
*/
|
||||
void meta_stack_update_layer (MetaStack *stack,
|
||||
MetaWindow *window);
|
||||
|
||||
/**
|
||||
* meta_stack_update_transient:
|
||||
* @stack: The stack to recalculate
|
||||
* @window: Dummy parameter
|
||||
*
|
||||
* Recalculates the correct stacking order for all windows in the stack
|
||||
* according to their transience, and moves them about accordingly.
|
||||
*
|
||||
* \param window Dummy parameter
|
||||
* \param stack The stack to recalculate
|
||||
* \bug What's with the dummy parameter?
|
||||
* FIXME: What's with the dummy parameter?
|
||||
*/
|
||||
void meta_stack_update_transient (MetaStack *stack,
|
||||
MetaWindow *window);
|
||||
|
||||
/**
|
||||
* Move a window to the top of its layer.
|
||||
* meta_stack_raise:
|
||||
* @stack: The stack to modify.
|
||||
* @window: The window that's making an ascension.
|
||||
* (Amulet of Yendor not required.)
|
||||
*
|
||||
* \param stack The stack to modify.
|
||||
* \param window The window that's making an ascension.
|
||||
* (Amulet of Yendor not required.)
|
||||
* Move a window to the top of its layer.
|
||||
*/
|
||||
void meta_stack_raise (MetaStack *stack,
|
||||
MetaWindow *window);
|
||||
/**
|
||||
* Move a window to the bottom of its layer.
|
||||
* meta_stack_lower:
|
||||
* @stack: The stack to modify.
|
||||
* @window: The window that's on the way downwards.
|
||||
*
|
||||
* \param stack The stack to modify.
|
||||
* \param window The window that's on the way downwards.
|
||||
* Move a window to the bottom of its layer.
|
||||
*/
|
||||
void meta_stack_lower (MetaStack *stack,
|
||||
MetaWindow *window);
|
||||
|
||||
/**
|
||||
* meta_stack_freeze:
|
||||
* @stack: The stack to freeze.
|
||||
*
|
||||
* Prevent syncing to server until the next call of meta_stack_thaw(),
|
||||
* so that we can carry out multiple operations in one go without having
|
||||
* everything halfway reflected on the X server.
|
||||
*
|
||||
* (Calls to meta_stack_freeze() nest, so that multiple calls to
|
||||
* meta_stack_freeze will require multiple calls to meta_stack_thaw().)
|
||||
*
|
||||
* \param stack The stack to freeze.
|
||||
*/
|
||||
void meta_stack_freeze (MetaStack *stack);
|
||||
|
||||
/**
|
||||
* meta_stack_thaw:
|
||||
* @stack: The stack to thaw.
|
||||
*
|
||||
* Undoes a meta_stack_freeze(), and processes anything which has become
|
||||
* necessary during the freeze. It is an error to call this function if
|
||||
* the stack has not been frozen.
|
||||
*
|
||||
* \param stack The stack to thaw.
|
||||
*/
|
||||
void meta_stack_thaw (MetaStack *stack);
|
||||
|
||||
/**
|
||||
* meta_stack_get_top:
|
||||
* @stack: The stack to examine.
|
||||
*
|
||||
* Finds the top window on the stack.
|
||||
*
|
||||
* \param stack The stack to examine.
|
||||
* \return The top window on the stack, or NULL in the vanishingly unlikely
|
||||
* event that you have no windows on your screen whatsoever.
|
||||
* Returns: The top window on the stack, or %NULL in the vanishingly unlikely
|
||||
* event that you have no windows on your screen whatsoever.
|
||||
*/
|
||||
MetaWindow* meta_stack_get_top (MetaStack *stack);
|
||||
|
||||
/**
|
||||
* meta_stack_get_bottom:
|
||||
* @stack: The stack to search
|
||||
*
|
||||
* Finds the window at the bottom of the stack. Since that's pretty much
|
||||
* always the desktop, this isn't the most useful of functions, and nobody
|
||||
* actually calls it. We should probably get rid of it.
|
||||
*
|
||||
* \param stack The stack to search
|
||||
*/
|
||||
MetaWindow* meta_stack_get_bottom (MetaStack *stack);
|
||||
|
||||
/**
|
||||
* meta_stack_get_above:
|
||||
* @stack: The stack to search.
|
||||
* @window: The window to look above.
|
||||
* @only_within_layer: If %TRUE, will return %NULL if @window is the
|
||||
* top window in its layer.
|
||||
*
|
||||
* Finds the window above a given window in the stack.
|
||||
* It is not an error to pass in a window which does not exist in
|
||||
* the stack; the function will merely return NULL.
|
||||
* the stack; the function will merely return %NULL.
|
||||
*
|
||||
* \param stack The stack to search.
|
||||
* \param window The window to look above.
|
||||
* \param only_within_layer If true, will return NULL if "window" is the
|
||||
* top window in its layer.
|
||||
* \return NULL if there is no such window;
|
||||
* the window above "window" otherwise.
|
||||
* Returns: %NULL if there is no such window;
|
||||
* the window above @window otherwise.
|
||||
*/
|
||||
MetaWindow* meta_stack_get_above (MetaStack *stack,
|
||||
MetaWindow *window,
|
||||
gboolean only_within_layer);
|
||||
|
||||
/**
|
||||
* meta_stack_get_below:
|
||||
* @stack: The stack to search.
|
||||
* @window: The window to look below.
|
||||
* @only_within_layer: If %TRUE, will return %NULL if window is the
|
||||
* bottom window in its layer.
|
||||
*
|
||||
* Finds the window below a given window in the stack.
|
||||
* It is not an error to pass in a window which does not exist in
|
||||
* the stack; the function will merely return NULL.
|
||||
* the stack; the function will merely return %NULL.
|
||||
*
|
||||
* \param stack The stack to search.
|
||||
* \param window The window to look below.
|
||||
* \param only_within_layer If true, will return NULL if "window" is the
|
||||
* bottom window in its layer.
|
||||
* \return NULL if there is no such window;
|
||||
* the window below "window" otherwise.
|
||||
*
|
||||
* Returns: %NULL if there is no such window;
|
||||
* the window below @window otherwise.
|
||||
*/
|
||||
MetaWindow* meta_stack_get_below (MetaStack *stack,
|
||||
MetaWindow *window,
|
||||
gboolean only_within_layer);
|
||||
|
||||
/**
|
||||
* Find the topmost, focusable, mapped, window in a stack. If you supply
|
||||
* a window as "not_this_one", we won't return that one (presumably
|
||||
* because it's going to be going away). But if you do supply "not_this_one"
|
||||
* and we find its parent, we'll return that; and if "not_this_one" is in
|
||||
* meta_stack_get_default_focus_window:
|
||||
* @stack: The stack to search.
|
||||
* @workspace: %NULL to search all workspaces; otherwise only windows
|
||||
* from that workspace will be returned.
|
||||
* @not_this_one: Window to ignore because it's being unfocussed or
|
||||
* going away.
|
||||
*
|
||||
* Find the topmost, focusable, mapped, window in a stack. If you supply
|
||||
* a window as @not_this_one, we won't return that one (presumably
|
||||
* because it's going to be going away). But if you do supply @not_this_one
|
||||
* and we find its parent, we'll return that; and if @not_this_one is in
|
||||
* a group, we'll return the top window of that group.
|
||||
*
|
||||
* Also, we are prejudiced against dock windows. Every kind of window, even
|
||||
* the desktop, will be returned in preference to a dock window.
|
||||
*
|
||||
* \param stack The stack to search.
|
||||
* \param workspace NULL to search all workspaces; otherwise only windows
|
||||
* from that workspace will be returned.
|
||||
* \param not_this_one Window to ignore because it's being unfocussed or
|
||||
* going away.
|
||||
* \return The window matching all these constraints or NULL if none does.
|
||||
*
|
||||
* \bug Never called!
|
||||
* Returns: The window matching all these constraints or %NULL if none does.
|
||||
*/
|
||||
MetaWindow* meta_stack_get_default_focus_window (MetaStack *stack,
|
||||
MetaWorkspace *workspace,
|
||||
MetaWindow *not_this_one);
|
||||
|
||||
/**
|
||||
* meta_stack_get_default_focus_window_at_point:
|
||||
* @stack: The stack to search.
|
||||
* @workspace: %NULL to search all workspaces; otherwise only windows
|
||||
* from that workspace will be returned.
|
||||
* @not_this_one: Window to ignore because it's being unfocussed or
|
||||
* going away.
|
||||
* @root_x: The returned window must contain this point,
|
||||
* unless it's a dock.
|
||||
* @root_y: See root_x.
|
||||
*
|
||||
* Find the topmost, focusable, mapped, window in a stack. If you supply
|
||||
* a window as "not_this_one", we won't return that one (presumably
|
||||
* because it's going to be going away). But if you do supply "not_this_one"
|
||||
* and we find its parent, we'll return that; and if "not_this_one" is in
|
||||
* a window as @not_this_one, we won't return that one (presumably
|
||||
* because it's going to be going away). But if you do supply @not_this_one
|
||||
* and we find its parent, we'll return that; and if @not_this_one is in
|
||||
* a group, we'll return the top window of that group.
|
||||
*
|
||||
* Also, we are prejudiced against dock windows. Every kind of window, even
|
||||
* the desktop, will be returned in preference to a dock window.
|
||||
*
|
||||
* \param stack The stack to search.
|
||||
* \param workspace NULL to search all workspaces; otherwise only windows
|
||||
* from that workspace will be returned.
|
||||
* \param not_this_one Window to ignore because it's being unfocussed or
|
||||
* going away.
|
||||
* \param root_x The returned window must contain this point,
|
||||
* unless it's a dock.
|
||||
* \param root_y See root_x.
|
||||
* \return The window matching all these constraints or NULL if none does.
|
||||
* Returns: The window matching all these constraints or %NULL if none does.
|
||||
*/
|
||||
MetaWindow* meta_stack_get_default_focus_window_at_point (MetaStack *stack,
|
||||
MetaWorkspace *workspace,
|
||||
@ -317,18 +340,25 @@ MetaWindow* meta_stack_get_default_focus_window_at_point (MetaStack *stack,
|
||||
int root_y);
|
||||
|
||||
/**
|
||||
* meta_stack_list_windows:
|
||||
* @stack: The stack to examine.
|
||||
* @workspace: If not %NULL, only windows on this workspace will be
|
||||
* returned; otherwise all windows in the stack will be
|
||||
* returned.
|
||||
*
|
||||
* Finds all the windows in the stack, in order.
|
||||
*
|
||||
* \param stack The stack to examine.
|
||||
* \param workspace If non-NULL, only windows on this workspace will be
|
||||
* returned; otherwise all windows in the stack will be
|
||||
* returned.
|
||||
* \return A list of windows, in stacking order, honouring layers.
|
||||
* Returns: A list of windows, in stacking order, honouring layers.
|
||||
*/
|
||||
GList* meta_stack_list_windows (MetaStack *stack,
|
||||
MetaWorkspace *workspace);
|
||||
|
||||
/**
|
||||
* meta_stack_windows_cmp:
|
||||
* @stack: A stack containing both window_a and window_b
|
||||
* @window_a: A window
|
||||
* @window_b Another window
|
||||
*
|
||||
* Comparison function for windows within a stack. This is not directly
|
||||
* suitable for use within a standard comparison routine, because it takes
|
||||
* an extra parameter; you will need to wrap it.
|
||||
@ -339,9 +369,6 @@ GList* meta_stack_list_windows (MetaStack *stack,
|
||||
*
|
||||
* (FIXME: Apparently identical to compare_window_position(). Merge them.)
|
||||
*
|
||||
* \param stack A stack containing both window_a and window_b
|
||||
* \param window_a A window
|
||||
* \param window_b Another window
|
||||
* \return -1 if window_a is below window_b, honouring layers; 1 if it's
|
||||
* above it; 0 if you passed in the same window twice!
|
||||
*/
|
||||
@ -350,35 +377,40 @@ int meta_stack_windows_cmp (MetaStack *stack,
|
||||
MetaWindow *window_b);
|
||||
|
||||
/**
|
||||
* meta_window_set_stack_position:
|
||||
* @window: The window which is moving.
|
||||
* @position: Where it should move to (0 is the bottom).
|
||||
*
|
||||
* Sets the position of a window within the stack. This will only move it
|
||||
* up or down within its layer. It is an error to attempt to move this
|
||||
* below position zero or above the last position in the stack (however, since
|
||||
* we don't provide a simple way to tell the number of windows in the stack,
|
||||
* this requirement may not be easy to fulfil).
|
||||
*
|
||||
* \param window The window which is moving.
|
||||
* \param position Where it should move to (0 is the bottom).
|
||||
*/
|
||||
void meta_window_set_stack_position (MetaWindow *window,
|
||||
int position);
|
||||
|
||||
/**
|
||||
* meta_stack_get_positions:
|
||||
* @stack: The stack to examine.
|
||||
*
|
||||
* Returns the current stack state, allowing rudimentary transactions.
|
||||
*
|
||||
* \param stack The stack to examine.
|
||||
* \return An opaque GList representing the current stack sort order;
|
||||
* it is the caller's responsibility to free it.
|
||||
* Pass this to meta_stack_set_positions() later if you want to restore
|
||||
* the state to where it was when you called this function.
|
||||
* Returns: An opaque GList representing the current stack sort order;
|
||||
* it is the caller's responsibility to free it.
|
||||
* Pass this to meta_stack_set_positions() later if you want to restore
|
||||
* the state to where it was when you called this function.
|
||||
*/
|
||||
GList* meta_stack_get_positions (MetaStack *stack);
|
||||
|
||||
/**
|
||||
* meta_stack_set_positions:
|
||||
* @stack: The stack to roll back.
|
||||
* @windows: The list returned from meta_stack_get_positions().
|
||||
*
|
||||
* Rolls back a transaction, given the list returned from
|
||||
* meta_stack_get_positions().
|
||||
*
|
||||
* \param stack The stack to roll back.
|
||||
* \param windows The list returned from meta_stack_get_positions().
|
||||
*/
|
||||
void meta_stack_set_positions (MetaStack *stack,
|
||||
GList *windows);
|
||||
|
@ -1,7 +1,8 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/**
|
||||
* \file window-props.c MetaWindow property handling
|
||||
* SECTION:window-props
|
||||
* @short_description: #MetaWindow property handling
|
||||
*
|
||||
* A system which can inspect sets of properties of given windows
|
||||
* and take appropriate action given their values.
|
||||
@ -389,11 +390,13 @@ reload_net_wm_user_time_window (MetaWindow *window,
|
||||
#define MAX_TITLE_LENGTH 512
|
||||
|
||||
/**
|
||||
* Called by set_window_title and set_icon_title to set the value of
|
||||
* *target to title. It required and atom is set, it will update the
|
||||
* set_title_text:
|
||||
*
|
||||
* Called by set_window_title() and set_icon_title() to set the value of
|
||||
* @target to @title. It required and @atom is set, it will update the
|
||||
* appropriate property.
|
||||
*
|
||||
* Returns TRUE if a new title was set.
|
||||
* Returns: %TRUE if a new title was set.
|
||||
*/
|
||||
static gboolean
|
||||
set_title_text (MetaWindow *window,
|
||||
@ -1643,6 +1646,9 @@ RELOAD_STRING (gtk_menubar_object_path, "gtk-menubar-object-path")
|
||||
#undef RELOAD_STRING
|
||||
|
||||
/**
|
||||
* meta_display_init_window_prop_hooks:
|
||||
* @display: The #MetaDisplay
|
||||
*
|
||||
* 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.
|
||||
|
@ -1,7 +1,8 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/**
|
||||
* \file window-props.h MetaWindow property handling
|
||||
* SECTION:window-props
|
||||
* @short_description: MetaWindow property handling
|
||||
*
|
||||
* A system which can inspect sets of properties of given windows
|
||||
* and take appropriate action given their values.
|
||||
@ -35,12 +36,13 @@
|
||||
#include "window-private.h"
|
||||
|
||||
/**
|
||||
* meta_window_reload_property:
|
||||
* @window: The window.
|
||||
* @property: A single X atom.
|
||||
*
|
||||
* Requests the current values of a single property for a given
|
||||
* window from the server, and deals with it appropriately.
|
||||
* Does not return it to the caller (it's been dealt with!)
|
||||
*
|
||||
* \param window The window.
|
||||
* \param property A single X atom.
|
||||
*/
|
||||
void meta_window_reload_property (MetaWindow *window,
|
||||
Atom property,
|
||||
@ -48,13 +50,14 @@ void meta_window_reload_property (MetaWindow *window,
|
||||
|
||||
|
||||
/**
|
||||
* meta_window_reload_properties:
|
||||
* @window: The window.
|
||||
* @properties: A pointer to a list of X atoms, "n_properties" long.
|
||||
* @n_properties: The length of the properties list.
|
||||
*
|
||||
* Requests the current values of a set of properties for a given
|
||||
* window from the server, and deals with them appropriately.
|
||||
* Does not return them to the caller (they've been dealt with!)
|
||||
*
|
||||
* \param window The window.
|
||||
* \param properties A pointer to a list of X atoms, "n_properties" long.
|
||||
* \param n_properties The length of the properties list.
|
||||
*/
|
||||
void meta_window_reload_properties (MetaWindow *window,
|
||||
const Atom *properties,
|
||||
@ -62,14 +65,15 @@ void meta_window_reload_properties (MetaWindow *window,
|
||||
gboolean initial);
|
||||
|
||||
/**
|
||||
* meta_window_reload_property_from_xwindow:
|
||||
* @window: A window on the same display as the one we're
|
||||
* investigating (only used to find the display)
|
||||
* @xwindow: The X handle for the window.
|
||||
* @property: A single X atom.
|
||||
*
|
||||
* Requests the current values of a single property for a given
|
||||
* window from the server, and deals with it appropriately.
|
||||
* Does not return it to the caller (it's been dealt with!)
|
||||
*
|
||||
* \param window A window on the same display as the one we're
|
||||
* investigating (only used to find the display)
|
||||
* \param xwindow The X handle for the window.
|
||||
* \param property A single X atom.
|
||||
*/
|
||||
void meta_window_reload_property_from_xwindow
|
||||
(MetaWindow *window,
|
||||
@ -78,15 +82,16 @@ void meta_window_reload_property_from_xwindow
|
||||
gboolean initial);
|
||||
|
||||
/**
|
||||
* meta_window_reload_properties_from_xwindow:
|
||||
* @window: A window on the same display as the one we're
|
||||
* investigating (only used to find the display)
|
||||
* @xwindow: The X handle for the window.
|
||||
* @properties: A pointer to a list of X atoms, "n_properties" long.
|
||||
* @n_properties: The length of the properties list.
|
||||
*
|
||||
* Requests the current values of a set of properties for a given
|
||||
* window from the server, and deals with them appropriately.
|
||||
* Does not return them to the caller (they've been dealt with!)
|
||||
*
|
||||
* \param window A window on the same display as the one we're
|
||||
* investigating (only used to find the display)
|
||||
* \param xwindow The X handle for the window.
|
||||
* \param properties A pointer to a list of X atoms, "n_properties" long.
|
||||
* \param n_properties The length of the properties list.
|
||||
*/
|
||||
void meta_window_reload_properties_from_xwindow
|
||||
(MetaWindow *window,
|
||||
@ -96,41 +101,44 @@ void meta_window_reload_properties_from_xwindow
|
||||
gboolean initial);
|
||||
|
||||
/**
|
||||
* meta_window_load_initial_properties:
|
||||
* @window: The window.
|
||||
*
|
||||
* Requests the current values for standard properties for a given
|
||||
* window from the server, and deals with them appropriately.
|
||||
* Does not return them to the caller (they've been dealt with!)
|
||||
*
|
||||
* \param window The window.
|
||||
*/
|
||||
void meta_window_load_initial_properties (MetaWindow *window);
|
||||
|
||||
/**
|
||||
* meta_display_init_window_prop_hooks:
|
||||
* @display: The display.
|
||||
*
|
||||
* Initialises the hooks used for the reload_propert* functions
|
||||
* on a particular display, and stores a pointer to them in the
|
||||
* display.
|
||||
*
|
||||
* \param display The display.
|
||||
*/
|
||||
void meta_display_init_window_prop_hooks (MetaDisplay *display);
|
||||
|
||||
/**
|
||||
* meta_display_free_window_prop_hooks:
|
||||
* @display: The display.
|
||||
* Frees the hooks used for the reload_propert* functions
|
||||
* for a particular display.
|
||||
*
|
||||
* \param display The display.
|
||||
*/
|
||||
void meta_display_free_window_prop_hooks (MetaDisplay *display);
|
||||
|
||||
/**
|
||||
* meta_set_normal_hints:
|
||||
* @window: The window to set the size hints on.
|
||||
* @hints: Either some X size hints, or NULL for default.
|
||||
*
|
||||
* Sets the size hints for a window. This happens when a
|
||||
* WM_NORMAL_HINTS property is set on a window, but it is public
|
||||
* because the size hints are set to defaults when a window is
|
||||
* created. See
|
||||
* http://tronche.com/gui/x/icccm/sec-4.html#WM_NORMAL_HINTS
|
||||
* for the X details.
|
||||
*
|
||||
* \param window The window to set the size hints on.
|
||||
* \param hints Either some X size hints, or NULL for default.
|
||||
*/
|
||||
void meta_set_normal_hints (MetaWindow *window,
|
||||
XSizeHints *hints);
|
||||
|
@ -2225,7 +2225,7 @@ implement_showing (MetaWindow *window,
|
||||
* so we should place the window even if we're hiding it rather
|
||||
* than showing it.
|
||||
*/
|
||||
if (!window->placed && meta_prefs_get_live_hidden_windows ())
|
||||
if (!window->placed)
|
||||
meta_window_force_placement (window);
|
||||
|
||||
meta_window_hide (window);
|
||||
@ -2827,20 +2827,6 @@ map_frame (MetaWindow *window)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
unmap_frame (MetaWindow *window)
|
||||
{
|
||||
if (window->frame && window->frame->mapped)
|
||||
{
|
||||
meta_topic (META_DEBUG_WINDOW_STATE, "Frame actually needs unmap\n");
|
||||
window->frame->mapped = FALSE;
|
||||
meta_ui_unmap_frame (window->screen->ui, window->frame->xwindow);
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
map_client_window (MetaWindow *window)
|
||||
{
|
||||
@ -3108,15 +3094,12 @@ meta_window_show (MetaWindow *window)
|
||||
if (map_client_window (window))
|
||||
did_show = TRUE;
|
||||
|
||||
if (meta_prefs_get_live_hidden_windows ())
|
||||
if (window->hidden)
|
||||
{
|
||||
if (window->hidden)
|
||||
{
|
||||
meta_stack_freeze (window->screen->stack);
|
||||
window->hidden = FALSE;
|
||||
meta_stack_thaw (window->screen->stack);
|
||||
did_show = TRUE;
|
||||
}
|
||||
meta_stack_freeze (window->screen->stack);
|
||||
window->hidden = FALSE;
|
||||
meta_stack_thaw (window->screen->stack);
|
||||
did_show = TRUE;
|
||||
}
|
||||
|
||||
if (window->iconic)
|
||||
@ -3251,32 +3234,19 @@ meta_window_hide (MetaWindow *window)
|
||||
|
||||
did_hide = FALSE;
|
||||
|
||||
if (meta_prefs_get_live_hidden_windows ())
|
||||
{
|
||||
/* If this is the first time that we've calculating the showing
|
||||
* state of the window, the frame and client window might not
|
||||
* yet be mapped, so we need to map them now */
|
||||
map_frame (window);
|
||||
map_client_window (window);
|
||||
/* If this is the first time that we've calculating the showing
|
||||
* state of the window, the frame and client window might not
|
||||
* yet be mapped, so we need to map them now */
|
||||
map_frame (window);
|
||||
map_client_window (window);
|
||||
|
||||
if (!window->hidden)
|
||||
{
|
||||
meta_stack_freeze (window->screen->stack);
|
||||
window->hidden = TRUE;
|
||||
meta_stack_thaw (window->screen->stack);
|
||||
|
||||
did_hide = TRUE;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (!window->hidden)
|
||||
{
|
||||
/* Unmapping the frame is enough to make the window disappear,
|
||||
* but we need to hide the window itself so the client knows
|
||||
* it has been hidden */
|
||||
if (unmap_frame (window))
|
||||
did_hide = TRUE;
|
||||
if (unmap_client_window (window, " (hiding)"))
|
||||
did_hide = TRUE;
|
||||
meta_stack_freeze (window->screen->stack);
|
||||
window->hidden = TRUE;
|
||||
meta_stack_thaw (window->screen->stack);
|
||||
|
||||
did_hide = TRUE;
|
||||
}
|
||||
|
||||
if (!window->iconic)
|
||||
@ -3452,10 +3422,11 @@ meta_window_save_rect (MetaWindow *window)
|
||||
}
|
||||
|
||||
/**
|
||||
* force_save_user_window_placement:
|
||||
* @window: Store current position of this window for future reference
|
||||
*
|
||||
* Save the user_rect regardless of whether the window is maximized or
|
||||
* fullscreen. See save_user_window_placement() for most uses.
|
||||
*
|
||||
* \param window Store current position of this window for future reference
|
||||
*/
|
||||
static void
|
||||
force_save_user_window_placement (MetaWindow *window)
|
||||
@ -3464,11 +3435,12 @@ force_save_user_window_placement (MetaWindow *window)
|
||||
}
|
||||
|
||||
/**
|
||||
* save_user_window_placement:
|
||||
* @window: Store current position of this window for future reference
|
||||
*
|
||||
* Save the user_rect, but only if the window is neither maximized nor
|
||||
* fullscreen, otherwise the window may snap back to those dimensions
|
||||
* (bug #461927).
|
||||
*
|
||||
* \param window Store current position of this window for future reference
|
||||
*/
|
||||
static void
|
||||
save_user_window_placement (MetaWindow *window)
|
||||
@ -4607,8 +4579,6 @@ meta_window_move_resize_internal (MetaWindow *window,
|
||||
gboolean need_move_frame = FALSE;
|
||||
gboolean need_resize_client = FALSE;
|
||||
gboolean need_resize_frame = FALSE;
|
||||
int frame_size_dx;
|
||||
int frame_size_dy;
|
||||
int size_dx;
|
||||
int size_dy;
|
||||
gboolean frame_shape_changed = FALSE;
|
||||
@ -4709,6 +4679,7 @@ meta_window_move_resize_internal (MetaWindow *window,
|
||||
|
||||
if (window->frame)
|
||||
{
|
||||
int frame_size_dx, frame_size_dy;
|
||||
int new_w, new_h;
|
||||
|
||||
new_w = window->rect.width + borders.total.left + borders.total.right;
|
||||
@ -4731,11 +4702,6 @@ meta_window_move_resize_internal (MetaWindow *window,
|
||||
window->frame->rect.width,
|
||||
window->frame->rect.height);
|
||||
}
|
||||
else
|
||||
{
|
||||
frame_size_dx = 0;
|
||||
frame_size_dy = 0;
|
||||
}
|
||||
|
||||
/* For nice effect, when growing the window we want to move/resize
|
||||
* the frame first, when shrinking the window we want to move/resize
|
||||
@ -5108,18 +5074,20 @@ meta_window_move_frame (MetaWindow *window,
|
||||
{
|
||||
int x = root_x_nw;
|
||||
int y = root_y_nw;
|
||||
MetaFrameBorders borders;
|
||||
|
||||
meta_frame_calc_borders (window->frame, &borders);
|
||||
|
||||
/* root_x_nw and root_y_nw correspond to where the top of
|
||||
* the visible frame should be. Offset by the distance between
|
||||
* the origin of the window and the origin of the enclosing
|
||||
* window decorations.
|
||||
*/
|
||||
x += window->frame->child_x - borders.invisible.left;
|
||||
y += window->frame->child_y - borders.invisible.top;
|
||||
if (window->frame)
|
||||
{
|
||||
MetaFrameBorders borders;
|
||||
meta_frame_calc_borders (window->frame, &borders);
|
||||
|
||||
/* root_x_nw and root_y_nw correspond to where the top of
|
||||
* the visible frame should be. Offset by the distance between
|
||||
* the origin of the window and the origin of the enclosing
|
||||
* window decorations.
|
||||
*/
|
||||
x += window->frame->child_x - borders.invisible.left;
|
||||
y += window->frame->child_y - borders.invisible.top;
|
||||
}
|
||||
meta_window_move (window, user_op, x, y);
|
||||
}
|
||||
|
||||
@ -5825,7 +5793,7 @@ update_net_frame_extents (MetaWindow *window)
|
||||
|
||||
meta_topic (META_DEBUG_GEOMETRY,
|
||||
"Setting _NET_FRAME_EXTENTS on managed window 0x%lx "
|
||||
"to left = %lu, right = %lu, top = %lu, bottom = %lu\n",
|
||||
"to left = %lu, right = %lu, top = %lu, bottom = %lu\n",
|
||||
window->xwindow, data[0], data[1], data[2], data[3]);
|
||||
|
||||
meta_error_trap_push (window->display);
|
||||
@ -8241,10 +8209,6 @@ menu_callback (MetaWindowMenu *menu,
|
||||
{
|
||||
meta_window_change_workspace (window,
|
||||
workspace);
|
||||
#if 0
|
||||
meta_workspace_activate (workspace);
|
||||
meta_window_raise (window);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -8334,13 +8298,6 @@ meta_window_show_menu (MetaWindow *window,
|
||||
else
|
||||
ops |= META_MENU_OP_MAXIMIZE;
|
||||
|
||||
#if 0
|
||||
if (window->shaded)
|
||||
ops |= META_MENU_OP_UNSHADE;
|
||||
else
|
||||
ops |= META_MENU_OP_SHADE;
|
||||
#endif
|
||||
|
||||
if (window->wm_state_above)
|
||||
ops |= META_MENU_OP_UNABOVE;
|
||||
else
|
||||
@ -8369,7 +8326,8 @@ meta_window_show_menu (MetaWindow *window,
|
||||
|
||||
if ((window->type == META_WINDOW_DESKTOP) ||
|
||||
(window->type == META_WINDOW_DOCK) ||
|
||||
(window->type == META_WINDOW_SPLASHSCREEN))
|
||||
(window->type == META_WINDOW_SPLASHSCREEN ||
|
||||
META_WINDOW_MAXIMIZED (window)))
|
||||
insensitive |= META_MENU_OP_ABOVE | META_MENU_OP_UNABOVE;
|
||||
|
||||
/* If all operations are disabled, just quit without showing the menu.
|
||||
|
@ -192,7 +192,7 @@ meta_workspace_new (MetaScreen *screen)
|
||||
return workspace;
|
||||
}
|
||||
|
||||
/** Foreach function for workspace_free_struts() */
|
||||
/* Foreach function for workspace_free_struts() */
|
||||
static void
|
||||
free_this (gpointer candidate, gpointer dummy)
|
||||
{
|
||||
@ -200,9 +200,10 @@ free_this (gpointer candidate, gpointer dummy)
|
||||
}
|
||||
|
||||
/**
|
||||
* Frees the combined struts list of a workspace.
|
||||
* workspace_free_all_struts:
|
||||
* @workspace: The workspace.
|
||||
*
|
||||
* \param workspace The workspace.
|
||||
* Frees the combined struts list of a workspace.
|
||||
*/
|
||||
static void
|
||||
workspace_free_all_struts (MetaWorkspace *workspace)
|
||||
@ -216,9 +217,10 @@ workspace_free_all_struts (MetaWorkspace *workspace)
|
||||
}
|
||||
|
||||
/**
|
||||
* Frees the struts list set with meta_workspace_set_builtin_struts
|
||||
* workspace_free_builtin_struts:
|
||||
* @workspace: The workspace.
|
||||
*
|
||||
* \param workspace The workspace.
|
||||
* Frees the struts list set with meta_workspace_set_builtin_struts
|
||||
*/
|
||||
static void
|
||||
workspace_free_builtin_struts (MetaWorkspace *workspace)
|
||||
@ -997,18 +999,6 @@ ensure_work_areas_validated (MetaWorkspace *workspace)
|
||||
|
||||
/* We're all done, YAAY! Record that everything has been validated. */
|
||||
workspace->work_areas_invalid = FALSE;
|
||||
|
||||
{
|
||||
/*
|
||||
* Notify the compositor that the workspace geometry has changed.
|
||||
*/
|
||||
MetaScreen *screen = workspace->screen;
|
||||
MetaDisplay *display = meta_screen_get_display (screen);
|
||||
MetaCompositor *comp = meta_display_get_compositor (display);
|
||||
|
||||
if (comp)
|
||||
meta_compositor_update_workspace_geometry (comp, workspace);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@ -1066,6 +1056,13 @@ meta_workspace_get_work_area_for_monitor (MetaWorkspace *workspace,
|
||||
*area = workspace->work_area_monitor[which_monitor];
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_workspace_get_work_area_all_monitors:
|
||||
* @workspace: a #MetaWorkspace
|
||||
* @area: (out): location to store the work area
|
||||
*
|
||||
* Stores the work area in @area.
|
||||
*/
|
||||
void
|
||||
meta_workspace_get_work_area_all_monitors (MetaWorkspace *workspace,
|
||||
MetaRectangle *area)
|
||||
|
@ -364,6 +364,7 @@ void meta_frame_borders_clear (MetaFrameBorders *self);
|
||||
(ycoord) < ((rect).y + (rect).height))
|
||||
|
||||
/**
|
||||
* MetaStackLayer:
|
||||
* Layers a window can be in.
|
||||
* These MUST be in the order of stacking.
|
||||
*/
|
||||
|
@ -153,8 +153,6 @@ void meta_compositor_set_updates (MetaCompositor *compositor,
|
||||
MetaWindow *window,
|
||||
gboolean updates);
|
||||
|
||||
void meta_compositor_update_workspace_geometry (MetaCompositor *compositor,
|
||||
MetaWorkspace *workspace);
|
||||
void meta_compositor_sync_stack (MetaCompositor *compositor,
|
||||
MetaScreen *screen,
|
||||
GList *stack);
|
||||
|
@ -72,12 +72,8 @@ void meta_shaped_texture_set_pixmap (MetaShapedTexture *stex,
|
||||
|
||||
CoglHandle meta_shaped_texture_get_texture (MetaShapedTexture *stex);
|
||||
|
||||
void meta_shaped_texture_set_shape_region (MetaShapedTexture *stex,
|
||||
cairo_region_t *region);
|
||||
|
||||
void meta_shaped_texture_set_overlay_path (MetaShapedTexture *stex,
|
||||
cairo_region_t *overlay_region,
|
||||
cairo_path_t *overlay_path);
|
||||
void meta_shaped_texture_set_mask_texture (MetaShapedTexture *stex,
|
||||
CoglHandle mask_texture);
|
||||
|
||||
/* Assumes ownership of clip_region */
|
||||
void meta_shaped_texture_set_clip_region (MetaShapedTexture *stex,
|
||||
|
@ -64,7 +64,6 @@ typedef enum
|
||||
META_PREF_RESIZE_WITH_RIGHT_BUTTON,
|
||||
META_PREF_EDGE_TILING,
|
||||
META_PREF_FORCE_FULLSCREEN,
|
||||
META_PREF_LIVE_HIDDEN_WINDOWS,
|
||||
META_PREF_WORKSPACES_ONLY_ON_PRIMARY,
|
||||
META_PREF_NO_TAB_POPUP,
|
||||
META_PREF_DRAGGABLE_BORDER_WIDTH
|
||||
@ -129,18 +128,8 @@ int meta_prefs_get_cursor_size (void);
|
||||
gboolean meta_prefs_get_compositing_manager (void);
|
||||
gboolean meta_prefs_get_force_fullscreen (void);
|
||||
|
||||
/**
|
||||
* Sets whether the compositor is turned on.
|
||||
*
|
||||
* \param whether TRUE to turn on, FALSE to turn off
|
||||
*/
|
||||
void meta_prefs_set_compositing_manager (gboolean whether);
|
||||
|
||||
void meta_prefs_set_force_fullscreen (gboolean whether);
|
||||
|
||||
gboolean meta_prefs_get_live_hidden_windows (void);
|
||||
void meta_prefs_set_live_hidden_windows (gboolean whether);
|
||||
|
||||
gboolean meta_prefs_get_workspaces_only_on_primary (void);
|
||||
|
||||
gboolean meta_prefs_get_no_tab_popup (void);
|
||||
@ -276,7 +265,7 @@ typedef struct
|
||||
|
||||
MetaKeyBindingAction action;
|
||||
|
||||
/**
|
||||
/*
|
||||
* A list of MetaKeyCombos. Each of them is bound to
|
||||
* this keypref. If one has keysym==modifiers==0, it is
|
||||
* ignored.
|
||||
|
@ -78,10 +78,6 @@ void meta_preview_set_frame_flags (MetaPreview *preview,
|
||||
void meta_preview_set_button_layout (MetaPreview *preview,
|
||||
const MetaButtonLayout *button_layout);
|
||||
|
||||
cairo_region_t * meta_preview_get_clip_region (MetaPreview *preview,
|
||||
gint new_window_width,
|
||||
gint new_window_height);
|
||||
|
||||
GdkPixbuf* meta_preview_get_icon (void);
|
||||
GdkPixbuf* meta_preview_get_mini_icon (void);
|
||||
|
||||
|
@ -1,15 +1,5 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/**
|
||||
* \file workspace.h Workspaces
|
||||
*
|
||||
* A workspace is a set of windows which all live on the same
|
||||
* screen. (You may also see the name "desktop" around the place,
|
||||
* which is the EWMH's name for the same thing.) Only one workspace
|
||||
* of a screen may be active at once; all windows on all other workspaces
|
||||
* are unmapped.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2001 Havoc Pennington
|
||||
* Copyright (C) 2004, 2005 Elijah Newren
|
||||
@ -33,6 +23,17 @@
|
||||
#ifndef META_WORKSPACE_H
|
||||
#define META_WORKSPACE_H
|
||||
|
||||
/**
|
||||
* SECTION:Workspaces
|
||||
* @short_description:Workspaces
|
||||
*
|
||||
* A workspace is a set of windows which all live on the same
|
||||
* screen. (You may also see the name "desktop" around the place,
|
||||
* which is the EWMH's name for the same thing.) Only one workspace
|
||||
* of a screen may be active at once; all windows on all other workspaces
|
||||
* are unmapped.
|
||||
*/
|
||||
|
||||
#include <meta/types.h>
|
||||
#include <meta/boxes.h>
|
||||
#include <meta/screen.h>
|
||||
|
@ -1,6 +1,5 @@
|
||||
[org.gnome.mutter]
|
||||
overlay-key = /apps/mutter/general/overlay_key
|
||||
attach-modal-dialogs = /apps/mutter/general/attach_modal_dialogs
|
||||
live-hidden-windows = /apps/mutter/general/live_hidden_windows
|
||||
workspaces-only-on-primary = /apps/mutter/general/workspaces_only_on_primary
|
||||
draggable-border-width = /apps/mutter/general/draggable_border_width
|
||||
|
@ -25,16 +25,6 @@
|
||||
</_description>
|
||||
</key>
|
||||
|
||||
<key name="live-hidden-windows" type="b">
|
||||
<default>false</default>
|
||||
<_summary>Live Hidden Windows</_summary>
|
||||
<_description>
|
||||
Determines whether hidden windows (i.e., minimized windows and
|
||||
windows on other workspaces than the current one) should be kept
|
||||
alive.
|
||||
</_description>
|
||||
</key>
|
||||
|
||||
<key name="edge-tiling" type="b">
|
||||
<default>false</default>
|
||||
<_summary>Enable edge tiling when dropping windows on screen edges</_summary>
|
||||
@ -89,10 +79,6 @@
|
||||
</schema>
|
||||
<schema id="org.gnome.mutter.keybindings" path="/org/gnome/mutter/keybindings/">
|
||||
|
||||
<key name="toggle-recording" type="as">
|
||||
<default><![CDATA[['<Control><Shift><Alt>r']]]></default>
|
||||
</key>
|
||||
|
||||
<key name="toggle-tiled-left" type="as">
|
||||
<default><![CDATA[['<Super>Left']]]></default>
|
||||
</key>
|
||||
|
411
src/ui/frames.c
411
src/ui/frames.c
@ -97,7 +97,6 @@ static MetaFrameControl get_control (MetaFrames *frames,
|
||||
MetaUIFrame *frame,
|
||||
int x,
|
||||
int y);
|
||||
static void invalidate_all_caches (MetaFrames *frames);
|
||||
static void invalidate_whole_window (MetaFrames *frames,
|
||||
MetaUIFrame *frame);
|
||||
|
||||
@ -261,14 +260,6 @@ meta_frames_init (MetaFrames *frames)
|
||||
|
||||
frames->frames = g_hash_table_new (unsigned_long_hash, unsigned_long_equal);
|
||||
|
||||
frames->tooltip_timeout = 0;
|
||||
|
||||
frames->expose_delay_count = 0;
|
||||
|
||||
frames->invalidate_cache_timeout_id = 0;
|
||||
frames->invalidate_frames = NULL;
|
||||
frames->cache = g_hash_table_new (g_direct_hash, g_direct_equal);
|
||||
|
||||
frames->style_variants = g_hash_table_new_full (g_str_hash, g_str_equal,
|
||||
g_free, g_object_unref);
|
||||
update_style_contexts (frames);
|
||||
@ -335,90 +326,13 @@ meta_frames_finalize (GObject *object)
|
||||
meta_prefs_remove_listener (prefs_changed_callback, frames);
|
||||
|
||||
g_hash_table_destroy (frames->text_heights);
|
||||
|
||||
invalidate_all_caches (frames);
|
||||
if (frames->invalidate_cache_timeout_id)
|
||||
g_source_remove (frames->invalidate_cache_timeout_id);
|
||||
|
||||
g_assert (g_hash_table_size (frames->frames) == 0);
|
||||
g_hash_table_destroy (frames->frames);
|
||||
g_hash_table_destroy (frames->cache);
|
||||
|
||||
G_OBJECT_CLASS (meta_frames_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
cairo_rectangle_int_t rect;
|
||||
cairo_surface_t *pixmap;
|
||||
} CachedFramePiece;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* Caches of the four rendered sides in a MetaFrame.
|
||||
* Order: top (titlebar), left, right, bottom.
|
||||
*/
|
||||
CachedFramePiece piece[4];
|
||||
} CachedPixels;
|
||||
|
||||
static CachedPixels *
|
||||
get_cache (MetaFrames *frames,
|
||||
MetaUIFrame *frame)
|
||||
{
|
||||
CachedPixels *pixels;
|
||||
|
||||
pixels = g_hash_table_lookup (frames->cache, frame);
|
||||
|
||||
if (!pixels)
|
||||
{
|
||||
pixels = g_new0 (CachedPixels, 1);
|
||||
g_hash_table_insert (frames->cache, frame, pixels);
|
||||
}
|
||||
|
||||
return pixels;
|
||||
}
|
||||
|
||||
static void
|
||||
invalidate_cache (MetaFrames *frames,
|
||||
MetaUIFrame *frame)
|
||||
{
|
||||
CachedPixels *pixels = get_cache (frames, frame);
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
if (pixels->piece[i].pixmap)
|
||||
cairo_surface_destroy (pixels->piece[i].pixmap);
|
||||
|
||||
g_free (pixels);
|
||||
g_hash_table_remove (frames->cache, frame);
|
||||
}
|
||||
|
||||
static void
|
||||
invalidate_all_caches (MetaFrames *frames)
|
||||
{
|
||||
GList *l;
|
||||
|
||||
for (l = frames->invalidate_frames; l; l = l->next)
|
||||
{
|
||||
MetaUIFrame *frame = l->data;
|
||||
|
||||
invalidate_cache (frames, frame);
|
||||
}
|
||||
|
||||
g_list_free (frames->invalidate_frames);
|
||||
frames->invalidate_frames = NULL;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
invalidate_cache_timeout (gpointer data)
|
||||
{
|
||||
MetaFrames *frames = data;
|
||||
|
||||
invalidate_all_caches (frames);
|
||||
frames->invalidate_cache_timeout_id = 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
queue_recalc_func (gpointer key, gpointer value, gpointer data)
|
||||
{
|
||||
@ -700,7 +614,6 @@ meta_frames_manage_window (MetaFrames *frames,
|
||||
frame->layout = NULL;
|
||||
frame->text_height = -1;
|
||||
frame->title = NULL;
|
||||
frame->expose_delayed = FALSE;
|
||||
frame->shape_applied = FALSE;
|
||||
frame->prelit_control = META_FRAME_CONTROL_NONE;
|
||||
|
||||
@ -724,11 +637,6 @@ meta_frames_unmanage_window (MetaFrames *frames,
|
||||
|
||||
if (frame)
|
||||
{
|
||||
/* invalidating all caches ensures the frame
|
||||
* is not actually referenced anymore
|
||||
*/
|
||||
invalidate_all_caches (frames);
|
||||
|
||||
/* restore the cursor */
|
||||
meta_core_set_screen_cursor (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
|
||||
frame->xwindow,
|
||||
@ -1130,7 +1038,6 @@ redraw_control (MetaFrames *frames,
|
||||
rect = control_rect (control, &fgeom);
|
||||
|
||||
gdk_window_invalidate_rect (frame->window, rect, FALSE);
|
||||
invalidate_cache (frames, frame);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@ -1841,8 +1748,6 @@ meta_frames_motion_notify_event (GtkWidget *widget,
|
||||
|
||||
/* Update prelit control and cursor */
|
||||
meta_frames_update_prelit_control (frames, frame, control);
|
||||
|
||||
/* No tooltip while in the process of clicking */
|
||||
}
|
||||
break;
|
||||
case META_GRAB_OP_NONE:
|
||||
@ -1906,222 +1811,50 @@ setup_bg_cr (cairo_t *cr, GdkWindow *window, int x_offset, int y_offset)
|
||||
}
|
||||
}
|
||||
|
||||
/* Returns a pixmap with a piece of the windows frame painted on it.
|
||||
*/
|
||||
|
||||
static cairo_surface_t *
|
||||
generate_pixmap (MetaFrames *frames,
|
||||
MetaUIFrame *frame,
|
||||
cairo_rectangle_int_t *rect)
|
||||
{
|
||||
cairo_surface_t *result;
|
||||
cairo_t *cr;
|
||||
|
||||
/* do not create a pixmap for nonexisting areas */
|
||||
if (rect->width <= 0 || rect->height <= 0)
|
||||
return NULL;
|
||||
|
||||
result = gdk_window_create_similar_surface (frame->window,
|
||||
CAIRO_CONTENT_COLOR,
|
||||
rect->width, rect->height);
|
||||
|
||||
cr = cairo_create (result);
|
||||
cairo_translate (cr, -rect->x, -rect->y);
|
||||
|
||||
setup_bg_cr (cr, frame->window, 0, 0);
|
||||
cairo_paint (cr);
|
||||
|
||||
meta_frames_paint (frames, frame, cr);
|
||||
|
||||
cairo_destroy (cr);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
populate_cache (MetaFrames *frames,
|
||||
MetaUIFrame *frame)
|
||||
{
|
||||
MetaFrameBorders borders;
|
||||
int width, height;
|
||||
int frame_width, frame_height, screen_width, screen_height;
|
||||
CachedPixels *pixels;
|
||||
MetaFrameType frame_type;
|
||||
MetaFrameFlags frame_flags;
|
||||
int i;
|
||||
|
||||
meta_core_get (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
|
||||
frame->xwindow,
|
||||
META_CORE_GET_FRAME_WIDTH, &frame_width,
|
||||
META_CORE_GET_FRAME_HEIGHT, &frame_height,
|
||||
META_CORE_GET_SCREEN_WIDTH, &screen_width,
|
||||
META_CORE_GET_SCREEN_HEIGHT, &screen_height,
|
||||
META_CORE_GET_CLIENT_WIDTH, &width,
|
||||
META_CORE_GET_CLIENT_HEIGHT, &height,
|
||||
META_CORE_GET_FRAME_TYPE, &frame_type,
|
||||
META_CORE_GET_FRAME_FLAGS, &frame_flags,
|
||||
META_CORE_GET_END);
|
||||
|
||||
/* don't cache extremely large windows */
|
||||
if (frame_width > 2 * screen_width ||
|
||||
frame_height > 2 * screen_height)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
meta_theme_get_frame_borders (meta_theme_get_current (),
|
||||
frame_type,
|
||||
frame->text_height,
|
||||
frame_flags,
|
||||
&borders);
|
||||
|
||||
pixels = get_cache (frames, frame);
|
||||
|
||||
/* Setup the rectangles for the four visible frame borders. First top, then
|
||||
* left, right and bottom. Top and bottom extend to the invisible borders
|
||||
* while left and right snugly fit in between:
|
||||
* -----
|
||||
* | |
|
||||
* -----
|
||||
*/
|
||||
|
||||
/* width and height refer to the client window's
|
||||
* size without any border added. */
|
||||
|
||||
/* top */
|
||||
pixels->piece[0].rect.x = borders.invisible.left;
|
||||
pixels->piece[0].rect.y = borders.invisible.top;
|
||||
pixels->piece[0].rect.width = width + borders.visible.left + borders.visible.right;
|
||||
pixels->piece[0].rect.height = borders.visible.top;
|
||||
|
||||
/* left */
|
||||
pixels->piece[1].rect.x = borders.invisible.left;
|
||||
pixels->piece[1].rect.y = borders.total.top;
|
||||
pixels->piece[1].rect.height = height;
|
||||
pixels->piece[1].rect.width = borders.visible.left;
|
||||
|
||||
/* right */
|
||||
pixels->piece[2].rect.x = borders.total.left + width;
|
||||
pixels->piece[2].rect.y = borders.total.top;
|
||||
pixels->piece[2].rect.width = borders.visible.right;
|
||||
pixels->piece[2].rect.height = height;
|
||||
|
||||
/* bottom */
|
||||
pixels->piece[3].rect.x = borders.invisible.left;
|
||||
pixels->piece[3].rect.y = borders.total.top + height;
|
||||
pixels->piece[3].rect.width = width + borders.visible.left + borders.visible.right;
|
||||
pixels->piece[3].rect.height = borders.visible.bottom;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
CachedFramePiece *piece = &pixels->piece[i];
|
||||
/* generate_pixmap() returns NULL for 0 width/height pieces, but
|
||||
* does so cheaply so we don't need to cache the NULL return */
|
||||
if (!piece->pixmap)
|
||||
piece->pixmap = generate_pixmap (frames, frame, &piece->rect);
|
||||
}
|
||||
|
||||
if (frames->invalidate_cache_timeout_id)
|
||||
g_source_remove (frames->invalidate_cache_timeout_id);
|
||||
|
||||
frames->invalidate_cache_timeout_id = g_timeout_add (1000, invalidate_cache_timeout, frames);
|
||||
|
||||
if (!g_list_find (frames->invalidate_frames, frame))
|
||||
frames->invalidate_frames =
|
||||
g_list_prepend (frames->invalidate_frames, frame);
|
||||
}
|
||||
|
||||
static void
|
||||
clip_to_screen (cairo_region_t *region,
|
||||
MetaUIFrame *frame)
|
||||
{
|
||||
cairo_rectangle_int_t frame_area;
|
||||
cairo_rectangle_int_t screen_area = { 0, 0, 0, 0 };
|
||||
cairo_region_t *tmp_region;
|
||||
|
||||
/* Chop off stuff outside the screen; this optimization
|
||||
* is crucial to handle huge client windows,
|
||||
* like "xterm -geometry 1000x1000"
|
||||
*/
|
||||
meta_core_get (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
|
||||
frame->xwindow,
|
||||
META_CORE_GET_FRAME_X, &frame_area.x,
|
||||
META_CORE_GET_FRAME_Y, &frame_area.y,
|
||||
META_CORE_GET_FRAME_WIDTH, &frame_area.width,
|
||||
META_CORE_GET_FRAME_HEIGHT, &frame_area.height,
|
||||
META_CORE_GET_SCREEN_WIDTH, &screen_area.width,
|
||||
META_CORE_GET_SCREEN_HEIGHT, &screen_area.height,
|
||||
META_CORE_GET_END);
|
||||
|
||||
cairo_region_translate (region, frame_area.x, frame_area.y);
|
||||
|
||||
tmp_region = cairo_region_create_rectangle (&frame_area);
|
||||
cairo_region_intersect (region, tmp_region);
|
||||
cairo_region_destroy (tmp_region);
|
||||
|
||||
tmp_region = cairo_region_create_rectangle (&screen_area);
|
||||
cairo_region_intersect (region, tmp_region);
|
||||
cairo_region_destroy (tmp_region);
|
||||
|
||||
cairo_region_translate (region, - frame_area.x, - frame_area.y);
|
||||
}
|
||||
|
||||
static void
|
||||
subtract_client_area (cairo_region_t *region,
|
||||
MetaUIFrame *frame)
|
||||
clip_region_to_visible_frame_border (cairo_region_t *region,
|
||||
MetaUIFrame *frame)
|
||||
{
|
||||
cairo_rectangle_int_t area;
|
||||
cairo_region_t *frame_border;
|
||||
MetaFrameFlags flags;
|
||||
MetaFrameType type;
|
||||
MetaFrameBorders borders;
|
||||
cairo_region_t *tmp_region;
|
||||
Display *display;
|
||||
int frame_width, frame_height;
|
||||
|
||||
display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
|
||||
|
||||
meta_core_get (display, frame->xwindow,
|
||||
META_CORE_GET_FRAME_FLAGS, &flags,
|
||||
META_CORE_GET_FRAME_TYPE, &type,
|
||||
META_CORE_GET_CLIENT_WIDTH, &area.width,
|
||||
META_CORE_GET_CLIENT_HEIGHT, &area.height,
|
||||
META_CORE_GET_FRAME_WIDTH, &frame_width,
|
||||
META_CORE_GET_FRAME_HEIGHT, &frame_height,
|
||||
META_CORE_GET_END);
|
||||
|
||||
meta_theme_get_frame_borders (meta_theme_get_current (),
|
||||
type, frame->text_height, flags,
|
||||
&borders);
|
||||
|
||||
area.x = borders.total.left;
|
||||
area.y = borders.total.top;
|
||||
/* Visible frame rect */
|
||||
area.x = borders.invisible.left;
|
||||
area.y = borders.invisible.top;
|
||||
area.width = frame_width - borders.invisible.left - borders.invisible.right;
|
||||
area.height = frame_height - borders.invisible.top - borders.invisible.bottom;
|
||||
|
||||
tmp_region = cairo_region_create_rectangle (&area);
|
||||
cairo_region_subtract (region, tmp_region);
|
||||
cairo_region_destroy (tmp_region);
|
||||
}
|
||||
frame_border = cairo_region_create_rectangle (&area);
|
||||
|
||||
static void
|
||||
cached_pixels_draw (CachedPixels *pixels,
|
||||
cairo_t *cr,
|
||||
cairo_region_t *region)
|
||||
{
|
||||
cairo_region_t *region_piece;
|
||||
int i;
|
||||
/* Client rect */
|
||||
area.x += borders.visible.left;
|
||||
area.y += borders.visible.top;
|
||||
area.width -= borders.visible.left + borders.visible.right;
|
||||
area.height -= borders.visible.top + borders.visible.bottom;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
CachedFramePiece *piece;
|
||||
piece = &pixels->piece[i];
|
||||
|
||||
if (piece->pixmap)
|
||||
{
|
||||
cairo_set_source_surface (cr, piece->pixmap,
|
||||
piece->rect.x, piece->rect.y);
|
||||
cairo_paint (cr);
|
||||
|
||||
region_piece = cairo_region_create_rectangle (&piece->rect);
|
||||
cairo_region_subtract (region, region_piece);
|
||||
cairo_region_destroy (region_piece);
|
||||
}
|
||||
}
|
||||
/* Visible frame border */
|
||||
cairo_region_subtract_rectangle (frame_border, &area);
|
||||
cairo_region_intersect (region, frame_border);
|
||||
|
||||
cairo_region_destroy (frame_border);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@ -2130,10 +1863,8 @@ meta_frames_draw (GtkWidget *widget,
|
||||
{
|
||||
MetaUIFrame *frame;
|
||||
MetaFrames *frames;
|
||||
CachedPixels *pixels;
|
||||
cairo_region_t *region;
|
||||
cairo_rectangle_int_t clip;
|
||||
int i, n_areas;
|
||||
cairo_region_t *region;
|
||||
cairo_surface_t *target;
|
||||
|
||||
frames = META_FRAMES (widget);
|
||||
@ -2145,47 +1876,23 @@ meta_frames_draw (GtkWidget *widget,
|
||||
if (frame == NULL)
|
||||
return FALSE;
|
||||
|
||||
if (frames->expose_delay_count > 0)
|
||||
{
|
||||
/* Redraw this entire frame later */
|
||||
frame->expose_delayed = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
populate_cache (frames, frame);
|
||||
|
||||
region = cairo_region_create_rectangle (&clip);
|
||||
|
||||
pixels = get_cache (frames, frame);
|
||||
clip_region_to_visible_frame_border (region, frame);
|
||||
|
||||
cached_pixels_draw (pixels, cr, region);
|
||||
|
||||
clip_to_screen (region, frame);
|
||||
subtract_client_area (region, frame);
|
||||
if (cairo_region_is_empty (region))
|
||||
goto out;
|
||||
|
||||
n_areas = cairo_region_num_rectangles (region);
|
||||
gdk_cairo_region (cr, region);
|
||||
cairo_clip (cr);
|
||||
|
||||
for (i = 0; i < n_areas; i++)
|
||||
{
|
||||
cairo_rectangle_int_t area;
|
||||
cairo_save (cr);
|
||||
setup_bg_cr (cr, frame->window, 0, 0);
|
||||
cairo_paint (cr);
|
||||
cairo_restore (cr);
|
||||
|
||||
cairo_region_get_rectangle (region, i, &area);
|
||||
|
||||
cairo_save (cr);
|
||||
|
||||
cairo_rectangle (cr, area.x, area.y, area.width, area.height);
|
||||
cairo_clip (cr);
|
||||
|
||||
cairo_push_group (cr);
|
||||
|
||||
meta_frames_paint (frames, frame, cr);
|
||||
|
||||
cairo_pop_group_to_source (cr);
|
||||
cairo_paint (cr);
|
||||
|
||||
cairo_restore (cr);
|
||||
}
|
||||
meta_frames_paint (frames, frame, cr);
|
||||
|
||||
out:
|
||||
cairo_region_destroy (region);
|
||||
|
||||
return TRUE;
|
||||
@ -2196,7 +1903,6 @@ meta_frames_paint (MetaFrames *frames,
|
||||
MetaUIFrame *frame,
|
||||
cairo_t *cr)
|
||||
{
|
||||
GtkWidget *widget;
|
||||
MetaFrameFlags flags;
|
||||
MetaFrameType type;
|
||||
GdkPixbuf *mini_icon;
|
||||
@ -2209,7 +1915,6 @@ meta_frames_paint (MetaFrames *frames,
|
||||
MetaGrabOp grab_op;
|
||||
Display *display;
|
||||
|
||||
widget = GTK_WIDGET (frames);
|
||||
display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
|
||||
|
||||
for (i = 0; i < META_BUTTON_TYPE_LAST; i++)
|
||||
@ -2308,7 +2013,6 @@ meta_frames_paint (MetaFrames *frames,
|
||||
|
||||
meta_theme_draw_frame_with_style (meta_theme_get_current (),
|
||||
frame->style,
|
||||
widget,
|
||||
cr,
|
||||
type,
|
||||
flags,
|
||||
@ -2627,54 +2331,9 @@ get_control (MetaFrames *frames,
|
||||
return META_FRAME_CONTROL_TITLE;
|
||||
}
|
||||
|
||||
void
|
||||
meta_frames_push_delay_exposes (MetaFrames *frames)
|
||||
{
|
||||
if (frames->expose_delay_count == 0)
|
||||
{
|
||||
/* Make sure we've repainted things */
|
||||
gdk_window_process_all_updates ();
|
||||
XFlush (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
|
||||
}
|
||||
|
||||
frames->expose_delay_count += 1;
|
||||
}
|
||||
|
||||
static void
|
||||
queue_pending_exposes_func (gpointer key, gpointer value, gpointer data)
|
||||
{
|
||||
MetaUIFrame *frame;
|
||||
MetaFrames *frames;
|
||||
|
||||
frames = META_FRAMES (data);
|
||||
frame = value;
|
||||
|
||||
if (frame->expose_delayed)
|
||||
{
|
||||
invalidate_whole_window (frames, frame);
|
||||
frame->expose_delayed = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
meta_frames_pop_delay_exposes (MetaFrames *frames)
|
||||
{
|
||||
g_return_if_fail (frames->expose_delay_count > 0);
|
||||
|
||||
frames->expose_delay_count -= 1;
|
||||
|
||||
if (frames->expose_delay_count == 0)
|
||||
{
|
||||
g_hash_table_foreach (frames->frames,
|
||||
queue_pending_exposes_func,
|
||||
frames);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
invalidate_whole_window (MetaFrames *frames,
|
||||
MetaUIFrame *frame)
|
||||
{
|
||||
gdk_window_invalidate_rect (frame->window, NULL, FALSE);
|
||||
invalidate_cache (frames, frame);
|
||||
}
|
||||
|
@ -80,7 +80,6 @@ struct _MetaUIFrame
|
||||
PangoLayout *layout;
|
||||
int text_height;
|
||||
char *title; /* NULL once we have a layout */
|
||||
guint expose_delayed : 1;
|
||||
guint shape_applied : 1;
|
||||
|
||||
/* FIXME get rid of this, it can just be in the MetaFrames struct */
|
||||
@ -94,18 +93,10 @@ struct _MetaFrames
|
||||
GHashTable *text_heights;
|
||||
|
||||
GHashTable *frames;
|
||||
|
||||
guint tooltip_timeout;
|
||||
MetaUIFrame *last_motion_frame;
|
||||
|
||||
GtkStyleContext *normal_style;
|
||||
GHashTable *style_variants;
|
||||
|
||||
int expose_delay_count;
|
||||
|
||||
int invalidate_cache_timeout_id;
|
||||
GList *invalidate_frames;
|
||||
GHashTable *cache;
|
||||
};
|
||||
|
||||
struct _MetaFramesClass
|
||||
@ -169,7 +160,4 @@ void meta_frames_notify_menu_hide (MetaFrames *frames);
|
||||
|
||||
Window meta_frames_get_moving_frame (MetaFrames *frames);
|
||||
|
||||
void meta_frames_push_delay_exposes (MetaFrames *frames);
|
||||
void meta_frames_pop_delay_exposes (MetaFrames *frames);
|
||||
|
||||
#endif
|
||||
|
@ -465,117 +465,3 @@ meta_preview_get_mini_icon (void)
|
||||
|
||||
return default_icon;
|
||||
}
|
||||
|
||||
cairo_region_t *
|
||||
meta_preview_get_clip_region (MetaPreview *preview, gint new_window_width, gint new_window_height)
|
||||
{
|
||||
cairo_rectangle_int_t xrect;
|
||||
cairo_region_t *corners_xregion, *window_xregion;
|
||||
gint flags;
|
||||
MetaFrameLayout *fgeom;
|
||||
MetaFrameStyle *frame_style;
|
||||
|
||||
g_return_val_if_fail (META_IS_PREVIEW (preview), NULL);
|
||||
|
||||
flags = (META_PREVIEW (preview)->flags);
|
||||
|
||||
window_xregion = cairo_region_create ();
|
||||
|
||||
xrect.x = 0;
|
||||
xrect.y = 0;
|
||||
xrect.width = new_window_width;
|
||||
xrect.height = new_window_height;
|
||||
|
||||
cairo_region_union_rectangle (window_xregion, &xrect);
|
||||
|
||||
if (preview->theme == NULL)
|
||||
return window_xregion;
|
||||
|
||||
/* Otherwise, we do have a theme, so calculate the corners */
|
||||
frame_style = meta_theme_get_frame_style (preview->theme,
|
||||
META_FRAME_TYPE_NORMAL, flags);
|
||||
|
||||
fgeom = frame_style->layout;
|
||||
|
||||
corners_xregion = cairo_region_create ();
|
||||
|
||||
if (fgeom->top_left_corner_rounded_radius != 0)
|
||||
{
|
||||
const int corner = fgeom->top_left_corner_rounded_radius;
|
||||
const float radius = sqrt(corner) + corner;
|
||||
int i;
|
||||
|
||||
for (i=0; i<corner; i++)
|
||||
{
|
||||
|
||||
const int width = floor(0.5 + radius - sqrt(radius*radius - (radius-(i+0.5))*(radius-(i+0.5))));
|
||||
xrect.x = 0;
|
||||
xrect.y = i;
|
||||
xrect.width = width;
|
||||
xrect.height = 1;
|
||||
|
||||
cairo_region_union_rectangle (corners_xregion, &xrect);
|
||||
}
|
||||
}
|
||||
|
||||
if (fgeom->top_right_corner_rounded_radius != 0)
|
||||
{
|
||||
const int corner = fgeom->top_right_corner_rounded_radius;
|
||||
const float radius = sqrt(corner) + corner;
|
||||
int i;
|
||||
|
||||
for (i=0; i<corner; i++)
|
||||
{
|
||||
const int width = floor(0.5 + radius - sqrt(radius*radius - (radius-(i+0.5))*(radius-(i+0.5))));
|
||||
xrect.x = new_window_width - width;
|
||||
xrect.y = i;
|
||||
xrect.width = width;
|
||||
xrect.height = 1;
|
||||
|
||||
cairo_region_union_rectangle (corners_xregion, &xrect);
|
||||
}
|
||||
}
|
||||
|
||||
if (fgeom->bottom_left_corner_rounded_radius != 0)
|
||||
{
|
||||
const int corner = fgeom->bottom_left_corner_rounded_radius;
|
||||
const float radius = sqrt(corner) + corner;
|
||||
int i;
|
||||
|
||||
for (i=0; i<corner; i++)
|
||||
{
|
||||
const int width = floor(0.5 + radius - sqrt(radius*radius - (radius-(i+0.5))*(radius-(i+0.5))));
|
||||
xrect.x = 0;
|
||||
xrect.y = new_window_height - i - 1;
|
||||
xrect.width = width;
|
||||
xrect.height = 1;
|
||||
|
||||
cairo_region_union_rectangle (corners_xregion, &xrect);
|
||||
}
|
||||
}
|
||||
|
||||
if (fgeom->bottom_right_corner_rounded_radius != 0)
|
||||
{
|
||||
const int corner = fgeom->bottom_right_corner_rounded_radius;
|
||||
const float radius = sqrt(corner) + corner;
|
||||
int i;
|
||||
|
||||
for (i=0; i<corner; i++)
|
||||
{
|
||||
const int width = floor(0.5 + radius - sqrt(radius*radius - (radius-(i+0.5))*(radius-(i+0.5))));
|
||||
xrect.x = new_window_width - width;
|
||||
xrect.y = new_window_height - i - 1;
|
||||
xrect.width = width;
|
||||
xrect.height = 1;
|
||||
|
||||
cairo_region_union_rectangle (corners_xregion, &xrect);
|
||||
}
|
||||
}
|
||||
|
||||
cairo_region_subtract (window_xregion, corners_xregion);
|
||||
cairo_region_destroy (corners_xregion);
|
||||
|
||||
return window_xregion;
|
||||
}
|
||||
|
||||
|
||||
|
@ -844,9 +844,12 @@ meta_select_workspace_class_init (MetaSelectWorkspaceClass *klass)
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_convert_meta_to_wnck() converts a MetaWindow to a
|
||||
* WnckWindowDisplayInfo window that is used to build a thumbnail of a
|
||||
* workspace.
|
||||
* meta_convert_meta_to_wnck:
|
||||
* @window: the #MetaWindow
|
||||
* @screen: the #MetaScreen the window is on
|
||||
*
|
||||
* Converts a #MetaWindow to a #WnckWindowDisplayInfo window
|
||||
* that is used to build a thumbnail of a workspace.
|
||||
**/
|
||||
static WnckWindowDisplayInfo
|
||||
meta_convert_meta_to_wnck (MetaWindow *window, MetaScreen *screen)
|
||||
|
@ -4281,29 +4281,15 @@ meta_theme_load (const char *theme_name,
|
||||
int i;
|
||||
|
||||
retval = NULL;
|
||||
|
||||
if (meta_is_debugging ())
|
||||
{
|
||||
/* Try in themes in our source tree */
|
||||
/* We try all supported major versions from current to oldest */
|
||||
for (major_version = THEME_MAJOR_VERSION; (major_version > 0); major_version--)
|
||||
{
|
||||
theme_dir = g_build_filename ("./themes", theme_name, NULL);
|
||||
retval = load_theme (theme_dir, theme_name, major_version, &error);
|
||||
g_free (theme_dir);
|
||||
if (!keep_trying (&error))
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
/* We try all supported major versions from current to oldest */
|
||||
for (major_version = THEME_MAJOR_VERSION; (major_version > 0); major_version--)
|
||||
{
|
||||
/* We try first in home dir, XDG_DATA_DIRS, then system dir for themes */
|
||||
/* We try first in XDG_USER_DATA_DIR, XDG_DATA_DIRS, then system dir for themes */
|
||||
|
||||
/* Try home dir for themes */
|
||||
theme_dir = g_build_filename (g_get_home_dir (),
|
||||
".themes",
|
||||
/* Try XDG_USER_DATA_DIR first */
|
||||
theme_dir = g_build_filename (g_get_user_data_dir(),
|
||||
"themes",
|
||||
theme_name,
|
||||
THEME_SUBDIR,
|
||||
NULL);
|
||||
|
@ -925,16 +925,6 @@ void meta_frame_layout_get_borders (const MetaFrameLayout *layout,
|
||||
MetaFrameFlags flags,
|
||||
MetaFrameType type,
|
||||
MetaFrameBorders *borders);
|
||||
void meta_frame_layout_calc_geometry (const MetaFrameLayout *layout,
|
||||
int text_height,
|
||||
MetaFrameFlags flags,
|
||||
int client_width,
|
||||
int client_height,
|
||||
const MetaButtonLayout *button_layout,
|
||||
MetaFrameType type,
|
||||
MetaFrameGeometry *fgeom,
|
||||
MetaTheme *theme);
|
||||
|
||||
gboolean meta_frame_layout_validate (const MetaFrameLayout *layout,
|
||||
GError **error);
|
||||
|
||||
@ -966,16 +956,9 @@ void meta_color_spec_render (MetaColorSpec *spec,
|
||||
|
||||
MetaDrawOp* meta_draw_op_new (MetaDrawType type);
|
||||
void meta_draw_op_free (MetaDrawOp *op);
|
||||
void meta_draw_op_draw (const MetaDrawOp *op,
|
||||
GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
const MetaDrawInfo *info,
|
||||
/* logical region being drawn */
|
||||
MetaRectangle logical_region);
|
||||
|
||||
void meta_draw_op_draw_with_style (const MetaDrawOp *op,
|
||||
GtkStyleContext *style_gtk,
|
||||
GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
const MetaDrawInfo *info,
|
||||
/* logical region being drawn */
|
||||
@ -984,14 +967,8 @@ void meta_draw_op_draw_with_style (const MetaDrawOp *op,
|
||||
MetaDrawOpList* meta_draw_op_list_new (int n_preallocs);
|
||||
void meta_draw_op_list_ref (MetaDrawOpList *op_list);
|
||||
void meta_draw_op_list_unref (MetaDrawOpList *op_list);
|
||||
void meta_draw_op_list_draw (const MetaDrawOpList *op_list,
|
||||
GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
const MetaDrawInfo *info,
|
||||
MetaRectangle rect);
|
||||
void meta_draw_op_list_draw_with_style (const MetaDrawOpList *op_list,
|
||||
GtkStyleContext *style_gtk,
|
||||
GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
const MetaDrawInfo *info,
|
||||
MetaRectangle rect);
|
||||
@ -1020,32 +997,6 @@ MetaFrameStyle* meta_frame_style_new (MetaFrameStyle *parent);
|
||||
void meta_frame_style_ref (MetaFrameStyle *style);
|
||||
void meta_frame_style_unref (MetaFrameStyle *style);
|
||||
|
||||
void meta_frame_style_draw (MetaFrameStyle *style,
|
||||
GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
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);
|
||||
|
||||
|
||||
void meta_frame_style_draw_with_style (MetaFrameStyle *style,
|
||||
GtkStyleContext *style_gtk,
|
||||
GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
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,
|
||||
guint current_theme_version,
|
||||
@ -1087,7 +1038,6 @@ void meta_theme_draw_frame (MetaTheme *theme,
|
||||
|
||||
void meta_theme_draw_frame_with_style (MetaTheme *theme,
|
||||
GtkStyleContext *style_gtk,
|
||||
GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
MetaFrameType type,
|
||||
MetaFrameFlags flags,
|
||||
|
336
src/ui/theme.c
336
src/ui/theme.c
@ -22,7 +22,8 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file theme.c Making Metacity look pretty
|
||||
* SECTION:theme
|
||||
* @short_description: Making Metacity look pretty
|
||||
*
|
||||
* The window decorations drawn by Metacity are described by files on disk
|
||||
* known internally as "themes" (externally as "window border themes" on
|
||||
@ -30,26 +31,8 @@
|
||||
* contains most of the code necessary to support themes; it does not
|
||||
* contain the XML parser, which is in theme-parser.c.
|
||||
*
|
||||
* \bug This is a big file with lots of different subsystems, which might
|
||||
* be better split out into separate files.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \defgroup tokenizer The theme expression tokenizer
|
||||
*
|
||||
* Themes can use a simple expression language to represent the values of
|
||||
* things. This is the tokeniser used for that language.
|
||||
*
|
||||
* \bug We could remove almost all this code by using GScanner instead,
|
||||
* but we would also have to find every expression in every existing theme
|
||||
* we could and make sure the parse trees were the same.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \defgroup parser The theme expression parser
|
||||
*
|
||||
* Themes can use a simple expression language to represent the values of
|
||||
* things. This is the parser used for that language.
|
||||
* FIXME: This is a big file with lots of different subsystems, which might
|
||||
* be better split out into separate files.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
@ -89,7 +72,7 @@ static void hls_to_rgb (gdouble *h,
|
||||
gdouble *l,
|
||||
gdouble *s);
|
||||
|
||||
/**
|
||||
/*
|
||||
* The current theme. (Themes are singleton.)
|
||||
*/
|
||||
static MetaTheme *meta_current_theme = NULL;
|
||||
@ -185,9 +168,10 @@ color_composite (const GdkRGBA *bg,
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets all the fields of a border to dummy values.
|
||||
* init_border:
|
||||
* @border: The border whose fields should be reset.
|
||||
*
|
||||
* \param border The border whose fields should be reset.
|
||||
* Sets all the fields of a border to dummy values.
|
||||
*/
|
||||
static void
|
||||
init_border (GtkBorder *border)
|
||||
@ -240,9 +224,6 @@ meta_frame_layout_new (void)
|
||||
return layout;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
static gboolean
|
||||
validate_border (const GtkBorder *border,
|
||||
const char **bad)
|
||||
@ -262,17 +243,18 @@ validate_border (const GtkBorder *border,
|
||||
}
|
||||
|
||||
/**
|
||||
* validate_geometry_value:
|
||||
* @val: The value to check
|
||||
* @name: The name to use in the error message
|
||||
* @error: (out): Set to an error if val was not initialised
|
||||
*
|
||||
* Ensures that the theme supplied a particular dimension. When a
|
||||
* MetaFrameLayout is created, all its integer fields are set to -1
|
||||
* #MetaFrameLayout is created, all its integer fields are set to -1
|
||||
* by meta_frame_layout_new(). After an instance of this type
|
||||
* should have been initialised, this function checks that
|
||||
* a given field is not still at -1. It is never called directly, but
|
||||
* rather via the CHECK_GEOMETRY_VALUE and CHECK_GEOMETRY_BORDER
|
||||
* rather via the %CHECK_GEOMETRY_VALUE and %CHECK_GEOMETRY_BORDER
|
||||
* macros.
|
||||
*
|
||||
* \param val The value to check
|
||||
* \param name The name to use in the error message
|
||||
* \param[out] error Set to an error if val was not initialised
|
||||
*/
|
||||
static gboolean
|
||||
validate_geometry_value (int val,
|
||||
@ -611,7 +593,7 @@ strip_button (MetaButtonSpace *func_rects[MAX_BUTTONS_PER_CORNER],
|
||||
return FALSE; /* did not strip anything */
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
meta_frame_layout_calc_geometry (const MetaFrameLayout *layout,
|
||||
int text_height,
|
||||
MetaFrameFlags flags,
|
||||
@ -1640,10 +1622,12 @@ meta_color_spec_render (MetaColorSpec *spec,
|
||||
}
|
||||
|
||||
/**
|
||||
* op_name:
|
||||
* @type: an operation, such as addition
|
||||
*
|
||||
* Represents an operation as a string.
|
||||
*
|
||||
* \param type an operation, such as addition
|
||||
* \return a string, such as "+"
|
||||
* Returns: a string, such as "+"
|
||||
*/
|
||||
static const char*
|
||||
op_name (PosOperatorType type)
|
||||
@ -1672,12 +1656,14 @@ op_name (PosOperatorType type)
|
||||
}
|
||||
|
||||
/**
|
||||
* op_from_string:
|
||||
* @p: a pointer into a string representing an operation; part of an
|
||||
* expression somewhere, so not null-terminated
|
||||
* @len: set to the length of the string found. Set to 0 if none is.
|
||||
*
|
||||
* Parses a string and returns an operation.
|
||||
*
|
||||
* \param p a pointer into a string representing an operation; part of an
|
||||
* expression somewhere, so not null-terminated
|
||||
* \param len set to the length of the string found. Set to 0 if none is.
|
||||
* \return the operation found. If none was, returns POS_OP_NONE.
|
||||
* Returns: the operation found. If none was, returns %POS_OP_NONE.
|
||||
*/
|
||||
static PosOperatorType
|
||||
op_from_string (const char *p,
|
||||
@ -1728,11 +1714,12 @@ op_from_string (const char *p,
|
||||
}
|
||||
|
||||
/**
|
||||
* free_tokens:
|
||||
* @tokens: an array of tokens to be freed
|
||||
* @n_tokens: how many tokens are in the array.
|
||||
*
|
||||
* Frees an array of tokens. All the tokens and their associated memory
|
||||
* will be freed.
|
||||
*
|
||||
* \param tokens an array of tokens to be freed
|
||||
* \param n_tokens how many tokens are in the array.
|
||||
*/
|
||||
static void
|
||||
free_tokens (PosToken *tokens,
|
||||
@ -1752,20 +1739,21 @@ free_tokens (PosToken *tokens,
|
||||
}
|
||||
|
||||
/**
|
||||
* parse_number:
|
||||
* @p: a pointer into a string representing an operation; part of an
|
||||
* expression somewhere, so not null-terminated
|
||||
* @end_return: set to a pointer to the end of the number found; but
|
||||
* not updated if no number was found at all
|
||||
* @next: set to either an integer or a float token
|
||||
* @err: (out): set to the problem if there was a problem
|
||||
*
|
||||
* Tokenises a number in an expression.
|
||||
*
|
||||
* \param p a pointer into a string representing an operation; part of an
|
||||
* expression somewhere, so not null-terminated
|
||||
* \param end_return set to a pointer to the end of the number found; but
|
||||
* not updated if no number was found at all
|
||||
* \param next set to either an integer or a float token
|
||||
* \param[out] err set to the problem if there was a problem
|
||||
* \return TRUE if a valid number was found, FALSE otherwise (and "err" will
|
||||
* have been set)
|
||||
* FIXME: The "while (*start)..." part: what's wrong with strchr-ish things?
|
||||
* FIXME: The name is wrong: it doesn't parse anything.
|
||||
*
|
||||
* \bug The "while (*start)..." part: what's wrong with strchr-ish things?
|
||||
* \bug The name is wrong: it doesn't parse anything.
|
||||
* \ingroup tokenizer
|
||||
* Returns: %TRUE if a valid number was found, FALSE otherwise (and "err" will
|
||||
* have been set)
|
||||
*/
|
||||
static gboolean
|
||||
parse_number (const char *p,
|
||||
@ -1842,7 +1830,7 @@ parse_number (const char *p,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Whether a variable can validly appear as part of the name of a variable.
|
||||
*/
|
||||
#define IS_VARIABLE_CHAR(c) (g_ascii_isalpha ((c)) || (c) == '_')
|
||||
@ -1888,16 +1876,15 @@ debug_print_tokens (PosToken *tokens,
|
||||
#endif
|
||||
|
||||
/**
|
||||
* pos_tokenize:
|
||||
* @expr: The expression
|
||||
* @tokens_p: (out) The resulting tokens
|
||||
* @n_tokens_p: (out): The number of resulting tokens
|
||||
* @err: (out): set to the problem if there was a problem
|
||||
|
||||
* Tokenises an expression.
|
||||
*
|
||||
* \param expr The expression
|
||||
* \param[out] tokens_p The resulting tokens
|
||||
* \param[out] n_tokens_p The number of resulting tokens
|
||||
* \param[out] err set to the problem if there was a problem
|
||||
*
|
||||
* \return True if the expression was successfully tokenised; false otherwise.
|
||||
*
|
||||
* \ingroup tokenizer
|
||||
* Returns: %TRUE if the expression was successfully tokenised; %FALSE otherwise.
|
||||
*/
|
||||
static gboolean
|
||||
pos_tokenize (const char *expr,
|
||||
@ -2025,8 +2012,9 @@ pos_tokenize (const char *expr,
|
||||
}
|
||||
|
||||
/**
|
||||
* PosExprType:
|
||||
*
|
||||
* The type of a PosExpr: either integer, double, or an operation.
|
||||
* \ingroup parser
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
@ -2036,14 +2024,15 @@ typedef enum
|
||||
} PosExprType;
|
||||
|
||||
/**
|
||||
* PosExpr:
|
||||
*
|
||||
* Type and value of an expression in a parsed sequence. We don't
|
||||
* keep expressions in a tree; if this is of type POS_EXPR_OPERATOR,
|
||||
* keep expressions in a tree; if this is of type %POS_EXPR_OPERATOR,
|
||||
* the arguments of the operator will be in the array positions
|
||||
* immediately preceding and following this operator; they cannot
|
||||
* themselves be operators.
|
||||
*
|
||||
* \bug operator is char; it should really be of PosOperatorType.
|
||||
* \ingroup parser
|
||||
* FIXME: operator is #gchar; it should really be of #PosOperatorType.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
@ -2334,29 +2323,29 @@ do_operations (PosExpr *exprs,
|
||||
}
|
||||
|
||||
/**
|
||||
* pos_eval_get_variable:
|
||||
* @t: The token representing a variable
|
||||
* @result: (out): The value of that variable; not set if the token did
|
||||
* not represent a known variable
|
||||
* @env: The environment within which t should be evaluated
|
||||
* @err: (out): set to the problem if there was a problem
|
||||
*
|
||||
* There is a predefined set of variables which can appear in an expression.
|
||||
* Here we take a token representing a variable, and return the current value
|
||||
* of that variable in a particular environment.
|
||||
* (The value is always an integer.)
|
||||
*
|
||||
* There are supposedly some circumstances in which this function can be
|
||||
* called from outside Metacity, in which case env->theme will be NULL, and
|
||||
* called from outside Metacity, in which case env->theme will be %NULL, and
|
||||
* therefore we can't use it to find out quark values, so we do the comparison
|
||||
* using strcmp, which is slower.
|
||||
* using strcmp(), which is slower.
|
||||
*
|
||||
* \param t The token representing a variable
|
||||
* \param[out] result The value of that variable; not set if the token did
|
||||
* not represent a known variable
|
||||
* \param env The environment within which t should be evaluated
|
||||
* \param[out] err set to the problem if there was a problem
|
||||
* FIXME: shouldn't @t be const?
|
||||
* FIXME: we should perhaps consider some sort of lookup arrangement into an
|
||||
* array; also, the duplication of code is unlovely; perhaps using glib
|
||||
* string hashes instead of quarks would fix both problems?
|
||||
*
|
||||
* \return true if we found the variable asked for, false if we didn't
|
||||
*
|
||||
* \bug shouldn't t be const?
|
||||
* \bug we should perhaps consider some sort of lookup arrangement into an
|
||||
* array; also, the duplication of code is unlovely; perhaps using glib
|
||||
* string hashes instead of quarks would fix both problems?
|
||||
* \ingroup parser
|
||||
* Returns: %TRUE if we found the variable asked for, %FALSE if we didn't
|
||||
*/
|
||||
static gboolean
|
||||
pos_eval_get_variable (PosToken *t,
|
||||
@ -2459,18 +2448,18 @@ pos_eval_get_variable (PosToken *t,
|
||||
}
|
||||
|
||||
/**
|
||||
* pos_eval_helper:
|
||||
* @tokens: A list of tokens to evaluate.
|
||||
* @n_tokens: How many tokens are in the list.
|
||||
* @env: The environment context in which to evaluate the expression.
|
||||
* @result: (out): The current value of the expression
|
||||
*
|
||||
* Evaluates a sequence of tokens within a particular environment context,
|
||||
* and returns the current value. May recur if parantheses are found.
|
||||
*
|
||||
* \param tokens A list of tokens to evaluate.
|
||||
* \param n_tokens How many tokens are in the list.
|
||||
* \param env The environment context in which to evaluate the expression.
|
||||
* \param[out] result The current value of the expression
|
||||
*
|
||||
* \bug Yes, we really do reparse the expression every time it's evaluated.
|
||||
* We should keep the parse tree around all the time and just
|
||||
* run the new values through it.
|
||||
* \ingroup parser
|
||||
* FIXME: Yes, we really do reparse the expression every time it's evaluated.
|
||||
* We should keep the parse tree around all the time and just
|
||||
* run the new values through it.
|
||||
*/
|
||||
static gboolean
|
||||
pos_eval_helper (PosToken *tokens,
|
||||
@ -2633,21 +2622,22 @@ pos_eval_helper (PosToken *tokens,
|
||||
*
|
||||
* so very not worth fooling with bison, yet so very painful by hand.
|
||||
*/
|
||||
|
||||
/**
|
||||
* pos_eval:
|
||||
* @spec: The expression to evaluate.
|
||||
* @env: The environment context to evaluate the expression in.
|
||||
* @val_p: (out): The integer value of the expression; if the expression
|
||||
* is of type float, this will be rounded. If we return
|
||||
* %FALSE because the expression is invalid, this will be
|
||||
* zero.
|
||||
* @err: (out): The error, if anything went wrong.
|
||||
*
|
||||
* Evaluates an expression.
|
||||
*
|
||||
* \param spec The expression to evaluate.
|
||||
* \param env The environment context to evaluate the expression in.
|
||||
* \param[out] val_p The integer value of the expression; if the expression
|
||||
* is of type float, this will be rounded. If we return
|
||||
* FALSE because the expression is invalid, this will be
|
||||
* zero.
|
||||
* \param[out] err The error, if anything went wrong.
|
||||
* FIXME: Shouldn't @spec be const?
|
||||
*
|
||||
* \return True if we evaluated the expression successfully; false otherwise.
|
||||
*
|
||||
* \bug Shouldn't spec be const?
|
||||
* \ingroup parser
|
||||
* Returns: %TRUE if we evaluated the expression successfully; %FALSE otherwise.
|
||||
*/
|
||||
static gboolean
|
||||
pos_eval (MetaDrawSpec *spec,
|
||||
@ -3633,7 +3623,6 @@ fill_env (MetaPositionExprEnv *env,
|
||||
static void
|
||||
meta_draw_op_draw_with_env (const MetaDrawOp *op,
|
||||
GtkStyleContext *style_gtk,
|
||||
GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
const MetaDrawInfo *info,
|
||||
MetaRectangle rect,
|
||||
@ -4043,7 +4032,7 @@ meta_draw_op_draw_with_env (const MetaDrawOp *op,
|
||||
d_rect.height = parse_size_unchecked (op->data.op_list.height, env);
|
||||
|
||||
meta_draw_op_list_draw_with_style (op->data.op_list.op_list,
|
||||
style_gtk, widget, cr, info,
|
||||
style_gtk, cr, info,
|
||||
d_rect);
|
||||
}
|
||||
break;
|
||||
@ -4081,7 +4070,7 @@ meta_draw_op_draw_with_env (const MetaDrawOp *op,
|
||||
while (tile.y < (ry + rheight))
|
||||
{
|
||||
meta_draw_op_list_draw_with_style (op->data.tile.op_list,
|
||||
style_gtk, widget, cr, info,
|
||||
style_gtk, cr, info,
|
||||
tile);
|
||||
|
||||
tile.y += tile.height;
|
||||
@ -4102,7 +4091,6 @@ meta_draw_op_draw_with_env (const MetaDrawOp *op,
|
||||
void
|
||||
meta_draw_op_draw_with_style (const MetaDrawOp *op,
|
||||
GtkStyleContext *style_gtk,
|
||||
GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
const MetaDrawInfo *info,
|
||||
MetaRectangle logical_region)
|
||||
@ -4111,23 +4099,12 @@ meta_draw_op_draw_with_style (const MetaDrawOp *op,
|
||||
|
||||
fill_env (&env, info, logical_region);
|
||||
|
||||
meta_draw_op_draw_with_env (op, style_gtk, widget, cr,
|
||||
meta_draw_op_draw_with_env (op, style_gtk, cr,
|
||||
info, logical_region,
|
||||
&env);
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
meta_draw_op_draw (const MetaDrawOp *op,
|
||||
GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
const MetaDrawInfo *info,
|
||||
MetaRectangle logical_region)
|
||||
{
|
||||
meta_draw_op_draw_with_style (op, gtk_widget_get_style_context (widget),
|
||||
widget, cr, info, logical_region);
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_draw_op_list_new: (skip)
|
||||
*
|
||||
@ -4182,7 +4159,6 @@ meta_draw_op_list_unref (MetaDrawOpList *op_list)
|
||||
void
|
||||
meta_draw_op_list_draw_with_style (const MetaDrawOpList *op_list,
|
||||
GtkStyleContext *style_gtk,
|
||||
GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
const MetaDrawInfo *info,
|
||||
MetaRectangle rect)
|
||||
@ -4229,7 +4205,7 @@ meta_draw_op_list_draw_with_style (const MetaDrawOpList *op_list,
|
||||
else if (gdk_cairo_get_clip_rectangle (cr, NULL))
|
||||
{
|
||||
meta_draw_op_draw_with_env (op,
|
||||
style_gtk, widget, cr, info,
|
||||
style_gtk, cr, info,
|
||||
rect,
|
||||
&env);
|
||||
}
|
||||
@ -4238,18 +4214,6 @@ meta_draw_op_list_draw_with_style (const MetaDrawOpList *op_list,
|
||||
cairo_restore (cr);
|
||||
}
|
||||
|
||||
void
|
||||
meta_draw_op_list_draw (const MetaDrawOpList *op_list,
|
||||
GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
const MetaDrawInfo *info,
|
||||
MetaRectangle rect)
|
||||
|
||||
{
|
||||
meta_draw_op_list_draw_with_style (op_list, gtk_widget_get_style_context (widget), widget,
|
||||
cr, info, rect);
|
||||
}
|
||||
|
||||
void
|
||||
meta_draw_op_list_append (MetaDrawOpList *op_list,
|
||||
MetaDrawOp *op)
|
||||
@ -4313,13 +4277,14 @@ meta_draw_op_list_contains (MetaDrawOpList *op_list,
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_frame_style_new:
|
||||
* @parent: The parent style. Data not filled in here will be
|
||||
* looked for in the parent style, and in its parent
|
||||
* style, and so on.
|
||||
*
|
||||
* Constructor for a MetaFrameStyle.
|
||||
*
|
||||
* \param parent The parent style. Data not filled in here will be
|
||||
* looked for in the parent style, and in its parent
|
||||
* style, and so on.
|
||||
*
|
||||
* \return The newly-constructed style.
|
||||
* Returns: (transfer full): The newly-constructed style.
|
||||
*/
|
||||
MetaFrameStyle*
|
||||
meta_frame_style_new (MetaFrameStyle *parent)
|
||||
@ -4341,10 +4306,10 @@ meta_frame_style_new (MetaFrameStyle *parent)
|
||||
}
|
||||
|
||||
/**
|
||||
* Increases the reference count of a frame style.
|
||||
* If the style is NULL, this is a no-op.
|
||||
* meta_frame_style_ref:
|
||||
* @style: The style.
|
||||
*
|
||||
* \param style The style.
|
||||
* Increases the reference count of a frame style.
|
||||
*/
|
||||
void
|
||||
meta_frame_style_ref (MetaFrameStyle *style)
|
||||
@ -4628,10 +4593,9 @@ button_rect (MetaButtonType type,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
meta_frame_style_draw_with_style (MetaFrameStyle *style,
|
||||
GtkStyleContext *style_gtk,
|
||||
GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
const MetaFrameGeometry *fgeom,
|
||||
int client_width,
|
||||
@ -4801,7 +4765,6 @@ meta_frame_style_draw_with_style (MetaFrameStyle *style,
|
||||
m_rect = meta_rect (rect.x, rect.y, rect.width, rect.height);
|
||||
meta_draw_op_list_draw_with_style (op_list,
|
||||
style_gtk,
|
||||
widget,
|
||||
cr,
|
||||
&draw_info,
|
||||
m_rect);
|
||||
@ -4843,7 +4806,6 @@ meta_frame_style_draw_with_style (MetaFrameStyle *style,
|
||||
|
||||
meta_draw_op_list_draw_with_style (op_list,
|
||||
style_gtk,
|
||||
widget,
|
||||
cr,
|
||||
&draw_info,
|
||||
m_rect);
|
||||
@ -4871,25 +4833,6 @@ meta_frame_style_draw_with_style (MetaFrameStyle *style,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
meta_frame_style_draw (MetaFrameStyle *style,
|
||||
GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
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, gtk_widget_get_style_context (widget), widget,
|
||||
cr, fgeom, client_width, client_height,
|
||||
title_layout, text_height,
|
||||
button_states, mini_icon, icon);
|
||||
}
|
||||
|
||||
MetaFrameStyleSet*
|
||||
meta_frame_style_set_new (MetaFrameStyleSet *parent)
|
||||
{
|
||||
@ -5498,7 +5441,6 @@ meta_theme_get_title_scale (MetaTheme *theme,
|
||||
void
|
||||
meta_theme_draw_frame_with_style (MetaTheme *theme,
|
||||
GtkStyleContext *style_gtk,
|
||||
GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
MetaFrameType type,
|
||||
MetaFrameFlags flags,
|
||||
@ -5533,7 +5475,6 @@ meta_theme_draw_frame_with_style (MetaTheme *theme,
|
||||
|
||||
meta_frame_style_draw_with_style (style,
|
||||
style_gtk,
|
||||
widget,
|
||||
cr,
|
||||
&fgeom,
|
||||
client_width, client_height,
|
||||
@ -5558,7 +5499,7 @@ meta_theme_draw_frame (MetaTheme *theme,
|
||||
GdkPixbuf *mini_icon,
|
||||
GdkPixbuf *icon)
|
||||
{
|
||||
meta_theme_draw_frame_with_style (theme, gtk_widget_get_style_context (widget), widget,
|
||||
meta_theme_draw_frame_with_style (theme, gtk_widget_get_style_context (widget),
|
||||
cr, type,flags,
|
||||
client_width, client_height,
|
||||
title_layout, text_height,
|
||||
@ -5853,13 +5794,15 @@ meta_theme_define_color_constant (MetaTheme *theme,
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_theme_lookup_color_constant:
|
||||
* @theme: the theme containing the constant
|
||||
* @name: the name of the constant
|
||||
* @value: (out): the string representation of the colour, or %NULL if it
|
||||
* doesn't exist
|
||||
*
|
||||
* Looks up a colour constant.
|
||||
*
|
||||
* \param theme the theme containing the constant
|
||||
* \param name the name of the constant
|
||||
* \param value [out] the string representation of the colour, or NULL if it
|
||||
* doesn't exist
|
||||
* \return TRUE if it exists, FALSE otherwise
|
||||
* Returns: %TRUE if it exists, %FALSE otherwise
|
||||
*/
|
||||
gboolean
|
||||
meta_theme_lookup_color_constant (MetaTheme *theme,
|
||||
@ -5910,11 +5853,13 @@ meta_gtk_widget_get_font_desc (GtkWidget *widget,
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_pango_font_desc_get_text_height:
|
||||
* @font_desc: the font
|
||||
* @context: the context of the font
|
||||
*
|
||||
* Returns the height of the letters in a particular font.
|
||||
*
|
||||
* \param font_desc the font
|
||||
* \param context the context of the font
|
||||
* \return the height of the letters
|
||||
* Returns: the height of the letters
|
||||
*/
|
||||
int
|
||||
meta_pango_font_desc_get_text_height (const PangoFontDescription *font_desc,
|
||||
@ -6510,11 +6455,13 @@ meta_gtk_arrow_to_string (GtkArrowType arrow)
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_image_fill_type_from_string:
|
||||
* @str: a string representing a fill_type
|
||||
*
|
||||
* Returns a fill_type from a string. The inverse of
|
||||
* meta_image_fill_type_to_string().
|
||||
*
|
||||
* \param str a string representing a fill_type
|
||||
* \result the fill_type, or -1 if it represents no fill_type.
|
||||
* Returns: the fill type, or -1 if it represents no fill type.
|
||||
*/
|
||||
MetaImageFillType
|
||||
meta_image_fill_type_from_string (const char *str)
|
||||
@ -6528,11 +6475,13 @@ meta_image_fill_type_from_string (const char *str)
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_image_fill_type_to_string:
|
||||
* @fill_type: the fill type
|
||||
*
|
||||
* Returns a string representation of a fill_type. The inverse of
|
||||
* meta_image_fill_type_from_string().
|
||||
*
|
||||
* \param fill_type the fill type
|
||||
* \result a string representing that type
|
||||
* Returns: a string representing that type
|
||||
*/
|
||||
const char*
|
||||
meta_image_fill_type_to_string (MetaImageFillType fill_type)
|
||||
@ -6549,13 +6498,14 @@ meta_image_fill_type_to_string (MetaImageFillType fill_type)
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_style_shade:
|
||||
* @a: the starting colour
|
||||
* @b: (out): the resulting colour
|
||||
* @k: amount to scale lightness and saturation by
|
||||
*
|
||||
* Takes a colour "a", scales the lightness and saturation by a certain amount,
|
||||
* and sets "b" to the resulting colour.
|
||||
* gtkstyle.c cut-and-pastage.
|
||||
*
|
||||
* \param a the starting colour
|
||||
* \param b [out] the resulting colour
|
||||
* \param k amount to scale lightness and saturation by
|
||||
*/
|
||||
static void
|
||||
gtk_style_shade (GdkRGBA *a,
|
||||
@ -6592,11 +6542,12 @@ gtk_style_shade (GdkRGBA *a,
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a red/green/blue triplet to a hue/lightness/saturation triplet.
|
||||
* rgb_to_hls:
|
||||
* @r: on input, red; on output, hue
|
||||
* @g: on input, green; on output, lightness
|
||||
* @b: on input, blue; on output, saturation
|
||||
*
|
||||
* \param r on input, red; on output, hue
|
||||
* \param g on input, green; on output, lightness
|
||||
* \param b on input, blue; on output, saturation
|
||||
* Converts a red/green/blue triplet to a hue/lightness/saturation triplet.
|
||||
*/
|
||||
static void
|
||||
rgb_to_hls (gdouble *r,
|
||||
@ -6670,11 +6621,12 @@ rgb_to_hls (gdouble *r,
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a hue/lightness/saturation triplet to a red/green/blue triplet.
|
||||
* hls_to_rgb:
|
||||
* @h: on input, hue; on output, red
|
||||
* @l: on input, lightness; on output, green
|
||||
* @s: on input, saturation; on output, blue
|
||||
*
|
||||
* \param h on input, hue; on output, red
|
||||
* \param l on input, lightness; on output, green
|
||||
* \param s on input, saturation; on output, blue
|
||||
* Converts a hue/lightness/saturation triplet to a red/green/blue triplet.
|
||||
*/
|
||||
static void
|
||||
hls_to_rgb (gdouble *h,
|
||||
@ -6966,12 +6918,14 @@ draw_bg_gradient_composite (const MetaTextureSpec *bg,
|
||||
#endif
|
||||
|
||||
/**
|
||||
* meta_theme_earliest_version_with_button:
|
||||
* @type: the button type
|
||||
*
|
||||
* Returns the earliest version of the theme format which required support
|
||||
* for a particular button. (For example, "shade" first appeared in v2, and
|
||||
* "close" in v1.)
|
||||
*
|
||||
* \param type the button type
|
||||
* \return the number of the theme format
|
||||
* Returns: the number of the theme format
|
||||
*/
|
||||
guint
|
||||
meta_theme_earliest_version_with_button (MetaButtonType type)
|
||||
|
12
src/ui/ui.c
12
src/ui/ui.c
@ -588,18 +588,6 @@ meta_gdk_pixbuf_get_from_pixmap (Pixmap xpixmap,
|
||||
return retval;
|
||||
}
|
||||
|
||||
void
|
||||
meta_ui_push_delay_exposes (MetaUI *ui)
|
||||
{
|
||||
meta_frames_push_delay_exposes (ui->frames);
|
||||
}
|
||||
|
||||
void
|
||||
meta_ui_pop_delay_exposes (MetaUI *ui)
|
||||
{
|
||||
meta_frames_pop_delay_exposes (ui->frames);
|
||||
}
|
||||
|
||||
GdkPixbuf*
|
||||
meta_ui_get_default_window_icon (MetaUI *ui)
|
||||
{
|
||||
|
@ -143,13 +143,6 @@ GdkPixbuf* meta_gdk_pixbuf_get_from_pixmap (Pixmap xpixmap,
|
||||
int width,
|
||||
int height);
|
||||
|
||||
/* Used when we have a server grab and draw all over everything,
|
||||
* then we need to handle exposes after doing that, instead of
|
||||
* during it
|
||||
*/
|
||||
void meta_ui_push_delay_exposes (MetaUI *ui);
|
||||
void meta_ui_pop_delay_exposes (MetaUI *ui);
|
||||
|
||||
GdkPixbuf* meta_ui_get_default_window_icon (MetaUI *ui);
|
||||
GdkPixbuf* meta_ui_get_default_mini_icon (MetaUI *ui);
|
||||
|
||||
|
Reference in New Issue
Block a user