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

[Fedora 40] gdk_display_get_primary_monitor() returned NULL #205

Open
LauraWebdev opened this issue Aug 27, 2024 · 6 comments
Open

[Fedora 40] gdk_display_get_primary_monitor() returned NULL #205

LauraWebdev opened this issue Aug 27, 2024 · 6 comments
Labels
bug Something isn't working Linux

Comments

@LauraWebdev
Copy link
Contributor

After updating my project from Photino.NET 2.6 to 3, it continues to give me the same error message box "gdk_display_get_primary_monitor() returned NULL" on Linux (Fedora).

image

I can click on close and it seems like the window does start, however WebMessages are apparently not sent to the window. They do appear within the debug log but don't register on the page itself.

It is worth noting that Fedora 40 apparently does not ship with webkit2gtk-4.0 anymore (they have switched to 4.1), so I had to install it via my package manager.

System information
image

@CalvinPVIII
Copy link

I'm getting the same error on arch as well. I needed to install the wbekit2gtk package to get the app to launch at all, and after installing that package it launches but that message pops up first. I haven't noticed any other issues outside of the initial popup.

@MikeYeager MikeYeager added bug Something isn't working Linux labels Oct 3, 2024
@MikeYeager
Copy link
Collaborator

This occurs when centering the window. We have confirmed that this does not happen on Ubuntu 22.04. It does happen on WSL running Ubuntu 22.04. In fact, several windows functions don't work in WSL. There does not seem to be much we can do about that. In any case, we did add that pop up dialog when the Center() call fails to aid in troubleshooting. If you get this popup, the Center() call won't work anyway. Removing the Center() call will get rid of the pop up. Not a great solution, I understand, but all we can do is stop activating the popup in this scenario. We cannot make the centering of the window work. What we know from the GTK docs is this, "The primary monitor, or NULL if no primary monitor is configured by the user." I'm not sure how one configures a primary monitor in Fedora (or WSL) or if it's even possible. We are open to ideas.

@philippjbauer
Copy link
Member

Not all Linux distributions allow to check for the primary monitor that is configured in the operating system. This leads to an error and we display a message, instead of failing silently. We can try to figure out a way to get the width and height of the first monitor instead of the configured primary monitor and use that information for centering. If we cannot find this information we may fail silently in the future (with console logging).

@philippjbauer
Copy link
Member

I've made a change that should help with this. @MikeYeager could you check out the latest debug commits and try to run that on WSL?

https://github.com/tryphotino/photino.Native/blob/73d762d3d4b0d59365193b4d0a4ce95f977e5e72/Photino.Native/Photino.Linux.cpp#L315

@LauraWebdev
Copy link
Contributor Author

@philippjbauer @MikeYeager I just noticed that this issue of course also drippled down to the examples repo, so none of the examples can actually be run as of now.

@MikeYeager
Copy link
Collaborator

@LauraWebdev We are currently working on updating all of the samples. Unfortunately, when we updated the samples that use frameworks like Angular, React and Vue, those samples all broke. We are fixing them and will post new samples soo, followed by new project templates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Linux
Projects
None yet
Development

No branches or pull requests

4 participants