Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port to GTK 4 #711

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Install Dependencies
run: |
apt update
apt install -y desktop-file-utils libaccountsservice-dev libclutter-gtk-1.0-dev libgdk-pixbuf2.0-dev libgranite-dev libgtk-3-dev libhandy-1-dev liblightdm-gobject-1-dev libx11-dev meson ${{ matrix.mutter_pkg }} libgnome-desktop-3-dev valac
apt install -y desktop-file-utils libaccountsservice-dev libclutter-gtk-1.0-dev libgdk-pixbuf2.0-dev libgranite-7-dev libgtk-4-dev libadwaita-1-dev liblightdm-gobject-1-dev libx11-dev meson libmutter-10-dev libgnome-desktop-3-dev valac
- name: Build
env:
DESTDIR: out
Expand Down
1 change: 0 additions & 1 deletion src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public int main (string[] args) {
Gtk.init (ref args);

var window = new Greeter.MainWindow ();
window.show_all ();

try {
wingpanel = new Greeter.SubprocessSupervisor ({"io.elementary.wingpanel", "-g"});
Expand Down
3 changes: 1 addition & 2 deletions src/Cards/UserCard.vala
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class Greeter.UserCard : Greeter.BaseCard {
private Pantheon.AccountsService greeter_act;
private Pantheon.SettingsDaemon.AccountsService settings_act;

private Gtk.GestureMultiPress click_gesture;
private Gtk.GestureClick click_gesture;
private Gtk.Revealer form_revealer;
private Gtk.Stack login_stack;
private Greeter.PasswordEntry password_entry;
Expand Down Expand Up @@ -285,7 +285,6 @@ public class Greeter.UserCard : Greeter.BaseCard {
}

main_box.pack_start (background_image);
main_box.show_all ();
}

private string accent_to_string (int i) {
Expand Down
10 changes: 4 additions & 6 deletions src/MainWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class Greeter.MainWindow : Gtk.ApplicationWindow {

private GLib.Queue<unowned Greeter.UserCard> user_cards;
private Gtk.SizeGroup card_size_group;
private Hdy.Carousel carousel;
private Adw.Carousel carousel;
private LightDM.Greeter lightdm_greeter;
private Greeter.Settings settings;
private Gtk.Button guest_login_button;
Expand Down Expand Up @@ -54,7 +54,6 @@ public class Greeter.MainWindow : Gtk.ApplicationWindow {
construct {
app_paintable = true;
decorated = false;
type_hint = Gdk.WindowTypeHint.DESKTOP;
get_style_context ().add_provider (css_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);

settings = new Greeter.Settings ();
Expand Down Expand Up @@ -98,9 +97,9 @@ public class Greeter.MainWindow : Gtk.ApplicationWindow {
margin_top = 24,
margin_bottom = 24
};
main_box.add (datetime_widget);
main_box.add (manual_login_stack);
main_box.add (extra_login_grid);
main_box.append (datetime_widget);
main_box.append (manual_login_stack);
main_box.append (extra_login_grid);

child = main_box;

Expand Down Expand Up @@ -499,7 +498,6 @@ public class Greeter.MainWindow : Gtk.ApplicationWindow {

private void add_card (LightDM.User lightdm_user) {
var user_card = new Greeter.UserCard (lightdm_user);
user_card.show_all ();

carousel.add (user_card);

Expand Down
10 changes: 5 additions & 5 deletions src/Widgets/CapsLockRevealer.vala
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

public class Greeter.CapsLockRevealer : Gtk.Revealer {
private weak Gdk.Keymap keymap;
private unowned Gdk.Device device;

private Gtk.Image caps_lock_image;
private Gtk.Image num_lock_image;
Expand Down Expand Up @@ -48,16 +48,16 @@ public class Greeter.CapsLockRevealer : Gtk.Revealer {

add (caps_lock_grid);

keymap = Gdk.Keymap.get_for_display (Gdk.Display.get_default ());
keymap.state_changed.connect (update_visibility);
device = Gdk.Display.get_default ().get_default_seat ().get_devices (KEYBOARD)[0];
device.changed.connect (update_visibility);

update_visibility ();
}

private void update_visibility () {
unowned string? label = null;
var caps_lock = keymap.get_caps_lock_state ();
var num_lock = keymap.get_num_lock_state ();
var caps_lock = device.caps_lock_state;
var num_lock = device.num_lock_state;

reveal_child = caps_lock || num_lock;

Expand Down
8 changes: 4 additions & 4 deletions src/meson.build
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
actservice_dep = dependency('accountsservice')
gobject_dep = dependency('gobject-2.0')
glib_dep = dependency('glib-2.0')
gtk_dep = dependency('gtk+-3.0')
granite_dep = dependency('granite', version: '>= 5.5.0')
hdy_dep = dependency('libhandy-1', version: '>= 1.1.90')
gtk_dep = dependency('gtk4')
granite_dep = dependency('granite-7', version: '>= 7.0.0')
adw_dep = dependency('libadwaita-1', version: '>= 1.0.0')
lightdm_dep = dependency('liblightdm-gobject-1')
gnome_desktop_dep = dependency('gnome-desktop-3.0')
m_dep = meson.get_compiler('c').find_library('m')
Expand All @@ -30,7 +30,7 @@ executable(
'Widgets/PasswordEntry.vala',
'Widgets/SessionButton.vala',
config_header,
dependencies: [ actservice_dep, gobject_dep, glib_dep, gtk_dep, granite_dep, hdy_dep, lightdm_dep, m_dep ],
dependencies: [ actservice_dep, gobject_dep, glib_dep, gtk_dep, granite_dep, adw_dep, lightdm_dep, m_dep ],
install : true,
install_dir: install_path
)