From b5b297e6b4f2ee61bcd6fa4e7d2b38410082ec36 Mon Sep 17 00:00:00 2001 From: lenemter Date: Sun, 23 Jun 2024 15:47:49 +0900 Subject: [PATCH 01/12] Canvas: discard bitmap on invalidate --- lib/Drawing/Canvas.vala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Drawing/Canvas.vala b/lib/Drawing/Canvas.vala index 3d8f1f6e..9d49bc1e 100644 --- a/lib/Drawing/Canvas.vala +++ b/lib/Drawing/Canvas.vala @@ -69,7 +69,9 @@ public class Gala.Drawing.Canvas : GLib.Object, Clutter.Content { } public void invalidate () { - if (width <= 0 || height <= 0) { + bitmap = null; + + if (width <= 0 || height <= 0) { return; } From 9205df5bb293d31e0b3428ce79f73e95d832af58 Mon Sep 17 00:00:00 2001 From: Leo Date: Sun, 23 Jun 2024 19:23:28 +0900 Subject: [PATCH 02/12] Manually set ui_group size (#1953) Co-authored-by: Leonhard <106322251+leolost2605@users.noreply.github.com> Co-authored-by: Leonhard Kargl --- src/WindowManager.vala | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/WindowManager.vala b/src/WindowManager.vala index b6c87ad2..707d1e6f 100644 --- a/src/WindowManager.vala +++ b/src/WindowManager.vala @@ -217,6 +217,7 @@ namespace Gala { ui_group = new Clutter.Actor (); ui_group.reactive = true; + update_ui_group_size (); stage.add_child (ui_group); window_group = display.get_window_group (); @@ -380,6 +381,25 @@ namespace Gala { return false; } + private void update_ui_group_size () { + unowned var display = get_display (); + + int max_width = 0; + int max_height = 0; + + var num_monitors = display.get_n_monitors (); + for (int i = 0; i < num_monitors; i++) { + var geom = display.get_monitor_geometry (i); + var total_width = geom.x + geom.width; + var total_height = geom.y + geom.height; + + max_width = (max_width > total_width) ? max_width : total_width; + max_height = (max_height > total_height) ? max_height : total_height; + } + + ui_group.set_size (max_width, max_height); + } + private void launch_action (string action_key) { try { var action = behavior_settings.get_string (action_key); @@ -390,6 +410,7 @@ namespace Gala { } private void on_monitors_changed () { + update_ui_group_size (); screen_shield.expand_to_screen_size (); } From 6dd497e98f31fa8e841d36a9029180b4081443a7 Mon Sep 17 00:00:00 2001 From: Leonhard <106322251+leolost2605@users.noreply.github.com> Date: Sun, 23 Jun 2024 12:25:09 +0200 Subject: [PATCH 03/12] Fix indentation (#1955) Co-authored-by: Leo --- lib/Drawing/Canvas.vala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Drawing/Canvas.vala b/lib/Drawing/Canvas.vala index 9d49bc1e..e629d38f 100644 --- a/lib/Drawing/Canvas.vala +++ b/lib/Drawing/Canvas.vala @@ -69,9 +69,9 @@ public class Gala.Drawing.Canvas : GLib.Object, Clutter.Content { } public void invalidate () { - bitmap = null; + bitmap = null; - if (width <= 0 || height <= 0) { + if (width <= 0 || height <= 0) { return; } From d91ad2e045a5ad04bff14fbadf3ea65e05f17150 Mon Sep 17 00:00:00 2001 From: Leo Date: Mon, 24 Jun 2024 04:21:27 +0900 Subject: [PATCH 04/12] ShadowEffect: Avoid painting inside the actor (#1954) --- lib/ShadowEffect.vala | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/lib/ShadowEffect.vala b/lib/ShadowEffect.vala index 0ecf47db..909edb29 100644 --- a/lib/ShadowEffect.vala +++ b/lib/ShadowEffect.vala @@ -69,7 +69,7 @@ public class Gala.ShadowEffect : Clutter.Effect { } } - private Cogl.Texture? get_shadow (Cogl.Context context, int width, int height, int shadow_size, int shadow_spread = 0) { + private Cogl.Texture? get_shadow (Cogl.Context context, int width, int height, int shadow_size) { var old_key = current_key; current_key = "%ix%i:%i".printf (width, height, shadow_size); if (old_key == current_key) { @@ -90,10 +90,10 @@ public class Gala.ShadowEffect : Clutter.Effect { var buffer = new Drawing.BufferSurface (width, height); Drawing.Utilities.cairo_rounded_rectangle ( buffer.context, - shadow_size - shadow_spread, - shadow_size - shadow_spread, - width - shadow_size * 2 + shadow_spread * 2, - height - shadow_size * 2 + shadow_spread * 2, + shadow_size, + shadow_size, + width - shadow_size * 2, + height - shadow_size * 2, border_radius ); @@ -107,6 +107,13 @@ public class Gala.ShadowEffect : Clutter.Effect { cr.set_source_surface (buffer.surface, 0, 0); cr.paint (); + cr.save (); + cr.set_operator (Cairo.Operator.CLEAR); + var size = shadow_size * scale_factor; + Drawing.Utilities.cairo_rounded_rectangle (cr, size, size, actor.width, actor.height, border_radius); + cr.fill (); + cr.restore (); + try { var texture = new Cogl.Texture2D.from_data (context, width, height, Cogl.PixelFormat.BGRA_8888_PRE, surface.get_stride (), surface.get_data ()); @@ -147,7 +154,7 @@ public class Gala.ShadowEffect : Clutter.Effect { pipeline.set_color (alpha); - context.get_framebuffer ().draw_rectangle (pipeline, bounding_box.x1, bounding_box.y1 + shadow_size / 4, bounding_box.x2, bounding_box.y2 + shadow_size / 4); + context.get_framebuffer ().draw_rectangle (pipeline, bounding_box.x1, bounding_box.y1, bounding_box.x2, bounding_box.y2); actor.continue_paint (context); } From 4c032e84ad8bdf2b776e9fd0cae2684bb80acaa5 Mon Sep 17 00:00:00 2001 From: Italo Felipe Capasso Ballesteros Date: Sun, 23 Jun 2024 14:29:05 +0000 Subject: [PATCH 05/12] Translated using Weblate (Spanish) Currently translated at 100.0% (58 of 58 strings) Translation: Desktop/Gala Translate-URL: https://l10n.elementary.io/projects/desktop/gala/es/ --- po/es.po | 74 ++++++++++++++++++++++++++++++-------------------------- 1 file changed, 40 insertions(+), 34 deletions(-) diff --git a/po/es.po b/po/es.po index 8397ab0c..1d5eecc5 100644 --- a/po/es.po +++ b/po/es.po @@ -8,10 +8,10 @@ msgstr "" "Project-Id-Version: gala\n" "Report-Msgid-Bugs-To: https://github.com/elementary/gala/issues\n" "POT-Creation-Date: 2024-06-17 17:08+0000\n" -"PO-Revision-Date: 2024-06-17 03:16+0000\n" +"PO-Revision-Date: 2024-06-23 23:28+0000\n" "Last-Translator: Italo Felipe Capasso Ballesteros \n" -"Language-Team: Spanish \n" +"Language-Team: Spanish " +"\n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -23,7 +23,7 @@ msgstr "" #: src/Dialogs.vala:144 #, c-format msgid "“%s” is not responding" -msgstr "" +msgstr "«%s» no responde" #: src/Dialogs.vala:146 msgid "Application is not responding" @@ -34,10 +34,12 @@ msgid "" "You may choose to wait a short while for the application to continue, or " "force it to quit entirely." msgstr "" +"Si lo desea, puede esperar un momento para que la aplicación continúe, o " +"puede forzarla a cerrar." #: src/Dialogs.vala:150 msgid "Force Quit" -msgstr "" +msgstr "Forzar cierre" #: src/Dialogs.vala:151 msgid "Wait" @@ -46,23 +48,23 @@ msgstr "" #: src/Dialogs.vala:217 #, c-format msgid "“%s” wants to inhibit system shortcuts" -msgstr "" +msgstr "«%s» quiere inhibir los atajos del sistema" #: src/Dialogs.vala:219 msgid "An application wants to inhibit system shortcuts" -msgstr "" +msgstr "Una aplicación quiere inhibir los atajos del sistema" #: src/Dialogs.vala:222 msgid "All system shortcuts will be redirected to the application." -msgstr "" +msgstr "Todos los atajos del sistema serán redirigidos a la aplicación." #: src/Dialogs.vala:223 msgid "Allow" -msgstr "" +msgstr "Permitir" #: src/Dialogs.vala:224 msgid "Deny" -msgstr "" +msgstr "Denegar" #: src/ScreenshotManager.vala:285 msgid "Screenshots" @@ -110,14 +112,12 @@ msgid "System Settings…" msgstr "Configuración del Sistema…" #: daemon/BackgroundMenu.vala:47 -#, fuzzy -#| msgid "System Settings…" msgid "Failed to open System Settings" -msgstr "Configuración del sistema…" +msgstr "No se pudo abrir la Configuración del Sistema" #: daemon/BackgroundMenu.vala:48 msgid "A handler for the “settings://” URI scheme must be installed." -msgstr "" +msgstr "Se debe instalar un programa que controle el esquema URI «settings://»." #: daemon/WindowMenu.vala:36 msgid "Hide" @@ -133,7 +133,7 @@ msgstr "Redimensionar" #: daemon/WindowMenu.vala:65 msgid "Always on Top" -msgstr "Siempre encima" +msgstr "Siempre visible" #: daemon/WindowMenu.vala:73 msgid "Always on Visible Workspace" @@ -161,7 +161,7 @@ msgstr "Deshacer mosaico" #: daemon/WindowMenu.vala:138 msgid "Unmaximize" -msgstr "Desmaximizar" +msgstr "Deshacer maximizado" #: daemon/WindowMenu.vala:140 msgid "Maximize" @@ -198,18 +198,24 @@ msgid "" "Changing the wallpaper or going to sleep respects the \"Reduce Motion\" " "option" msgstr "" +"Al cambiar el fondo de escritorio o poner en reposo el escritorio, ahora " +"respeta la opción «Reducir el movimiento»" #: data/gala.metainfo.xml.in:35 msgid "Use appropriate drag-and-drop pointers when moving windows" msgstr "" +"Se usan los iconos de puntero apropiados para las acciones de arrastrar y " +"soltar" #: data/gala.metainfo.xml.in:36 msgid "Fix the issue when gestures in the multitasking view might stop working" msgstr "" +"Se corrigió un problema donde los gestos en la Vista Multitarea podrían " +"dejar de funcionar" #: data/gala.metainfo.xml.in:37 msgid "Improve dynamic workspaces behaviour with multiple monitors" -msgstr "" +msgstr "Se mejoraron las áreas de trabajo dinámicas con múltiples monitores" #: data/gala.metainfo.xml.in:38 data/gala.metainfo.xml.in:60 #: data/gala.metainfo.xml.in:75 data/gala.metainfo.xml.in:90 @@ -219,60 +225,60 @@ msgstr "Traducciones actualizadas" #: data/gala.metainfo.xml.in:59 msgid "Improve handling of move-to-workspace shortcut" -msgstr "" +msgstr "Se mejoró el funcionamiento del atajo de «mover al área de trabajo»" #: data/gala.metainfo.xml.in:102 msgid "" "Set the keyboard layout correctly at startup so that the indicator matches " "the selected layout" msgstr "" +"Ahora se utiliza la distribución del teclado correcta al iniciar para que el " +"indicador coincida con la distribución seleccionada" #: data/gala.metainfo.xml.in:103 msgid "Fix screenshot keyboard shortcuts while in Multitasking View" msgstr "" +"Se corrigieron los atajos de captura de pantalla cuando se encuentra en " +"Vista Multitarea" #: data/gala.metainfo.xml.in:104 msgid "" "Correctly set the active workspace highlight when entering Multitasking View " "and animate 1:1 with multitouch gestures" msgstr "" +"Ahora se establece correctamente el área de trabajo activa cuando se entra a " +"la Vista Multitarea. También las animaciones coinciden con los gestos " +"multitoque 1:1" #: data/gala.metainfo.xml.in:105 msgid "Update panel color after dimming the wallpaper" -msgstr "" +msgstr "Ahora se actualiza el color del panel al atenuar el fondo de escritorio" #: data/gala.metainfo.xml.in:106 -#, fuzzy -#| msgid "Enable rounded corner mask" msgid "Scale rounded corners per-display" -msgstr "Activar la máscara de bordes redondeados" +msgstr "Ahora se escalan los bordes redondeados de acuerdo a cada pantalla" #: data/gala.metainfo.xml.in:107 msgid "Support fractional scaling" -msgstr "" +msgstr "Se agregó compatibilidad para escalado fraccional" #: data/gala.metainfo.xml.in:127 -#, fuzzy -#| msgid "Minor visual improvements" msgid "Performance improvements" -msgstr "Mejoras visuales menores" +msgstr "Mejoras de rendimiento" #: data/gala.metainfo.xml.in:128 -#, fuzzy -#| msgid "Multitasking View" msgid "Remove texture from Multitasking View" -msgstr "Vista de multitarea" +msgstr "Se eliminó la textura de la Vista Multitarea" #: data/gala.metainfo.xml.in:129 -#, fuzzy -#| msgid "The opacity of windows behind the window switcher." msgid "Avoid accidentally selecting windows in the window switcher" -msgstr "Opacidad de ventanas ubicadas detrás del alternador de ventanas." +msgstr "" +"Ahora se evita seleccionar ventanas accidentalmente en alternador de ventanas" #: data/gala-multitaskingview.desktop.in:4 #: data/gala-multitaskingview.desktop.in:6 msgid "Multitasking View" -msgstr "Vista de multitarea" +msgstr "Vista Multitarea" #: data/gala-multitaskingview.desktop.in:5 msgid "View all open windows and workspaces" @@ -280,7 +286,7 @@ msgstr "Ver todas las ventanas y áreas de trabajo" #: data/gala-other.desktop.in:4 msgid "Other" -msgstr "Otro" +msgstr "Otros" #: data/gala-other.desktop.in:5 msgid "Fallback desktop file for notifications from outdated applications." From d5ff40d825817c3664d48a2f98f304a1d538e7c6 Mon Sep 17 00:00:00 2001 From: Gran PC Date: Sun, 23 Jun 2024 14:13:14 +0000 Subject: [PATCH 06/12] Translated using Weblate (Spanish) Currently translated at 100.0% (58 of 58 strings) Translation: Desktop/Gala Translate-URL: https://l10n.elementary.io/projects/desktop/gala/es/ --- po/es.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/po/es.po b/po/es.po index 1d5eecc5..deeece75 100644 --- a/po/es.po +++ b/po/es.po @@ -9,7 +9,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/elementary/gala/issues\n" "POT-Creation-Date: 2024-06-17 17:08+0000\n" "PO-Revision-Date: 2024-06-23 23:28+0000\n" -"Last-Translator: Italo Felipe Capasso Ballesteros \n" +"Last-Translator: Gran PC \n" "Language-Team: Spanish " "\n" "Language: es\n" @@ -27,7 +27,7 @@ msgstr "«%s» no responde" #: src/Dialogs.vala:146 msgid "Application is not responding" -msgstr "" +msgstr "La aplicación no responde" #: src/Dialogs.vala:149 msgid "" @@ -43,7 +43,7 @@ msgstr "Forzar cierre" #: src/Dialogs.vala:151 msgid "Wait" -msgstr "" +msgstr "Esperar" #: src/Dialogs.vala:217 #, c-format From fd1d4f1b773169c92d74b2a2adca759ae4cbcc53 Mon Sep 17 00:00:00 2001 From: Italo Felipe Capasso Ballesteros Date: Mon, 24 Jun 2024 03:42:24 +0000 Subject: [PATCH 07/12] Translated using Weblate (Spanish) Currently translated at 100.0% (58 of 58 strings) Translation: Desktop/Gala Translate-URL: https://l10n.elementary.io/projects/desktop/gala/es/ --- po/es.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/po/es.po b/po/es.po index deeece75..658330ff 100644 --- a/po/es.po +++ b/po/es.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: gala\n" "Report-Msgid-Bugs-To: https://github.com/elementary/gala/issues\n" "POT-Creation-Date: 2024-06-17 17:08+0000\n" -"PO-Revision-Date: 2024-06-23 23:28+0000\n" -"Last-Translator: Gran PC \n" +"PO-Revision-Date: 2024-06-24 04:01+0000\n" +"Last-Translator: Italo Felipe Capasso Ballesteros \n" "Language-Team: Spanish " "\n" "Language: es\n" @@ -161,7 +161,7 @@ msgstr "Deshacer mosaico" #: daemon/WindowMenu.vala:138 msgid "Unmaximize" -msgstr "Deshacer maximizado" +msgstr "Restaurar" #: daemon/WindowMenu.vala:140 msgid "Maximize" From ea7d9581ee1e9a76795f1e91f65cb1f4a15b28e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Corentin=20No=C3=ABl?= Date: Thu, 27 Jun 2024 15:20:34 +0200 Subject: [PATCH 08/12] Dialogs: Use the provided object in finish Allows to make sure that the object will be the same as the one the function started and will actually not be null. --- src/Dialogs.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Dialogs.vala b/src/Dialogs.vala index 0898eb7d..49df6fc4 100644 --- a/src/Dialogs.vala +++ b/src/Dialogs.vala @@ -99,7 +99,7 @@ namespace Gala { uint ret; try { - portal.access_dialog.end (res, out ret); + ((AccessPortal) obj).access_dialog.end (res, out ret); } catch (Error e) { warning (e.message); ret = 2; From ce5418e0f681021df08c553b48af41a619666636 Mon Sep 17 00:00:00 2001 From: David Hewitt Date: Fri, 28 Jun 2024 15:09:29 +0000 Subject: [PATCH 09/12] Translated using Weblate (English (United Kingdom)) Currently translated at 100.0% (58 of 58 strings) Translation: Desktop/Gala Translate-URL: https://l10n.elementary.io/projects/desktop/gala/en_GB/ --- po/en_GB.po | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/po/en_GB.po b/po/en_GB.po index 14df6d0e..3ad91b09 100644 --- a/po/en_GB.po +++ b/po/en_GB.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: beat-box\n" "Report-Msgid-Bugs-To: https://github.com/elementary/gala/issues\n" "POT-Creation-Date: 2024-06-17 17:08+0000\n" -"PO-Revision-Date: 2024-02-22 04:12+0000\n" +"PO-Revision-Date: 2024-06-29 15:16+0000\n" "Last-Translator: David Hewitt \n" "Language-Team: English (United Kingdom) \n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.0.2\n" +"X-Generator: Weblate 5.5.5\n" "X-Launchpad-Export-Date: 2017-03-14 07:02+0000\n" #: src/Dialogs.vala:144 @@ -48,23 +48,23 @@ msgstr "Wait" #: src/Dialogs.vala:217 #, c-format msgid "“%s” wants to inhibit system shortcuts" -msgstr "" +msgstr "“%s” wants to inhibit system shortcuts" #: src/Dialogs.vala:219 msgid "An application wants to inhibit system shortcuts" -msgstr "" +msgstr "An application wants to inhibit system shortcuts" #: src/Dialogs.vala:222 msgid "All system shortcuts will be redirected to the application." -msgstr "" +msgstr "All system shortcuts will be redirected to the application." #: src/Dialogs.vala:223 msgid "Allow" -msgstr "" +msgstr "Allow" #: src/Dialogs.vala:224 msgid "Deny" -msgstr "" +msgstr "Deny" #: src/ScreenshotManager.vala:285 msgid "Screenshots" From 0a5fae4b3323182f49d8551d17bead2d2ec31b63 Mon Sep 17 00:00:00 2001 From: Leonhard <106322251+leolost2605@users.noreply.github.com> Date: Sun, 30 Jun 2024 15:11:14 +0200 Subject: [PATCH 10/12] wayland/NotificationStack: Don't flicker at the beginning of the animation (#1963) --- src/NotificationStack.vala | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/NotificationStack.vala b/src/NotificationStack.vala index 39ff45d2..5cdfb10a 100644 --- a/src/NotificationStack.vala +++ b/src/NotificationStack.vala @@ -63,6 +63,10 @@ public class Gala.NotificationStack : Object { window.stick (); if (animate) { + // Don't flicker at the beginning of the animation + notification.opacity = 0; + notification.rotation_angle_x = 90; + var opacity_transition = new Clutter.PropertyTransition ("opacity"); opacity_transition.set_from_value (0); opacity_transition.set_to_value (255); From 42b9242970f238017fb4c9bc45647c31da406c67 Mon Sep 17 00:00:00 2001 From: Ihor Hordiichuk Date: Sun, 30 Jun 2024 13:02:10 +0000 Subject: [PATCH 11/12] Translated using Weblate (Ukrainian) Currently translated at 100.0% (58 of 58 strings) Translation: Desktop/Gala Translate-URL: https://l10n.elementary.io/projects/desktop/gala/uk/ --- po/uk.po | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/po/uk.po b/po/uk.po index 8bbdb9c2..b2026590 100644 --- a/po/uk.po +++ b/po/uk.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: beat-box\n" "Report-Msgid-Bugs-To: https://github.com/elementary/gala/issues\n" "POT-Creation-Date: 2024-06-17 17:08+0000\n" -"PO-Revision-Date: 2024-04-26 18:13+0000\n" +"PO-Revision-Date: 2024-07-01 13:16+0000\n" "Last-Translator: Ihor Hordiichuk \n" "Language-Team: Ukrainian \n" @@ -18,7 +18,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && " "n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" -"X-Generator: Weblate 5.0.2\n" +"X-Generator: Weblate 5.5.5\n" "X-Launchpad-Export-Date: 2017-02-21 05:47+0000\n" #: src/Dialogs.vala:144 @@ -49,23 +49,23 @@ msgstr "Зачекати" #: src/Dialogs.vala:217 #, c-format msgid "“%s” wants to inhibit system shortcuts" -msgstr "" +msgstr "“%s” хоче заборонити використання системних комбінацій клавіш" #: src/Dialogs.vala:219 msgid "An application wants to inhibit system shortcuts" -msgstr "" +msgstr "Застосунок хоче заборонити використання системних комбінацій клавіш" #: src/Dialogs.vala:222 msgid "All system shortcuts will be redirected to the application." -msgstr "" +msgstr "Усі системні комбінації клавіш будуть перенаправлені до застосунку." #: src/Dialogs.vala:223 msgid "Allow" -msgstr "" +msgstr "Дозволити" #: src/Dialogs.vala:224 msgid "Deny" -msgstr "" +msgstr "Відхилити" #: src/ScreenshotManager.vala:285 msgid "Screenshots" From 956125b488ba3da2ea1b1d93ffa8c0521e14a3ff Mon Sep 17 00:00:00 2001 From: Leonhard <106322251+leolost2605@users.noreply.github.com> Date: Tue, 2 Jul 2024 17:36:34 +0200 Subject: [PATCH 12/12] Shell: Move trusted clients config to own config file (#1956) --- data/gala.gschema.xml | 8 --- data/io.elementary.desktop.wm.shell | 7 +++ data/meson.build | 5 ++ src/ShellClients/ShellClientsManager.vala | 64 +++++++++++++++++++++-- 4 files changed, 72 insertions(+), 12 deletions(-) create mode 100644 data/io.elementary.desktop.wm.shell diff --git a/data/gala.gschema.xml b/data/gala.gschema.xml index 518dff71..f30ea687 100644 --- a/data/gala.gschema.xml +++ b/data/gala.gschema.xml @@ -439,12 +439,4 @@ - - - - [['io.elementary.dock'], ["io.elementary.wingpanel"]] - Clients to be launched by gala as trusted for interacting with the shell wl protcol. - An array of arrays of arguments to be used to launch the client. - - diff --git a/data/io.elementary.desktop.wm.shell b/data/io.elementary.desktop.wm.shell new file mode 100644 index 00000000..340789ed --- /dev/null +++ b/data/io.elementary.desktop.wm.shell @@ -0,0 +1,7 @@ +[io.elementary.wingpanel] +launch-on-x=true +args=io.elementary.wingpanel + +[io.elementary.dock] +launch-on-x=false +args=io.elementary.dock diff --git a/data/meson.build b/data/meson.build index d4ec7849..f5f58f1c 100644 --- a/data/meson.build +++ b/data/meson.build @@ -4,6 +4,11 @@ install_data( rename: 'org.pantheon.desktop.gala.gschema.xml' ) +install_data( + 'io.elementary.desktop.wm.shell', + install_dir: get_option('sysconfdir') / 'xdg', +) + i18n.merge_file( input: 'gala.metainfo.xml.in', output: meson.project_name() + '.metainfo.xml', diff --git a/src/ShellClients/ShellClientsManager.vala b/src/ShellClients/ShellClientsManager.vala index 4a58002e..37074668 100644 --- a/src/ShellClients/ShellClientsManager.vala +++ b/src/ShellClients/ShellClientsManager.vala @@ -34,10 +34,66 @@ public class Gala.ShellClientsManager : Object { construct { notifications_client = new NotificationsClient (wm.get_display ()); - var shell_settings = new Settings ("io.elementary.desktop.wm.shell"); - var clients = shell_settings.get_value ("trusted-clients"); - foreach (var client in clients) { - protocol_clients += new ManagedClient (wm.get_display (), client.get_strv ()); + start_clients.begin (); + } + + private async void start_clients () { + // Prioritize user config over system + (unowned string)[] config_dirs = { Environment.get_user_config_dir () }; + foreach (unowned var dir in Environment.get_system_config_dirs ()) { + config_dirs += dir; + } + + string? path = null; + foreach (unowned var dir in config_dirs) { + var file_path = Path.build_filename (dir, "io.elementary.desktop.wm.shell"); + warning (file_path); + if (FileUtils.test (file_path, EXISTS)) { + path = file_path; + break; + } + } + + if (path == null) { + warning ("No shell config file found."); + return; + } + + var file = File.new_for_path (path); + + Bytes bytes; + try { + bytes = yield file.load_bytes_async (null, null); + } catch (Error e) { + warning ("Failed to load shell config file: %s", e.message); + return; + } + + var key_file = new KeyFile (); + try { + key_file.load_from_bytes (bytes, NONE); + } catch (Error e) { + warning ("Failed to parse shell config file: %s", e.message); + return; + } + + foreach (var group in key_file.get_groups ()) { + if (!Meta.Util.is_wayland_compositor ()) { + try { + if (!key_file.get_boolean (group, "launch-on-x")) { + continue; + } + } catch (Error e) { + warning ("Failed to check whether client should be launched on x, assuming yes: %s", e.message); + } + } + + try { + var args = key_file.get_string_list (group, "args"); + protocol_clients += new ManagedClient (wm.get_display (), args); + } catch (Error e) { + warning ("Failed to load launch args for client %s: %s", group, e.message); + } } }