-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
Implement Input Capture Desktop Portal #268
base: master
Are you sure you want to change the base?
Conversation
@@ -1,6 +1,7 @@ | |||
[submodule "hyprland-protocols"] | |||
path = subprojects/hyprland-protocols | |||
url = https://github.com/hyprwm/hyprland-protocols | |||
url = https://github.com/3l0w/hyprland-protocols | |||
branch = feat/input-capture-impl |
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.
marking this one as a blocker until this is removed so we dont forget (don't resolve)
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.
a bit of a lengthy review, mostly style and guidelines. Many comments apply to the entirety of the PR
transform = (wl_output_transform)transform_; | ||
output->setMode([this](CCWlOutput* r, uint32_t flags, int32_t width, int32_t height, int32_t refresh) { | ||
refreshRate = refresh; | ||
this->width = width; |
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.
no this-> here and everywhere else
for conflicting local and member names, use local_
e.g. int32_t width_
and then width = width_
@@ -32,6 +33,9 @@ struct SOutput { | |||
uint32_t id = 0; | |||
float refreshRate = 60.0; | |||
wl_output_transform transform = WL_OUTPUT_TRANSFORM_NORMAL; | |||
uint32_t width, height; |
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.
ALWAYS initialize member primitives
CInputCapturePortal::CInputCapturePortal(SP<CCHyprlandInputCaptureManagerV1> mgr) { | ||
Debug::log(LOG, "[input-capture] initializing input capture portal"); | ||
m_sState.manager = mgr; | ||
sessionCounter = 0; |
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.
should be moved to the header
|
||
CInputCapturePortal::CInputCapturePortal(SP<CCHyprlandInputCaptureManagerV1> mgr) { | ||
Debug::log(LOG, "[input-capture] initializing input capture portal"); | ||
m_sState.manager = mgr; |
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.
CInputCapturePortal::CInputCapturePortal(SP<CCHyprlandInputCaptureManagerV1> mgr) : m_sState.manager(mgr) {
m_pObject->registerMethod(INTERFACE_NAME, "Release", "osa{sv}", "ua{sv}", [&](sdbus::MethodCall c) { onRelease(c); }); | ||
m_pObject->registerMethod(INTERFACE_NAME, "ConnectToEIS", "osa{sv}", "h", [&](sdbus::MethodCall c) { onConnectToEIS(c); }); | ||
|
||
m_pObject->registerProperty(INTERFACE_NAME, "SupportedCapabilities", "u", [](sdbus::PropertyGetReply& reply) { reply << (uint)(1 | 2); }); |
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.
uint is quite ambiguous, use uint32_t
return 0; | ||
} | ||
|
||
this->client.handle = client; |
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.
no this->
} | ||
|
||
void EmulatedInputServer::ensurePointer(eis_event* event) { | ||
if (client.pointer != nullptr) |
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.
!= nullptr redundant
if (client.pointer != nullptr) | ||
return; | ||
|
||
struct eis_device* pointer = eis_seat_new_device(client.seat); |
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.
C-style structs, drop the struct
#include <string> | ||
|
||
struct EisClient { | ||
struct eis_client* handle; |
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.
no C-style structs + initialize
Describe your PR, what does it fix/add?
This PR implements the input capture desktop portal with the new protocol defined in hyprwm/hyprland-protocols#8.
Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)
Nothing to declare yet.
Is it ready for merging, or does it need work?
It work when used with hyprwm/Hyprland#7919, but still need work, like sending the keyboard layout, or security concerns.