summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-04-10 16:47:19 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-04-10 16:47:19 +0200
commit71916ee09ada62e6d75bc801501e69252820bfd1 (patch)
tree2b4694c57613eb156d1e478c2ef88f627dbdbef5 /src
parent92bfe6f13e56a0dd0cfeac82f90d55cc95eefe23 (diff)
fixed XDG popups yet again + removed some old TODOs
Diffstat (limited to 'src')
-rw-r--r--src/events/Devices.cpp3
-rw-r--r--src/events/Monitors.cpp2
-rw-r--r--src/events/Popups.cpp15
-rw-r--r--src/managers/InputManager.cpp2
-rw-r--r--src/managers/KeybindManager.cpp3
5 files changed, 10 insertions, 15 deletions
diff --git a/src/events/Devices.cpp b/src/events/Devices.cpp
index 0bd91a48..57fb221f 100644
--- a/src/events/Devices.cpp
+++ b/src/events/Devices.cpp
@@ -56,8 +56,7 @@ void Events::listener_mouseAxis(wl_listener* listener, void* data) {
void Events::listener_requestMouse(wl_listener* listener, void* data) {
const auto EVENT = (wlr_seat_pointer_request_set_cursor_event*)data;
-
- // TODO: crashes sometimes
+
if (EVENT->seat_client == g_pCompositor->m_sSeat.seat->pointer_state.focused_client)
wlr_cursor_set_surface(g_pCompositor->m_sWLRCursor, EVENT->surface, EVENT->hotspot_x, EVENT->hotspot_y);
}
diff --git a/src/events/Monitors.cpp b/src/events/Monitors.cpp
index 669cf354..f80cfaa0 100644
--- a/src/events/Monitors.cpp
+++ b/src/events/Monitors.cpp
@@ -88,6 +88,8 @@ void Events::listener_newOutput(wl_listener* listener, void* data) {
return;
}
+ // TODO: this doesn't seem to set the X and Y correctly,
+ // wlr_output_layout_output_coords returns invalid values, I think...
wlr_output_layout_add(g_pCompositor->m_sWLROutputLayout, OUTPUT, monitorRule.offset.x, monitorRule.offset.y);
wlr_output_set_custom_mode(OUTPUT, OUTPUT->width, OUTPUT->height, (int)(round(monitorRule.refreshRate * 1000)));
diff --git a/src/events/Popups.cpp b/src/events/Popups.cpp
index ccfa91e1..fd026fde 100644
--- a/src/events/Popups.cpp
+++ b/src/events/Popups.cpp
@@ -50,16 +50,13 @@ void createNewPopup(wlr_xdg_popup* popup, SXDGPopup* pHyprPopup) {
const auto PMONITOR = g_pCompositor->m_pLastMonitor;
- double lx = pHyprPopup->lx, ly = pHyprPopup->ly;
- wlr_output_layout_output_coords(g_pCompositor->m_sWLROutputLayout, PMONITOR->output, &lx, &ly);
-
- wlr_box box = {.x = lx, .y = ly, .width = PMONITOR->vecSize.x, .height = PMONITOR->vecSize.y};
+ wlr_box box = {.x = PMONITOR->vecPosition.x - pHyprPopup->lx, .y = PMONITOR->vecPosition.y - pHyprPopup->ly, .width = PMONITOR->vecSize.x, .height = PMONITOR->vecSize.y};
wlr_xdg_popup_unconstrain_from_box(popup, &box);
pHyprPopup->monitor = PMONITOR;
- Debug::log(LOG, "Popup: Coords %ix%i, at %i %i", popup->geometry.width, popup->geometry.height, popup->geometry.x, popup->geometry.y);
+ Debug::log(LOG, "Popup: Unconstrained from lx ly: %f %f, pHyprPopup lx ly: %f %f", (float)PMONITOR->vecPosition.x, (float)PMONITOR->vecPosition.y, (float)pHyprPopup->lx, (float)pHyprPopup->ly);
}
void Events::listener_newPopup(void* owner, void* data) {
@@ -77,8 +74,8 @@ void Events::listener_newPopup(void* owner, void* data) {
const auto PMONITOR = g_pCompositor->getMonitorFromID(layersurface->monitorID);
PNEWPOPUP->popup = WLRPOPUP;
- PNEWPOPUP->lx = layersurface->position.x - PMONITOR->vecPosition.x;
- PNEWPOPUP->ly = layersurface->position.y - PMONITOR->vecPosition.y;
+ PNEWPOPUP->lx = layersurface->position.x;
+ PNEWPOPUP->ly = layersurface->position.y;
PNEWPOPUP->monitor = PMONITOR;
createNewPopup(WLRPOPUP, PNEWPOPUP);
}
@@ -98,8 +95,8 @@ void Events::listener_newPopupXDG(void* owner, void* data) {
const auto PMONITOR = g_pCompositor->getMonitorFromID(PWINDOW->m_iMonitorID);
PNEWPOPUP->popup = WLRPOPUP;
- PNEWPOPUP->lx = PWINDOW->m_vEffectivePosition.x - PMONITOR->vecPosition.x;
- PNEWPOPUP->ly = PWINDOW->m_vEffectivePosition.y - PMONITOR->vecPosition.y;
+ PNEWPOPUP->lx = PWINDOW->m_vEffectivePosition.x;
+ PNEWPOPUP->ly = PWINDOW->m_vEffectivePosition.y;
PNEWPOPUP->parentWindow = PWINDOW;
PNEWPOPUP->monitor = PMONITOR;
createNewPopup(WLRPOPUP, PNEWPOPUP);
diff --git a/src/managers/InputManager.cpp b/src/managers/InputManager.cpp
index 56efd695..5157a063 100644
--- a/src/managers/InputManager.cpp
+++ b/src/managers/InputManager.cpp
@@ -2,14 +2,12 @@
#include "../Compositor.hpp"
void CInputManager::onMouseMoved(wlr_pointer_motion_event* e) {
- // TODO: sensitivity
float sensitivity = g_pConfigManager->getFloat("general:sensitivity");
wlr_cursor_move(g_pCompositor->m_sWLRCursor, &e->pointer->base, e->delta_x * sensitivity, e->delta_y * sensitivity);
mouseMoveUnified(e->time_msec);
- // todo: pointer
}
void CInputManager::onMouseWarp(wlr_pointer_motion_absolute_event* e) {
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp
index ac66dd14..b79d8c3a 100644
--- a/src/managers/KeybindManager.cpp
+++ b/src/managers/KeybindManager.cpp
@@ -40,8 +40,7 @@ bool CKeybindManager::handleKeybinds(const uint32_t& modmask, const xkb_keysym_t
// this little maneouver is gonna cost us 4µs
const auto KBKEY = xkb_keysym_from_name(k.key.c_str(), XKB_KEYSYM_CASE_INSENSITIVE);
const auto KBKEYUPPER = xkb_keysym_to_upper(KBKEY);
- // TODO: fix 0-9 keys and other modified ones with shift
- // or mention in the fucking wiki
+ // small TODO: fix 0-9 keys and other modified ones with shift
if (key != KBKEY && key != KBKEYUPPER)
continue;