aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorvaxerski <[email protected]>2023-07-19 00:26:04 +0200
committervaxerski <[email protected]>2023-07-19 00:28:15 +0200
commitce9c5fd7227d6f90a103a0ae379b61a429a9f572 (patch)
treedac7fcd43b3fba663f4a420ac0ca7b0f3f6ddb45
parentf2999e84b90a3b1aafee870d291f07147e495b6d (diff)
downloadHyprland-ce9c5fd7227d6f90a103a0ae379b61a429a9f572.tar.gz
Hyprland-ce9c5fd7227d6f90a103a0ae379b61a429a9f572.zip
render: set refresh to 0 for both wl and x11 backends
-rw-r--r--src/helpers/XWaylandStubs.hpp7
-rw-r--r--src/render/Renderer.cpp8
2 files changed, 10 insertions, 5 deletions
diff --git a/src/helpers/XWaylandStubs.hpp b/src/helpers/XWaylandStubs.hpp
index 940bcce0..39eaa5e0 100644
--- a/src/helpers/XWaylandStubs.hpp
+++ b/src/helpers/XWaylandStubs.hpp
@@ -28,7 +28,8 @@ typedef struct {
} xcb_size_hints_t;
typedef unsigned int xcb_window_t;
-typedef enum xcb_stack_mode_t {
+typedef enum xcb_stack_mode_t
+{
XCB_STACK_MODE_ABOVE = 0,
XCB_STACK_MODE_BELOW = 1,
XCB_STACK_MODE_TOP_IF = 2,
@@ -168,4 +169,8 @@ inline wlr_xwayland_surface* wlr_xwayland_surface_try_from_wlr_surface(wlr_surfa
inline bool wlr_xwayland_or_surface_wants_focus(const wlr_xwayland_surface*) {
return false;
+}
+
+inline bool wlr_backend_is_x11(void*) {
+ return false;
} \ No newline at end of file
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index 973e6105..67cf6f41 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -1588,6 +1588,8 @@ bool CHyprRenderer::applyMonitorRule(CMonitor* pMonitor, SMonitorRule* pMonitorR
wlr_output_set_transform(pMonitor->output, pMonitorRule->transform);
pMonitor->transform = pMonitorRule->transform;
+ const auto WLRREFRESHRATE = (wlr_backend_is_wl(pMonitor->output->backend) || wlr_backend_is_x11(pMonitor->output->backend)) ? 0 : pMonitorRule->refreshRate * 1000;
+
// loop over modes and choose an appropriate one.
if (pMonitorRule->resolution != Vector2D() && pMonitorRule->resolution != Vector2D(-1, -1) && pMonitorRule->resolution != Vector2D(-1, -2)) {
if (!wl_list_empty(&pMonitor->output->modes) && pMonitorRule->drmMode.type != DRM_MODE_TYPE_USERDEF) {
@@ -1619,8 +1621,7 @@ bool CHyprRenderer::applyMonitorRule(CMonitor* pMonitor, SMonitorRule* pMonitorR
}
if (!found) {
- wlr_output_set_custom_mode(pMonitor->output, (int)pMonitorRule->resolution.x, (int)pMonitorRule->resolution.y,
- (wlr_backend_is_wl(pMonitor->output->backend) ? 0 : (int)pMonitorRule->refreshRate * 1000));
+ wlr_output_set_custom_mode(pMonitor->output, (int)pMonitorRule->resolution.x, (int)pMonitorRule->resolution.y, WLRREFRESHRATE);
pMonitor->vecSize = pMonitorRule->resolution;
pMonitor->refreshRate = pMonitorRule->refreshRate;
@@ -1668,8 +1669,7 @@ bool CHyprRenderer::applyMonitorRule(CMonitor* pMonitor, SMonitorRule* pMonitorR
}
}
} else {
- wlr_output_set_custom_mode(pMonitor->output, (int)pMonitorRule->resolution.x, (int)pMonitorRule->resolution.y,
- (wlr_backend_is_wl(pMonitor->output->backend) ? 0 : (int)pMonitorRule->refreshRate * 1000));
+ wlr_output_set_custom_mode(pMonitor->output, (int)pMonitorRule->resolution.x, (int)pMonitorRule->resolution.y, WLRREFRESHRATE);
}
pMonitor->vecSize = pMonitorRule->resolution;