@@ -116,7 +116,7 @@ public class AppCenter.App : Gtk.Application {
116116 protected override void startup () {
117117 base . startup ();
118118
119- Hdy . init ();
119+ Granite . init ();
120120
121121 var granite_settings = Granite . Settings . get_default ();
122122 var gtk_settings = Gtk . Settings . get_default ();
@@ -127,22 +127,6 @@ public class AppCenter.App : Gtk.Application {
127127 gtk_settings. gtk_application_prefer_dark_theme = granite_settings. prefers_color_scheme == Granite . Settings . ColorScheme . DARK ;
128128 });
129129
130- var provider = new Gtk .CssProvider ();
131- provider. load_from_resource (" io/elementary/appcenter/application.css" );
132- Gtk . StyleContext . add_provider_for_screen (
133- Gdk . Screen . get_default (),
134- provider,
135- Gtk . STYLE_PROVIDER_PRIORITY_APPLICATION
136- );
137-
138- var fallback_provider = new Gtk .CssProvider ();
139- fallback_provider. load_from_resource (" io/elementary/appcenter/fallback.css" );
140- Gtk . StyleContext . add_provider_for_screen (
141- Gdk . Screen . get_default (),
142- fallback_provider,
143- Gtk . STYLE_PROVIDER_PRIORITY_FALLBACK
144- );
145-
146130 var quit_action = new SimpleAction (" quit" , null );
147131 quit_action. activate. connect (() = > {
148132 if (active_window != null ) {
@@ -250,13 +234,19 @@ public class AppCenter.App : Gtk.Application {
250234 var main_window = new MainWindow (this );
251235 add_window (main_window);
252236
253- var window_height = App . settings. get_int (" window-height" );
254- var window_width = App . settings. get_int (" window-width" );
255- main_window. resize (window_width, window_height);
237+ /*
238+ * This is very finicky. Bind size after present else set_titlebar gives us bad sizes
239+ * Set maximize after height/width else window is min size on unmaximize
240+ * Bind maximize as SET else get get bad sizes
241+ */
242+ settings. bind (" window-height" , main_window, " default-height" , SettingsBindFlags . DEFAULT );
243+ settings. bind (" window-width" , main_window, " default-width" , SettingsBindFlags . DEFAULT );
256244
257245 if (settings. get_boolean (" window-maximized" )) {
258246 main_window. maximize ();
259247 }
248+
249+ settings. bind (" window-maximized" , main_window, " maximized" , SettingsBindFlags . SET );
260250 }
261251
262252 if (show_updates) {
@@ -356,14 +346,9 @@ public class AppCenter.App : Gtk.Application {
356346 if (error == null ) {
357347 if (package. get_can_launch ()) {
358348 // Check if window is focused
359- if (active_window != null ) {
360- var main_window = (MainWindow ) active_window;
361- var win = main_window. get_window ();
362- if (win != null && (win. get_state () & Gdk . WindowState . FOCUSED ) != 0 ) {
363- main_window. send_installed_toast (package);
364-
365- break ;
366- }
349+ if (active_window != null && active_window. is_active) {
350+ ((MainWindow ) active_window). send_installed_toast (package);
351+ break ;
367352 }
368353
369354 var notification = new Notification (_(" The app has been installed" ));
@@ -406,8 +391,9 @@ public class AppCenter.App : Gtk.Application {
406391 transient_for = active_window
407392 };
408393
409- update_fail_dialog. destroy . connect (() = > {
394+ update_fail_dialog. close_request . connect (() = > {
410395 update_fail_dialog = null ;
396+ return Gdk . EVENT_PROPAGATE ;
411397 });
412398 }
413399
0 commit comments