mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 18:25:59 +01:00
compositor/wayland: up the max buffer size to avoid disconnects when app hangs
This commit is contained in:
parent
f6387536f6
commit
3ddb16bd5b
3 changed files with 57 additions and 1 deletions
|
@ -110,7 +110,7 @@ pkg_check_modules(
|
||||||
IMPORTED_TARGET
|
IMPORTED_TARGET
|
||||||
xkbcommon
|
xkbcommon
|
||||||
uuid
|
uuid
|
||||||
wayland-server
|
wayland-server>=1.22.90
|
||||||
wayland-protocols
|
wayland-protocols
|
||||||
cairo
|
cairo
|
||||||
pango
|
pango
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include "desktop/LayerSurface.hpp"
|
#include "desktop/LayerSurface.hpp"
|
||||||
#include "render/Renderer.hpp"
|
#include "render/Renderer.hpp"
|
||||||
#include "xwayland/XWayland.hpp"
|
#include "xwayland/XWayland.hpp"
|
||||||
|
#include "helpers/ByteOperations.hpp"
|
||||||
|
|
||||||
#include <hyprutils/string/String.hpp>
|
#include <hyprutils/string/String.hpp>
|
||||||
#include <aquamarine/input/Input.hpp>
|
#include <aquamarine/input/Input.hpp>
|
||||||
|
@ -229,6 +230,9 @@ void CCompositor::initServer(std::string socketName, int socketFd) {
|
||||||
if (envEnabled("HYPRLAND_TRACE"))
|
if (envEnabled("HYPRLAND_TRACE"))
|
||||||
Debug::trace = true;
|
Debug::trace = true;
|
||||||
|
|
||||||
|
// set the buffer size to 1MB to avoid disconnects due to an app hanging for a short while
|
||||||
|
wl_display_set_default_max_buffer_size(m_sWLDisplay, 1_MB);
|
||||||
|
|
||||||
Aquamarine::SBackendOptions options;
|
Aquamarine::SBackendOptions options;
|
||||||
options.logFunction = aqLog;
|
options.logFunction = aqLog;
|
||||||
|
|
||||||
|
|
52
src/helpers/ByteOperations.hpp
Normal file
52
src/helpers/ByteOperations.hpp
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#define ULL unsigned long long
|
||||||
|
#define LD long double
|
||||||
|
|
||||||
|
constexpr ULL operator""_kB(const ULL BYTES) {
|
||||||
|
return BYTES * 1024;
|
||||||
|
}
|
||||||
|
constexpr ULL operator""_MB(const ULL BYTES) {
|
||||||
|
return BYTES * 1024 * 1024;
|
||||||
|
}
|
||||||
|
constexpr ULL operator""_GB(const ULL BYTES) {
|
||||||
|
return BYTES * 1024 * 1024 * 1024;
|
||||||
|
}
|
||||||
|
constexpr ULL operator""_TB(const ULL BYTES) {
|
||||||
|
return BYTES * 1024 * 1024 * 1024 * 1024;
|
||||||
|
}
|
||||||
|
constexpr LD operator""_kB(const LD BYTES) {
|
||||||
|
return BYTES * 1024;
|
||||||
|
}
|
||||||
|
constexpr LD operator""_MB(const LD BYTES) {
|
||||||
|
return BYTES * 1024 * 1024;
|
||||||
|
}
|
||||||
|
constexpr LD operator""_GB(const LD BYTES) {
|
||||||
|
return BYTES * 1024 * 1024 * 1024;
|
||||||
|
}
|
||||||
|
constexpr LD operator""_TB(const LD BYTES) {
|
||||||
|
return BYTES * 1024 * 1024 * 1024 * 1024;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
using __acceptable_byte_operation_type = typename std::enable_if<std::is_trivially_constructible<T, ULL>::value || std::is_trivially_constructible<T, LD>::value>::type;
|
||||||
|
|
||||||
|
template <typename X, typename = __acceptable_byte_operation_type<X>>
|
||||||
|
constexpr X kBtoBytes(const X kB) {
|
||||||
|
return kB * 1024;
|
||||||
|
}
|
||||||
|
template <typename X, typename = __acceptable_byte_operation_type<X>>
|
||||||
|
constexpr X MBtoBytes(const X MB) {
|
||||||
|
return MB * 1024 * 1024;
|
||||||
|
}
|
||||||
|
template <typename X, typename = __acceptable_byte_operation_type<X>>
|
||||||
|
constexpr X GBtoBytes(const X GB) {
|
||||||
|
return GB * 1024 * 1024 * 1024;
|
||||||
|
}
|
||||||
|
template <typename X, typename = __acceptable_byte_operation_type<X>>
|
||||||
|
constexpr X TBtoBytes(const X TB) {
|
||||||
|
return TB * 1024 * 1024 * 1024 * 1024;
|
||||||
|
}
|
||||||
|
|
||||||
|
#undef ULL
|
||||||
|
#undef LD
|
Loading…
Reference in a new issue