Skip to content

Commit

Permalink
MainWindow: center with shell protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit committed Nov 20, 2024
1 parent ad031cd commit c528e36
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Install Dependencies
run: |
apt update
apt install -y desktop-file-utils libgranite-7-dev libgtk-4-dev libadwaita-1-dev meson valac
apt install -y desktop-file-utils libgranite-7-dev libgtk-4-dev libadwaita-1-dev libpantheon-wayland-1-dev meson valac
- name: Build
run: |
meson build
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ You'll need the following dependencies:
* libgtk-4-dev (>= 4.10)
* libgranite-7-dev
* libadwaita-1-dev (>= 1.4.0)
* libpantheon-wayland-1-dev
* meson
* valac

Expand Down
4 changes: 3 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ gtk_dep = dependency('gtk4', version: '>= 4.10')
posix_dep = meson.get_compiler('vala').find_library('posix')
adw_dep = dependency('libadwaita-1', version: '>= 1.4.0')
m_dep = cc.find_library('m', required : false)
pantheon_wayland_dep = dependency('pantheon-wayland-1')

dependencies = [
gee_dep,
Expand All @@ -32,7 +33,8 @@ dependencies = [
gtk_dep,
posix_dep,
adw_dep,
m_dep
m_dep,
pantheon_wayland_dep
]

asresources = gnome.compile_resources(
Expand Down
7 changes: 6 additions & 1 deletion src/MainWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* Authored by: Corentin Noël <[email protected]>
*/

public class Onboarding.MainWindow : Gtk.ApplicationWindow {
public class Onboarding.MainWindow : Gtk.ApplicationWindow, PantheonWayland.ExtendedBehavior {
public string[] viewed { get; set; }
public static GLib.Settings settings;
public static ListStore pages;
Expand Down Expand Up @@ -140,6 +140,11 @@ public class Onboarding.MainWindow : Gtk.ApplicationWindow {
add_action (back_action);
add_action (next_action);
add_action (skip_action);

child.realize.connect (() => {
connect_to_shell ();
make_centered ();
});
}

private void action_next () {
Expand Down

0 comments on commit c528e36

Please sign in to comment.