| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 
 | From: =?utf-8?q?Jeremy_B=C3=ADcha?= <jbicha@ubuntu.com>
Date: Sat, 30 Aug 2025 11:07:03 -0400
Subject: Update to gtk4 0.10
Forwarded: https://gitlab.gnome.org/World/amberol/-/merge_requests/187
---
 Cargo.toml              |  14 ++---
 src/cover_picture.rs    |   3 +-
 src/drag_overlay.rs     |   3 +-
 src/marquee.rs          |   3 +-
 src/playback_control.rs |   3 +-
 src/playlist_view.rs    |   3 +-
 src/queue_row.rs        |   3 +-
 src/song_cover.rs       |   3 +-
 src/song_details.rs     |   3 +-
 src/volume_control.rs   |   3 +-
 src/waveform_view.rs    | 157 +++++++++++++++++++++++++++---------------------
 src/window.rs           |   3 +-
 12 files changed, 115 insertions(+), 86 deletions(-)
diff --git a/Cargo.toml b/Cargo.toml
index 7e04be7..2e05695 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,9 +9,9 @@ edition = "2018"
 
 [dependencies]
 color-thief = "0.2.1"
-gdk-pixbuf = { version = "0.20", features = ["v2_42"] }
+gdk-pixbuf = { version = "0.21", features = ["v2_42"] }
 gettext-rs = { version = "0.7", features = ["gettext-system"] }
-gtk = { version = "0.9.6", package = "gtk4", features = ["v4_16"] }
+gtk = { version = "0.10", package = "gtk4", features = ["v4_16"] }
 lofty = "0.22.2"
 log = "0.4"
 mpris-server = "0.8"
@@ -26,21 +26,21 @@ async-channel = "2.2.0"
 futures = "0.3"
 
 [target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies]
-ashpd = {version = "0.11", default-features = false, features = ["gtk4", "async-std"]}
+ashpd = {version = "0.12", default-features = false, features = ["gtk4", "async-std"]}
 
 [dependencies.adw]
 package = "libadwaita"
-version = "0.7"
+version = "0.8"
 features = ["v1_5"]
 
 [dependencies.gst]
 package = "gstreamer"
-version = "0.23"
+version = "0.24"
 
 [dependencies.gst-audio]
 package = "gstreamer-audio"
-version = "0.23"
+version = "0.24"
 
 [dependencies.gst-play]
 package = "gstreamer-play"
-version = "0.23"
+version = "0.24"
diff --git a/src/cover_picture.rs b/src/cover_picture.rs
index 186dbcd..197942a 100644
--- a/src/cover_picture.rs
+++ b/src/cover_picture.rs
@@ -155,7 +155,8 @@ mod imp {
 glib::wrapper! {
     pub struct CoverPicture(ObjectSubclass<imp::CoverPicture>)
         @extends gtk::Widget,
-        @implements gio::ActionGroup, gio::ActionMap, gtk::Accessible;
+        @implements gio::ActionGroup, gio::ActionMap, gtk::Accessible,
+                    gtk::Buildable, gtk::ConstraintTarget;
 }
 
 impl Default for CoverPicture {
diff --git a/src/drag_overlay.rs b/src/drag_overlay.rs
index 00a8bd2..90ec1b4 100644
--- a/src/drag_overlay.rs
+++ b/src/drag_overlay.rs
@@ -93,7 +93,8 @@ mod imp {
 
 glib::wrapper! {
     pub struct DragOverlay(ObjectSubclass<imp::DragOverlay>)
-        @extends gtk::Widget, adw::Bin;
+        @extends gtk::Widget, adw::Bin,
+        @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget;
 }
 
 impl Default for DragOverlay {
diff --git a/src/marquee.rs b/src/marquee.rs
index 714f246..216b5d4 100644
--- a/src/marquee.rs
+++ b/src/marquee.rs
@@ -294,7 +294,8 @@ mod imp {
 
 glib::wrapper! {
     pub struct Marquee(ObjectSubclass<imp::Marquee>)
-        @extends gtk::Widget;
+        @extends gtk::Widget,
+        @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget;
 }
 
 impl Default for Marquee {
diff --git a/src/playback_control.rs b/src/playback_control.rs
index 3f7667f..6b8d13e 100644
--- a/src/playback_control.rs
+++ b/src/playback_control.rs
@@ -80,7 +80,8 @@ mod imp {
 glib::wrapper! {
     pub struct PlaybackControl(ObjectSubclass<imp::PlaybackControl>)
         @extends gtk::Widget,
-        @implements gio::ActionGroup, gio::ActionMap;
+        @implements gio::ActionGroup, gio::ActionMap, gtk::Accessible,
+                    gtk::Buildable, gtk::ConstraintTarget;
 }
 
 impl Default for PlaybackControl {
diff --git a/src/playlist_view.rs b/src/playlist_view.rs
index 8087564..cda68ed 100644
--- a/src/playlist_view.rs
+++ b/src/playlist_view.rs
@@ -71,7 +71,8 @@ mod imp {
 glib::wrapper! {
     pub struct PlaylistView(ObjectSubclass<imp::PlaylistView>)
         @extends gtk::Widget,
-        @implements gio::ActionGroup, gio::ActionMap;
+        @implements gio::ActionGroup, gio::ActionMap, gtk::Accessible,
+                    gtk::Buildable, gtk::ConstraintTarget;
 }
 
 impl Default for PlaylistView {
diff --git a/src/queue_row.rs b/src/queue_row.rs
index d16e4ab..0dd584b 100644
--- a/src/queue_row.rs
+++ b/src/queue_row.rs
@@ -152,7 +152,8 @@ mod imp {
 glib::wrapper! {
     pub struct QueueRow(ObjectSubclass<imp::QueueRow>)
         @extends gtk::Widget,
-        @implements gio::ActionGroup, gio::ActionMap;
+        @implements gio::ActionGroup, gio::ActionMap, gtk::Accessible,
+                    gtk::Buildable, gtk::ConstraintTarget;
 }
 
 impl Default for QueueRow {
diff --git a/src/song_cover.rs b/src/song_cover.rs
index a769486..8d8d53f 100644
--- a/src/song_cover.rs
+++ b/src/song_cover.rs
@@ -52,7 +52,8 @@ mod imp {
 
 glib::wrapper! {
     pub struct SongCover(ObjectSubclass<imp::SongCover>)
-        @extends gtk::Widget;
+        @extends gtk::Widget,
+        @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget;
 }
 
 impl Default for SongCover {
diff --git a/src/song_details.rs b/src/song_details.rs
index 73dc9ee..8733c4a 100644
--- a/src/song_details.rs
+++ b/src/song_details.rs
@@ -53,7 +53,8 @@ mod imp {
 
 glib::wrapper! {
     pub struct SongDetails(ObjectSubclass<imp::SongDetails>)
-        @extends gtk::Widget;
+        @extends gtk::Widget,
+        @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget;
 }
 
 impl Default for SongDetails {
diff --git a/src/volume_control.rs b/src/volume_control.rs
index b01ab3b..53bfb90 100644
--- a/src/volume_control.rs
+++ b/src/volume_control.rs
@@ -118,7 +118,8 @@ mod imp {
 glib::wrapper! {
     pub struct VolumeControl(ObjectSubclass<imp::VolumeControl>)
         @extends gtk::Widget,
-        @implements gio::ActionGroup, gio::ActionMap;
+        @implements gio::ActionGroup, gio::ActionMap, gtk::Accessible,
+                    gtk::Buildable, gtk::ConstraintTarget;
 }
 
 impl Default for VolumeControl {
diff --git a/src/waveform_view.rs b/src/waveform_view.rs
index 7c5df2f..50fb749 100644
--- a/src/waveform_view.rs
+++ b/src/waveform_view.rs
@@ -352,7 +352,7 @@ mod imp {
 glib::wrapper! {
     pub struct WaveformView(ObjectSubclass<imp::WaveformView>)
         @extends gtk::Widget,
-        @implements gtk::Accessible;
+        @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget;
 }
 
 fn ease_out_cubic(t: f64) -> f64 {
@@ -377,44 +377,58 @@ impl WaveformView {
         let drag_gesture = gtk::GestureDrag::new();
         drag_gesture.set_name(Some("waveform-drag"));
         drag_gesture.set_button(0);
-        drag_gesture.connect_drag_begin(
-            clone!(@strong self as this => move |gesture, start_x, _| {
+        drag_gesture.connect_drag_begin(clone!(
+            #[strong(rename_to = this)]
+            self,
+            move |gesture, start_x, _| {
                 if !this.has_focus() {
                     this.grab_focus();
                 }
                 gesture.set_state(gtk::EventSequenceState::Claimed);
                 this.seek_to_coord(start_x);
-            }),
-        );
-        drag_gesture.connect_drag_update(
-            clone!(@strong self as this => move |gesture, offset_x, _| {
+            }
+        ));
+        drag_gesture.connect_drag_update(clone!(
+            #[strong(rename_to = this)]
+            self,
+            move |gesture, offset_x, _| {
                 if !this.has_focus() {
                     this.grab_focus();
                 }
                 gesture.set_state(gtk::EventSequenceState::Claimed);
                 this.seek_to_coord(gesture.start_point().unwrap().0 + offset_x);
-            }),
-        );
+            }
+        ));
         self.add_controller(drag_gesture);
 
         let motion_gesture = gtk::EventControllerMotion::new();
         motion_gesture.set_name(Some("waveform-motion"));
-        motion_gesture.connect_motion(clone!(@strong self as this => move |_, x, _| {
-            let width = this.width() as f64;
-            let position = x / width;
-            this.imp().hover_position.replace(Some(position));
-            this.queue_draw();
-        }));
-        motion_gesture.connect_leave(clone!(@strong self as this => move |_| {
-            this.imp().hover_position.replace(None);
-            this.queue_draw();
-        }));
+        motion_gesture.connect_motion(clone!(
+            #[strong(rename_to = this)]
+            self,
+            move |_, x, _| {
+                let width = this.width() as f64;
+                let position = x / width;
+                this.imp().hover_position.replace(Some(position));
+                this.queue_draw();
+            }
+        ));
+        motion_gesture.connect_leave(clone!(
+            #[strong(rename_to = this)]
+            self,
+            move |_| {
+                this.imp().hover_position.replace(None);
+                this.queue_draw();
+            }
+        ));
         self.add_controller(motion_gesture);
 
         let key_controller = gtk::EventControllerKey::new();
         key_controller.set_name(Some("waveform-key"));
-        key_controller.connect_key_released(
-            clone!(@strong self as this => move |_, keyval, _, _| {
+        key_controller.connect_key_released(clone!(
+            #[strong(rename_to = this)]
+            self,
+            move |_, keyval, _, _| {
                 let delta = match keyval {
                     gdk::Key::Left => -0.05,
                     gdk::Key::Right => 0.05,
@@ -423,8 +437,8 @@ impl WaveformView {
 
                 let position = this.imp().position.get() + delta;
                 this.emit_by_name::<()>("position-changed", &[&position]);
-            }),
-        );
+            }
+        ));
         self.add_controller(key_controller);
     }
 
@@ -480,62 +494,67 @@ impl WaveformView {
         self.imp().factor.set(None);
         self.imp().first_frame_time.set(None);
 
-        let tick_id = self.add_tick_callback(clone!(@strong self as this => move |_, clock| {
-            let frame_time = clock.frame_time();
-            if let Some(first_frame_time) = this.imp().first_frame_time.get() {
-                if frame_time < first_frame_time {
-                    warn!("Frame clock going backwards");
-                    return glib::ControlFlow::Continue;
-                }
-
-                let has_peaks = this.imp().peaks.borrow().is_some();
-                let has_next_peaks = this.imp().next_peaks.borrow().is_some();
-
-                if has_peaks && has_next_peaks {
-                    // Animate the existing peaks to zero
-                    let progress = 1.0 - ((frame_time - first_frame_time) as f64 / ANIMATION_USECS);
-                    let delta = ease_out_cubic(progress);
-                    if delta < 0.0 {
-                        this.imp().peaks.replace(None);
-                        this.imp().factor.replace(None);
-                    } else {
-                        this.imp().factor.replace(Some(delta));
-                        this.queue_draw();
+        let tick_id = self.add_tick_callback(clone!(
+            #[strong(rename_to = this)]
+            self,
+            move |_, clock| {
+                let frame_time = clock.frame_time();
+                if let Some(first_frame_time) = this.imp().first_frame_time.get() {
+                    if frame_time < first_frame_time {
+                        warn!("Frame clock going backwards");
+                        return glib::ControlFlow::Continue;
                     }
-                } else if has_peaks && !has_next_peaks {
-                    // Animate the peaks from zero
-                    let progress = (frame_time - first_frame_time) as f64 / ANIMATION_USECS;
-                    let delta = ease_out_cubic(progress);
-                    if delta > 1.0 {
-                        // Animation complete
+
+                    let has_peaks = this.imp().peaks.borrow().is_some();
+                    let has_next_peaks = this.imp().next_peaks.borrow().is_some();
+
+                    if has_peaks && has_next_peaks {
+                        // Animate the existing peaks to zero
+                        let progress =
+                            1.0 - ((frame_time - first_frame_time) as f64 / ANIMATION_USECS);
+                        let delta = ease_out_cubic(progress);
+                        if delta < 0.0 {
+                            this.imp().peaks.replace(None);
+                            this.imp().factor.replace(None);
+                        } else {
+                            this.imp().factor.replace(Some(delta));
+                            this.queue_draw();
+                        }
+                    } else if has_peaks && !has_next_peaks {
+                        // Animate the peaks from zero
+                        let progress = (frame_time - first_frame_time) as f64 / ANIMATION_USECS;
+                        let delta = ease_out_cubic(progress);
+                        if delta > 1.0 {
+                            // Animation complete
+                            this.imp().factor.replace(None);
+                            this.imp().first_frame_time.replace(None);
+                            this.imp().tick_id.replace(None);
+                            this.queue_resize();
+                            return glib::ControlFlow::Break;
+                        } else {
+                            this.imp().factor.replace(Some(delta));
+                            this.queue_draw();
+                        }
+                    } else if !has_peaks && has_next_peaks {
+                        // Swap peaks
+                        let next_peaks = this.imp().next_peaks.take();
+                        this.imp().peaks.replace(next_peaks);
                         this.imp().factor.replace(None);
                         this.imp().first_frame_time.replace(None);
+                        this.queue_resize();
+                    } else {
+                        // No peaks
+                        this.imp().factor.replace(None);
                         this.imp().tick_id.replace(None);
                         this.queue_resize();
                         return glib::ControlFlow::Break;
-                    } else {
-                        this.imp().factor.replace(Some(delta));
-                        this.queue_draw();
                     }
-                } else if !has_peaks && has_next_peaks {
-                    // Swap peaks
-                    let next_peaks = this.imp().next_peaks.take();
-                    this.imp().peaks.replace(next_peaks);
-                    this.imp().factor.replace(None);
-                    this.imp().first_frame_time.replace(None);
-                    this.queue_resize();
                 } else {
-                    // No peaks
-                    this.imp().factor.replace(None);
-                    this.imp().tick_id.replace(None);
-                    this.queue_resize();
-                    return glib::ControlFlow::Break;
+                    this.imp().first_frame_time.replace(Some(frame_time));
                 }
-            } else {
-                this.imp().first_frame_time.replace(Some(frame_time));
+                glib::ControlFlow::Continue
             }
-            glib::ControlFlow::Continue
-        }));
+        ));
 
         self.imp().tick_id.replace(Some(tick_id));
         self.queue_resize();
diff --git a/src/window.rs b/src/window.rs
index e59c804..e688674 100644
--- a/src/window.rs
+++ b/src/window.rs
@@ -316,7 +316,8 @@ mod imp {
 glib::wrapper! {
     pub struct Window(ObjectSubclass<imp::Window>)
         @extends gtk::Widget, gtk::Window, gtk::ApplicationWindow, adw::ApplicationWindow,
-        @implements gio::ActionGroup, gio::ActionMap;
+        @implements gio::ActionGroup, gio::ActionMap, gtk::Accessible, gtk::Buildable,
+                    gtk::ConstraintTarget, gtk::Native, gtk::Root, gtk::ShortcutManager;
 }
 
 impl Window {
 |