#define DALI_INTERNAL_WINDOW_SYSTEM_COMMON_WINDOW_SYSTEM_H
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
KEY_DOWN,
KEY_UP,
SELECTION_CLEAR,
- SELECTION_NOTIFY
+ SELECTION_NOTIFY,
+ CONFIGURE_NOTIFY,
};
/**
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// Window Callbacks
/////////////////////////////////////////////////////////////////////////////////////////////////
+static Eina_Bool EcoreEventWindowConfigure(void* data, int type, void* event)
+{
+ WindowBaseEcoreX* windowBase = static_cast<WindowBaseEcoreX*>(data);
+ if(windowBase)
+ {
+ windowBase->OnWindowConfigure(event);
+ }
+
+ return ECORE_CALLBACK_PASS_ON;
+}
+
static Eina_Bool EcoreEventWindowPropertyChanged(void* data, int type, void* event)
{
WindowBaseEcoreX* windowBase = static_cast<WindowBaseEcoreX*>(data);
// Enable Drag & Drop
ecore_x_dnd_aware_set(mEcoreWindow, EINA_TRUE);
+ mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_X_EVENT_WINDOW_CONFIGURE, EcoreEventWindowConfigure, this));
mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY, EcoreEventWindowPropertyChanged, this));
mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DELETE_REQUEST, EcoreEventWindowDeleteRequest, this));
mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_X_EVENT_SELECTION_NOTIFY, EcoreEventSelectionNotify, this));
}
+void WindowBaseEcoreX::OnWindowConfigure(void* event)
+{
+ auto configure = static_cast<Ecore_X_Event_Window_Configure*>(event);
+ if(configure->win == mEcoreWindow)
+ {
+ Dali::PositionSize positionSize;
+ positionSize.x = configure->x;
+ positionSize.y = configure->y;
+ positionSize.width = configure->w;
+ positionSize.height = configure->h;
+ mUpdatePositionSizeSignal.Emit(positionSize);
+ }
+}
+
Eina_Bool WindowBaseEcoreX::OnWindowPropertyChanged(void* data, int type, void* event)
{
Ecore_X_Event_Window_Property* propertyChangedEvent = static_cast<Ecore_X_Event_Window_Property*>(event);
#define DALI_INTERNAL_WINDOWSYSTEM_ECOREX_WINDOW_BASE_ECORE_X_H
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
public:
/**
+ * @brief Called when the window configuration is changed.
+ */
+ void OnWindowConfigure(void* event);
+
+ /**
* @brief Called when the window property is changed.
*/
Eina_Bool OnWindowPropertyChanged(void* data, int type, void* event);
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// Window Callbacks
/////////////////////////////////////////////////////////////////////////////////////////////////
+static bool EventWindowConfigureNotify(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
+{
+ WindowBaseX* windowBase = static_cast<WindowBaseX*>(data);
+ if(windowBase)
+ {
+ windowBase->OnConfigure(event);
+ }
+
+ return false;
+}
+
static bool EventWindowPropertyChanged(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event)
{
WindowBaseX* windowBase = static_cast<WindowBaseX*>(data);
void WindowBaseX::SetupEvents()
{
auto& windowSystem = WindowSystem::GetImplementation();
+ windowSystem.AddEventHandler(WindowSystemBase::Event::CONFIGURE_NOTIFY, EventWindowConfigureNotify, this);
windowSystem.AddEventHandler(WindowSystemBase::Event::PROPERTY_NOTIFY, EventWindowPropertyChanged, this);
windowSystem.AddEventHandler(WindowSystemBase::Event::DELETE_REQUEST, EventWindowDeleteRequest, this);
windowSystem.AddEventHandler(WindowSystemBase::Event::FOCUS_IN, EventWindowFocusIn, this);
return handled;
}
+void WindowBaseX::OnConfigure(WindowSystemBase::EventBase* event)
+{
+ auto configureEvent = static_cast<WindowSystemX::X11ConfigureNotifyEvent*>(event);
+ if(configureEvent->window == mWindow)
+ {
+ DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "Window::OnConfigureNotify\n");
+ Dali::PositionSize positionSize;
+ positionSize.x = configureEvent->x;
+ positionSize.y = configureEvent->y;
+ positionSize.width = configureEvent->width;
+ positionSize.height = configureEvent->height;
+ /// @note Can also get the window below this one if raise/lower was called.
+ mUpdatePositionSizeSignal.Emit(positionSize);
+ }
+}
+
void WindowBaseX::OnDeleteRequest()
{
mDeleteRequestSignal.Emit();
#define DALI_INTERNAL_WINDOW_SYSTEM_X11_WINDOW_BASE_X_H
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
public:
/**
+ * @brief Called when the window has been moved/resized
+ */
+ void OnConfigure(WindowSystemBase::EventBase* event);
+
+ /**
* @brief Called when the window property is changed.
*/
bool OnWindowPropertyChanged(void* data, WindowSystemBase::Event type, WindowSystemBase::EventBase* event);
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
::Window* window;
};
+void ConfigureNotifyEventHandler(const XEvent* xevent)
+{
+ WindowSystemX::X11ConfigureNotifyEvent configureNotify;
+ configureNotify.window = xevent->xconfigure.window;
+ configureNotify.event = xevent;
+
+ configureNotify.x = xevent->xconfigure.x;
+ configureNotify.y = xevent->xconfigure.y;
+ configureNotify.width = xevent->xconfigure.width;
+ configureNotify.height = xevent->xconfigure.height;
+
+ GetImplementation().TriggerEventHandler(WindowSystemBase::Event::CONFIGURE_NOTIFY, configureNotify);
+}
+
void PropertyNotifyEventHandler(const XEvent* xevent)
{
WindowSystemX::X11PropertyNotifyEvent propertyNotifyEvent;
mXEventHandlers[KeyRelease] = &KeyReleaseEventHandler;
mXEventHandlers[SelectionClear] = &SelectionClearEventHandler;
mXEventHandlers[SelectionNotify] = &SelectionNotifyEventHandler;
+ mXEventHandlers[ConfigureNotify] = &ConfigureNotifyEventHandler;
}
void InitializeInput()
EnterWindowMask |
LeaveWindowMask |
PointerMotionMask |
+ StructureNotifyMask |
ExposureMask |
VisibilityChangeMask |
StructureNotifyMask |
#define DALI_INTERNAL_WINDOW_SYSTEM_X11_WINDOW_SYSTEM_H
/*
- * COPYRIGHT (c) 2022 Samsung Electronics Co., Ltd.
+ * COPYRIGHT (c) 2023 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
};
/**
+ * Event struct that is sent when a window is moved/resized/lowered/raised
+ */
+ struct X11ConfigureNotifyEvent : public X11Event
+ {
+ int x; // Relative to parent window's origin.
+ int y;
+ int width;
+ int height;
+ ::Window above; // The window that this is now above.
+ };
+
+ /**
* Event struct that is sent when a window property is changed.
*/
struct X11PropertyNotifyEvent : public X11Event