-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
(WIP) wayland: add support for XDG_TOPLEVEL_STATE_SUSPENDED #15667
base: master
Are you sure you want to change the base?
Conversation
gfx/common/wayland_common.c
Outdated
@@ -33,6 +33,10 @@ | |||
#define APP_ID "org.libretro.RetroArch" | |||
#define WINDOW_TITLE "RetroArch" | |||
|
|||
#ifndef XDG_TOPLEVEL_STATE_SUSPENDED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is defined in the header generated by wayland-scanner
from xdg-shell.xml
when./configure
is run.
Making sure it's defined more likely to hide issues than fix them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant that the #define XDG_TOPLEVEL_STATE_SUSPENDED
was unnecessary.
However trying it on my machine I see that XDG_TOPLEVEL_STATE_SUSPENDED
isn't being defined in ./gfx/common/wayland/xdg-shell.h
because ./gfx/common/wayland/generate_wayland_protos.sh
is selecting my distros protocol files which are not as up to date.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have increased requirement wayland-protocols
version to 1.32, so if it's not found - bundled (and updated) xdg-shell
will be used instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hah, I completely missed that.
I was trying to hack pkg-config support into ./gfx/common/wayland/generate_wayland_protos.sh
.
Hmm, after compiling with this PR and run on KDE Plasma Wayland I got this error:
but on Sway it works fine |
Ah, yes, that is because you've upped xdg_toplevel support to version 6. Empty functions may be fine. |
Should I make a separate PR for this? |
My gut says no. If the implementation of either event handler ends up complex then split it off. |
Done |
@ColinKinloch should I also adapt libdecor part to this? https://gitlab.freedesktop.org/libdecor/libdecor/-/merge_requests/126 |
Looks like the latest release of libdecor was |
Also, does RetroArch already have an interface to interrupt window rendering (render loop) that could be bound to the suspended state? |
I have a pretty poor understanding of the RetroArch code base outside of the Wayland code to be honest. |
I've had another look at this. Here are my thoughts: Now that I'm still not exactly sure where implement suspend in retroarch. I guess the goal is to avoid rendering frames when the surface is suspended so that the game loop, audio etc are still processed. Adding Logging when the surface suspends and resumes in |
Hello. I am unable to continue working on this PR at this time, so you can take it over if you'd like |
Hi there @Sunderland93 and @ColinKinloch , sorry for the neglect with this PR. Are you guys still willing to finalize this and get it incorporated, or has another PR superseded it? I'm still interested in getting this across the finish line. Thanks. |
This adds support for suspended toplevel state introduced in https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/201
Currently I'm not sure how to properly plug this event to RetroArch's window, so WIP for now
@ColinKinloch