Skip to content

Commit

Permalink
Simpler fade-in animation
Browse files Browse the repository at this point in the history
  • Loading branch information
lenemter committed Feb 9, 2024
1 parent aafd149 commit a948139
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
19 changes: 18 additions & 1 deletion compositor/WindowManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ namespace GreeterCompositor {

public Greeter.SystemBackground system_background { get; private set; }

Meta.PluginInfo info;
private Clutter.Actor? fade_in_screen = null;

private Meta.PluginInfo info;

// Used to toggle screenreader
private GLib.Settings application_settings;
Expand Down Expand Up @@ -76,6 +78,12 @@ namespace GreeterCompositor {
public override void start () {
show_stage ();

fade_in_screen.save_easing_state ();
fade_in_screen.set_easing_duration (1000);
fade_in_screen.set_easing_mode (Clutter.AnimationMode.EASE);
fade_in_screen.opacity = 0;
fade_in_screen.restore_easing_state ();

unowned Meta.Display display = get_display ();
display.gl_video_memory_purged.connect (() => {
refresh_background ();
Expand Down Expand Up @@ -124,6 +132,15 @@ namespace GreeterCompositor {
pointer_locator = new PointerLocator (this);
ui_group.add_child (pointer_locator);

int width, height;
display.get_size (out width, out height);
fade_in_screen = new Clutter.Actor () {
width = width,
height = height,
background_color = Clutter.Color.from_rgba (0, 0, 0, 255),
};
stage.add_child (fade_in_screen);

MaskCorners.init (this);

/*keybindings*/
Expand Down
4 changes: 2 additions & 2 deletions src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ public int main (string[] args) {
var settings_daemon = new Greeter.SettingsDaemon ();
settings_daemon.start ();

Gtk.init (ref args);

Greeter.SubprocessSupervisor compositor;
Greeter.SubprocessSupervisor wingpanel;

Expand All @@ -43,6 +41,8 @@ public int main (string[] args) {
critical (e.message);
}

Gtk.init (ref args);

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

Expand Down

0 comments on commit a948139

Please sign in to comment.