Use maximum display resolution for the window size

Instead of it being hardcoded to 1440p.
This commit is contained in:
Robbert van der Helm
2020-04-28 11:47:39 +02:00
parent ed54308b45
commit 8adb944445
3 changed files with 70 additions and 36 deletions
+28 -9
View File
@@ -32,6 +32,14 @@
#include <optional>
#include <string>
/**
* Used to store the maximum width and height of a screen.
*/
struct Size {
uint16_t width;
uint16_t height;
};
/**
* A basic RAII wrapper around the Win32 window class system, for use in the
* Editor class below.
@@ -100,10 +108,27 @@ class Editor {
void handle_events();
private:
/**
* A pointer to the currently active window. Will be a null pointer if no
* window is active.
*/
std::unique_ptr<xcb_connection_t, decltype(&xcb_disconnect)> x11_connection;
/**
* The Wine window's client area, or the maximum size of that window. This
* will be set to a size that's large enough to be able to enter full screen
* on a single display. This is more of a theoretical maximum size, as the
* plugin will only use a portion of this window to draw to. Because we're
* not changing the size of the Wine window and simply letting the user or
* the host resize the X11 parent window it's been embedded in instead,
* resizing will feel smooth and native.
*/
const Size client_area;
/**
* The Win32 window class registered for the windows window.
*/
WindowClass window_class;
const WindowClass window_class;
public:
/**
@@ -117,20 +142,14 @@ class Editor {
/**
* The window handle of the editor window created by the DAW.
*/
xcb_window_t parent_window;
const xcb_window_t parent_window;
/**
* The X11 window handle of the window belonging to `win32_handle`.
*/
xcb_window_t child_window;
const xcb_window_t child_window;
/**
*Needed to handle idle updates through a timer
*/
AEffect* plugin;
/**
* A pointer to the currently active window. Will be a null pointer if no
* window is active.
*/
std::unique_ptr<xcb_connection_t, decltype(&xcb_disconnect)> x11_connection;
};