Add the ping/pong events to avoid non-responding window and few other minor fixes
This commit is contained in:
parent
01ffc129fb
commit
fc79ee50d0
@ -215,6 +215,8 @@ define out. */
|
|||||||
|
|
||||||
#ifdef _IRR_COMPILE_WITH_WAYLAND
|
#ifdef _IRR_COMPILE_WITH_WAYLAND
|
||||||
#define _IRR_COMPILE_WITH_EGL_
|
#define _IRR_COMPILE_WITH_EGL_
|
||||||
|
#undef _IRR_COMPILE_WITH_X11_
|
||||||
|
#undef _IRR_COMPILE_WITH_X11_DEVICE_
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//! Define _IRR_OPENGL_USE_EXTPOINTER_ if the OpenGL renderer should use OpenGL extensions via function pointers.
|
//! Define _IRR_OPENGL_USE_EXTPOINTER_ if the OpenGL renderer should use OpenGL extensions via function pointers.
|
||||||
|
@ -516,6 +516,7 @@ void IrrPrintXGrabError(int grabResult, const c8 * grabCommand )
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _IRR_COMPILE_WITH_OPENGL_
|
#ifdef _IRR_COMPILE_WITH_OPENGL_
|
||||||
|
#ifdef _IRR_COMPILE_WITH_X11_
|
||||||
static GLXContext getMeAGLContext(Display *display, GLXFBConfig glxFBConfig, bool force_legacy_context)
|
static GLXContext getMeAGLContext(Display *display, GLXFBConfig glxFBConfig, bool force_legacy_context)
|
||||||
{
|
{
|
||||||
GLXContext Context;
|
GLXContext Context;
|
||||||
@ -600,7 +601,7 @@ static GLXContext getMeAGLContext(Display *display, GLXFBConfig glxFBConfig, boo
|
|||||||
Context = glXCreateNewContext(display, glxFBConfig, GLX_RGBA_TYPE, NULL, True);
|
Context = glXCreateNewContext(display, glxFBConfig, GLX_RGBA_TYPE, NULL, True);
|
||||||
return Context;
|
return Context;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool CIrrDeviceLinux::createWindow()
|
bool CIrrDeviceLinux::createWindow()
|
||||||
|
@ -384,8 +384,27 @@ public:
|
|||||||
dev->VideoModeList.setDesktop(24, core::dimension2du(width, height));
|
dev->VideoModeList.setDesktop(24, core::dimension2du(width, height));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
handle_ping(void *data, struct wl_shell_surface *shell_surface,
|
||||||
|
uint32_t serial)
|
||||||
|
{
|
||||||
|
wl_shell_surface_pong(shell_surface, serial);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
handle_configure(void *data, struct wl_shell_surface *shell_surface,
|
||||||
|
uint32_t edges, int32_t width, int32_t height)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
handle_popup_done(void *data, struct wl_shell_surface *shell_surface)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
static const struct wl_output_listener output_listener;
|
static const struct wl_output_listener output_listener;
|
||||||
|
static const struct wl_shell_surface_listener shell_surface_listener;
|
||||||
|
|
||||||
static void registry_add (void *data, struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version) {
|
static void registry_add (void *data, struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version) {
|
||||||
CIrrDeviceWayland *dev = static_cast<CIrrDeviceWayland *>(data);
|
CIrrDeviceWayland *dev = static_cast<CIrrDeviceWayland *>(data);
|
||||||
@ -443,12 +462,20 @@ const struct wl_output_listener WaylandCallbacks::output_listener = {
|
|||||||
WaylandCallbacks::display_handle_scale
|
WaylandCallbacks::display_handle_scale
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const struct wl_shell_surface_listener WaylandCallbacks::shell_surface_listener =
|
||||||
|
{
|
||||||
|
WaylandCallbacks::handle_ping,
|
||||||
|
WaylandCallbacks::handle_configure,
|
||||||
|
WaylandCallbacks::handle_popup_done
|
||||||
|
};
|
||||||
|
|
||||||
const wl_registry_listener WaylandCallbacks::registry_listener = {
|
const wl_registry_listener WaylandCallbacks::registry_listener = {
|
||||||
WaylandCallbacks::registry_add,
|
WaylandCallbacks::registry_add,
|
||||||
WaylandCallbacks::registry_remove,
|
WaylandCallbacks::registry_remove,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//const char* wmDeleteWindow = "WM_DELETE_WINDOW";
|
//const char* wmDeleteWindow = "WM_DELETE_WINDOW";
|
||||||
|
|
||||||
//! constructor
|
//! constructor
|
||||||
@ -495,6 +522,8 @@ CIrrDeviceWayland::CIrrDeviceWayland(const SIrrlichtCreationParameters& param)
|
|||||||
|
|
||||||
wl_seat_add_listener(seat, &WaylandCallbacks::seat_listener, this);
|
wl_seat_add_listener(seat, &WaylandCallbacks::seat_listener, this);
|
||||||
wl_output_add_listener(output, &WaylandCallbacks::output_listener, this);
|
wl_output_add_listener(output, &WaylandCallbacks::output_listener, this);
|
||||||
|
|
||||||
|
shell_surface = NULL;
|
||||||
|
|
||||||
// create keymap
|
// create keymap
|
||||||
createKeyMap();
|
createKeyMap();
|
||||||
@ -532,6 +561,8 @@ CIrrDeviceWayland::~CIrrDeviceWayland()
|
|||||||
wl_keyboard_destroy(keyboard);
|
wl_keyboard_destroy(keyboard);
|
||||||
wl_pointer_destroy(pointer);
|
wl_pointer_destroy(pointer);
|
||||||
wl_seat_destroy(seat);
|
wl_seat_destroy(seat);
|
||||||
|
if (shell_surface)
|
||||||
|
wl_shell_surface_destroy(shell_surface);
|
||||||
wl_registry_destroy(registry);
|
wl_registry_destroy(registry);
|
||||||
wl_display_flush(display);
|
wl_display_flush(display);
|
||||||
wl_display_disconnect(display);
|
wl_display_disconnect(display);
|
||||||
@ -592,6 +623,9 @@ bool CIrrDeviceWayland::createWindow()
|
|||||||
surface = wl_compositor_create_surface(compositor);
|
surface = wl_compositor_create_surface(compositor);
|
||||||
shell_surface = wl_shell_get_shell_surface(shell, surface);
|
shell_surface = wl_shell_get_shell_surface(shell, surface);
|
||||||
|
|
||||||
|
wl_shell_surface_add_listener(shell_surface,
|
||||||
|
&WaylandCallbacks::shell_surface_listener, this);
|
||||||
|
|
||||||
if (CreationParams.Fullscreen)
|
if (CreationParams.Fullscreen)
|
||||||
{
|
{
|
||||||
wl_shell_surface_set_fullscreen(shell_surface,
|
wl_shell_surface_set_fullscreen(shell_surface,
|
||||||
|
@ -978,7 +978,7 @@ bool COpenGLDriver::endScene()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _IRR_COMPILE_WITH_X11_DEVICE_
|
#ifdef _IRR_COMPILE_WITH_WAYLAND
|
||||||
if (DeviceType == EIDT_WAYLAND)
|
if (DeviceType == EIDT_WAYLAND)
|
||||||
{
|
{
|
||||||
wl_display_dispatch_pending(wl_device->display);
|
wl_display_dispatch_pending(wl_device->display);
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#include "utils/translation.hpp"
|
#include "utils/translation.hpp"
|
||||||
#include "utils/time.hpp"
|
#include "utils/time.hpp"
|
||||||
|
|
||||||
|
#include "../../../lib/irrlicht/include/IrrCompileConfig.h"
|
||||||
#include "../../../lib/irrlicht/source/Irrlicht/CIrrDeviceLinux.h"
|
#include "../../../lib/irrlicht/source/Irrlicht/CIrrDeviceLinux.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user