2020-01-26 22:59:51 +00:00
|
|
|
#include <stdint.h>
|
2020-06-11 10:42:27 +00:00
|
|
|
|
2020-05-15 13:59:01 +00:00
|
|
|
extern "C" {
|
|
|
|
#include <wlr/types/wlr_buffer.h>
|
|
|
|
#include <wlr/render/wlr_texture.h>
|
|
|
|
}
|
|
|
|
|
2020-01-23 05:50:01 +00:00
|
|
|
extern uint32_t currentOutputWidth;
|
|
|
|
extern uint32_t currentOutputHeight;
|
|
|
|
|
2020-01-17 09:57:39 +00:00
|
|
|
unsigned int get_time_in_milliseconds(void);
|
2020-09-05 15:49:24 +00:00
|
|
|
uint64_t get_time_in_nanos();
|
2020-09-05 16:52:24 +00:00
|
|
|
void sleep_for_nanos(uint64_t nanos);
|
|
|
|
void sleep_until_nanos(uint64_t nanos);
|
2019-10-24 01:31:18 +00:00
|
|
|
|
2020-09-13 07:31:52 +00:00
|
|
|
void steamcompmgr_main(int argc, char **argv);
|
2019-10-24 01:31:18 +00:00
|
|
|
|
2020-02-24 21:19:39 +00:00
|
|
|
#include "rendervulkan.hpp"
|
|
|
|
|
2020-01-26 22:59:51 +00:00
|
|
|
#include <mutex>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include <wlr/render/dmabuf.h>
|
|
|
|
|
2020-02-24 21:19:39 +00:00
|
|
|
#include <X11/extensions/Xfixes.h>
|
|
|
|
|
2020-01-26 22:59:51 +00:00
|
|
|
struct ResListEntry_t {
|
|
|
|
struct wlr_surface *surf;
|
2020-05-15 13:59:01 +00:00
|
|
|
struct wlr_buffer *buf;
|
2020-01-26 22:59:51 +00:00
|
|
|
};
|
|
|
|
|
2020-02-24 21:19:39 +00:00
|
|
|
struct _XDisplay;
|
|
|
|
struct _win;
|
|
|
|
|
|
|
|
class MouseCursor
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit MouseCursor(_XDisplay *display);
|
|
|
|
|
|
|
|
int x() const;
|
|
|
|
int y() const;
|
|
|
|
|
|
|
|
void move(int x, int y);
|
|
|
|
void updatePosition();
|
|
|
|
void constrainPosition();
|
|
|
|
void resetPosition();
|
|
|
|
|
|
|
|
void paint(struct _win *window, struct Composite_t *pComposite,
|
|
|
|
struct VulkanPipeline_t *pPipeline);
|
|
|
|
void setDirty();
|
|
|
|
|
2021-09-01 14:03:41 +00:00
|
|
|
// Will take ownership of data.
|
|
|
|
bool setCursorImage(char *data, int w, int h);
|
|
|
|
|
2021-09-13 06:19:08 +00:00
|
|
|
void hide() { m_lastMovedTime = 0; checkSuspension(); }
|
|
|
|
|
2020-02-24 21:19:39 +00:00
|
|
|
private:
|
|
|
|
void warp(int x, int y);
|
|
|
|
void checkSuspension();
|
|
|
|
|
2020-04-01 20:41:50 +00:00
|
|
|
void queryGlobalPosition(int &x, int &y);
|
|
|
|
void queryPositions(int &rootX, int &rootY, int &winX, int &winY);
|
2020-02-24 21:19:39 +00:00
|
|
|
void queryButtonMask(unsigned int &mask);
|
|
|
|
|
|
|
|
bool getTexture();
|
|
|
|
|
2020-08-28 07:29:52 +00:00
|
|
|
int m_x = 0, m_y = 0;
|
|
|
|
int m_hotspotX = 0, m_hotspotY = 0;
|
|
|
|
int m_width = 0, m_height = 0;
|
2020-02-24 21:19:39 +00:00
|
|
|
|
2020-08-28 07:29:52 +00:00
|
|
|
VulkanTexture_t m_texture = 0;
|
2020-02-24 21:19:39 +00:00
|
|
|
bool m_dirty;
|
|
|
|
bool m_imageEmpty;
|
|
|
|
|
2020-08-28 07:29:52 +00:00
|
|
|
unsigned int m_lastMovedTime = 0;
|
2020-02-24 21:19:39 +00:00
|
|
|
bool m_hideForMovement;
|
|
|
|
|
2020-08-28 07:29:52 +00:00
|
|
|
PointerBarrier m_scaledFocusBarriers[4] = { None };
|
2020-02-24 21:19:39 +00:00
|
|
|
|
|
|
|
_XDisplay *m_display;
|
|
|
|
};
|
|
|
|
|
2020-01-23 08:50:06 +00:00
|
|
|
extern std::mutex wayland_commit_lock;
|
|
|
|
extern std::vector<ResListEntry_t> wayland_commit_queue;
|
2020-07-03 00:40:31 +00:00
|
|
|
|
2020-07-03 01:45:00 +00:00
|
|
|
extern std::vector< wlr_surface * > wayland_surfaces_deleted;
|
|
|
|
|
2020-09-13 07:19:02 +00:00
|
|
|
extern bool hasFocusWindow;
|
|
|
|
|
2021-05-28 20:57:11 +00:00
|
|
|
// These are used for touch scaling, so it's really the window that's focused for touch
|
2020-07-03 00:40:31 +00:00
|
|
|
extern float focusedWindowScaleX;
|
|
|
|
extern float focusedWindowScaleY;
|
|
|
|
extern float focusedWindowOffsetX;
|
|
|
|
extern float focusedWindowOffsetY;
|
2021-06-10 12:48:09 +00:00
|
|
|
|
2021-10-18 03:17:30 +00:00
|
|
|
extern uint32_t inputCounter;
|
|
|
|
|
2021-06-10 12:48:09 +00:00
|
|
|
void nudge_steamcompmgr( void );
|
2021-07-28 08:12:04 +00:00
|
|
|
void take_screenshot( void );
|