GHOST/wayland: use 'is_dialog' flag to prevent drawing into same window

This commit is contained in:
Christian Rauch 2020-05-30 12:23:39 +01:00
parent 2ee94c954d
commit 63bcee81f6
3 changed files with 14 additions and 1 deletions

View File

@ -1527,7 +1527,7 @@ GHOST_IWindow *GHOST_SystemWayland::createWindow(const char *title,
GHOST_TDrawingContextType type,
GHOST_GLSettings glSettings,
const bool exclusive,
const bool /*is_dialog*/,
const bool is_dialog,
const GHOST_IWindow *parentWindow)
{
GHOST_WindowWayland *window = new GHOST_WindowWayland(
@ -1540,6 +1540,7 @@ GHOST_IWindow *GHOST_SystemWayland::createWindow(const char *title,
state,
parentWindow,
type,
is_dialog,
((glSettings.flags & GHOST_glStereoVisual) != 0),
exclusive);

View File

@ -39,6 +39,7 @@ struct window_t {
bool is_maximised;
bool is_fullscreen;
bool is_active;
bool is_dialog;
int32_t width, height;
};
@ -144,6 +145,7 @@ GHOST_WindowWayland::GHOST_WindowWayland(GHOST_SystemWayland *system,
GHOST_TWindowState state,
const GHOST_IWindow *parentWindow,
GHOST_TDrawingContextType type,
const bool is_dialog,
const bool stereoVisual,
const bool exclusive)
: GHOST_Window(width, height, state, stereoVisual, exclusive),
@ -155,6 +157,8 @@ GHOST_WindowWayland::GHOST_WindowWayland(GHOST_SystemWayland *system,
w->width = int32_t(width);
w->height = int32_t(height);
w->is_dialog = is_dialog;
/* Window surfaces. */
w->surface = wl_compositor_create_surface(m_system->compositor());
w->egl_window = wl_egl_window_create(w->surface, int(width), int(height));
@ -376,6 +380,11 @@ GHOST_TSuccess GHOST_WindowWayland::endFullScreen() const
return GHOST_kSuccess;
}
bool GHOST_WindowWayland::isDialog() const
{
return w->is_dialog;
}
/**
* \param type The type of rendering context create.
* \return Indication of success.

View File

@ -42,6 +42,7 @@ class GHOST_WindowWayland : public GHOST_Window {
GHOST_TWindowState state,
const GHOST_IWindow *parentWindow,
GHOST_TDrawingContextType type,
const bool is_dialog,
const bool stereoVisual,
const bool exclusive);
@ -106,6 +107,8 @@ class GHOST_WindowWayland : public GHOST_Window {
GHOST_TSuccess endFullScreen() const override;
bool isDialog() const override;
private:
GHOST_SystemWayland *m_system;
struct window_t *w;