summaryrefslogtreecommitdiff
path: root/src/managers/XWaylandManager.hpp
blob: e05551e4f1bff96db80ce480298ffb4444089379 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#pragma once

#include "../defines.hpp"
#include "../Window.hpp"
#include <optional>

class CHyprXWaylandManager {
  public:
    CHyprXWaylandManager();
    ~CHyprXWaylandManager();

    wlr_xwayland* m_sWLRXWayland = nullptr;

    wlr_surface*  getWindowSurface(CWindow*);
    void          activateSurface(wlr_surface*, bool);
    void          activateWindow(CWindow*, bool);
    void          getGeometryForWindow(CWindow*, wlr_box*);
    std::string   getTitle(CWindow*);
    std::string   getAppIDClass(CWindow*);
    void          sendCloseWindow(CWindow*);
    void          setWindowSize(CWindow*, Vector2D, bool force = false);
    void          setWindowStyleTiled(CWindow*, uint32_t);
    void          setWindowFullscreen(CWindow*, bool);
    wlr_surface*  surfaceAt(CWindow*, const Vector2D&, Vector2D&);
    bool          shouldBeFloated(CWindow*);
    void          moveXWaylandWindow(CWindow*, const Vector2D&);
    void          checkBorders(CWindow*);
    Vector2D      getMaxSizeForWindow(CWindow*);
    void          updateXWaylandScale();

  private:
    void setXWaylandScale(std::optional<double> scale);
};

inline std::unique_ptr<CHyprXWaylandManager> g_pXWaylandManager;