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

Open layer shell surfaces on wayland #66

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

coffeeispower
Copy link

@coffeeispower coffeeispower commented Dec 22, 2024

See issue #65 for more details

Closes #65

win->handle = adw_window_title_new(_("Clickable"), NULL);
adw_header_bar_set_title_widget(ADW_HEADER_BAR(win->header_bar),
win->handle);
gtk_box_append(GTK_BOX(win->box), win->header_bar);

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally have no opinion about layer shell if it don't break other things, but if you insist to make myself unable to move my window, I cannot accept that. I am a GNOME lover.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem I can add it back but only when is a floating window because it doesn't work when it is a layer.
Sorry for removing that, i was kinda desperate to make this work properly on hyprland (make the window not tile and be automatically positioned at the bottom) so probably have somethings to fix.

@AlynxZhou
Copy link
Owner

It seems that your editor is doing auto format for the UI file and makes a lot of unrelated changes, I think it's better not to change that file if it is unrelated to this PR. Thanks.

Comment on lines +339 to +346
GtkWindow* gtk_window = GTK_WINDOW(win);
// Create a layer shell surface instead of a normal floating window
gtk_layer_init_for_window(gtk_window);
// Make the layer appear on top of normal windows
gtk_layer_set_layer(gtk_window, GTK_LAYER_SHELL_LAYER_TOP);
gtk_layer_set_anchor(gtk_window, GTK_LAYER_SHELL_EDGE_BOTTOM, true);
gtk_layer_set_anchor(gtk_window, GTK_LAYER_SHELL_EDGE_RIGHT, true);
gtk_layer_set_anchor(gtk_window, GTK_LAYER_SHELL_EDGE_LEFT, true);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this break desktops without layer shell? If the library don't check by itself, we may need to check here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it falls back to a floating window but i haven't checked

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it has a gtk_layer_is_supported() function though so it's easy to check

@AlynxZhou
Copy link
Owner

I think we could make gtk4-layer-shell an optional dependency, for distros that does not have this library, but that could be done later.

@coffeeispower
Copy link
Author

coffeeispower commented Dec 22, 2024

Probably we could make this an option? Because you already have a settings window so it's easy to just slap some options there for enabling layer shell surfaces, setting the anchors and margins

@AlynxZhou
Copy link
Owner

Probably we could make this an option?

I think compiling time checking is enough.

@AlynxZhou
Copy link
Owner

Do you still have time to update this? I wish you could first split UI changes out of this PR, and then I could merge and update it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use layer shell surfaces
2 participants