mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-02 16:45:59 +01:00
render: set refresh to 0 for both wl and x11 backends
This commit is contained in:
parent
f2999e84b9
commit
ce9c5fd722
2 changed files with 10 additions and 5 deletions
|
@ -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;
|
||||
}
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue