Compare commits

...

22 Commits

Author SHA1 Message Date
66406b3035 Bump version to 3.5.2
Update NEWS
2012-06-05 19:00:28 +02:00
042ddc5637 workspace: add annotation for meta_workspace_get_work_area_all_monitors 2012-05-31 19:17:49 +02:00
5b04ab4473 Updated Spanish translation 2012-05-31 15:29:44 +02:00
16b86ae7f7 Updated Spanish translation 2012-05-31 14:15:54 +02:00
49400657ca stack: Ignore keep-on-top property on maximized windows
It is impossible to switch to other windows when keep-on-top is set
for maximized windows; given that keep-on-top is only ever useful
to keep a window visible while focusing a different window, the
current behavior is pointless. So ignore keep-on-top while a window
is maximized.

https://bugzilla.gnome.org/show_bug.cgi?id=673581
2012-05-30 15:01:57 +02:00
30bc8bc6ce window-actor: Add a debugging tool to write a region to a PNG
Just a helper function that I keep rewriting all over the place.

https://bugzilla.gnome.org/show_bug.cgi?id=676052
2012-05-25 17:31:06 -04:00
ac18f41ed1 window-actor: Use MetaRegionBuilder when scanning the visible region
This gives a pretty solid performance improvement when resizing windows.
2012-05-25 17:31:06 -04:00
60c05a0dac window-actor: Add back antialiased window corners
This simply adds fancy arcs to the mask texture. It's still not painted
with GTK+ yet.

https://bugzilla.gnome.org/show_bug.cgi?id=676052
2012-05-25 17:31:05 -04:00
c47de98c88 window-actor: Paint the shape region with cairo
https://bugzilla.gnome.org/show_bug.cgi?id=676052
2012-05-21 16:12:30 -04:00
f1aada0fae window-actor: Punt mask generation to MetaWindowActor
This effectively makes MetaShapedTexture not a MetaShapedTexture, but a simple
and dumb MetaMaskedTexture, with an optimization for clipped regions.

We're doing this as the mask may need to be more complicated than made of
a cairo path -- we eventually want GTK+ to draw the entire frame background,
which we'll then scan.

https://bugzilla.gnome.org/show_bug.cgi?id=676052
2012-05-21 16:12:30 -04:00
4de492eb20 shaped-texture: Remove the cairo overlay (and rounded corners)
As we want GTK+ to paint the mask on an A8, we can't simply use a cairo
path. A later commit will make this into a simple masked texture, and
meta-window-actor will be in control of the mask.

https://bugzilla.gnome.org/show_bug.cgi?id=676052
2012-05-21 16:12:30 -04:00
9ca00d5cce window-actor: Remove an unnecessary frame check
meta_frame_calc_borders will zero out the borders if we don't have a frame.

https://bugzilla.gnome.org/show_bug.cgi?id=676052
2012-05-21 16:12:30 -04:00
b98e4e37ad theme: Make meta_frame_style_draw_with_style static
https://bugzilla.gnome.org/show_bug.cgi?id=676052
2012-05-21 16:12:30 -04:00
8b64a951c9 theme: Make meta_frame_layout_calc_geometry static
https://bugzilla.gnome.org/show_bug.cgi?id=676052
2012-05-21 16:12:30 -04:00
c2a0719e44 preview-widget: Remove meta_preview_get_clip_region
The concept of a clip region doesn't make sense now that we have anti-aliased
corners and a full alpha channel. Once the theme transition is complete,
creating a preview image with an alpha channel will be possible by passing
an ARGB surface to gtk_widget_draw(preview_widget, ...);

https://bugzilla.gnome.org/show_bug.cgi?id=676052
2012-05-21 16:12:30 -04:00
8cb7a450ae screen: Remove more unused private API
These queued redraws, which is a problem when we want to know exactly
what changed when we redraw, so we do minimal effort. We're eventually
going to replace the queue_redraw API with something a lot better, so
let's just get these out of the way now.

https://bugzilla.gnome.org/show_bug.cgi?id=676052
2012-05-21 16:11:16 -04:00
6fb857cb23 frames: Remove frame border pixel caching and related optimizations
Since we now cache windows in the X server, we don't really need to cache
them here. Since we are redirecting windows in most cases, we're not gaining
anything except added memory usage. Additionally, remove the clip to screen
optimization - if a window is partially off-screen, we still need to draw
the entire thing as redirection means we won't get an expose event for it.

Additionally, when introducing invisible borders, something accidentally
slipped through: we were getting expose events on the invisible borders,
and they weren't in the cached pixels rect, so we were painting the theme
for them, even if we didn't actually paint anything with cairo. Make sure
to clip out the invisible borders instead of just the client rect so that
we don't draw if our expose event is on the invisible borders.

https://bugzilla.gnome.org/show_bug.cgi?id=675111
2012-05-21 12:51:32 -04:00
fc87a635b2 frames: Remove expose_delayed
This was introduced for the effects API and wireframe mode, and was
forgotten when that went the way of the dinosaur.

https://bugzilla.gnome.org/show_bug.cgi?id=671104
2012-05-14 15:44:49 -03:00
81930ca76e theme-parser: Look for themes in XDG_USER_DATA_DIR, not in ~/.themes
https://bugzilla.gnome.org/show_bug.cgi?id=675316
2012-05-14 14:25:55 -03:00
da65738901 theme-parser: Don't load themes from our source tree
There aren't any mutter themes in the source tree. You're better off
using jhbuild with gnome-themes-standard.

https://bugzilla.gnome.org/show_bug.cgi?id=675316
2012-05-14 14:25:55 -03:00
4528e1216a l10n: updated Italian translaion 2012-05-09 11:35:16 +02:00
d56ecde39b Updated Telugu Translation 2012-05-07 00:13:59 +05:30
24 changed files with 1300 additions and 2135 deletions

22
NEWS
View File

@ -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

View File

@ -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])

287
po/es.po
View File

@ -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"

1148
po/it.po

File diff suppressed because it is too large Load Diff

719
po/te.po

File diff suppressed because it is too large Load Diff

View File

@ -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,178 +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;
/* 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);
if (meta_texture_rectangle_check (paint_tex))
priv->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 */
priv->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);
}
g_free (mask_data);
priv->mask_width = tex_width;
priv->mask_height = tex_height;
}
}
static void
meta_shaped_texture_paint (ClutterActor *actor)
{
@ -368,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)
{
@ -383,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))
@ -475,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))
@ -495,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);
@ -587,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;
@ -596,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));
}
@ -727,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

View File

@ -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,
@ -1681,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;
@ -1699,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
@ -1989,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
@ -2114,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,
@ -2173,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);
}

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -1216,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)
{

View File

@ -341,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;

View File

@ -8326,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.

View File

@ -1056,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)

View File

@ -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,

View File

@ -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);

View File

@ -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,12 +260,6 @@ meta_frames_init (MetaFrames *frames)
frames->frames = g_hash_table_new (unsigned_long_hash, unsigned_long_equal);
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);
@ -333,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)
{
@ -698,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;
@ -722,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,
@ -1128,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
@ -1902,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
@ -2126,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);
@ -2141,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;
@ -2620,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);
}

View File

@ -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 */
@ -98,12 +97,6 @@ struct _MetaFrames
GtkStyleContext *normal_style;
GHashTable *style_variants;
int expose_delay_count;
int invalidate_cache_timeout_id;
GList *invalidate_frames;
GHashTable *cache;
};
struct _MetaFramesClass
@ -167,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

View File

@ -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;
}

View File

@ -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);

View File

@ -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);
@ -1007,18 +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_with_style (MetaFrameStyle *style,
GtkStyleContext *style_gtk,
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,

View File

@ -593,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,
@ -4593,7 +4593,7 @@ button_rect (MetaButtonType type,
}
}
void
static void
meta_frame_style_draw_with_style (MetaFrameStyle *style,
GtkStyleContext *style_gtk,
cairo_t *cr,

View File

@ -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)
{

View File

@ -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);