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

Wayland backend errors. #1121

Closed
MrSorcus opened this issue Nov 7, 2017 · 10 comments
Closed

Wayland backend errors. #1121

MrSorcus opened this issue Nov 7, 2017 · 10 comments
Labels
enhancement Feature suggestions and PRs external Issues GLFW cannot reasonably solve Wayland
Milestone

Comments

@MrSorcus
Copy link

MrSorcus commented Nov 7, 2017

[glfw error 65544]: Wayland: Focusing a window requires user interaction
[glfw error 65544]: Wayland: Clipboard setting not implemented yet
[glfw error 65544]: Wayland: Clipboard getting not implemented yet
[glfw error 65544]: Wayland: Window attention request not implemented yet

kitty in sway

@MrSorcus MrSorcus changed the title Wayland backend clipboard. Wayland backend errors. Nov 7, 2017
@linkmauve
Copy link
Member

The first one will never be fixed, a client is not allowed to steal focus from another, this behaviour is extremely bad for most users, and can be catastrophic when e.g. they are typing a password or other sensitive information.

The second one has been implemented in #358, which probably needs to be refreshed, I can provide review if someone does it.

For the last one, there is no protocol available yet AFAIK, one would need to write one and implement it in some compositors first, if you are interested in that you could head to wayland-protocols, have a look at how they are written, and propose one.

@linkmauve linkmauve added enhancement Feature suggestions and PRs external Issues GLFW cannot reasonably solve labels Dec 25, 2017
@linkmauve linkmauve added this to Nice to have in Finish the Wayland backend Dec 25, 2017
@linkmauve
Copy link
Member

Clipboard support has now been merged, see #1353, closing this bug.

@almarklein
Copy link

[glfw error 65544]: Wayland: Focusing a window requires user interaction
...

The first one will never be fixed [...]

@linkmauve it looks like that error still occurs on Wayland. In the Python glfw wrapper this means that one cannot create a window on Wayland, because glfw errors are thrown as Python exceptions.

Could you please clarify glfw's approach to this error, so that we can think of an approach to fix this issue in the wrapper? E.g. can glfw (this repo) adopt a change so that the error does not occur, or should we accept that this error occurs and somehow deal with it in pyglfw?

@linkmauve
Copy link
Member

I think the best thing to do would be (for GLFW and user programs) to stop trying to steal the focus away from the user, an operation which is (rightly so) not supported in xdg-shell.

As for making the steal focus operation a noop rather than reporting an error, I’m not sure this should be done as it would confuse devs as to why it didn’t do anything. I’m not 100% set on that, for instance if we deprecate this function (and effectively make it a noop on every platform) it would probably be fine to not report an error.

Maybe in the meantime you should log errors by default rather than throwing exceptions, or document that behaviour to your users?

@almarklein
Copy link

I think the best thing to do would be (for GLFW and user programs) to stop trying to steal the focus away from the user

It looks like glfw is trying to focus on the window when it is created. The code I'm running, nor pyglfw seem to try to focus on it by themselves. Does that make sense?

Maybe in the meantime you should log errors by default rather than throwing exceptions, or document that behaviour to your users?

That's an interesting thought. Can I infer from this that you consider some errors more like warnings, i.e. a message that the user should see, but does not mean that glfw is in a critical state? Perhaps at some level (at pyglfw?) we should better distinguish between errors and warnings.

@elmindreda
Copy link
Member

That's an interesting thought. Can I infer from this that you consider some errors more like warnings, i.e. a message that the user should see, but does not mean that glfw is in a critical state?

None of GLFW's errors mean that GLFW is in a critical state. Barring a segfault, the worst that should happen on error is that the requested operation failed. This includes GLFW_OUT_OF_MEMORY.

@elmindreda
Copy link
Member

In the master branch these errors now use GLFW_FEATURE_UNAVAILABLE or GLFW_FEATURE_UNIMPLEMENTED, which should make them easier to reason about and handle.

@FlorianLudwig
Copy link

The following workaround makes pyglfw behave like glfw:

import glfw

glfw.ERROR_REPORTING = "warn"

@zoeleu
Copy link

zoeleu commented Oct 7, 2021

For focusing a window error: why can't it just be a warning? Minecraft crashes under GLFW Wayland because of this error.

@theoparis
Copy link

For focusing a window error: why can't it just be a warning? Minecraft crashes under GLFW Wayland because of this error.

Why is this closed? This is still breaking minecraft with wayland.
There seems to be a patch here but It'd be nice if this wasn't required along with building glfw from source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature suggestions and PRs external Issues GLFW cannot reasonably solve Wayland
Projects
No open projects
Development

No branches or pull requests

7 participants