Compare commits

..

2 Commits

Author SHA1 Message Date
Jasper St. Pierre
0829749049 wayland: Implement support for wl_viewport 2014-11-05 10:14:35 -08:00
Jasper St. Pierre
725d0ad680 shaped-texture: Add API to support a viewport view
This will be used by our Wayland front-end to implement the wl_viewport
extension.
2014-11-05 10:14:35 -08:00
33 changed files with 5064 additions and 2416 deletions

2
.gitignore vendored
View File

@@ -66,6 +66,8 @@ src/meta-dbus-idle-monitor.[ch]
src/meta-dbus-login1.[ch]
src/gtk-shell-protocol.c
src/gtk-shell-server-protocol.h
src/scaler-protocol.c
src/scaler-server-protocol.h
src/xdg-shell-protocol.c
src/xdg-shell-server-protocol.h
src/xserver-protocol.c

25
NEWS
View File

@@ -1,28 +1,3 @@
3.15.3
======
* Don't leave left-over frames queued [Owen; #738686]
* Set CRTC configuration even if it might be redundant [Rui; #740838]
Contributors:
Rui Matos, Jasper St. Pierre, Rico Tzschichholz, Owen W. Taylor
Translations:
Trần Ngọc Quân [vi], Muhammet Kara [tr]
3.15.2
======
* Don't enable hiDPI on monitors with broken EDID [Bastien; #734839]
* Prevent crash applying monitor config for a closed lid [Rui; #739450]
* Fix "flicker" during startup transition [Ray; #740377]
* Misc. bug fixes [Lan, Florian, Carlos; #731521, #740133, #738890]
Contributors:
Emmanuele Bassi, Carlos Garnacho, Jonathon Jongsma, Ting-Wei Lan, Rui Matos,
Florian Müllner, Bastien Nocera, Jasper St. Pierre, Ray Strode
Translations:
Kjartan Maraas [nb]
3.15.1
======
* Use GResources for theme loading [Cosimo; #736936]

View File

@@ -2,7 +2,7 @@ AC_PREREQ(2.62)
m4_define([mutter_major_version], [3])
m4_define([mutter_minor_version], [15])
m4_define([mutter_micro_version], [3])
m4_define([mutter_micro_version], [1])
m4_define([mutter_version],
[mutter_major_version.mutter_minor_version.mutter_micro_version])
@@ -206,7 +206,7 @@ if test $have_native_backend = yes; then
fi
AM_CONDITIONAL([HAVE_NATIVE_BACKEND],[test $have_native_backend = yes])
PKG_CHECK_MODULES(MUTTER_WAYLAND, [clutter-wayland-1.0 clutter-wayland-compositor-1.0 wayland-server >= 1.6.90], [have_wayland=yes], [have_wayland=no])
PKG_CHECK_MODULES(MUTTER_WAYLAND, [clutter-wayland-1.0 clutter-wayland-compositor-1.0 wayland-server >= 1.5.90], [have_wayland=yes], [have_wayland=no])
if test $have_wayland = yes; then
AC_PATH_PROG([WAYLAND_SCANNER],[wayland-scanner],[no])
AS_IF([test $WAYLAND_SCANNER = "no"],

View File

@@ -111,15 +111,6 @@ IGNORE_HFILES= \
xprops.h \
$(NULL)
if !HAVE_NATIVE_BACKEND
IGNORE_HFILES+= \
meta-backend-native.h \
meta-cursor-renderer-native.h \
meta-idle-monitor-native.h \
meta-monitor-manager-kms.h \
$(NULL)
endif
if !HAVE_WAYLAND
IGNORE_HFILES += \
meta-surface-actor-wayland.h \

273
po/nb.po
View File

@@ -4,10 +4,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: mutter 3.15.x\n"
"Project-Id-Version: mutter 3.13.x\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-11-15 18:32+0100\n"
"PO-Revision-Date: 2014-11-15 18:34+0100\n"
"POT-Creation-Date: 2014-09-06 14:13+0200\n"
"PO-Revision-Date: 2014-08-23 13:37+0200\n"
"Last-Translator: Kjartan Maraas <kmaraas@gnome.org>\n"
"Language-Team: Norwegian bokmål <i18n-no@lister.ping.uio.no>\n"
"Language: \n"
@@ -351,7 +351,7 @@ msgid ""
"If set to true, and the focus mode is either \"sloppy\" or \"mouse\" then "
"the focus will not be changed immediately when entering a window, but only "
"after the pointer stops moving."
msgstr "Hvis denne settes til «true» og fokusmodus er enten «sloppy» eller «mouse» så vil fokus ikke endres med en gang markøren kommer inn i et vindu, men i stedet når markørens bevegelse stopper."
msgstr ""
#: ../data/org.gnome.mutter.gschema.xml.in.h:15
msgid "Draggable border width"
@@ -385,7 +385,7 @@ msgstr "Plasser nye vinduer i senter"
msgid ""
"When true, the new windows will always be put in the center of the active "
"screen of the monitor."
msgstr "Når denne er «true» vil mye vinduer alltid plasseres midt på aktivt område på skjermen."
msgstr ""
#: ../data/org.gnome.mutter.gschema.xml.in.h:21
msgid "Select window from tab popup"
@@ -423,29 +423,29 @@ msgstr "Bytt til VT 6"
msgid "Switch to VT 7"
msgstr "Bytt til VT 7"
#: ../src/backends/meta-monitor-manager.c:350
#: ../src/backends/meta-monitor-manager.c:412
msgid "Built-in display"
msgstr "Innebygget skjerm"
#: ../src/backends/meta-monitor-manager.c:375
#: ../src/backends/meta-monitor-manager.c:437
msgid "Unknown"
msgstr "Ukjent"
#: ../src/backends/meta-monitor-manager.c:377
#: ../src/backends/meta-monitor-manager.c:439
msgid "Unknown Display"
msgstr "Ukjent skjerm"
#. TRANSLATORS: this is a monitor vendor name, followed by a
#. * size in inches, like 'Dell 15"'
#.
#: ../src/backends/meta-monitor-manager.c:385
#: ../src/backends/meta-monitor-manager.c:447
#, c-format
msgid "%s %s"
msgstr "%s %s"
#. This probably means that a non-WM compositor like xcompmgr is running;
#. * we have no way to get it to exit
#: ../src/compositor/compositor.c:456
#: ../src/compositor/compositor.c:443
#, c-format
msgid ""
"Another compositing manager is already running on screen %i on display \"%s"
@@ -481,7 +481,7 @@ msgstr "_Vent"
msgid "_Force Quit"
msgstr "_Tvungen nedstenging"
#: ../src/core/display.c:550
#: ../src/core/display.c:547
#, c-format
msgid "Failed to open X Window System display '%s'\n"
msgstr "Feil under åpning av X Window System skjerm «%s»\n"
@@ -518,12 +518,12 @@ msgstr "Kjør som en wayland-kompositør"
msgid "Run as a full display server, rather than nested"
msgstr "Kjør som en full skjermtjener, heller enn nøstet"
#: ../src/core/main.c:451
#: ../src/core/main.c:459
#, c-format
msgid "Failed to scan themes directory: %s\n"
msgstr "Feil under søk i temakatalog: %s\n"
#: ../src/core/main.c:467
#: ../src/core/main.c:475
#, c-format
msgid ""
"Could not find a theme! Be sure %s exists and contains the usual themes.\n"
@@ -553,17 +553,17 @@ msgstr "Skriv versjonsnummer"
msgid "Mutter plugin to use"
msgstr "Mutter-tillegg som skal brukes"
#: ../src/core/prefs.c:2064
#: ../src/core/prefs.c:2101
#, c-format
msgid "Workspace %d"
msgstr "Arbeidsområde %d"
#: ../src/core/screen.c:543
#: ../src/core/screen.c:548
#, c-format
msgid "Screen %d on display '%s' is invalid\n"
msgstr "Skjerm %d på display «%s» er ugyldig\n"
#: ../src/core/screen.c:559
#: ../src/core/screen.c:564
#, c-format
msgid ""
"Screen %d on display \"%s\" already has a window manager; try using the --"
@@ -572,7 +572,7 @@ msgstr ""
"Skjerm %d på display «%s» har allerede en vindushåndterer; prøv å bruke "
"flagget --replace for å erstatte aktiv vindushåndterer.\n"
#: ../src/core/screen.c:652
#: ../src/core/screen.c:657
#, c-format
msgid "Screen %d on display \"%s\" already has a window manager\n"
msgstr "Skjerm %d på display «%s» har allerede en vinduhåndterer\n"
@@ -589,48 +589,48 @@ msgstr "Mutter er kompilert uten støtte for «verbose» modus\n"
msgid "%d x %d"
msgstr "%d x %d"
#: ../src/ui/theme.c:154
#: ../src/ui/theme.c:233
msgid "top"
msgstr "topp"
#: ../src/ui/theme.c:156
#: ../src/ui/theme.c:235
msgid "bottom"
msgstr "bunn"
#: ../src/ui/theme.c:158
#: ../src/ui/theme.c:237
msgid "left"
msgstr "venstre"
#: ../src/ui/theme.c:160
#: ../src/ui/theme.c:239
msgid "right"
msgstr "høyre"
#: ../src/ui/theme.c:188
#: ../src/ui/theme.c:267
#, c-format
msgid "frame geometry does not specify \"%s\" dimension"
msgstr "rammegeometrien spesifiserer ikke «%s»-dimensjon"
#: ../src/ui/theme.c:207
#: ../src/ui/theme.c:286
#, c-format
msgid "frame geometry does not specify dimension \"%s\" for border \"%s\""
msgstr "rammegeometri spesifiserer ikke dimensjon «%s» for kant «%s»"
#: ../src/ui/theme.c:244
#: ../src/ui/theme.c:323
#, c-format
msgid "Button aspect ratio %g is not reasonable"
msgstr "Aspektrate %g for knapp er ikke fornuftig"
#: ../src/ui/theme.c:256
#: ../src/ui/theme.c:335
#, c-format
msgid "Frame geometry does not specify size of buttons"
msgstr "Rammegeometrien spesifiserer ikke størrelse på knapper"
#: ../src/ui/theme.c:1024
#: ../src/ui/theme.c:1061
#, c-format
msgid "Gradients should have at least two colors"
msgstr "Gradienter må ha minst to farger"
#: ../src/ui/theme.c:1174
#: ../src/ui/theme.c:1211
#, c-format
msgid ""
"GTK custom color specification must have color name and fallback in "
@@ -639,7 +639,7 @@ msgstr ""
"Egendefinert GTK-fargespesifikasjon må ha fargenavn og reserve i parantes, f."
"eks gtk:custom(foo,bar); kunne ikke lese «%s»"
#: ../src/ui/theme.c:1190
#: ../src/ui/theme.c:1227
#, c-format
msgid ""
"Invalid character '%c' in color_name parameter of gtk:custom, only A-Za-z0-9-"
@@ -648,7 +648,7 @@ msgstr ""
"Ugyldig tegn «%c» i parameter color_name for gtk:custom, kun A-Za-z0-9-_ er "
"gyldig"
#: ../src/ui/theme.c:1204
#: ../src/ui/theme.c:1241
#, c-format
msgid ""
"Gtk:custom format is \"gtk:custom(color_name,fallback)\", \"%s\" does not "
@@ -657,7 +657,7 @@ msgstr ""
"Gtk:custom-format er «gtk:custom(color_name,fallback)», «%s» passer ikke i "
"formatet"
#: ../src/ui/theme.c:1249
#: ../src/ui/theme.c:1286
#, c-format
msgid ""
"GTK color specification must have the state in brackets, e.g. gtk:fg[NORMAL] "
@@ -666,7 +666,7 @@ msgstr ""
"GTK-fargespesifikasjon må ha tilstand i klammer, f.eks. gtk:fg[NORMAL], hvor "
"NORMAL er tilstanden; kunne ikke lese «%s»"
#: ../src/ui/theme.c:1263
#: ../src/ui/theme.c:1300
#, c-format
msgid ""
"GTK color specification must have a close bracket after the state, e.g. gtk:"
@@ -675,17 +675,17 @@ msgstr ""
"GTK-fargespesifikasjon må ha en avsluttende klamme etter tilstanden, f.eks. "
"gtk:fg[NORMAL], hvor NORMAL er tilstanden; kunne ikke lese «%s»"
#: ../src/ui/theme.c:1274
#: ../src/ui/theme.c:1311
#, c-format
msgid "Did not understand state \"%s\" in color specification"
msgstr "Forsto ikke tilstand «%s» i fargespesifikasjonen"
#: ../src/ui/theme.c:1287
#: ../src/ui/theme.c:1324
#, c-format
msgid "Did not understand color component \"%s\" in color specification"
msgstr "Forsto ikke fargekomponent «%s» i fargespesifikasjonen"
#: ../src/ui/theme.c:1315
#: ../src/ui/theme.c:1352
#, c-format
msgid ""
"Blend format is \"blend/bg_color/fg_color/alpha\", \"%s\" does not fit the "
@@ -694,56 +694,56 @@ msgstr ""
"Blandingsformat er «blend/bg_color/fg_color/alpha», «%s» passer ikke i "
"formatet"
#: ../src/ui/theme.c:1326
#: ../src/ui/theme.c:1363
#, c-format
msgid "Could not parse alpha value \"%s\" in blended color"
msgstr "Kunne ikke lese alpha-verdi «%s» i blandet farge"
#: ../src/ui/theme.c:1336
#: ../src/ui/theme.c:1373
#, c-format
msgid "Alpha value \"%s\" in blended color is not between 0.0 and 1.0"
msgstr "Alpha-verdi «%s» i blandet farge er ikke mellom 0.0 og 1.0"
#: ../src/ui/theme.c:1382
#: ../src/ui/theme.c:1419
#, c-format
msgid ""
"Shade format is \"shade/base_color/factor\", \"%s\" does not fit the format"
msgstr ""
"Skyggeformatet er «shade/base_color/factor», «%s» passer ikke i formatet"
#: ../src/ui/theme.c:1393
#: ../src/ui/theme.c:1430
#, c-format
msgid "Could not parse shade factor \"%s\" in shaded color"
msgstr "Kunne ikke lese skyggefaktor «%s» i skyggelagt farge"
#: ../src/ui/theme.c:1403
#: ../src/ui/theme.c:1440
#, c-format
msgid "Shade factor \"%s\" in shaded color is negative"
msgstr "Skyggefaktor «%s» i skyggelagt farge er negativ"
#: ../src/ui/theme.c:1432
#: ../src/ui/theme.c:1469
#, c-format
msgid "Could not parse color \"%s\""
msgstr "Kunne ikke lese farge «%s»"
#: ../src/ui/theme.c:1741
#: ../src/ui/theme.c:1778
#, c-format
msgid "Coordinate expression contains character '%s' which is not allowed"
msgstr "Koordinatuttrykk inneholder tegn «%s» som ikke er tillatt"
#: ../src/ui/theme.c:1768
#: ../src/ui/theme.c:1805
#, c-format
msgid ""
"Coordinate expression contains floating point number '%s' which could not be "
"parsed"
msgstr "Koordinatuttrykk inneholder flyttall «%s» som ikke kunne tolkes"
#: ../src/ui/theme.c:1782
#: ../src/ui/theme.c:1819
#, c-format
msgid "Coordinate expression contains integer '%s' which could not be parsed"
msgstr "Koordinatuttrykk inneholder heltall «%s» som ikke kunne tolkes"
#: ../src/ui/theme.c:1903
#: ../src/ui/theme.c:1940
#, c-format
msgid ""
"Coordinate expression contained unknown operator at the start of this text: "
@@ -752,39 +752,39 @@ msgstr ""
"Koordinatuttrykket inneholdt en ukjent operator ved begynnelsen av denne "
"teksten: «%s»"
#: ../src/ui/theme.c:1960
#: ../src/ui/theme.c:1997
#, c-format
msgid "Coordinate expression was empty or not understood"
msgstr "Koordinatuttrykket var tomt eller ble ikke forstått"
#: ../src/ui/theme.c:2073 ../src/ui/theme.c:2083 ../src/ui/theme.c:2117
#: ../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 "Koordinatuttrykket resulterer i divisjon med null"
#: ../src/ui/theme.c:2125
#: ../src/ui/theme.c:2162
#, c-format
msgid ""
"Coordinate expression tries to use mod operator on a floating-point number"
msgstr "Koordinatuttrykket prøver å bruke mod-operator på et flyttall"
#: ../src/ui/theme.c:2181
#: ../src/ui/theme.c:2218
#, c-format
msgid ""
"Coordinate expression has an operator \"%s\" where an operand was expected"
msgstr "Koordinatuttrykket har en operator «%s» hvor en operand var ventet"
#: ../src/ui/theme.c:2190
#: ../src/ui/theme.c:2227
#, c-format
msgid "Coordinate expression had an operand where an operator was expected"
msgstr "Koordinatuttrykket hadde en operand hvor en operator var ventet"
#: ../src/ui/theme.c:2198
#: ../src/ui/theme.c:2235
#, c-format
msgid "Coordinate expression ended with an operator instead of an operand"
msgstr "Koordinatuttrykket sluttet med en operator i stedet for en operand"
#: ../src/ui/theme.c:2208
#: ../src/ui/theme.c:2245
#, c-format
msgid ""
"Coordinate expression has operator \"%c\" following operator \"%c\" with no "
@@ -793,38 +793,38 @@ msgstr ""
"Koordinatuttrykket har en operator «%c» etter en operator «%c» og ingen "
"operand mellom dem."
#: ../src/ui/theme.c:2359 ../src/ui/theme.c:2404
#: ../src/ui/theme.c:2396 ../src/ui/theme.c:2441
#, c-format
msgid "Coordinate expression had unknown variable or constant \"%s\""
msgstr "Koordinatuttrykket haddeen ukjent variabel eller konstant «%s»"
#: ../src/ui/theme.c:2458
#: ../src/ui/theme.c:2495
#, c-format
msgid "Coordinate expression parser overflowed its buffer."
msgstr "Tolkeren for koordinatuttrykk oversteg buffergrensen."
#: ../src/ui/theme.c:2487
#: ../src/ui/theme.c:2524
#, c-format
msgid "Coordinate expression had a close parenthesis with no open parenthesis"
msgstr "Koordinatuttrykket hadde en parantes slutt uten parantes start"
#: ../src/ui/theme.c:2551
#: ../src/ui/theme.c:2588
#, c-format
msgid "Coordinate expression had an open parenthesis with no close parenthesis"
msgstr "Koordinatuttrykket hadde en åpen parantes uten en avsluttende parantes"
#: ../src/ui/theme.c:2562
#: ../src/ui/theme.c:2599
#, c-format
msgid "Coordinate expression doesn't seem to have any operators or operands"
msgstr ""
"Koordinatuttrykket ser ikke ut til å ha noen operatorer eller operander"
#: ../src/ui/theme.c:2775 ../src/ui/theme.c:2795 ../src/ui/theme.c:2815
#: ../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 "Tema inneholdt et uttrykk som resulterte i en feil: %s\n"
#: ../src/ui/theme.c:4055
#: ../src/ui/theme.c:4455
#, c-format
msgid ""
"<button function=\"%s\" state=\"%s\" draw_ops=\"whatever\"/> must be "
@@ -833,25 +833,25 @@ msgstr ""
"<button function=«%s» state=«%s» draw_ops=«ett-eller-annet»/> må "
"spesifiseres for denne rammestilen"
#: ../src/ui/theme.c:4570 ../src/ui/theme.c:4595
#: ../src/ui/theme.c:4970 ../src/ui/theme.c:4995
#, c-format
msgid ""
"Missing <frame state=\"%s\" resize=\"%s\" focus=\"%s\" style=\"whatever\"/>"
msgstr ""
"Mangler <frame state=«%s» resize=«%s» focus=«%s» stil=«ett-eller-annet»/>"
#: ../src/ui/theme.c:4641
#: ../src/ui/theme.c:5041
#, c-format
msgid "Failed to load theme \"%s\": %s\n"
msgstr "Klarte ikke å laste tema «%s»: %s\n"
#: ../src/ui/theme.c:4777 ../src/ui/theme.c:4784 ../src/ui/theme.c:4791
#: ../src/ui/theme.c:4798 ../src/ui/theme.c:4805
#: ../src/ui/theme.c:5177 ../src/ui/theme.c:5184 ../src/ui/theme.c:5191
#: ../src/ui/theme.c:5198 ../src/ui/theme.c:5205
#, c-format
msgid "No <%s> set for theme \"%s\""
msgstr "<%s> er ikke satt for tema «%s»"
#: ../src/ui/theme.c:4813
#: ../src/ui/theme.c:5213
#, c-format
msgid ""
"No frame style set for window type \"%s\" in theme \"%s\", add a <window "
@@ -860,14 +860,14 @@ msgstr ""
"Ingen rammestil satt for vindutype «%s» i tema «%s», legg til et <window "
"type=«%s» style_set=«ett-eller-annet»/>-element"
#: ../src/ui/theme.c:5220 ../src/ui/theme.c:5282 ../src/ui/theme.c:5345
#: ../src/ui/theme.c:5620 ../src/ui/theme.c:5682 ../src/ui/theme.c:5745
#, c-format
msgid ""
"User-defined constants must begin with a capital letter; \"%s\" does not"
msgstr ""
"Brukerdefinerte konstanter må begynne med stor bokstav; «%s» gjør ikke det"
#: ../src/ui/theme.c:5228 ../src/ui/theme.c:5290 ../src/ui/theme.c:5353
#: ../src/ui/theme.c:5628 ../src/ui/theme.c:5690 ../src/ui/theme.c:5753
#, c-format
msgid "Constant \"%s\" has already been defined"
msgstr "Konstant «%s» er allerede definert"
@@ -930,13 +930,13 @@ msgstr "Bolske verdier må være «sann» eller «usann» ikke «%s»"
msgid "Angle must be between 0.0 and 360.0, was %g\n"
msgstr "Vinkelen må være mellom 0.0 og 360.0, var %g\n"
#: ../src/ui/theme-parser.c:797
#: ../src/ui/theme-parser.c:800
#, c-format
msgid "Alpha must be between 0.0 (invisible) and 1.0 (fully opaque), was %g\n"
msgstr ""
"Alpha må være mellom 0.0 (usynlig) og 1.0 (helt ugjennomsiktig), var %g\n"
#: ../src/ui/theme-parser.c:862
#: ../src/ui/theme-parser.c:865
#, c-format
msgid ""
"Invalid title scale \"%s\" (must be one of xx-small,x-small,small,medium,"
@@ -945,58 +945,58 @@ msgstr ""
"Ugyldig skalering av tittel «%s» (må være en av xx-small,x-small,small,"
"medium,large,x-large,xx-large)\n"
#: ../src/ui/theme-parser.c:1018 ../src/ui/theme-parser.c:1081
#: ../src/ui/theme-parser.c:1115 ../src/ui/theme-parser.c:1218
#: ../src/ui/theme-parser.c:1021 ../src/ui/theme-parser.c:1084
#: ../src/ui/theme-parser.c:1118 ../src/ui/theme-parser.c:1221
#, c-format
msgid "<%s> name \"%s\" used a second time"
msgstr "<%s> navn «%s» brukt på nytt"
#: ../src/ui/theme-parser.c:1030 ../src/ui/theme-parser.c:1127
#: ../src/ui/theme-parser.c:1230
#: ../src/ui/theme-parser.c:1033 ../src/ui/theme-parser.c:1130
#: ../src/ui/theme-parser.c:1233
#, c-format
msgid "<%s> parent \"%s\" has not been defined"
msgstr "<%s> opphav «%s» er ikke definert"
#: ../src/ui/theme-parser.c:1140
#: ../src/ui/theme-parser.c:1143
#, c-format
msgid "<%s> geometry \"%s\" has not been defined"
msgstr "<%s> geometri «%s» er ikke definert"
#: ../src/ui/theme-parser.c:1153
#: ../src/ui/theme-parser.c:1156
#, c-format
msgid "<%s> must specify either a geometry or a parent that has a geometry"
msgstr "<%s> må spesifisere enten en geometri eller et opphav som har geometri"
#: ../src/ui/theme-parser.c:1195
#: ../src/ui/theme-parser.c:1198
msgid "You must specify a background for an alpha value to be meaningful"
msgstr "Du må oppgi en bakgrunn for at en alpha-verdi skal ha mening"
#: ../src/ui/theme-parser.c:1263
#: ../src/ui/theme-parser.c:1266
#, c-format
msgid "Unknown type \"%s\" on <%s> element"
msgstr "Ukjent type «%s» på <%s>-element"
#: ../src/ui/theme-parser.c:1274
#: ../src/ui/theme-parser.c:1277
#, c-format
msgid "Unknown style_set \"%s\" on <%s> element"
msgstr "Ukjent style_set «%s» på <%s>-element"
#: ../src/ui/theme-parser.c:1282
#: ../src/ui/theme-parser.c:1285
#, c-format
msgid "Window type \"%s\" has already been assigned a style set"
msgstr "Vindutype «%s» er allerede tildelt et stilsett"
#: ../src/ui/theme-parser.c:1312 ../src/ui/theme-parser.c:1376
#: ../src/ui/theme-parser.c:1602 ../src/ui/theme-parser.c:2821
#: ../src/ui/theme-parser.c:2867 ../src/ui/theme-parser.c:3017
#: ../src/ui/theme-parser.c:3253 ../src/ui/theme-parser.c:3291
#: ../src/ui/theme-parser.c:3329 ../src/ui/theme-parser.c:3367
#: ../src/ui/theme-parser.c:1315 ../src/ui/theme-parser.c:1379
#: ../src/ui/theme-parser.c:1605 ../src/ui/theme-parser.c:2840
#: ../src/ui/theme-parser.c:2886 ../src/ui/theme-parser.c:3036
#: ../src/ui/theme-parser.c:3272 ../src/ui/theme-parser.c:3310
#: ../src/ui/theme-parser.c:3348 ../src/ui/theme-parser.c:3386
#, c-format
msgid "Element <%s> is not allowed below <%s>"
msgstr "Element <%s> er ikke tillatt under <%s>"
#: ../src/ui/theme-parser.c:1426 ../src/ui/theme-parser.c:1440
#: ../src/ui/theme-parser.c:1485
#: ../src/ui/theme-parser.c:1429 ../src/ui/theme-parser.c:1443
#: ../src/ui/theme-parser.c:1488
msgid ""
"Cannot specify both \"button_width\"/\"button_height\" and \"aspect_ratio\" "
"for buttons"
@@ -1004,123 +1004,123 @@ msgstr ""
"Kan ikke spesifisere både «button_width»/«button_height» og «aspect_ratio» "
"for knapper"
#: ../src/ui/theme-parser.c:1449
#: ../src/ui/theme-parser.c:1452
#, c-format
msgid "Distance \"%s\" is unknown"
msgstr "Avstand «%s» er ukjent"
#: ../src/ui/theme-parser.c:1494
#: ../src/ui/theme-parser.c:1497
#, c-format
msgid "Aspect ratio \"%s\" is unknown"
msgstr "Aspektrate «%s» er ukjent"
#: ../src/ui/theme-parser.c:1556
#: ../src/ui/theme-parser.c:1559
#, c-format
msgid "Border \"%s\" is unknown"
msgstr "Grense «%s» er ukjent"
#: ../src/ui/theme-parser.c:1867
#: ../src/ui/theme-parser.c:1870
#, c-format
msgid "No \"start_angle\" or \"from\" attribute on element <%s>"
msgstr "Ingen «start_angle» eller «from»-attributt på element <%s>"
#: ../src/ui/theme-parser.c:1874
#: ../src/ui/theme-parser.c:1877
#, c-format
msgid "No \"extent_angle\" or \"to\" attribute on element <%s>"
msgstr "Ingen «extent_angle» eller «to»-attributt <%s>-element"
#: ../src/ui/theme-parser.c:2114
#: ../src/ui/theme-parser.c:2117
#, c-format
msgid "Did not understand value \"%s\" for type of gradient"
msgstr "Forsto ikke verdi «%s» for gradienttype"
#: ../src/ui/theme-parser.c:2189 ../src/ui/theme-parser.c:2551
#: ../src/ui/theme-parser.c:2195 ../src/ui/theme-parser.c:2570
#, c-format
msgid "Did not understand fill type \"%s\" for <%s> element"
msgstr "Forsto ikke fyll-type «%s» for <%s>-element"
#: ../src/ui/theme-parser.c:2343 ../src/ui/theme-parser.c:2426
#: ../src/ui/theme-parser.c:2489
#: ../src/ui/theme-parser.c:2362 ../src/ui/theme-parser.c:2445
#: ../src/ui/theme-parser.c:2508
#, c-format
msgid "Did not understand state \"%s\" for <%s> element"
msgstr "Forsto ikke tilstand «%s» for element <%s>"
#: ../src/ui/theme-parser.c:2353 ../src/ui/theme-parser.c:2436
#: ../src/ui/theme-parser.c:2372 ../src/ui/theme-parser.c:2455
#, c-format
msgid "Did not understand shadow \"%s\" for <%s> element"
msgstr "Forsto ikke skygge «%s» for element <%s>"
#: ../src/ui/theme-parser.c:2363
#: ../src/ui/theme-parser.c:2382
#, c-format
msgid "Did not understand arrow \"%s\" for <%s> element"
msgstr "Forsto ikke pil «%s» for element <%s>"
#: ../src/ui/theme-parser.c:2677 ../src/ui/theme-parser.c:2773
#: ../src/ui/theme-parser.c:2696 ../src/ui/theme-parser.c:2792
#, c-format
msgid "No <draw_ops> called \"%s\" has been defined"
msgstr "Ingen <draw_ops> kalt «%s» er definert"
#: ../src/ui/theme-parser.c:2689 ../src/ui/theme-parser.c:2785
#: ../src/ui/theme-parser.c:2708 ../src/ui/theme-parser.c:2804
#, c-format
msgid "Including draw_ops \"%s\" here would create a circular reference"
msgstr "Hvis du tar med draw_ops «%s» her vil dette lage en sirkulær referanse"
#: ../src/ui/theme-parser.c:2900
#: ../src/ui/theme-parser.c:2919
#, c-format
msgid "Unknown position \"%s\" for frame piece"
msgstr "Ukjent posisjon «%s» for rammesdel"
#: ../src/ui/theme-parser.c:2908
#: ../src/ui/theme-parser.c:2927
#, c-format
msgid "Frame style already has a piece at position %s"
msgstr "Rammestil har allerede en del i posisjon %s"
#: ../src/ui/theme-parser.c:2925 ../src/ui/theme-parser.c:3002
#: ../src/ui/theme-parser.c:2944 ../src/ui/theme-parser.c:3021
#, c-format
msgid "No <draw_ops> with the name \"%s\" has been defined"
msgstr "Ingen <draw_ops> med navn «%s» er definert"
#: ../src/ui/theme-parser.c:2955
#: ../src/ui/theme-parser.c:2974
#, c-format
msgid "Unknown function \"%s\" for button"
msgstr "Ukjent funksjon «%s» for knapp"
#: ../src/ui/theme-parser.c:2965
#: ../src/ui/theme-parser.c:2984
#, c-format
msgid "Button function \"%s\" does not exist in this version (%d, need %d)"
msgstr "Knappefunksjon «%s» eksisterer ikke i denne versjonen (%d, trenger %d)"
#: ../src/ui/theme-parser.c:2977
#: ../src/ui/theme-parser.c:2996
#, c-format
msgid "Unknown state \"%s\" for button"
msgstr "Ukjent tilstand «%s» for knapp"
#: ../src/ui/theme-parser.c:2985
#: ../src/ui/theme-parser.c:3004
#, c-format
msgid "Frame style already has a button for function %s state %s"
msgstr "Rammestil har allerede en knapp for funksjon %s tilstand %s"
#: ../src/ui/theme-parser.c:3056
#: ../src/ui/theme-parser.c:3075
#, c-format
msgid "\"%s\" is not a valid value for focus attribute"
msgstr "«%s» er ikke en gyldig verdi for fokusattributt"
#: ../src/ui/theme-parser.c:3065
#: ../src/ui/theme-parser.c:3084
#, c-format
msgid "\"%s\" is not a valid value for state attribute"
msgstr "«%s» er ikke en gyldig verdi for tilstandsattributt"
#: ../src/ui/theme-parser.c:3075
#: ../src/ui/theme-parser.c:3094
#, c-format
msgid "A style called \"%s\" has not been defined"
msgstr "En stil med navn «%s» er ikke definert"
#: ../src/ui/theme-parser.c:3096 ../src/ui/theme-parser.c:3119
#: ../src/ui/theme-parser.c:3115 ../src/ui/theme-parser.c:3138
#, c-format
msgid "\"%s\" is not a valid value for resize attribute"
msgstr "«%s» er ikke en gyldig verdi for attributt for endring av størrelse"
#: ../src/ui/theme-parser.c:3130
#: ../src/ui/theme-parser.c:3149
#, c-format
msgid ""
"Should not have \"resize\" attribute on <%s> element for maximized/shaded "
@@ -1129,27 +1129,27 @@ msgstr ""
"Skal ikke være noen «resize»-attributt på <%s>-element for maksimert/"
"skyggelagt tilstand"
#: ../src/ui/theme-parser.c:3144
#: ../src/ui/theme-parser.c:3163
#, c-format
msgid ""
"Should not have \"resize\" attribute on <%s> element for maximized states"
msgstr ""
"Skal ikke være noen «resize»-attributt på <%s>-element for maksimert tilstand"
#: ../src/ui/theme-parser.c:3158 ../src/ui/theme-parser.c:3202
#: ../src/ui/theme-parser.c:3177 ../src/ui/theme-parser.c:3221
#, c-format
msgid "Style has already been specified for state %s resize %s focus %s"
msgstr ""
"Stil er allerede spesifisert for tilstand %s størrelsesendring %s fokus %s"
#: ../src/ui/theme-parser.c:3169 ../src/ui/theme-parser.c:3180
#: ../src/ui/theme-parser.c:3191 ../src/ui/theme-parser.c:3213
#: ../src/ui/theme-parser.c:3224 ../src/ui/theme-parser.c:3235
#: ../src/ui/theme-parser.c:3188 ../src/ui/theme-parser.c:3199
#: ../src/ui/theme-parser.c:3210 ../src/ui/theme-parser.c:3232
#: ../src/ui/theme-parser.c:3243 ../src/ui/theme-parser.c:3254
#, c-format
msgid "Style has already been specified for state %s focus %s"
msgstr "Stil er allerede spesifisert for tilstand %s fokus %s"
#: ../src/ui/theme-parser.c:3274
#: ../src/ui/theme-parser.c:3293
msgid ""
"Can't have a two draw_ops for a <piece> element (theme specified a draw_ops "
"attribute and also a <draw_ops> element, or specified two elements)"
@@ -1158,7 +1158,7 @@ msgstr ""
"draw_ops-attributt i tillegg til et <draw_ops>-element, eller så "
"spesifiserte det to elementer)"
#: ../src/ui/theme-parser.c:3312
#: ../src/ui/theme-parser.c:3331
msgid ""
"Can't have a two draw_ops for a <button> element (theme specified a draw_ops "
"attribute and also a <draw_ops> element, or specified two elements)"
@@ -1167,7 +1167,7 @@ msgstr ""
"draw_ops-attributt i tillegg til et <draw_ops>-element, eller det "
"spesifiserte to elementer)"
#: ../src/ui/theme-parser.c:3350
#: ../src/ui/theme-parser.c:3369
msgid ""
"Can't have a two draw_ops for a <menu_icon> element (theme specified a "
"draw_ops attribute and also a <draw_ops> element, or specified two elements)"
@@ -1176,12 +1176,12 @@ msgstr ""
"draw_ops-attributt i tillegg til et <draw_ops>-element, eller det "
"spesifiserte to elementer)"
#: ../src/ui/theme-parser.c:3414
#: ../src/ui/theme-parser.c:3433
#, c-format
msgid "Bad version specification '%s'"
msgstr "Ugyldig versjonspesifikasjon «%s»"
#: ../src/ui/theme-parser.c:3487
#: ../src/ui/theme-parser.c:3506
msgid ""
"\"version\" attribute cannot be used in metacity-theme-1.xml or metacity-"
"theme-2.xml"
@@ -1189,66 +1189,66 @@ msgstr ""
"«version»-attributt kan ikke brukes i metacity-theme-1.xml eller metacity-"
"theme-2.xml"
#: ../src/ui/theme-parser.c:3510
#: ../src/ui/theme-parser.c:3529
#, c-format
msgid "Theme requires version %s but latest supported theme version is %d.%d"
msgstr "Tema krever versjon %s men siste støttede temaversjon er %d.%d"
#: ../src/ui/theme-parser.c:3542
#: ../src/ui/theme-parser.c:3561
#, c-format
msgid "Outermost element in theme must be <metacity_theme> not <%s>"
msgstr "Ytterste element i temaet må være <metacity_theme> ikke <%s>"
#: ../src/ui/theme-parser.c:3562
#: ../src/ui/theme-parser.c:3581
#, c-format
msgid ""
"Element <%s> is not allowed inside a name/author/date/description element"
msgstr ""
"Element <%s> er ikke tillatt inne i et name/author/date/description element"
#: ../src/ui/theme-parser.c:3567
#: ../src/ui/theme-parser.c:3586
#, c-format
msgid "Element <%s> is not allowed inside a <constant> element"
msgstr "Element <%s> er ikke tillatt inne i et <constand> element"
#: ../src/ui/theme-parser.c:3579
#: ../src/ui/theme-parser.c:3598
#, c-format
msgid ""
"Element <%s> is not allowed inside a distance/border/aspect_ratio element"
msgstr "Element <%s> er ikke tillatt inne i et avstand/kant/aspektrate-element"
#: ../src/ui/theme-parser.c:3601
#: ../src/ui/theme-parser.c:3620
#, c-format
msgid "Element <%s> is not allowed inside a draw operation element"
msgstr "Element <%s> er ikke tillatt inne i et element for tegneoperasjon"
#: ../src/ui/theme-parser.c:3611 ../src/ui/theme-parser.c:3641
#: ../src/ui/theme-parser.c:3646 ../src/ui/theme-parser.c:3651
#: ../src/ui/theme-parser.c:3630 ../src/ui/theme-parser.c:3660
#: ../src/ui/theme-parser.c:3665 ../src/ui/theme-parser.c:3670
#, c-format
msgid "Element <%s> is not allowed inside a <%s> element"
msgstr "Element <%s> er ikke tillatt inne i et <%s>-element"
#: ../src/ui/theme-parser.c:3879
#: ../src/ui/theme-parser.c:3898
msgid "No draw_ops provided for frame piece"
msgstr "Ingen draw_ops tilbys for rammedelen"
#: ../src/ui/theme-parser.c:3894
#: ../src/ui/theme-parser.c:3913
msgid "No draw_ops provided for button"
msgstr "Ingen draw_ops tilbys for knappen"
#: ../src/ui/theme-parser.c:3948
#: ../src/ui/theme-parser.c:3967
#, c-format
msgid "No text is allowed inside element <%s>"
msgstr "Ingen tekst er tillatt inne i element <%s>"
#: ../src/ui/theme-parser.c:4006 ../src/ui/theme-parser.c:4018
#: ../src/ui/theme-parser.c:4030 ../src/ui/theme-parser.c:4042
#: ../src/ui/theme-parser.c:4054
#: ../src/ui/theme-parser.c:4025 ../src/ui/theme-parser.c:4037
#: ../src/ui/theme-parser.c:4049 ../src/ui/theme-parser.c:4061
#: ../src/ui/theme-parser.c:4073
#, c-format
msgid "<%s> specified twice for this theme"
msgstr "<%s> spesifisert to ganger for dette temaet"
#: ../src/ui/theme-parser.c:4316
#: ../src/ui/theme-parser.c:4335
#, c-format
msgid "Failed to find a valid file for theme %s\n"
msgstr "Fant ikke en gyldig fil for tema %s\n"
@@ -1261,7 +1261,10 @@ msgstr ""
"Disse vinduene støtter ikke &quot;lagre aktiv konfigurasjon&quot;og vil "
"måtte startes på nytt manuelt neste gang du logger inn."
#: ../src/x11/window-props.c:558
#: ../src/x11/window-props.c:515
#, c-format
msgid "%s (on %s)"
msgstr "%s (på %s)"
#~ msgid "background texture could not be created from file"
#~ msgstr "bakgrunnstekstur kunne ikke lages fra fil"

2041
po/tr.po

File diff suppressed because it is too large Load Diff

3857
po/vi.po

File diff suppressed because it is too large Load Diff

View File

@@ -49,6 +49,8 @@ mutter_built_sources += \
gtk-shell-server-protocol.h \
xdg-shell-protocol.c \
xdg-shell-server-protocol.h \
scaler-protocol.c \
scaler-server-protocol.h \
$(NULL)
endif

View File

@@ -55,8 +55,7 @@ meta_cursor_reference_ref (MetaCursorReference *self)
static void
meta_cursor_image_free (MetaCursorImage *image)
{
if (image->texture)
cogl_object_unref (image->texture);
cogl_object_unref (image->texture);
#ifdef HAVE_NATIVE_BACKEND
if (image->bo)
@@ -256,30 +255,22 @@ meta_cursor_image_load_from_xcursor_image (MetaCursorImage *image,
#endif
}
static void
load_cursor_image (MetaCursorReference *cursor)
{
XcursorImage *image;
/* Either cursors are loaded from X cursors or buffers. Since
* buffers are converted over immediately, we can make sure to
* load this directly. */
g_assert (cursor->cursor != META_CURSOR_NONE);
image = load_cursor_on_client (cursor->cursor);
if (!image)
return;
meta_cursor_image_load_from_xcursor_image (&cursor->image, image);
XcursorImageDestroy (image);
}
MetaCursorReference *
meta_cursor_reference_from_theme (MetaCursor cursor)
{
MetaCursorReference *self = g_slice_new0 (MetaCursorReference);
MetaCursorReference *self;
XcursorImage *image;
image = load_cursor_on_client (cursor);
if (!image)
return NULL;
self = g_slice_new0 (MetaCursorReference);
self->ref_count = 1;
self->cursor = cursor;
meta_cursor_image_load_from_xcursor_image (&self->image, image);
XcursorImageDestroy (image);
return self;
}
@@ -389,14 +380,10 @@ meta_cursor_reference_get_cogl_texture (MetaCursorReference *cursor,
int *hot_x,
int *hot_y)
{
if (!cursor->image.texture)
load_cursor_image (cursor);
if (hot_x)
*hot_x = cursor->image.hot_x;
if (hot_y)
*hot_y = cursor->image.hot_y;
return COGL_TEXTURE (cursor->image.texture);
}
@@ -406,9 +393,6 @@ meta_cursor_reference_get_gbm_bo (MetaCursorReference *cursor,
int *hot_x,
int *hot_y)
{
if (!cursor->image.bo)
load_cursor_image (cursor);
if (hot_x)
*hot_x = cursor->image.hot_x;
if (hot_y)

View File

@@ -34,7 +34,6 @@
#include "config.h"
#include "boxes-private.h"
#include "meta-monitor-config.h"
#include <string.h>
@@ -1097,108 +1096,40 @@ init_config_from_preferred_mode (MetaOutputConfig *config,
config->is_presentation = FALSE;
}
/* This function handles configuring the outputs when the driver provides a
* suggested layout position for each output. This is done in recent versions
* of qxl and allows displays to be aligned on the guest in the same order as
* they are aligned on the client.
*/
static gboolean
make_suggested_config (MetaMonitorConfig *self,
MetaOutput *outputs,
unsigned n_outputs,
int max_width,
int max_height,
MetaConfiguration *config)
static MetaConfiguration *
make_default_config (MetaMonitorConfig *self,
MetaOutput *outputs,
unsigned n_outputs,
int max_width,
int max_height)
{
unsigned int i;
MetaOutput *primary;
GList *region = NULL;
g_return_val_if_fail (config != NULL, FALSE);
primary = find_primary_output (outputs, n_outputs);
for (i = 0; i < n_outputs; i++)
{
gboolean is_primary = (&outputs[i] == primary);
if (outputs[i].suggested_x < 0 || outputs[i].suggested_y < 0)
return FALSE;
init_config_from_preferred_mode (&config->outputs[i], &outputs[i]);
config->outputs[i].is_primary = is_primary;
config->outputs[i].rect.x = outputs[i].suggested_x;
config->outputs[i].rect.y = outputs[i].suggested_y;
/* Reject the configuration if the suggested positions result in
* overlapping displays */
if (meta_rectangle_overlaps_with_region (region, &config->outputs[i].rect))
{
g_warning ("Overlapping outputs, rejecting suggested configuration");
g_list_free (region);
return FALSE;
}
region = g_list_prepend (region, &config->outputs[i].rect);
}
g_list_free (region);
return TRUE;
}
static void
make_linear_config (MetaMonitorConfig *self,
MetaOutput *outputs,
unsigned n_outputs,
int max_width,
int max_height,
MetaConfiguration *config)
{
MetaOutput *primary;
unsigned i;
int x;
g_return_if_fail (config != NULL);
primary = find_primary_output (outputs, n_outputs);
x = primary->preferred_mode->width;
for (i = 0; i < n_outputs; i++)
{
gboolean is_primary = (&outputs[i] == primary);
init_config_from_preferred_mode (&config->outputs[i], &outputs[i]);
config->outputs[i].is_primary = is_primary;
if (is_primary)
{
config->outputs[i].rect.x = 0;
}
else
{
config->outputs[i].rect.x = x;
x += config->outputs[i].rect.width;
}
}
}
/* Search for a configuration that includes one less screen, then add the new
* one as a presentation screen in preferred mode.
*
* XXX: but presentation mode is not implemented in the control-center or in
* mutter core, so let's do extended for now.
*/
static gboolean
extend_stored_config (MetaMonitorConfig *self,
MetaOutput *outputs,
unsigned n_outputs,
int max_width,
int max_height,
MetaConfiguration *config)
{
int x, y;
unsigned i, j;
int x, y;
MetaConfiguration *ret;
MetaOutput *primary;
ret = config_new ();
make_config_key (ret, outputs, n_outputs, -1);
ret->outputs = g_new0 (MetaOutputConfig, n_outputs);
/* Special case the simple case: one output, primary at preferred mode,
nothing else to do */
if (n_outputs == 1)
{
init_config_from_preferred_mode (&ret->outputs[0], &outputs[0]);
ret->outputs[0].is_primary = TRUE;
return ret;
}
/* If we reach this point, this is either the first time mutter runs
on this system ever, or we just hotplugged a new screen.
In the latter case, search for a configuration that includes one
less screen, then add the new one as a presentation screen
in preferred mode.
XXX: but presentation mode is not implemented in the control-center
or in mutter core, so let's do extended for now.
*/
x = 0;
y = 0;
for (i = 0; i < n_outputs; i++)
@@ -1216,80 +1147,63 @@ extend_stored_config (MetaMonitorConfig *self,
{
if (j < i)
{
g_assert (output_key_equal (&config->keys[j], &ref->keys[j]));
config->outputs[j] = ref->outputs[j];
g_assert (output_key_equal (&ret->keys[j], &ref->keys[j]));
ret->outputs[j] = ref->outputs[j];
x = MAX (x, ref->outputs[j].rect.x + ref->outputs[j].rect.width);
y = MAX (y, ref->outputs[j].rect.y + ref->outputs[j].rect.height);
}
else if (j > i)
{
g_assert (output_key_equal (&config->keys[j], &ref->keys[j - 1]));
config->outputs[j] = ref->outputs[j - 1];
g_assert (output_key_equal (&ret->keys[j], &ref->keys[j - 1]));
ret->outputs[j] = ref->outputs[j - 1];
x = MAX (x, ref->outputs[j - 1].rect.x + ref->outputs[j - 1].rect.width);
y = MAX (y, ref->outputs[j - 1].rect.y + ref->outputs[j - 1].rect.height);
}
else
{
init_config_from_preferred_mode (&config->outputs[j], &outputs[0]);
init_config_from_preferred_mode (&ret->outputs[j], &outputs[0]);
}
}
/* Place the new output at the right end of the screen, if it fits,
otherwise below it, otherwise disable it (or apply_configuration will fail) */
if (x + config->outputs[i].rect.width <= max_width)
config->outputs[i].rect.x = x;
else if (y + config->outputs[i].rect.height <= max_height)
config->outputs[i].rect.y = y;
if (x + ret->outputs[i].rect.width <= max_width)
ret->outputs[i].rect.x = x;
else if (y + ret->outputs[i].rect.height <= max_height)
ret->outputs[i].rect.y = y;
else
config->outputs[i].enabled = FALSE;
ret->outputs[i].enabled = FALSE;
return TRUE;
return ret;
}
}
return FALSE;
}
/* No previous configuration found, try with a really default one, which
is one primary that goes first and the rest to the right of it, extended.
*/
primary = find_primary_output (outputs, n_outputs);
static MetaConfiguration *
make_default_config (MetaMonitorConfig *self,
MetaOutput *outputs,
unsigned n_outputs,
int max_width,
int max_height,
gboolean use_stored_config)
{
MetaConfiguration *ret = NULL;
unsigned i;
ret = config_new ();
make_config_key (ret, outputs, n_outputs, -1);
ret->outputs = g_new0 (MetaOutputConfig, n_outputs);
/* Special case the simple case: one output, primary at preferred mode,
nothing else to do */
if (n_outputs == 1)
{
init_config_from_preferred_mode (&ret->outputs[0], &outputs[0]);
ret->outputs[0].is_primary = TRUE;
goto check_limits;
}
if (make_suggested_config (self, outputs, n_outputs, max_width, max_height, ret))
goto check_limits;
if (use_stored_config &&
extend_stored_config (self, outputs, n_outputs, max_width, max_height, ret))
goto check_limits;
make_linear_config (self, outputs, n_outputs, max_width, max_height, ret);
check_limits:
/* Disable outputs that would go beyond framebuffer limits */
x = primary->preferred_mode->width;
for (i = 0; i < n_outputs; i++)
{
if ((ret->outputs[i].rect.x + ret->outputs[i].rect.width > max_width)
|| (ret->outputs[i].rect.y + ret->outputs[i].rect.height > max_height))
ret->outputs[i].enabled = FALSE;
gboolean is_primary = (&outputs[i] == primary);
init_config_from_preferred_mode (&ret->outputs[i], &outputs[i]);
ret->outputs[i].is_primary = is_primary;
if (is_primary)
{
ret->outputs[i].rect.x = 0;
}
else
{
ret->outputs[i].rect.x = x;
x += ret->outputs[i].rect.width;
}
/* Disable outputs that would go beyond framebuffer limits */
if (ret->outputs[i].rect.x + ret->outputs[i].rect.width > max_width)
ret->outputs[i].enabled = FALSE;
}
return ret;
@@ -1347,7 +1261,6 @@ meta_monitor_config_make_default (MetaMonitorConfig *self,
unsigned n_outputs;
gboolean ok = FALSE;
int max_width, max_height;
gboolean use_stored_config;
outputs = meta_monitor_manager_get_outputs (manager, &n_outputs);
meta_monitor_manager_get_screen_limits (manager, &max_width, &max_height);
@@ -1358,16 +1271,7 @@ meta_monitor_config_make_default (MetaMonitorConfig *self,
return;
}
/* if the device has hotplug_mode_update, it's possible that the
* current display configuration does not match a stored configuration.
* Since extend_existing_config() tries to build a configuration that is
* based on a previously-stored configuration, it's quite likely that the
* resulting config will fail. Even if it doesn't fail, it may result in
* an unexpected configuration, so don't attempt to use a stored config
* in this situation. */
use_stored_config = !meta_monitor_manager_has_hotplug_mode_update (manager);
default_config = make_default_config (self, outputs, n_outputs, max_width, max_height, use_stored_config);
default_config = make_default_config (self, outputs, n_outputs, max_width, max_height);
if (default_config != NULL)
{
ok = apply_configuration_with_lid (self, default_config, manager);

View File

@@ -116,8 +116,6 @@ struct _MetaOutput
/* get a new preferred mode on hotplug events, to handle dynamic guest resizing */
gboolean hotplug_mode_update;
gint suggested_x;
gint suggested_y;
};
struct _MetaCRTC

View File

@@ -130,8 +130,8 @@ take_device (Login1Session *session_proxy,
{
gboolean ret = FALSE;
GVariant *fd_variant = NULL;
GUnixFDList *fd_list = NULL;
int fd = -1;
GUnixFDList *fd_list;
if (!login1_session_call_take_device_sync (session_proxy,
dev_major,

View File

@@ -207,7 +207,7 @@ find_properties (MetaMonitorManagerKms *manager_kms,
strcmp (prop->name, "EDID") == 0)
output_kms->edid_blob_id = output_kms->connector->prop_values[i];
drmModeFreeProperty (prop);
drmModeFreeProperty(prop);
}
}
@@ -229,10 +229,8 @@ read_output_edid (MetaMonitorManagerKms *manager_kms,
}
if (edid_blob->length > 0)
{
return g_bytes_new_with_free_func (edid_blob->data, edid_blob->length,
(GDestroyNotify)drmModeFreePropertyBlob, edid_blob);
}
return g_bytes_new_with_free_func (edid_blob->data, edid_blob->length,
(GDestroyNotify)drmModeFreePropertyBlob, edid_blob);
else
{
drmModeFreePropertyBlob (edid_blob);
@@ -417,8 +415,6 @@ meta_monitor_manager_kms_read_current (MetaMonitorManager *manager)
meta_output->name = make_output_name (connector);
meta_output->width_mm = connector->mmWidth;
meta_output->height_mm = connector->mmHeight;
meta_output->suggested_x = -1;
meta_output->suggested_y = -1;
switch (connector->subpixel)
{

View File

@@ -139,34 +139,6 @@ meta_monitor_transform_from_xrandr_all (Rotation rotation)
return ret;
}
static gboolean
output_get_integer_property (MetaMonitorManagerXrandr *manager_xrandr,
MetaOutput *output, const char *propname,
gint *value)
{
gboolean exists = FALSE;
Atom atom, actual_type;
int actual_format;
unsigned long nitems, bytes_after;
unsigned char *buffer;
atom = XInternAtom (manager_xrandr->xdisplay, propname, False);
XRRGetOutputProperty (manager_xrandr->xdisplay,
(XID)output->winsys_id,
atom,
0, G_MAXLONG, False, False, XA_INTEGER,
&actual_type, &actual_format,
&nitems, &bytes_after, &buffer);
exists = (actual_type == XA_INTEGER && actual_format == 32 && nitems == 1);
if (exists && value != NULL)
*value = ((int*)buffer)[0];
XFree (buffer);
return exists;
}
static gboolean
output_get_property_exists (MetaMonitorManagerXrandr *manager_xrandr,
MetaOutput *output, const char *propname)
@@ -384,28 +356,6 @@ output_get_hotplug_mode_update (MetaMonitorManagerXrandr *manager_xrandr,
return output_get_property_exists (manager_xrandr, output, "hotplug_mode_update");
}
static gint
output_get_suggested_x (MetaMonitorManagerXrandr *manager_xrandr,
MetaOutput *output)
{
gint val;
if (output_get_integer_property (manager_xrandr, output, "suggested X", &val))
return val;
return -1;
}
static gint
output_get_suggested_y (MetaMonitorManagerXrandr *manager_xrandr,
MetaOutput *output)
{
gint val;
if (output_get_integer_property (manager_xrandr, output, "suggested Y", &val))
return val;
return -1;
}
static char *
get_xmode_name (XRRModeInfo *xmode)
{
@@ -593,8 +543,6 @@ meta_monitor_manager_xrandr_read_current (MetaMonitorManager *manager)
meta_output->height_mm = output->mm_height;
meta_output->subpixel_order = COGL_SUBPIXEL_ORDER_UNKNOWN;
meta_output->hotplug_mode_update = output_get_hotplug_mode_update (manager_xrandr, meta_output);
meta_output->suggested_x = output_get_suggested_x (manager_xrandr, meta_output);
meta_output->suggested_y = output_get_suggested_y (manager_xrandr, meta_output);
meta_output->n_modes = output->nmode;
meta_output->modes = g_new0 (MetaMonitorMode *, meta_output->n_modes);
@@ -888,12 +836,26 @@ meta_monitor_manager_xrandr_apply_configuration (MetaMonitorManager *manager,
unsigned int j, n_outputs;
int width, height;
Status ok;
unsigned long old_controlled_mask;
unsigned long new_controlled_mask;
mode = crtc_info->mode;
n_outputs = crtc_info->outputs->len;
outputs = g_new (XID, n_outputs);
old_controlled_mask = 0;
for (j = 0; j < manager->n_outputs; j++)
{
MetaOutput *output;
output = &manager->outputs[j];
if (output->crtc == crtc)
old_controlled_mask |= 1UL << j;
}
new_controlled_mask = 0;
for (j = 0; j < n_outputs; j++)
{
MetaOutput *output;
@@ -902,10 +864,21 @@ meta_monitor_manager_xrandr_apply_configuration (MetaMonitorManager *manager,
output->is_dirty = TRUE;
output->crtc = crtc;
new_controlled_mask |= 1UL << j;
outputs[j] = output->winsys_id;
}
if (crtc->current_mode == mode &&
crtc->rect.x == crtc_info->x &&
crtc->rect.y == crtc_info->y &&
crtc->transform == crtc_info->transform &&
old_controlled_mask == new_controlled_mask)
{
/* No change */
goto next;
}
ok = XRRSetCrtcConfig (manager_xrandr->xdisplay,
manager_xrandr->resources,
(XID)crtc->crtc_id,

View File

@@ -34,4 +34,9 @@ void meta_shaped_texture_set_texture (MetaShapedTexture *stex,
CoglTexture *texture);
gboolean meta_shaped_texture_is_obscured (MetaShapedTexture *self);
void meta_shaped_texture_set_viewport (MetaShapedTexture *stex,
cairo_rectangle_int_t *src_rect,
int dest_width,
int dest_height);
#endif

View File

@@ -85,7 +85,12 @@ struct _MetaShapedTexturePrivate
cairo_region_t *clip_region;
cairo_region_t *unobscured_region;
/* Viewport stuff */
cairo_rectangle_int_t viewport_src_rect;
guint viewport_dest_width, viewport_dest_height;
guint tex_width, tex_height;
guint dest_width, dest_height;
guint create_mipmaps : 1;
};
@@ -136,7 +141,7 @@ set_unobscured_region (MetaShapedTexture *self,
g_clear_pointer (&priv->unobscured_region, (GDestroyNotify) cairo_region_destroy);
if (unobscured_region)
{
cairo_rectangle_int_t bounds = { 0, 0, priv->tex_width, priv->tex_height };
cairo_rectangle_int_t bounds = { 0, 0, priv->dest_width, priv->dest_height };
priv->unobscured_region = cairo_region_copy (unobscured_region);
cairo_region_intersect_rectangle (priv->unobscured_region, &bounds);
}
@@ -212,24 +217,45 @@ get_unblended_pipeline (CoglContext *ctx)
return cogl_pipeline_copy (template);
}
static void
scale_coords_by_src (cairo_rectangle_int_t *coords,
int dest_width, int dest_height,
cairo_rectangle_int_t *src_rect)
{
if (src_rect->width == 0 && src_rect->height == 0)
return;
coords->x = ((coords->x / dest_width) * src_rect->width) + src_rect->x;
coords->y = ((coords->y / dest_height) * src_rect->height) + src_rect->y;
coords->width = ((coords->width / dest_width) * src_rect->width);
coords->height = ((coords->height / dest_height) * src_rect->height);
}
static void
paint_clipped_rectangle (CoglFramebuffer *fb,
CoglPipeline *pipeline,
cairo_rectangle_int_t *rect,
ClutterActorBox *alloc)
ClutterActorBox *alloc,
cairo_rectangle_int_t *src_rect)
{
cairo_rectangle_int_t pixel_coords;
float coords[8];
float x1, y1, x2, y2;
float dest_width = alloc->x2 - alloc->x1;
float dest_height = alloc->y2 - alloc->y1;
x1 = rect->x;
y1 = rect->y;
x2 = rect->x + rect->width;
y2 = rect->y + rect->height;
coords[0] = rect->x / (alloc->x2 - alloc->x1);
coords[1] = rect->y / (alloc->y2 - alloc->y1);
coords[2] = (rect->x + rect->width) / (alloc->x2 - alloc->x1);
coords[3] = (rect->y + rect->height) / (alloc->y2 - alloc->y1);
pixel_coords = *rect;
scale_coords_by_src (&pixel_coords, dest_width, dest_height, src_rect);
coords[0] = pixel_coords.x / dest_width;
coords[1] = pixel_coords.y / dest_height;
coords[2] = (pixel_coords.x + pixel_coords.width) / dest_width;
coords[3] = (pixel_coords.y + pixel_coords.height) / dest_height;
coords[4] = coords[0];
coords[5] = coords[1];
@@ -241,6 +267,32 @@ paint_clipped_rectangle (CoglFramebuffer *fb,
&coords[0], 8);
}
static void
update_size (MetaShapedTexture *stex)
{
MetaShapedTexturePrivate *priv = stex->priv;
guint dest_width, dest_height;
if (priv->viewport_dest_width > 0)
dest_width = priv->viewport_dest_width;
else
dest_width = priv->tex_width;
if (priv->viewport_dest_height > 0)
dest_height = priv->viewport_dest_height;
else
dest_height = priv->tex_height;
if (priv->dest_width != dest_width ||
priv->dest_height != dest_height)
{
priv->dest_width = dest_width;
priv->dest_height = dest_height;
clutter_actor_queue_relayout (CLUTTER_ACTOR (stex));
g_signal_emit (stex, signals[SIZE_CHANGED], 0);
}
}
static void
set_cogl_texture (MetaShapedTexture *stex,
CoglTexture *cogl_tex)
@@ -274,8 +326,7 @@ set_cogl_texture (MetaShapedTexture *stex,
{
priv->tex_width = width;
priv->tex_height = height;
clutter_actor_queue_relayout (CLUTTER_ACTOR (stex));
g_signal_emit (stex, signals[SIZE_CHANGED], 0);
update_size (stex);
}
/* NB: We don't queue a redraw of the actor here because we don't
@@ -292,7 +343,7 @@ meta_shaped_texture_paint (ClutterActor *actor)
{
MetaShapedTexture *stex = (MetaShapedTexture *) actor;
MetaShapedTexturePrivate *priv = stex->priv;
guint tex_width, tex_height;
guint dest_width, dest_height;
guchar opacity;
CoglContext *ctx;
CoglFramebuffer *fb;
@@ -329,13 +380,13 @@ meta_shaped_texture_paint (ClutterActor *actor)
if (paint_tex == NULL)
return;
tex_width = priv->tex_width;
tex_height = priv->tex_height;
dest_width = priv->dest_width;
dest_height = priv->dest_height;
if (tex_width == 0 || tex_height == 0) /* no contents yet */
if (dest_width == 0 || dest_height == 0) /* no contents yet */
return;
cairo_rectangle_int_t tex_rect = { 0, 0, tex_width, tex_height };
cairo_rectangle_int_t tex_rect = { 0, 0, dest_width, dest_height };
/* Use nearest-pixel interpolation if the texture is unscaled. This
* improves performance, especially with software rendering.
@@ -418,7 +469,7 @@ meta_shaped_texture_paint (ClutterActor *actor)
{
cairo_rectangle_int_t rect;
cairo_region_get_rectangle (region, i, &rect);
paint_clipped_rectangle (fb, opaque_pipeline, &rect, &alloc);
paint_clipped_rectangle (fb, opaque_pipeline, &rect, &alloc, &priv->viewport_src_rect);
}
cogl_object_unref (opaque_pipeline);
@@ -473,16 +524,13 @@ meta_shaped_texture_paint (ClutterActor *actor)
if (!gdk_rectangle_intersect (&tex_rect, &rect, &rect))
continue;
paint_clipped_rectangle (fb, blended_pipeline, &rect, &alloc);
paint_clipped_rectangle (fb, blended_pipeline, &rect, &alloc, &priv->viewport_src_rect);
}
}
else
{
/* 3) blended_region is NULL. Do a full paint. */
cogl_framebuffer_draw_rectangle (fb, blended_pipeline,
0, 0,
alloc.x2 - alloc.x1,
alloc.y2 - alloc.y1);
paint_clipped_rectangle (fb, blended_pipeline, &tex_rect, &alloc, &priv->viewport_src_rect);
}
cogl_object_unref (blended_pipeline);
@@ -505,10 +553,10 @@ meta_shaped_texture_get_preferred_width (ClutterActor *self,
priv = META_SHAPED_TEXTURE (self)->priv;
if (min_width_p)
*min_width_p = priv->tex_width;
*min_width_p = priv->dest_width;
if (natural_width_p)
*natural_width_p = priv->tex_width;
*natural_width_p = priv->dest_width;
}
static void
@@ -524,10 +572,10 @@ meta_shaped_texture_get_preferred_height (ClutterActor *self,
priv = META_SHAPED_TEXTURE (self)->priv;
if (min_height_p)
*min_height_p = priv->tex_height;
*min_height_p = priv->dest_height;
if (natural_height_p)
*natural_height_p = priv->tex_height;
*natural_height_p = priv->dest_height;
}
static cairo_region_t *
@@ -762,6 +810,22 @@ meta_shaped_texture_set_opaque_region (MetaShapedTexture *stex,
priv->opaque_region = NULL;
}
void
meta_shaped_texture_set_viewport (MetaShapedTexture *stex,
cairo_rectangle_int_t *src_rect,
int dest_width,
int dest_height)
{
MetaShapedTexturePrivate *priv = stex->priv;
priv->viewport_src_rect = *src_rect;
priv->viewport_dest_width = dest_width;
priv->viewport_dest_height = dest_height;
update_size (stex);
clutter_actor_queue_redraw (CLUTTER_ACTOR (stex));
}
/**
* meta_shaped_texture_get_image:
* @stex: A #MetaShapedTexture

View File

@@ -49,8 +49,6 @@ meta_surface_actor_pick (ClutterActor *actor,
{
MetaSurfaceActor *self = META_SURFACE_ACTOR (actor);
MetaSurfaceActorPrivate *priv = self->priv;
ClutterActorIter iter;
ClutterActor *child;
if (!clutter_actor_should_pick_paint (actor))
return;
@@ -67,6 +65,8 @@ meta_surface_actor_pick (ClutterActor *actor,
CoglContext *ctx;
CoglFramebuffer *fb;
CoglColor cogl_color;
ClutterActorIter iter;
ClutterActor *child;
n_rects = cairo_region_num_rectangles (priv->input_region);
rectangles = g_alloca (sizeof (float) * 4 * n_rects);
@@ -93,12 +93,12 @@ meta_surface_actor_pick (ClutterActor *actor,
cogl_pipeline_set_color (pipeline, &cogl_color);
cogl_framebuffer_draw_rectangles (fb, pipeline, rectangles, n_rects);
cogl_object_unref (pipeline);
clutter_actor_iter_init (&iter, actor);
while (clutter_actor_iter_next (&iter, &child))
clutter_actor_paint (child);
}
clutter_actor_iter_init (&iter, actor);
while (clutter_actor_iter_next (&iter, &child))
clutter_actor_paint (child);
}
static void
@@ -235,6 +235,16 @@ meta_surface_actor_set_opaque_region (MetaSurfaceActor *self,
meta_shaped_texture_set_opaque_region (priv->texture, region);
}
void
meta_surface_actor_set_viewport (MetaSurfaceActor *self,
cairo_rectangle_int_t *src_rect,
int dest_width,
int dest_height)
{
MetaSurfaceActorPrivate *priv = self->priv;
meta_shaped_texture_set_viewport (priv->texture, src_rect, dest_width, dest_height);
}
static gboolean
is_frozen (MetaSurfaceActor *self)
{

View File

@@ -61,6 +61,11 @@ void meta_surface_actor_set_input_region (MetaSurfaceActor *self,
void meta_surface_actor_set_opaque_region (MetaSurfaceActor *self,
cairo_region_t *region);
void meta_surface_actor_set_viewport (MetaSurfaceActor *self,
cairo_rectangle_int_t *src_rect,
int dest_width,
int dest_height);
void meta_surface_actor_process_damage (MetaSurfaceActor *actor,
int x, int y, int width, int height);
void meta_surface_actor_pre_paint (MetaSurfaceActor *actor);

View File

@@ -100,7 +100,7 @@ struct _MetaWindowActorPrivate
guint disposed : 1;
/* If set, the client needs to be sent a _NET_WM_FRAME_DRAWN
* client message for one or more messages in ->frames */
* client message using the most recent frame in ->frames */
guint needs_frame_drawn : 1;
guint repaint_scheduled : 1;
@@ -118,21 +118,10 @@ struct _MetaWindowActorPrivate
typedef struct _FrameData FrameData;
/* Each time the application updates the sync request counter to a new even value
* value, we queue a frame into the windows list of frames. Once we're painting
* an update "in response" to the window, we fill in frame_counter with the
* Cogl counter for that frame, and send _NET_WM_FRAME_DRAWN at the end of the
* frame. _NET_WM_FRAME_TIMINGS is sent when we get a frame_complete callback.
*
* As an exception, if a window is completely obscured, we try to throttle drawning
* to a slower frame rate. In this case, frame_counter stays -1 until
* send_frame_message_timeout() runs, at which point we send both the
* _NET_WM_FRAME_DRAWN and _NET_WM_FRAME_TIMINGS messages.
*/
struct _FrameData
{
guint64 sync_request_serial;
int64_t frame_counter;
guint64 sync_request_serial;
gint64 frame_drawn_time;
};
@@ -666,30 +655,6 @@ clip_shadow_under_window (MetaWindowActor *self)
return is_non_opaque (self) && priv->window->frame;
}
static void
assign_frame_counter_to_frames (MetaWindowActor *self)
{
MetaWindowActorPrivate *priv = self->priv;
GList *l;
/* If the window is obscured, then we're expecting to deal with sending
* frame messages in a timeout, rather than in this paint cycle.
*/
if (priv->send_frame_messages_timer != 0)
return;
for (l = priv->frames; l; l = l->next)
{
FrameData *frame = l->data;
if (frame->frame_counter == -1)
{
CoglOnscreen *onscreen = COGL_ONSCREEN (cogl_get_draw_framebuffer());
frame->frame_counter = cogl_onscreen_get_frame_counter (onscreen);
}
}
}
static void
meta_window_actor_paint (ClutterActor *actor)
{
@@ -706,8 +671,6 @@ meta_window_actor_paint (ClutterActor *actor)
{
g_source_remove (priv->send_frame_messages_timer);
priv->send_frame_messages_timer = 0;
assign_frame_counter_to_frames (self);
}
if (shadow != NULL)
@@ -910,27 +873,16 @@ send_frame_messages_timeout (gpointer data)
{
MetaWindowActor *self = (MetaWindowActor *) data;
MetaWindowActorPrivate *priv = self->priv;
GList *l;
FrameData *frame = g_slice_new0 (FrameData);
for (l = priv->frames; l;)
{
GList *l_next = l->next;
FrameData *frame = l->data;
frame->sync_request_serial = priv->window->sync_request_serial;
if (frame->frame_counter == -1)
{
do_send_frame_drawn (self, frame);
do_send_frame_timings (self, frame, 0, 0);
priv->frames = g_list_delete_link (priv->frames, l);
frame_data_free (frame);
}
l = l_next;
}
do_send_frame_drawn (self, frame);
do_send_frame_timings (self, frame, 0, 0);
priv->needs_frame_drawn = FALSE;
priv->send_frame_messages_timer = 0;
frame_data_free (frame);
return FALSE;
}
@@ -939,10 +891,6 @@ static void
queue_send_frame_messages_timeout (MetaWindowActor *self)
{
MetaWindowActorPrivate *priv = self->priv;
if (priv->send_frame_messages_timer != 0)
return;
MetaDisplay *display = meta_window_get_display (priv->window);
gint64 current_time = meta_compositor_monotonic_time_to_server_time (display, g_get_monotonic_time ());
MetaMonitorManager *monitor_manager = meta_monitor_manager_get ();
@@ -985,7 +933,6 @@ meta_window_actor_queue_frame_drawn (MetaWindowActor *self,
return;
frame = g_slice_new0 (FrameData);
frame->frame_counter = -1;
priv->needs_frame_drawn = TRUE;
@@ -1208,7 +1155,7 @@ gboolean
meta_window_actor_should_unredirect (MetaWindowActor *self)
{
MetaWindowActorPrivate *priv = self->priv;
if (!meta_window_actor_is_destroyed (self) && priv->surface)
if (priv->surface)
return meta_surface_actor_should_unredirect (priv->surface);
else
return FALSE;
@@ -1958,12 +1905,24 @@ meta_window_actor_handle_updates (MetaWindowActor *self)
void
meta_window_actor_pre_paint (MetaWindowActor *self)
{
MetaWindowActorPrivate *priv = self->priv;
GList *l;
if (meta_window_actor_is_destroyed (self))
return;
meta_window_actor_handle_updates (self);
assign_frame_counter_to_frames (self);
for (l = priv->frames; l != NULL; l = l->next)
{
FrameData *frame = l->data;
if (frame->frame_counter == 0)
{
CoglOnscreen *onscreen = COGL_ONSCREEN (cogl_get_draw_framebuffer());
frame->frame_counter = cogl_onscreen_get_frame_counter (onscreen);
}
}
}
static void
@@ -2004,23 +1963,16 @@ meta_window_actor_post_paint (MetaWindowActor *self)
if (meta_window_actor_is_destroyed (self))
return;
/* If the window had damage, but wasn't actually redrawn because
* it is obscured, we should wait until timer expiration before
* sending _NET_WM_FRAME_* messages.
*/
if (priv->send_frame_messages_timer == 0 &&
priv->needs_frame_drawn)
/* This window had damage, but wasn't actually redrawn because
* it is obscured. So we should wait until timer expiration
* before sending _NET_WM_FRAME_* messages.
*/
if (priv->send_frame_messages_timer != 0)
return;
if (priv->needs_frame_drawn)
{
GList *l;
for (l = priv->frames; l; l = l->next)
{
FrameData *frame = l->data;
if (frame->frame_drawn_time == 0)
do_send_frame_drawn (self, frame);
}
do_send_frame_drawn (self, priv->frames->data);
priv->needs_frame_drawn = FALSE;
}
@@ -2105,20 +2057,15 @@ meta_window_actor_frame_complete (MetaWindowActor *self,
{
GList *l_next = l->next;
FrameData *frame = l->data;
gint64 frame_counter = cogl_frame_info_get_frame_counter (frame_info);
if (frame->frame_counter != -1 && frame->frame_counter <= frame_counter)
if (frame->frame_counter == cogl_frame_info_get_frame_counter (frame_info))
{
if (G_UNLIKELY (frame->frame_drawn_time == 0))
g_warning ("%s: Frame has assigned frame counter but no frame drawn time",
priv->window->desc);
if (G_UNLIKELY (frame->frame_counter < frame_counter))
g_warning ("%s: frame_complete callback never occurred for frame %" G_GINT64_FORMAT,
priv->window->desc, frame->frame_counter);
priv->frames = g_list_delete_link (priv->frames, l);
send_frame_timings (self, frame, frame_info, presentation_time);
frame_data_free (frame);
if (frame->frame_drawn_time != 0)
{
priv->frames = g_list_delete_link (priv->frames, l);
send_frame_timings (self, frame, frame_info, presentation_time);
frame_data_free (frame);
}
}
l = l_next;

View File

@@ -328,17 +328,17 @@ setup_constraint_info (ConstraintInfo *info,
info->orig = *orig;
info->current = *new;
if (flags & META_MOVE_RESIZE_MOVE_ACTION && flags & META_MOVE_RESIZE_RESIZE_ACTION)
if (flags & META_IS_MOVE_ACTION && flags & META_IS_RESIZE_ACTION)
info->action_type = ACTION_MOVE_AND_RESIZE;
else if (flags & META_MOVE_RESIZE_RESIZE_ACTION)
else if (flags & META_IS_RESIZE_ACTION)
info->action_type = ACTION_RESIZE;
else if (flags & META_MOVE_RESIZE_MOVE_ACTION)
else if (flags & META_IS_MOVE_ACTION)
info->action_type = ACTION_MOVE;
else
g_error ("BAD, BAD developer! No treat for you! (Fix your calls to "
"meta_window_move_resize_internal()).\n");
info->is_user_action = (flags & META_MOVE_RESIZE_USER_ACTION);
info->is_user_action = (flags & META_IS_USER_ACTION);
info->resize_gravity = resize_gravity;
@@ -1017,7 +1017,6 @@ constrain_aspect_ratio (MetaWindow *window,
double best_width, best_height;
double alt_width, alt_height;
MetaRectangle *start_rect;
MetaRectangle client_rect;
if (priority > PRIORITY_ASPECT_RATIO)
return TRUE;
@@ -1069,18 +1068,15 @@ constrain_aspect_ratio (MetaWindow *window,
fudge = 1;
break;
}
meta_window_frame_rect_to_client_rect (window, &info->current, &client_rect);
constraint_already_satisfied =
client_rect.width - (client_rect.height * minr ) > -minr*fudge &&
client_rect.width - (client_rect.height * maxr ) < maxr*fudge;
info->current.width - (info->current.height * minr ) > -minr*fudge &&
info->current.width - (info->current.height * maxr ) < maxr*fudge;
if (check_only || constraint_already_satisfied)
return constraint_already_satisfied;
/*** Enforce constraint ***/
new_width = client_rect.width;
new_height = client_rect.height;
new_width = info->current.width;
new_height = info->current.height;
switch (info->resize_gravity)
{
@@ -1127,14 +1123,6 @@ constrain_aspect_ratio (MetaWindow *window,
break;
}
{
client_rect.width = new_width;
client_rect.height = new_height;
meta_window_client_rect_to_frame_rect (window, &client_rect, &client_rect);
new_width = client_rect.width;
new_height = client_rect.height;
}
/* Figure out what original rect to pass to meta_rectangle_resize_with_gravity
* See bug 448183
*/

View File

@@ -1205,7 +1205,7 @@ meta_grab_op_is_resizing (MetaGrabOp op)
if (!grab_op_is_window (op))
return FALSE;
return (op & META_GRAB_OP_WINDOW_DIR_MASK) != 0 || op == META_GRAB_OP_KEYBOARD_RESIZING_UNKNOWN;
return (op & META_GRAB_OP_WINDOW_DIR_MASK) != 0;
}
gboolean
@@ -1953,11 +1953,6 @@ meta_display_end_grab_op (MetaDisplay *display,
g_signal_emit (display, display_signals[GRAB_OP_END], 0,
display->screen, grab_window, grab_op);
/* We need to reset this early, since the
* meta_window_grab_op_ended callback relies on this being
* up to date. */
display->grab_op = META_GRAB_OP_NONE;
if (display->event_route == META_EVENT_ROUTE_WINDOW_OP)
{
/* Clear out the edge cache */
@@ -1990,6 +1985,7 @@ meta_display_end_grab_op (MetaDisplay *display,
}
display->event_route = META_EVENT_ROUTE_NORMAL;
display->grab_op = META_GRAB_OP_NONE;
display->grab_window = NULL;
display->grab_tile_mode = META_TILE_NONE;
display->grab_tile_monitor_number = -1;

View File

@@ -496,6 +496,15 @@ create_guard_window (Display *xdisplay, MetaScreen *screen)
return guard_window;
}
/* Set a black background on the root window so that we don't
* see confusing old copies of old windows when debugging
* and testing. */
static void
meta_screen_set_background (MetaScreen *screen)
{
XSetWindowBackground (screen->display->xdisplay, screen->xroot, 0x00000000);
}
MetaScreen*
meta_screen_new (MetaDisplay *display,
int number,
@@ -700,6 +709,7 @@ meta_screen_new (MetaDisplay *display,
reload_monitor_infos (screen);
meta_screen_set_cursor (screen, META_CURSOR_DEFAULT);
meta_screen_set_background (screen);
/* Handle creating a no_focus_window for this screen */
screen->no_focus_window =

View File

@@ -72,12 +72,11 @@ typedef enum {
typedef enum
{
META_MOVE_RESIZE_CONFIGURE_REQUEST = 1 << 0,
META_MOVE_RESIZE_USER_ACTION = 1 << 1,
META_MOVE_RESIZE_MOVE_ACTION = 1 << 2,
META_MOVE_RESIZE_RESIZE_ACTION = 1 << 3,
META_MOVE_RESIZE_WAYLAND_RESIZE = 1 << 4,
META_MOVE_RESIZE_STATE_CHANGED = 1 << 5,
META_IS_CONFIGURE_REQUEST = 1 << 0,
META_IS_USER_ACTION = 1 << 1,
META_IS_MOVE_ACTION = 1 << 2,
META_IS_RESIZE_ACTION = 1 << 3,
META_IS_WAYLAND_RESIZE = 1 << 4,
} MetaMoveResizeFlags;
typedef enum

View File

@@ -2690,10 +2690,7 @@ meta_window_maximize (MetaWindow *window,
meta_window_get_frame_rect (window, &old_rect);
meta_window_move_resize_internal (window,
META_MOVE_RESIZE_MOVE_ACTION | META_MOVE_RESIZE_RESIZE_ACTION | META_MOVE_RESIZE_STATE_CHANGED,
NorthWestGravity,
window->unconstrained_rect);
meta_window_move_resize_now (window);
meta_window_get_frame_rect (window, &new_rect);
meta_compositor_maximize_window (window->display->compositor,
@@ -3047,7 +3044,7 @@ meta_window_unmaximize_internal (MetaWindow *window,
meta_window_client_rect_to_frame_rect (window, &target_rect, &target_rect);
meta_window_move_resize_internal (window,
META_MOVE_RESIZE_MOVE_ACTION | META_MOVE_RESIZE_RESIZE_ACTION | META_MOVE_RESIZE_STATE_CHANGED,
META_IS_MOVE_ACTION | META_IS_RESIZE_ACTION,
gravity,
target_rect);
@@ -3192,11 +3189,9 @@ meta_window_make_fullscreen (MetaWindow *window)
if (!window->fullscreen)
{
meta_window_make_fullscreen_internal (window);
meta_window_move_resize_internal (window,
META_MOVE_RESIZE_MOVE_ACTION | META_MOVE_RESIZE_RESIZE_ACTION | META_MOVE_RESIZE_STATE_CHANGED,
NorthWestGravity,
window->unconstrained_rect);
/* move_resize with new constraints
*/
meta_window_queue(window, META_QUEUE_MOVE_RESIZE);
}
}
@@ -3218,19 +3213,19 @@ meta_window_unmake_fullscreen (MetaWindow *window)
/* Window's size hints may have changed while maximized, making
* saved_rect invalid. #329152
*/
meta_window_frame_rect_to_client_rect (window, &target_rect, &target_rect);
ensure_size_hints_satisfied (&target_rect, &window->size_hints);
meta_window_client_rect_to_frame_rect (window, &target_rect, &target_rect);
/* Need to update window->has_resize_func before we move_resize()
*/
meta_window_recalc_features (window);
set_net_wm_state (window);
meta_window_move_resize_internal (window,
META_MOVE_RESIZE_MOVE_ACTION | META_MOVE_RESIZE_RESIZE_ACTION | META_MOVE_RESIZE_STATE_CHANGED,
NorthWestGravity,
target_rect);
meta_window_move_resize_frame (window,
FALSE,
target_rect.x,
target_rect.y,
target_rect.width,
target_rect.height);
meta_window_update_layer (window);
@@ -3617,19 +3612,19 @@ meta_window_move_resize_internal (MetaWindow *window,
/* The action has to be a move, a resize or the wayland client
* acking our choice of size.
*/
g_assert (flags & (META_MOVE_RESIZE_MOVE_ACTION | META_MOVE_RESIZE_RESIZE_ACTION | META_MOVE_RESIZE_WAYLAND_RESIZE));
g_assert (flags & (META_IS_MOVE_ACTION | META_IS_RESIZE_ACTION | META_IS_WAYLAND_RESIZE));
did_placement = !window->placed && window->calc_placement;
/* We don't need it in the idle queue anymore. */
meta_window_unqueue (window, META_QUEUE_MOVE_RESIZE);
if ((flags & META_MOVE_RESIZE_RESIZE_ACTION) && (flags & META_MOVE_RESIZE_MOVE_ACTION))
if ((flags & META_IS_RESIZE_ACTION) && (flags & META_IS_MOVE_ACTION))
{
/* We're both moving and resizing. Just use the passed in rect. */
unconstrained_rect = frame_rect;
}
else if ((flags & META_MOVE_RESIZE_RESIZE_ACTION))
else if ((flags & META_IS_RESIZE_ACTION))
{
/* If this is only a resize, then ignore the position given in
* the parameters and instead calculate the new position from
@@ -3640,7 +3635,7 @@ meta_window_move_resize_internal (MetaWindow *window,
frame_rect.width,
frame_rect.height);
}
else if ((flags & META_MOVE_RESIZE_MOVE_ACTION))
else if ((flags & META_IS_MOVE_ACTION))
{
/* If this is only a move, then ignore the passed in size and
* just use the existing size of the window. */
@@ -3649,7 +3644,7 @@ meta_window_move_resize_internal (MetaWindow *window,
unconstrained_rect.width = window->rect.width;
unconstrained_rect.height = window->rect.height;
}
else if ((flags & META_MOVE_RESIZE_WAYLAND_RESIZE))
else if ((flags & META_IS_WAYLAND_RESIZE))
{
/* This is a Wayland buffer acking our size. The new rect is
* just the existing one we have. Ignore the passed-in rect
@@ -3660,7 +3655,7 @@ meta_window_move_resize_internal (MetaWindow *window,
g_assert_not_reached ();
constrained_rect = unconstrained_rect;
if (flags & (META_MOVE_RESIZE_MOVE_ACTION | META_MOVE_RESIZE_RESIZE_ACTION))
if (flags & (META_IS_MOVE_ACTION | META_IS_RESIZE_ACTION))
{
MetaRectangle old_rect;
meta_window_get_frame_rect (window, &old_rect);
@@ -3703,10 +3698,10 @@ meta_window_move_resize_internal (MetaWindow *window,
old_output_winsys_id = window->monitor->winsys_id;
meta_window_update_monitor (window, flags & META_MOVE_RESIZE_USER_ACTION);
meta_window_update_monitor (window, flags & META_IS_USER_ACTION);
if (old_output_winsys_id != window->monitor->winsys_id &&
flags & META_MOVE_RESIZE_MOVE_ACTION && flags & META_MOVE_RESIZE_USER_ACTION)
flags & META_IS_MOVE_ACTION && flags & META_IS_USER_ACTION)
window->preferred_output_winsys_id = window->monitor->winsys_id;
if ((result & META_MOVE_RESIZE_RESULT_FRAME_SHAPE_CHANGED) && window->frame_bounds)
@@ -3744,7 +3739,7 @@ meta_window_move_frame (MetaWindow *window,
g_return_if_fail (!window->override_redirect);
flags = (user_op ? META_MOVE_RESIZE_USER_ACTION : 0) | META_MOVE_RESIZE_MOVE_ACTION;
flags = (user_op ? META_IS_USER_ACTION : 0) | META_IS_MOVE_ACTION;
meta_window_move_resize_internal (window, flags, NorthWestGravity, rect);
}
@@ -3794,7 +3789,7 @@ meta_window_move_resize_frame (MetaWindow *window,
g_return_if_fail (!window->override_redirect);
flags = (user_op ? META_MOVE_RESIZE_USER_ACTION : 0) | META_MOVE_RESIZE_MOVE_ACTION | META_MOVE_RESIZE_RESIZE_ACTION;
flags = (user_op ? META_IS_USER_ACTION : 0) | META_IS_MOVE_ACTION | META_IS_RESIZE_ACTION;
meta_window_move_resize_internal (window, flags, NorthWestGravity, rect);
}
@@ -3846,7 +3841,7 @@ meta_window_resize_frame_with_gravity (MetaWindow *window,
rect.width = w;
rect.height = h;
flags = (user_op ? META_MOVE_RESIZE_USER_ACTION : 0) | META_MOVE_RESIZE_RESIZE_ACTION;
flags = (user_op ? META_IS_USER_ACTION : 0) | META_IS_RESIZE_ACTION;
meta_window_move_resize_internal (window, flags, gravity, rect);
}

View File

@@ -547,16 +547,9 @@ data_device_set_selection (struct wl_client *client,
meta_wayland_data_device_set_selection (data_device, source, serial);
}
static void
data_device_release(struct wl_client *client, struct wl_resource *resource)
{
wl_resource_destroy(resource);
}
static const struct wl_data_device_interface data_device_interface = {
data_device_start_drag,
data_device_set_selection,
data_device_release,
};
static void

View File

@@ -65,33 +65,6 @@ unbind_resource (struct wl_resource *resource)
wl_list_remove (wl_resource_get_link (resource));
}
static void
sync_focus_surface (MetaWaylandPointer *pointer)
{
MetaDisplay *display = meta_get_display ();
switch (display->event_route)
{
case META_EVENT_ROUTE_WINDOW_OP:
case META_EVENT_ROUTE_COMPOSITOR_GRAB:
/* The compositor has a grab, so remove our focus... */
meta_wayland_pointer_set_focus (pointer, NULL);
break;
case META_EVENT_ROUTE_NORMAL:
case META_EVENT_ROUTE_WAYLAND_POPUP:
{
const MetaWaylandPointerGrabInterface *interface = pointer->grab->interface;
interface->focus (pointer->grab, pointer->current);
}
break;
default:
g_assert_not_reached ();
}
}
static void
set_cursor_surface (MetaWaylandPointer *pointer,
MetaWaylandSurface *surface)
@@ -206,7 +179,7 @@ default_grab_button (MetaWaylandPointerGrab *grab,
}
if (pointer->button_count == 0 && event_type == CLUTTER_BUTTON_RELEASE)
sync_focus_surface (pointer);
meta_wayland_pointer_set_focus (pointer, pointer->current);
}
static const MetaWaylandPointerGrabInterface default_pointer_grab_interface = {
@@ -274,6 +247,36 @@ count_buttons (const ClutterEvent *event)
return count;
}
static void
sync_focus_surface (MetaWaylandPointer *pointer)
{
MetaDisplay *display = meta_get_display ();
MetaWaylandSurface *focus_surface;
switch (display->event_route)
{
case META_EVENT_ROUTE_WINDOW_OP:
/* Don't update the focus surface while we're grabbing a window. */
return;
case META_EVENT_ROUTE_COMPOSITOR_GRAB:
/* The compositor has focus, so remove our focus... */
focus_surface = NULL;
break;
case META_EVENT_ROUTE_NORMAL:
case META_EVENT_ROUTE_WAYLAND_POPUP:
focus_surface = pointer->current;
break;
default:
g_assert_not_reached ();
}
const MetaWaylandPointerGrabInterface *interface = pointer->grab->interface;
interface->focus (pointer->grab, focus_surface);
}
static void
repick_for_event (MetaWaylandPointer *pointer,
const ClutterEvent *for_event)
@@ -304,7 +307,6 @@ repick_for_event (MetaWaylandPointer *pointer,
pointer->current = NULL;
sync_focus_surface (pointer);
meta_wayland_pointer_update_cursor_surface (pointer);
}
void

View File

@@ -32,6 +32,7 @@
#include <wayland-server.h>
#include "gtk-shell-server-protocol.h"
#include "xdg-shell-server-protocol.h"
#include "scaler-server-protocol.h"
#include "meta-wayland-private.h"
#include "meta-xwayland-private.h"
@@ -265,6 +266,7 @@ pending_state_init (MetaWaylandPendingState *state)
wl_list_init (&state->frame_callback_list);
state->has_new_geometry = FALSE;
state->viewport.changed = FALSE;
}
static void
@@ -420,6 +422,12 @@ commit_pending_state (MetaWaylandSurface *surface,
wl_list_insert_list (&compositor->frame_callbacks, &pending->frame_callback_list);
wl_list_init (&pending->frame_callback_list);
if (pending->viewport.changed)
meta_surface_actor_set_viewport (surface->surface_actor,
&pending->viewport.src_rect,
pending->viewport.dest_width,
pending->viewport.dest_height);
if (surface == compositor->seat->pointer.cursor_surface)
cursor_surface_commit (surface, pending);
else if (meta_wayland_data_device_is_dnd_surface (&compositor->seat->data_device, surface))
@@ -1681,6 +1689,136 @@ bind_subcompositor (struct wl_client *client,
wl_resource_set_implementation (resource, &meta_wayland_subcompositor_interface, data, NULL);
}
static void
destroy_wl_viewport (struct wl_resource *resource)
{
MetaWaylandSurface *surface = wl_resource_get_user_data (resource);
surface->has_viewport = FALSE;
surface->pending.viewport.changed = TRUE;
}
static void
wl_viewport_destroy (struct wl_client *client,
struct wl_resource *resource)
{
wl_resource_destroy (resource);
}
static void
viewport_set_src (struct wl_resource *resource,
wl_fixed_t src_x,
wl_fixed_t src_y,
wl_fixed_t src_width,
wl_fixed_t src_height)
{
MetaWaylandSurface *surface = wl_resource_get_user_data (resource);
surface->pending.viewport.src_rect.x = wl_fixed_to_int (src_x);
surface->pending.viewport.src_rect.y = wl_fixed_to_int (src_y);
surface->pending.viewport.src_rect.width = wl_fixed_to_int (src_width);
surface->pending.viewport.src_rect.height = wl_fixed_to_int (src_height);
surface->pending.viewport.changed = TRUE;
}
static void
viewport_set_dest (struct wl_resource *resource,
int dst_width,
int dst_height)
{
MetaWaylandSurface *surface = wl_resource_get_user_data (resource);
surface->pending.viewport.dest_width = dst_width;
surface->pending.viewport.dest_height = dst_height;
surface->pending.viewport.changed = TRUE;
}
static void
wl_viewport_set (struct wl_client *client,
struct wl_resource *resource,
wl_fixed_t src_x,
wl_fixed_t src_y,
wl_fixed_t src_width,
wl_fixed_t src_height,
int dst_width,
int dst_height)
{
viewport_set_src (resource, src_x, src_y, src_width, src_height);
viewport_set_dest (resource, dst_width, dst_height);
}
static void
wl_viewport_set_source (struct wl_client *client,
struct wl_resource *resource,
wl_fixed_t src_x,
wl_fixed_t src_y,
wl_fixed_t src_width,
wl_fixed_t src_height)
{
viewport_set_src (resource, src_x, src_y, src_width, src_height);
}
static void
wl_viewport_set_destination (struct wl_client *client,
struct wl_resource *resource,
int dst_width,
int dst_height)
{
viewport_set_dest (resource, dst_width, dst_height);
}
static const struct wl_viewport_interface meta_wayland_viewport_interface = {
wl_viewport_destroy,
wl_viewport_set,
wl_viewport_set_source,
wl_viewport_set_destination,
};
static void
wl_scaler_destroy (struct wl_client *client,
struct wl_resource *resource)
{
wl_resource_destroy (resource);
}
static void
wl_scaler_get_viewport (struct wl_client *client,
struct wl_resource *master_resource,
uint32_t viewport_id,
struct wl_resource *surface_resource)
{
struct wl_resource *resource;
MetaWaylandSurface *surface = wl_resource_get_user_data (surface_resource);
if (surface->has_viewport)
{
wl_resource_post_error (master_resource,
WL_SCALER_ERROR_VIEWPORT_EXISTS,
"viewport already exists on surface");
return;
}
resource = wl_resource_create (client, &wl_viewport_interface, wl_resource_get_version (master_resource), viewport_id);
wl_resource_set_implementation (resource, &meta_wayland_viewport_interface, surface, destroy_wl_viewport);
surface->has_viewport = TRUE;
}
static const struct wl_scaler_interface meta_wayland_scaler_interface = {
wl_scaler_destroy,
wl_scaler_get_viewport,
};
static void
bind_scaler (struct wl_client *client,
void *data,
guint32 version,
guint32 id)
{
struct wl_resource *resource;
resource = wl_resource_create (client, &wl_scaler_interface, version, id);
wl_resource_set_implementation (resource, &meta_wayland_scaler_interface, data, NULL);
}
void
meta_wayland_shell_init (MetaWaylandCompositor *compositor)
{
@@ -1707,6 +1845,12 @@ meta_wayland_shell_init (MetaWaylandCompositor *compositor)
META_WL_SUBCOMPOSITOR_VERSION,
compositor, bind_subcompositor) == NULL)
g_error ("Failed to register a global wl-subcompositor object");
if (wl_global_create (compositor->wayland_display,
&wl_scaler_interface,
META_WL_SCALER_VERSION,
compositor, bind_scaler) == NULL)
g_error ("Failed to register a global wl-subcompositor object");
}
static void

View File

@@ -58,6 +58,12 @@ typedef struct
MetaRectangle new_geometry;
gboolean has_new_geometry;
struct {
gboolean changed;
cairo_rectangle_int_t src_rect;
int32_t dest_width, dest_height;
} viewport;
} MetaWaylandPendingState;
struct _MetaWaylandSurface
@@ -72,6 +78,7 @@ struct _MetaWaylandSurface
int scale;
int32_t offset_x, offset_y;
GList *subsurfaces;
gboolean has_viewport;
/* All the pending state that wl_surface.commit will apply. */
MetaWaylandPendingState pending;

View File

@@ -36,7 +36,7 @@
/* Global/master objects (version exported by wl_registry and negotiated through bind) */
#define META_WL_COMPOSITOR_VERSION 3
#define META_WL_DATA_DEVICE_MANAGER_VERSION 2
#define META_WL_DATA_DEVICE_MANAGER_VERSION 1
#define META_XDG_SHELL_VERSION 1
#define META_WL_SHELL_VERSION 1
#define META_WL_SEAT_VERSION 4
@@ -44,5 +44,6 @@
#define META_XSERVER_VERSION 1
#define META_GTK_SHELL_VERSION 1
#define META_WL_SUBCOMPOSITOR_VERSION 1
#define META_WL_SCALER_VERSION 2
#endif

View File

@@ -59,6 +59,7 @@ get_time (void)
typedef struct
{
GSource source;
GPollFD pfd;
struct wl_display *display;
} WaylandEventSource;
@@ -74,6 +75,13 @@ wayland_event_source_prepare (GSource *base, int *timeout)
return FALSE;
}
static gboolean
wayland_event_source_check (GSource *base)
{
WaylandEventSource *source = (WaylandEventSource *)base;
return source->pfd.revents;
}
static gboolean
wayland_event_source_dispatch (GSource *base,
GSourceFunc callback,
@@ -90,7 +98,7 @@ wayland_event_source_dispatch (GSource *base,
static GSourceFuncs wayland_event_source_funcs =
{
wayland_event_source_prepare,
NULL,
wayland_event_source_check,
wayland_event_source_dispatch,
NULL
};
@@ -104,9 +112,9 @@ wayland_event_source_new (struct wl_display *display)
source = (WaylandEventSource *) g_source_new (&wayland_event_source_funcs,
sizeof (WaylandEventSource));
source->display = display;
g_source_add_unix_fd (&source->source,
wl_event_loop_get_fd (loop),
G_IO_IN | G_IO_ERR);
source->pfd.fd = wl_event_loop_get_fd (loop);
source->pfd.events = G_IO_IN | G_IO_ERR;
g_source_add_poll (&source->source, &source->pfd);
return &source->source;
}

View File

@@ -0,0 +1,210 @@
<?xml version="1.0" encoding="UTF-8"?>
<protocol name="scaler">
<copyright>
Copyright © 2013-2014 Collabora, Ltd.
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
without fee, provided that the above copyright notice appear in
all copies and that both that copyright notice and this permission
notice appear in supporting documentation, and that the name of
the copyright holders not be used in advertising or publicity
pertaining to distribution of the software without specific,
written prior permission. The copyright holders make no
representations about the suitability of this software for any
purpose. It is provided "as is" without express or implied
warranty.
THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
</copyright>
<interface name="wl_scaler" version="2">
<description summary="surface cropping and scaling">
The global interface exposing surface cropping and scaling
capabilities is used to instantiate an interface extension for a
wl_surface object. This extended interface will then allow
cropping and scaling the surface contents, effectively
disconnecting the direct relationship between the buffer and the
surface size.
</description>
<request name="destroy" type="destructor">
<description summary="unbind from the cropping and scaling interface">
Informs the server that the client will not be using this
protocol object anymore. This does not affect any other objects,
wl_viewport objects included.
</description>
</request>
<enum name="error">
<entry name="viewport_exists" value="0"
summary="the surface already has a viewport object associated"/>
</enum>
<request name="get_viewport">
<description summary="extend surface interface for crop and scale">
Instantiate an interface extension for the given wl_surface to
crop and scale its content. If the given wl_surface already has
a wl_viewport object associated, the viewport_exists
protocol error is raised.
</description>
<arg name="id" type="new_id" interface="wl_viewport"
summary="the new viewport interface id"/>
<arg name="surface" type="object" interface="wl_surface"
summary="the surface"/>
</request>
</interface>
<interface name="wl_viewport" version="2">
<description summary="crop and scale interface to a wl_surface">
An additional interface to a wl_surface object, which allows the
client to specify the cropping and scaling of the surface
contents.
This interface allows to define the source rectangle (src_x,
src_y, src_width, src_height) from where to take the wl_buffer
contents, and scale that to destination size (dst_width,
dst_height). This state is double-buffered, and is applied on the
next wl_surface.commit.
The two parts of crop and scale state are independent: the source
rectangle, and the destination size. Initially both are unset, that
is, no scaling is applied. The whole of the current wl_buffer is
used as the source, and the surface size is as defined in
wl_surface.attach.
If the destination size is set, it causes the surface size to become
dst_width, dst_height. The source (rectangle) is scaled to exactly
this size. This overrides whatever the attached wl_buffer size is,
unless the wl_buffer is NULL. If the wl_buffer is NULL, the surface
has no content and therefore no size. Otherwise, the size is always
at least 1x1 in surface coordinates.
If the source rectangle is set, it defines what area of the
wl_buffer is taken as the source. If the source rectangle is set and
the destination size is not set, the surface size becomes the source
rectangle size rounded up to the nearest integer. If the source size
is already exactly integers, this results in cropping without scaling.
The coordinate transformations from buffer pixel coordinates up to
the surface-local coordinates happen in the following order:
1. buffer_transform (wl_surface.set_buffer_transform)
2. buffer_scale (wl_surface.set_buffer_scale)
3. crop and scale (wl_viewport.set*)
This means, that the source rectangle coordinates of crop and scale
are given in the coordinates after the buffer transform and scale,
i.e. in the coordinates that would be the surface-local coordinates
if the crop and scale was not applied.
If the source rectangle is partially or completely outside of the
wl_buffer, then the surface contents are undefined (not void), and
the surface size is still dst_width, dst_height.
The x, y arguments of wl_surface.attach are applied as normal to
the surface. They indicate how many pixels to remove from the
surface size from the left and the top. In other words, they are
still in the surface-local coordinate system, just like dst_width
and dst_height are.
If the wl_surface associated with the wl_viewport is destroyed,
the wl_viewport object becomes inert.
If the wl_viewport object is destroyed, the crop and scale
state is removed from the wl_surface. The change will be applied
on the next wl_surface.commit.
</description>
<request name="destroy" type="destructor">
<description summary="remove scaling and cropping from the surface">
The associated wl_surface's crop and scale state is removed.
The change is applied on the next wl_surface.commit.
</description>
</request>
<enum name="error">
<entry name="bad_value" value="0"
summary="negative or zero values in width or height"/>
</enum>
<request name="set">
<description summary="set the crop and scale state">
Set both source rectangle and destination size of the associated
wl_surface. See wl_viewport for the description, and relation to
the wl_buffer size.
The bad_value protocol error is raised if src_width or
src_height is negative, or if dst_width or dst_height is not
positive.
The crop and scale state is double-buffered state, and will be
applied on the next wl_surface.commit.
Arguments dst_x and dst_y do not exist here, use the x and y
arguments to wl_surface.attach. The x, y, dst_width, and dst_height
define the surface-local coordinate system irrespective of the
attached wl_buffer size.
</description>
<arg name="src_x" type="fixed" summary="source rectangle x"/>
<arg name="src_y" type="fixed" summary="source rectangle y"/>
<arg name="src_width" type="fixed" summary="source rectangle width"/>
<arg name="src_height" type="fixed" summary="source rectangle height"/>
<arg name="dst_width" type="int" summary="surface width"/>
<arg name="dst_height" type="int" summary="surface height"/>
</request>
<request name="set_source" since="2">
<description summary="set the source rectangle for cropping">
Set the source rectangle of the associated wl_surface. See
wl_viewport for the description, and relation to the wl_buffer
size.
If width is -1.0 and height is -1.0, the destination size is unset
instead. Any other pair of values for width and height that
contains zero or negative values raises the bad_value protocol
error.
The crop and scale state is double-buffered state, and will be
applied on the next wl_surface.commit.
</description>
<arg name="x" type="fixed" summary="source rectangle x"/>
<arg name="y" type="fixed" summary="source rectangle y"/>
<arg name="width" type="fixed" summary="source rectangle width"/>
<arg name="height" type="fixed" summary="source rectangle height"/>
</request>
<request name="set_destination" since="2">
<description summary="set the surface size for scaling">
Set the destination size of the associated wl_surface. See
wl_viewport for the description, and relation to the wl_buffer
size.
If width is -1 and height is -1, the destination size is unset
instead. Any other pair of values for width and height that
contains zero or negative values raises the bad_value protocol
error.
The crop and scale state is double-buffered state, and will be
applied on the next wl_surface.commit.
Arguments x and y do not exist here, use the x and y arguments to
wl_surface.attach. The x, y, width, and height define the
surface-local coordinate system irrespective of the attached
wl_buffer size.
</description>
<arg name="width" type="int" summary="surface width"/>
<arg name="height" type="int" summary="surface height"/>
</request>
</interface>
</protocol>

View File

@@ -168,7 +168,7 @@ meta_window_wayland_move_resize_internal (MetaWindow *window,
* it can be for maximized or fullscreen.
*/
if (flags & META_MOVE_RESIZE_WAYLAND_RESIZE)
if (flags & META_IS_WAYLAND_RESIZE)
{
/* This is a call to wl_surface_commit(), ignore the constrained_rect and
* update the real client size to match the buffer size.
@@ -188,11 +188,8 @@ meta_window_wayland_move_resize_internal (MetaWindow *window,
}
else
{
/* If the size changed, or the state changed, then we have to wait until
* the client acks our configure before moving the window. */
if (constrained_rect.width != window->rect.width ||
constrained_rect.height != window->rect.height ||
(flags & META_MOVE_RESIZE_STATE_CHANGED))
constrained_rect.height != window->rect.height)
{
/* If we get a 0x0 size, this means that we're trying to resize
* a surface that doesn't have any buffer attached. This can happen
@@ -400,7 +397,7 @@ meta_window_wayland_move_resize (MetaWindow *window,
window->custom_frame_extents.left = new_geom.x;
window->custom_frame_extents.top = new_geom.y;
flags = META_MOVE_RESIZE_WAYLAND_RESIZE;
flags = META_IS_WAYLAND_RESIZE;
/* x/y are ignored when we're doing interactive resizing */
if (!meta_grab_op_is_resizing (window->display->grab_op))
@@ -410,7 +407,7 @@ meta_window_wayland_move_resize (MetaWindow *window,
rect.x = wl_window->pending_move_x;
rect.y = wl_window->pending_move_y;
wl_window->has_pending_move = FALSE;
flags |= META_MOVE_RESIZE_MOVE_ACTION;
flags |= META_IS_MOVE_ACTION;
}
else
{
@@ -422,7 +419,7 @@ meta_window_wayland_move_resize (MetaWindow *window,
{
rect.x += dx;
rect.y += dy;
flags |= META_MOVE_RESIZE_MOVE_ACTION;
flags |= META_IS_MOVE_ACTION;
}
}
@@ -432,7 +429,7 @@ meta_window_wayland_move_resize (MetaWindow *window,
rect.height = new_geom.height;
if (rect.width != window->rect.width || rect.height != window->rect.height)
flags |= META_MOVE_RESIZE_RESIZE_ACTION;
flags |= META_IS_RESIZE_ACTION;
gravity = meta_resize_gravity_from_grab_op (window->display->grab_op);
meta_window_move_resize_internal (window, flags, gravity, rect);

View File

@@ -491,7 +491,7 @@ meta_window_apply_session_info (MetaWindow *window,
window->size_hints.win_gravity = info->gravity;
gravity = window->size_hints.win_gravity;
flags = META_MOVE_RESIZE_MOVE_ACTION | META_MOVE_RESIZE_RESIZE_ACTION;
flags = META_IS_MOVE_ACTION | META_IS_RESIZE_ACTION;
adjust_for_gravity (window, FALSE, gravity, &rect);
meta_window_client_rect_to_frame_rect (window, &rect, &rect);
@@ -560,7 +560,7 @@ meta_window_x11_manage (MetaWindow *window)
rect.width = window->size_hints.width;
rect.height = window->size_hints.height;
flags = META_MOVE_RESIZE_CONFIGURE_REQUEST | META_MOVE_RESIZE_MOVE_ACTION | META_MOVE_RESIZE_RESIZE_ACTION;
flags = META_IS_CONFIGURE_REQUEST | META_IS_MOVE_ACTION | META_IS_RESIZE_ACTION;
adjust_for_gravity (window, TRUE, gravity, &rect);
meta_window_client_rect_to_frame_rect (window, &rect, &rect);
@@ -1056,7 +1056,7 @@ meta_window_x11_move_resize_internal (MetaWindow *window,
gboolean is_configure_request;
is_configure_request = (flags & META_MOVE_RESIZE_CONFIGURE_REQUEST) != 0;
is_configure_request = (flags & META_IS_CONFIGURE_REQUEST) != 0;
meta_frame_calc_borders (window->frame, &borders);
@@ -1684,7 +1684,7 @@ meta_window_x11_update_input_region (MetaWindow *window)
/* Translate the set of XShape rectangles that we
* get from the X server to a cairo_region. */
XRectangle *rects = NULL;
int n_rects = -1, ordering;
int n_rects, ordering;
meta_error_trap_push (window->display);
rects = XShapeGetRectangles (window->display->xdisplay,
@@ -1694,46 +1694,21 @@ meta_window_x11_update_input_region (MetaWindow *window)
&ordering);
meta_error_trap_pop (window->display);
/* XXX: The X Shape specification is quite unfortunately specified.
*
* By default, the window has a shape the same as its bounding region,
* which we consider "NULL".
*
* If the window sets an empty region, then we'll get n_rects as 0
* and rects as NULL, which we need to transform back into an empty
* region.
*
* It would be great to have a less-broken extension for this, but
* hey, it's X11!
*/
/* XXX: The x shape extension doesn't provide a way to only test if an
* input shape has been specified, so we have to query and throw away the
* rectangles. */
if (rects)
{
if (n_rects > 1 ||
(n_rects == 1 &&
(rects[0].x != 0 ||
rects[0].y != 0 ||
rects[0].width != priv->client_rect.width ||
rects[0].height != priv->client_rect.height)))
region = region_create_from_x_rectangles (rects, n_rects);
if (n_rects == -1)
{
/* We had an error. */
region = NULL;
XFree (rects);
}
else if (n_rects == 0)
{
/* Client set an empty region. */
region = cairo_region_create ();
}
else if (n_rects == 1 &&
(rects[0].x == 0 ||
rects[0].y == 0 ||
rects[0].width == priv->client_rect.width ||
rects[0].height == priv->client_rect.height))
{
/* This is the bounding region case. Keep the
* region as NULL. */
region = NULL;
}
else
{
/* Window has a custom shape. */
region = region_create_from_x_rectangles (rects, n_rects);
}
meta_XFree (rects);
}
if (region != NULL)
@@ -1971,16 +1946,16 @@ meta_window_move_resize_request (MetaWindow *window,
* windows offscreen when users don't want it if not constrained
* (e.g. hitting a dropdown triangle in a fileselector to show more
* options, which makes the window bigger). Thus we do not set
* META_MOVE_RESIZE_USER_ACTION in flags to the
* META_IS_USER_ACTION in flags to the
* meta_window_move_resize_internal() call.
*/
flags = META_MOVE_RESIZE_CONFIGURE_REQUEST;
flags = META_IS_CONFIGURE_REQUEST;
if (value_mask & (CWX | CWY))
flags |= META_MOVE_RESIZE_MOVE_ACTION;
flags |= META_IS_MOVE_ACTION;
if (value_mask & (CWWidth | CWHeight))
flags |= META_MOVE_RESIZE_RESIZE_ACTION;
flags |= META_IS_RESIZE_ACTION;
if (flags & (META_MOVE_RESIZE_MOVE_ACTION | META_MOVE_RESIZE_RESIZE_ACTION))
if (flags & (META_IS_MOVE_ACTION | META_IS_RESIZE_ACTION))
{
MetaRectangle rect, monitor_rect;