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

Fixed interface not opening on Hyprland #188

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

Conversation

FrancisTheCat
Copy link

I am not 100% sure what the parameters that were passed to XCreateWindow before were supposed to do, however I found that switching to XCreateSimpleWindow resolved the problem for me. I also tested the fix on DWM, Openbox and Sway, where it continued working. I might have created some obscure regression by removing the extended parameters, but this seems to be working well. However the person that wrote the original code may have a good reason for choosing XCreateWindow that Im not aware of.

I tested on Arch with recent versions of all the mentioned compositors with an RTX 2060

@FrancisTheCat
Copy link
Author

I just noticed this change causes problems with popups :( Ill keep trying to get this to work tho since I really like this debugger

@FrancisTheCat FrancisTheCat changed the title Fixed interface not opening on Hyprland Fixed interface not opening on Hyprland (Not Yet working!) Jan 13, 2025
@FrancisTheCat FrancisTheCat changed the title Fixed interface not opening on Hyprland (Not Yet working!) Fixed interface not opening on Hyprland Jan 13, 2025
@FrancisTheCat
Copy link
Author

I think Ive fixed my fix, tho as a Wayland enjoyer my understanding of X11 does not suffice to explain why it works.

luigi2.h Outdated
window->window = XCreateSimpleWindow(ui.display, DefaultRootWindow(ui.display), 0, 0, width, height, 1, 0, 0);
if (flags & UI_WINDOW_MENU) {
XSetWindowAttributes attributes = {};
attributes.override_redirect = flags & UI_WINDOW_MENU;

Choose a reason for hiding this comment

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

maybe: attributes.override_redirect = True;

@greg7mdp
Copy link

greg7mdp commented Jan 13, 2025

I'm wondering if the difference is that you're setting the border_pixel and background_pixel to 0 with XCreateSimpleWindow.

I'd be curious to know if the following works as well (I can't try since unfortunately I can't install hyprland right now):

	XSetWindowAttributes attributes = {};
	attributes.override_redirect = flags & UI_WINDOW_MENU;
        attributes.border_pixel = 0;
        attributes.background_pixel = 0;

	window->window = XCreateWindow(ui.display, DefaultRootWindow(ui.display), 0, 0, width, height, 0, 0,
		InputOutput, CopyFromParent, CWOverrideRedirect | CWBorderPixel | CWBackPixel, &attributes);

@FrancisTheCat
Copy link
Author

I'm wondering if the difference is that you're setting the border_pixel and background_pixel to 0 with XCreateSimpleWindow.

I'd be curious to know if the following works as well (I can't try since unfortunately I can't install hyprland right now):

	XSetWindowAttributes attributes = {};
	attributes.override_redirect = flags & UI_WINDOW_MENU;
        attributes.border_pixel = 0;
        attributes.background_pixel = 0;

	window->window = XCreateWindow(ui.display, DefaultRootWindow(ui.display), 0, 0, width, height, 0, 0,
		InputOutput, CopyFromParent, CWOverrideRedirect | CWBorderPixel | CWBackPixel, &attributes);

doesn't help :(

@greg7mdp
Copy link

doesn't help :(

Weird. It's gotta be the InputOutput then. Maybe it should be CopyFromParent instead?

@FrancisTheCat
Copy link
Author

doesn't help :(

Weird. It's gotta be the InputOutput then. Maybe it should be CopyFromParent instead?

didnt help either, I think we should just write this off as a weird xwayland bug

@greg7mdp
Copy link

didnt help either

Well thanks for checking anyways!

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.

2 participants