Skip to content

Commit d2cccf5

Browse files
authored
Merge branch 'main' into styles/fix-active-on-other-workspace-dot
2 parents e78636d + aabd437 commit d2cccf5

File tree

7 files changed

+111
-25
lines changed

7 files changed

+111
-25
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
image: ghcr.io/elementary/docker:${{ matrix.version }}
2020

2121
steps:
22-
- uses: actions/checkout@v4
22+
- uses: actions/checkout@v5
2323
- name: Install Dependencies
2424
run: |
2525
apt update
@@ -37,6 +37,6 @@ jobs:
3737
image: valalang/lint
3838

3939
steps:
40-
- uses: actions/checkout@v4
40+
- uses: actions/checkout@v5
4141
- name: Lint
4242
run: io.elementary.vala-lint -d .

.github/workflows/merge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010

1111
steps:
1212
- name: Clone repository
13-
uses: actions/checkout@v4
13+
uses: actions/checkout@v5
1414
with:
1515
token: ${{ secrets.GIT_USER_TOKEN }}
1616

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-22.04
1111
if: github.event.pull_request.merged == true && true == contains(join(github.event.pull_request.labels.*.name), 'Release')
1212
steps:
13-
- uses: actions/checkout@v4
13+
- uses: actions/checkout@v5
1414
- uses: elementary/actions/release@main
1515
env:
1616
GIT_USER_TOKEN: "${{ secrets.GIT_USER_TOKEN }}"

data/Application.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ launcher progressbar progress {
6464
min-width: 0;
6565
}
6666

67+
tooltip {
68+
margin-bottom: 0.5em;
69+
}
70+
6771
backgrounditem,
6872
icongroup {
6973
padding: 6px;

po/es.po

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ msgstr ""
88
"Project-Id-Version: io.elementary.dock\n"
99
"Report-Msgid-Bugs-To: \n"
1010
"POT-Creation-Date: 2025-08-04 12:27+0000\n"
11-
"PO-Revision-Date: 2024-06-05 02:13+0000\n"
12-
"Last-Translator: Italo Felipe Capasso Ballesteros <edwood.grant@gmail.com>\n"
13-
"Language-Team: Spanish <https://l10n.elementary.io/projects/desktop/dock/es/"
14-
">\n"
11+
"PO-Revision-Date: 2025-08-11 20:55+0000\n"
12+
"Last-Translator: Italo Felipe Capasso Ballesteros <italo@gp-mail.com>\n"
13+
"Language-Team: Spanish <https://l10n.elementaryos.org/projects/desktop/dock/"
14+
"es/>\n"
1515
"Language: es\n"
1616
"MIME-Version: 1.0\n"
1717
"Content-Type: text/plain; charset=UTF-8\n"
1818
"Content-Transfer-Encoding: 8bit\n"
1919
"Plural-Forms: nplurals=2; plural=n != 1;\n"
20-
"X-Generator: Weblate 5.5\n"
20+
"X-Generator: Weblate 5.11.4\n"
2121

2222
#: src/AppSystem/App.vala:89
2323
#, c-format
@@ -30,15 +30,15 @@ msgstr "Mantener en el Dock"
3030

3131
#: src/AppSystem/Background/BackgroundAppRow.vala:36
3232
msgid "Quit"
33-
msgstr ""
33+
msgstr "Salir"
3434

3535
#: src/AppSystem/Background/BackgroundItem.vala:33
3636
msgid "Background Apps"
37-
msgstr ""
37+
msgstr "Aplicaciones en segundo plano"
3838

3939
#: src/AppSystem/Background/BackgroundItem.vala:35
4040
msgid "Apps running without a visible window."
41-
msgstr ""
41+
msgstr "Aplicaciones en ejecución sin una ventana visible."
4242

4343
#: src/DBus/SwitcherooControl.vala:70 src/DBus/SwitcherooControl.vala:98
4444
msgid "Default"

po/zh_Hans.po

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgstr ""
88
"Project-Id-Version: io.elementary.dock\n"
99
"Report-Msgid-Bugs-To: \n"
1010
"POT-Creation-Date: 2025-08-04 12:27+0000\n"
11-
"PO-Revision-Date: 2025-08-03 05:55+0000\n"
11+
"PO-Revision-Date: 2025-08-08 14:55+0000\n"
1212
"Last-Translator: JieXu <[email protected]>\n"
1313
"Language-Team: Chinese (Simplified Han script) <https://"
1414
"l10n.elementaryos.org/projects/desktop/dock/zh_Hans/>\n"
@@ -30,15 +30,15 @@ msgstr "在 Dock 栏中保留"
3030

3131
#: src/AppSystem/Background/BackgroundAppRow.vala:36
3232
msgid "Quit"
33-
msgstr ""
33+
msgstr "退出"
3434

3535
#: src/AppSystem/Background/BackgroundItem.vala:33
3636
msgid "Background Apps"
37-
msgstr ""
37+
msgstr "后台应用"
3838

3939
#: src/AppSystem/Background/BackgroundItem.vala:35
4040
msgid "Apps running without a visible window."
41-
msgstr ""
41+
msgstr "无可见窗口但仍在运行的应用。"
4242

4343
#: src/DBus/SwitcherooControl.vala:70 src/DBus/SwitcherooControl.vala:98
4444
msgid "Default"

src/AppSystem/Launcher.vala

Lines changed: 91 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
*/
55

66
public class Dock.Launcher : BaseItem {
7+
private class PopoverTooltip : Gtk.Popover {
8+
class construct {
9+
set_css_name ("tooltip");
10+
}
11+
}
12+
713
private const int DND_TIMEOUT = 1000;
814

915
private static Settings? notify_settings;
@@ -30,7 +36,9 @@ public class Dock.Launcher : BaseItem {
3036
private Gtk.Revealer badge_revealer;
3137
private Adw.TimedAnimation bounce_up;
3238
private Adw.TimedAnimation bounce_down;
33-
private Gtk.PopoverMenu popover;
39+
private Adw.TimedAnimation shake;
40+
private Gtk.PopoverMenu popover_menu;
41+
private Gtk.Popover popover_tooltip;
3442

3543
private Gtk.Image? second_running_indicator;
3644
private bool multiple_windows_open {
@@ -63,11 +71,32 @@ public class Dock.Launcher : BaseItem {
6371
}
6472

6573
construct {
66-
popover = new Gtk.PopoverMenu.from_model (app.menu_model) {
74+
popover_menu = new Gtk.PopoverMenu.from_model (app.menu_model) {
6775
autohide = true,
6876
position = TOP
6977
};
70-
popover.set_parent (this);
78+
popover_menu.set_parent (this);
79+
80+
var name_label = new Gtk.Label (app.app_info.get_display_name ());
81+
popover_tooltip = new PopoverTooltip () {
82+
position = TOP,
83+
child = name_label,
84+
autohide = false,
85+
can_focus = false,
86+
can_target = false,
87+
focusable = false,
88+
has_arrow = false
89+
};
90+
popover_tooltip.set_parent (this);
91+
92+
var motion_controller = new Gtk.EventControllerMotion ();
93+
motion_controller.enter.connect (() => {
94+
if (!popover_menu.visible) {
95+
popover_tooltip.popup ();
96+
}
97+
});
98+
motion_controller.leave.connect (popover_tooltip.popdown);
99+
add_controller (motion_controller);
71100

72101
image = new Gtk.Image ();
73102

@@ -99,8 +128,6 @@ public class Dock.Launcher : BaseItem {
99128
overlay.add_overlay (badge_revealer);
100129
overlay.add_overlay (progress_revealer);
101130

102-
tooltip_text = app.app_info.get_display_name ();
103-
104131
insert_action_group (ACTION_GROUP_PREFIX, app.action_group);
105132

106133
// We have to destroy the progressbar when it is not needed otherwise it will
@@ -150,11 +177,33 @@ public class Dock.Launcher : BaseItem {
150177
};
151178
bounce_up.done.connect (bounce_down.play);
152179

180+
shake = new Adw.TimedAnimation (
181+
this,
182+
0,
183+
0,
184+
70,
185+
new Adw.CallbackAnimationTarget ((val) => {
186+
var height = overlay.get_height ();
187+
var width = overlay.get_width ();
188+
189+
overlay.allocate (
190+
width, height, -1,
191+
new Gsk.Transform ().translate (Graphene.Point () { x = (int) val })
192+
);
193+
})
194+
) {
195+
easing = EASE_OUT_CIRC,
196+
reverse = true
197+
};
198+
153199
gesture_click.button = 0;
154200
gesture_click.released.connect (on_click_released);
155201

156202
var long_press = new Gtk.GestureLongPress ();
157-
long_press.pressed.connect (popover.popup);
203+
long_press.pressed.connect (() => {
204+
popover_menu.popup ();
205+
popover_tooltip.popdown ();
206+
});
158207
add_controller (long_press);
159208

160209
var scroll_controller = new Gtk.EventControllerScroll (VERTICAL);
@@ -200,8 +249,10 @@ public class Dock.Launcher : BaseItem {
200249
}
201250

202251
~Launcher () {
203-
popover.unparent ();
204-
popover.dispose ();
252+
popover_menu.unparent ();
253+
popover_menu.dispose ();
254+
popover_tooltip.unparent ();
255+
popover_tooltip.dispose ();
205256
}
206257

207258
/**
@@ -211,6 +262,7 @@ public class Dock.Launcher : BaseItem {
211262
base.cleanup ();
212263
bounce_down = null;
213264
bounce_up = null;
265+
shake = null;
214266
current_count_binding.unbind ();
215267
remove_dnd_cycle ();
216268
}
@@ -228,11 +280,13 @@ public class Dock.Launcher : BaseItem {
228280
if (app.launch_new_instance (context)) {
229281
animate_launch ();
230282
} else {
283+
animate_shake ();
231284
event_display.beep ();
232285
}
233286
break;
234287
case Gdk.BUTTON_SECONDARY:
235-
popover.popup ();
288+
popover_menu.popup ();
289+
popover_tooltip.popdown ();
236290
break;
237291
}
238292
}
@@ -248,6 +302,28 @@ public class Dock.Launcher : BaseItem {
248302
bounce_up.play ();
249303
}
250304

305+
private void animate_shake () {
306+
if (shake.state == PLAYING) {
307+
return;
308+
}
309+
310+
shake.value_to = -0.1 * overlay.get_width ();
311+
shake.play ();
312+
313+
int repeat_count = 0;
314+
ulong iterate = 0;
315+
iterate = shake.done.connect (() => {
316+
if (repeat_count == 4) {
317+
disconnect (iterate);
318+
return;
319+
}
320+
321+
shake.value_to *= -1;
322+
shake.play ();
323+
repeat_count++;
324+
});
325+
}
326+
251327
protected override bool drag_cancelled (Gdk.Drag drag, Gdk.DragCancelReason reason) {
252328
if (app.pinned && reason == NO_TARGET) {
253329
var popover = new PoofPopover ();
@@ -288,6 +364,12 @@ public class Dock.Launcher : BaseItem {
288364
}
289365

290366
private void queue_dnd_cycle () {
367+
// This fixes an X11 bug where the cycling through all open windows of the app
368+
// is triggered while rearranging the app icons in the dock via drag and drop.
369+
if (moving) {
370+
return;
371+
}
372+
291373
queue_dnd_cycle_id = Timeout.add (DND_TIMEOUT, () => {
292374
app.next_window.begin (false);
293375
return Source.CONTINUE;

0 commit comments

Comments
 (0)