mirror of
https://github.com/hyprwm/hyprpaper.git
synced 2026-05-05 08:08:02 +02:00
fixd
This commit is contained in:
parent
561cb583da
commit
bedf9b6268
1 changed files with 8 additions and 13 deletions
|
|
@ -2,10 +2,7 @@
|
|||
#include "../Hyprpaper.hpp"
|
||||
|
||||
void SMonitor::registerListeners() {
|
||||
output->setMode([this](CCWlOutput* r, uint32_t flags, int32_t width, int32_t height, int32_t refresh) {
|
||||
size = Vector2D(width, height);
|
||||
newModeForGeometry = true;
|
||||
});
|
||||
output->setMode([this](CCWlOutput* r, uint32_t flags, int32_t width, int32_t height, int32_t refresh) { size = Vector2D(width, height); });
|
||||
|
||||
output->setDone([this](CCWlOutput* r) {
|
||||
readyForLS = true;
|
||||
|
|
@ -27,15 +24,13 @@ void SMonitor::registerListeners() {
|
|||
|
||||
output->setGeometry([this](CCWlOutput* r, int32_t x, int32_t y, int32_t width_mm, int32_t height_mm, int32_t subpixel, const char* make, const char* model,
|
||||
int32_t transform_) { //
|
||||
transform = (wl_output_transform)transform_;
|
||||
|
||||
//if no new mode has been sent before a geometry request, ignore it.
|
||||
if (!newModeForGeometry)
|
||||
return;
|
||||
newModeForGeometry = false;
|
||||
|
||||
//see https://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_output-enum-transform
|
||||
if ((transform % 4) == 1 || (transform % 4) == 3)
|
||||
/*
|
||||
see https://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_output-enum-transform
|
||||
IF { (new transform event IS by 90n degrees) AND (old transform event was NOT by 90n degrees) }
|
||||
THEN { swap the size vector accordingly. }
|
||||
*/
|
||||
if (((transform_ % 4) == 1 || (transform_ % 4) == 3) && ((transform % 4) != 1 || (transform % 4) != 3))
|
||||
std::swap(size.x, size.y);
|
||||
transform = (wl_output_transform)transform_;
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue