Merge branch 'master' into leolost/widget

This commit is contained in:
Leonhard 2024-07-02 20:21:45 +02:00 committed by GitHub
commit 8131c646f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 169 additions and 69 deletions

View File

@ -439,12 +439,4 @@
<description></description>
</key>
</schema>
<schema path="/io/elementary/desktop/wm/shell/" id="io.elementary.desktop.wm.shell">
<key type="aas" name="trusted-clients">
<default>[['io.elementary.dock'], ["io.elementary.wingpanel"]]</default>
<summary>Clients to be launched by gala as trusted for interacting with the shell wl protcol.</summary>
<description>An array of arrays of arguments to be used to launch the client.</description>
</key>
</schema>
</schemalist>

View File

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

View File

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

View File

@ -69,6 +69,8 @@ public class Gala.Drawing.Canvas : GLib.Object, Clutter.Content {
}
public void invalidate () {
bitmap = null;
if (width <= 0 || height <= 0) {
return;
}

View File

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

View File

@ -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 <davidmhewitt@gmail.com>\n"
"Language-Team: English (United Kingdom) <https://l10n.elementary.io/projects/"
"desktop/gala/en_GB/>\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"

View File

@ -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-24 04:01+0000\n"
"Last-Translator: Italo Felipe Capasso Ballesteros <edwood.grant@gmail.com>\n"
"Language-Team: Spanish <https://l10n.elementary.io/projects/desktop/gala/es/"
">\n"
"Language-Team: Spanish <https://l10n.elementary.io/projects/desktop/gala/es/>"
"\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -23,46 +23,48 @@ 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"
msgstr ""
msgstr "La aplicación no responde"
#: src/Dialogs.vala:149
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"
msgstr ""
msgstr "Esperar"
#: 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 "Restaurar"
#: 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."

View File

@ -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 <igor_ck@outlook.com>\n"
"Language-Team: Ukrainian <https://l10n.elementary.io/projects/desktop/gala/"
"uk/>\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"

View File

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

View File

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

View File

@ -35,10 +35,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);
}
}
}

View File

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