Skip to content

Commit c298959

Browse files
committed
remotedesktop: merge input-capture, remove screenWidth/Height members
2 parents aa0a498 + e17cadc commit c298959

21 files changed

+262
-191
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ pkg_check_modules(
6363
libspa-0.2
6464
libdrm
6565
libeis-1.0
66+
uuid
6667
gbm
6768
hyprlang>=0.2.0
6869
hyprutils>=0.2.6
@@ -134,9 +135,12 @@ protocolnew("${HYPRLAND_PROTOCOLS}/protocols" "hyprland-global-shortcuts-v1"
134135
true)
135136
protocolnew("${HYPRLAND_PROTOCOLS}/protocols" "hyprland-toplevel-export-v1"
136137
true)
138+
protocolnew("${HYPRLAND_PROTOCOLS}/protocols" "hyprland-toplevel-mapping-v1"
139+
true)
137140
protocolnew("${HYPRLAND_PROTOCOLS}/protocols" "hyprland-input-capture-v1"
138141
true)
139142
protocolnew("stable/linux-dmabuf" "linux-dmabuf-v1" false)
143+
protocolnew("staging/ext-foreign-toplevel-list" "ext-foreign-toplevel-list-v1" false)
140144

141145
# Installation
142146
install(TARGETS hyprland-share-picker)

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.3.8
1+
1.3.9

flake.lock

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

hyprland-share-picker/main.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,17 @@ std::vector<SWindowEntry> getWindows(const char* env) {
6161
const auto TITLESEPPOS = rolling.find("[HE>]");
6262
const auto TITLESTR = rolling.substr(CLASSSEPPOS + 5, TITLESEPPOS - 5 - CLASSSEPPOS);
6363

64+
// window address
65+
const auto WINDOWSEPPOS = rolling.find("[HA>]");
66+
const auto WINDOWADDR = rolling.substr(TITLESEPPOS + 5, WINDOWSEPPOS - 5 - TITLESEPPOS);
67+
6468
try {
6569
result.push_back({TITLESTR, CLASSSTR, std::stoull(IDSTR)});
6670
} catch (std::exception& e) {
6771
// silent err
6872
}
6973

70-
rolling = rolling.substr(TITLESEPPOS + 5);
74+
rolling = rolling.substr(WINDOWSEPPOS + 5);
7175
}
7276

7377
return result;

nix/default.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
hyprutils,
1212
hyprwayland-scanner,
1313
libdrm,
14-
mesa,
14+
libgbm,
1515
pipewire,
1616
qtbase,
1717
qttools,
@@ -48,7 +48,7 @@ stdenv.mkDerivation {
4848
hyprlang
4949
hyprutils
5050
libdrm
51-
mesa
51+
libgbm
5252
pipewire
5353
qtbase
5454
qttools

nix/overlays.nix

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ in {
1717
default = lib.composeManyExtensions [
1818
self.overlays.xdg-desktop-portal-hyprland
1919
self.overlays.sdbus-cpp_2
20-
self.overlays.hypr-gcc14Stdenv
2120
inputs.hyprland-protocols.overlays.default
2221
inputs.hyprwayland-scanner.overlays.default
2322
inputs.hyprlang.overlays.default
@@ -60,18 +59,4 @@ in {
6059
};
6160
}));
6261
};
63-
64-
# TODO: remove this when the next version of Hyprland is available (in Nixpkgs)
65-
hypr-gcc14Stdenv = final: prev: {
66-
hyprcursor = (prev.hyprcursor.override {stdenv = prev.gcc14Stdenv;}).overrideAttrs (self: super: {
67-
src = final.fetchFromGitHub {
68-
owner = "hyprwm";
69-
repo = "hyprcursor";
70-
rev = "f388aacd22be4a6e4d634fbaf6f75eb0713d239a";
71-
hash = "sha256-+2bZJL2u5hva7rSp65OfKJBK+k03T6GB/NCvpoS1OOo=";
72-
};
73-
});
74-
hyprlang = prev.hyprlang.override {stdenv = prev.gcc14Stdenv;};
75-
hyprutil = prev.hyprutil.override {stdenv = prev.gcc14Stdenv;};
76-
};
7762
}

protocols/meson.build

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ wayland_protos = dependency('wayland-protocols',
44
)
55

66
hyprland_protos = dependency('hyprland-protocols',
7-
version: '>=0.2',
7+
version: '>=0.6.4',
88
fallback: 'hyprland-protocols',
99
)
1010

@@ -21,9 +21,11 @@ client_protocols = [
2121
'wlr-screencopy-unstable-v1.xml',
2222
'wlr-foreign-toplevel-management-unstable-v1.xml',
2323
hl_protocol_dir / 'protocols/hyprland-toplevel-export-v1.xml',
24+
hl_protocol_dir / 'protocols/hyprland-toplevel-mapping-v1.xml',
2425
hl_protocol_dir / 'protocols/hyprland-global-shortcuts-v1.xml',
2526
hl_protocol_dir / 'protocols/hyprland-input-capture-v1.xml',
2627
wl_protocol_dir / 'stable/linux-dmabuf/linux-dmabuf-v1.xml',
28+
wl_protocol_dir / 'staging/ext-foreign-toplevel-list/ext-foreign-toplevel-list-v1.xml',
2729
]
2830

2931
wl_proto_files = []

src/core/PortalManager.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ SOutput::SOutput(SP<CCWlOutput> output_) : output(output_) {
2222
refreshRate = refresh;
2323
width = width_;
2424
height = height_;
25-
Debug::log(LOG, "??? {} {}", flags, refresh);
2625
});
2726
output->setGeometry(
2827
[this](CCWlOutput* r, int32_t x_, int32_t y_, int32_t physical_width, int32_t physical_height, int32_t subpixel, const char* make, const char* model, int32_t transform_) {
@@ -31,7 +30,10 @@ SOutput::SOutput(SP<CCWlOutput> output_) : output(output_) {
3130
y = y_;
3231
});
3332
output->setScale([this](CCWlOutput* r, uint32_t factor_) { scale = factor_; });
34-
output->setDone([](CCWlOutput* r) {});
33+
output->setDone([](CCWlOutput* r) {
34+
if (g_pPortalManager->m_sPortals.inputCapture != nullptr)
35+
g_pPortalManager->m_sPortals.inputCapture->zonesChanged();
36+
});
3537
}
3638

3739
CPortalManager::CPortalManager() {
@@ -86,7 +88,6 @@ void CPortalManager::onGlobal(uint32_t name, const char* interface, uint32_t ver
8688
m_sPortals.remoteDesktop->registerKeyboard(makeShared<CCZwpVirtualKeyboardManagerV1>(
8789
(wl_proxy*)wl_registry_bind((wl_registry*)m_sWaylandConnection.registry->resource(), name, &zwp_virtual_keyboard_manager_v1_interface, version)));
8890

89-
9091
else if (INTERFACE == hyprland_toplevel_export_manager_v1_interface.name) {
9192
m_sWaylandConnection.hyprlandToplevelMgr = makeShared<CCHyprlandToplevelExportManagerV1>(
9293
(wl_proxy*)wl_registry_bind((wl_registry*)m_sWaylandConnection.registry->resource(), name, &hyprland_toplevel_export_manager_v1_interface, version));
@@ -229,6 +230,11 @@ void CPortalManager::onGlobal(uint32_t name, const char* interface, uint32_t ver
229230
if (!std::any_cast<Hyprlang::INT>(m_sConfig.config->getConfigValue("general:toplevel_dynamic_bind")))
230231
m_sHelpers.toplevel->activate();
231232
}
233+
234+
else if (INTERFACE == hyprland_toplevel_mapping_manager_v1_interface.name) {
235+
m_sHelpers.toplevelMapping = std::make_unique<CToplevelMappingManager>(makeShared<CCHyprlandToplevelMappingManagerV1>(
236+
(wl_proxy*)wl_registry_bind((wl_registry*)m_sWaylandConnection.registry->resource(), name, &hyprland_toplevel_mapping_manager_v1_interface, version)));
237+
}
232238
}
233239

234240
void CPortalManager::onGlobalRemoved(uint32_t name) {
@@ -451,6 +457,7 @@ void CPortalManager::startEventLoop() {
451457
m_sPortals.inputCapture.reset();
452458
m_sPortals.remoteDesktop.reset();
453459
m_sHelpers.toplevel.reset();
460+
m_sPortals.inputCapture.reset();
454461

455462
m_pConnection.reset();
456463
pw_loop_destroy(m_sPipewire.loop);

src/core/PortalManager.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "../portals/RemoteDesktop.hpp"
1313
#include "../helpers/Timer.hpp"
1414
#include "../shared/ToplevelManager.hpp"
15+
#include "../shared/ToplevelMappingManager.hpp"
1516
#include <gbm.h>
1617
#include <poll.h>
1718
#include <xf86drm.h>
@@ -83,7 +84,8 @@ class CPortalManager {
8384
} m_sPortals;
8485

8586
struct {
86-
std::unique_ptr<CToplevelManager> toplevel;
87+
std::unique_ptr<CToplevelManager> toplevel;
88+
std::unique_ptr<CToplevelMappingManager> toplevelMapping;
8789
} m_sHelpers;
8890

8991
struct {

src/portals/GlobalShortcuts.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ dbUasv CGlobalShortcutsPortal::onBindShortcuts(sdbus::ObjectPath requestHandle,
130130
return {0, data};
131131
}
132132

133-
dbUasv CGlobalShortcutsPortal::onListShortcuts(sdbus::ObjectPath sessionHandle, sdbus::ObjectPath requestHandle) {
133+
dbUasv CGlobalShortcutsPortal::onListShortcuts(sdbus::ObjectPath requestHandle, sdbus::ObjectPath sessionHandle) {
134134
Debug::log(LOG, "[globalshortcuts] List keys:");
135135
Debug::log(LOG, "[globalshortcuts] | {}", sessionHandle.c_str());
136136

@@ -192,4 +192,4 @@ void CGlobalShortcutsPortal::onDeactivated(SKeybind* pKeybind, uint64_t time) {
192192
Debug::log(TRACE, "[gs] Session {} called deactivated on {}", PSESSION->sessionHandle.c_str(), pKeybind->id);
193193

194194
m_pObject->emitSignal("Deactivated").onInterface(INTERFACE_NAME).withArguments(PSESSION->sessionHandle, pKeybind->id, time, std::unordered_map<std::string, sdbus::Variant>{});
195-
}
195+
}

0 commit comments

Comments
 (0)