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

Simpler fade-in animation #703

Merged
merged 3 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
lenemter marked this conversation as resolved.
Show resolved Hide resolved

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