When RequestMoveToServer() or RequestResizeToServer() is called, window start to be moved or resized by display server.
After the action is finished, server send the completed event.
This patch is to received the events.
--- /dev/null
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+namespace Tizen.NUI
+{
+ internal static partial class Interop
+ {
+ internal static partial class WindowMoveCompletedSignal
+ {
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_Move_Completed_Signal")]
+ public static extern global::System.IntPtr GetSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Move_Completed_Signal_Empty")]
+ [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)]
+ public static extern bool Empty(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Move_Completed_Signal_GetConnectionCount")]
+ public static extern uint GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Move_Completed_Signal_Connect")]
+ public static extern void Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Move_Completed_Signal_Disconnect")]
+ public static extern void Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Move_Completed_Signal_Emit")]
+ [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)]
+ public static extern bool Emit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_Move_Completed_Signal")]
+ public static extern global::System.IntPtr NewSignal();
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_Move_Completed_Signal")]
+ public static extern void DeleteSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
+ }
+ }
+}
--- /dev/null
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+namespace Tizen.NUI
+{
+ internal static partial class Interop
+ {
+ internal static partial class WindowResizeCompletedSignal
+ {
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_Resize_Completed_Signal")]
+ public static extern global::System.IntPtr GetSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Resize_Completed_Signal_Empty")]
+ [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)]
+ public static extern bool Empty(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Resize_Completed_Signal_GetConnectionCount")]
+ public static extern uint GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Resize_Completed_Signal_Connect")]
+ public static extern void Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Resize_Completed_Signal_Disconnect")]
+ public static extern void Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Resize_Completed_Signal_Emit")]
+ [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)]
+ public static extern bool Emit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_Resize_Completed_Signal")]
+ public static extern global::System.IntPtr NewSignal();
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_Resize_Completed_Signal")]
+ public static extern void DeleteSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
+ }
+ }
+}
--- /dev/null
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+namespace Tizen.NUI
+{
+ internal class WindowMoveCompletedSignal : Disposable
+ {
+ internal WindowMoveCompletedSignal(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
+ {
+ }
+
+ protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
+ {
+ Interop.WindowMoveCompletedSignal.DeleteSignal(swigCPtr);
+ }
+
+ public bool Empty()
+ {
+ bool ret = Interop.WindowMoveCompletedSignal.Empty(SwigCPtr);
+
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ public uint GetConnectionCount()
+ {
+ uint ret = Interop.WindowMoveCompletedSignal.GetConnectionCount(SwigCPtr);
+
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ public void Connect(System.Delegate func)
+ {
+ System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
+ {
+ Interop.WindowMoveCompletedSignal.Connect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+ }
+
+ public void Disconnect(System.Delegate func)
+ {
+ System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
+ {
+ Interop.WindowMoveCompletedSignal.Disconnect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+ }
+
+ public bool Emit(Window window, Position2D position)
+ {
+ bool ret = Interop.WindowMoveCompletedSignal.Emit(SwigCPtr, Window.getCPtr(window), Position2D.getCPtr(position));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ public WindowMoveCompletedSignal(Window window) : this(Interop.WindowMoveCompletedSignal.GetSignal(Window.getCPtr(window)), false)
+ {
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+ }
+}
--- /dev/null
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+namespace Tizen.NUI
+{
+ internal class WindowResizeCompletedSignal : Disposable
+ {
+ internal WindowResizeCompletedSignal(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
+ {
+ }
+
+ protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
+ {
+ Interop.WindowResizeCompletedSignal.DeleteSignal(swigCPtr);
+ }
+
+ public bool Empty()
+ {
+ bool ret = Interop.WindowResizeCompletedSignal.Empty(SwigCPtr);
+
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ public uint GetConnectionCount()
+ {
+ uint ret = Interop.WindowResizeCompletedSignal.GetConnectionCount(SwigCPtr);
+
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ public void Connect(System.Delegate func)
+ {
+ System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
+ {
+ Interop.WindowResizeCompletedSignal.Connect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+ }
+
+ public void Disconnect(System.Delegate func)
+ {
+ System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
+ {
+ Interop.WindowResizeCompletedSignal.Disconnect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+ }
+
+ public bool Emit(Window window, Size2D size)
+ {
+ bool ret = Interop.WindowResizeCompletedSignal.Emit(SwigCPtr, Window.getCPtr(window), Size2D.getCPtr(size));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ public WindowResizeCompletedSignal(Window window) : this(Interop.WindowResizeCompletedSignal.GetSignal(Window.getCPtr(window)), false)
+ {
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+ }
+}
private KeyboardRepeatSettingsChangedEventCallbackType keyboardRepeatSettingsChangedEventCallback;
private AuxiliaryMessageEventCallbackType auxiliaryMessageEventCallback;
private WindowMouseInOutEventCallbackType windowMouseInOutEventCallback;
+ private MoveCompletedEventCallbackType moveCompletedEventCallback;
+ private ResizeCompletedEventCallbackType resizeCompletedEventCallback;
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void WindowFocusChangedEventCallbackType(IntPtr window, bool focusGained);
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate bool InterceptKeyEventDelegateType(IntPtr arg1);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void WindowMouseInOutEventCallbackType(IntPtr window, IntPtr mouseEvent);
+ [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+ private delegate void MoveCompletedEventCallbackType(IntPtr window, IntPtr position);
+ [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+ private delegate void ResizeCompletedEventCallbackType(IntPtr window, IntPtr size);
+
/// <summary>
/// FocusChanged event.
}
/// <summary>
- /// Emits the event when the window resized.
+ /// Emits the event when window is resized by user or the display server.<br />
/// </summary>
/// <since_tizen> 3 </since_tizen>
public event EventHandler<ResizedEventArgs> Resized
}
/// <summary>
- /// MovedEvent
+ /// Emits the event when window is moved by user or the display server.<br />
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public event EventHandler<WindowMovedEventArgs> Moved
}
}
+ /// <summary>
+ /// Emits the event when window has been moved by the display server.<br />
+ /// To make the window move by display server, RequestMoveToServer() should be called.<br />
+ /// After the moving job is completed, this signal will be emitted.<br />
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public event EventHandler<WindowMoveCompletedEventArgs> MoveCompleted
+ {
+ add
+ {
+ if (moveCompletedHandler == null)
+ {
+ moveCompletedEventCallback = OnMoveCompleted;
+ using WindowMoveCompletedSignal signal = new WindowMoveCompletedSignal(Interop.WindowMoveCompletedSignal.GetSignal(SwigCPtr), false);
+ signal.Ensure()?.Connect(moveCompletedEventCallback);
+ }
+ moveCompletedHandler += value;
+ }
+ remove
+ {
+ moveCompletedHandler -= value;
+ if (moveCompletedHandler == null && moveCompletedEventCallback != null)
+ {
+ using WindowMoveCompletedSignal signal = new WindowMoveCompletedSignal(Interop.WindowMoveCompletedSignal.GetSignal(SwigCPtr), false);
+ signal.Ensure()?.Disconnect(moveCompletedEventCallback);
+ moveCompletedEventCallback = null;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Emits the event when window has been resized by the display server.<br />
+ /// To make the window resize by display server, RequestResizeToServer() should be called.<br />
+ /// After the resizing job is completed, this signal will be emitted.<br />
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public event EventHandler<WindowResizeCompletedEventArgs> ResizeCompleted
+ {
+ add
+ {
+ if (resizeCompletedHandler == null)
+ {
+ resizeCompletedEventCallback = OnResizeCompleted;
+ using WindowResizeCompletedSignal signal = new WindowResizeCompletedSignal(Interop.WindowResizeCompletedSignal.GetSignal(SwigCPtr), false);
+ signal.Ensure()?.Connect(resizeCompletedEventCallback);
+ }
+ resizeCompletedHandler += value;
+ }
+ remove
+ {
+ resizeCompletedHandler -= value;
+ if (resizeCompletedHandler == null && resizeCompletedEventCallback != null)
+ {
+ using WindowResizeCompletedSignal signal = new WindowResizeCompletedSignal(Interop.WindowResizeCompletedSignal.GetSignal(SwigCPtr), false);
+ signal.Ensure()?.Disconnect(resizeCompletedEventCallback);
+ resizeCompletedEventCallback = null;
+ }
+ }
+ }
+
private event EventHandler<FocusChangedEventArgs> windowFocusChangedEventHandler;
private event EventHandler<TouchEventArgs> rootLayerTouchDataEventHandler;
private ReturnTypeEventHandler<object, TouchEventArgs, bool> rootLayerInterceptTouchDataEventHandler;
private event EventHandler keyboardRepeatSettingsChangedHandler;
private event EventHandler<AuxiliaryMessageEventArgs> auxiliaryMessageEventHandler;
private event EventHandler<MouseInOutEventArgs> windowMouseInOutEventHandler;
+ private event EventHandler<WindowMoveCompletedEventArgs> moveCompletedHandler;
+ private event EventHandler<WindowResizeCompletedEventArgs> resizeCompletedHandler;
internal event EventHandler EventProcessingFinished
windowMouseInOutEventCallback = null;
}
+ if (moveCompletedEventCallback != null)
+ {
+ using WindowMoveCompletedSignal signal = new WindowMoveCompletedSignal(Interop.WindowMoveCompletedSignal.GetSignal(GetBaseHandleCPtrHandleRef), false);
+ signal?.Disconnect(moveCompletedEventCallback);
+ moveCompletedEventCallback = null;
+ }
+
+ if (resizeCompletedEventCallback != null)
+ {
+ using WindowResizeCompletedSignal signal = new WindowResizeCompletedSignal(Interop.WindowResizeCompletedSignal.GetSignal(GetBaseHandleCPtrHandleRef), false);
+ signal?.Disconnect(resizeCompletedEventCallback);
+ resizeCompletedEventCallback = null;
+ }
}
private void OnWindowFocusedChanged(IntPtr window, bool focusGained)
}
}
+ private void OnMoveCompleted(IntPtr window, IntPtr position)
+ {
+ if (window == global::System.IntPtr.Zero)
+ {
+ return;
+ }
+
+ if (moveCompletedHandler != null)
+ {
+ WindowMoveCompletedEventArgs e = new WindowMoveCompletedEventArgs(this.WindowPosition);
+ moveCompletedHandler(this, e);
+ }
+ return;
+ }
+
+ private void OnResizeCompleted(IntPtr window, IntPtr size)
+ {
+ if (window == global::System.IntPtr.Zero)
+ {
+ return;
+ }
+
+ if (resizeCompletedHandler != null)
+ {
+ WindowResizeCompletedEventArgs e = new WindowResizeCompletedEventArgs(this.WindowSize);
+ resizeCompletedHandler(this, e);
+ }
+ return;
+ }
+
/// <summary>
/// The focus changed event argument.
/// </summary>
}
/// <summary>
- /// MovedArgs
+ /// Move event is sent when window is resized by user or the display server.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public class WindowMovedEventArgs : EventArgs
}
}
}
+
+ /// <summary>
+ /// Move Completed event is sent when window has been moved the display server.
+ /// It is triggered by calling RequestMoveToServer().
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class WindowMoveCompletedEventArgs : EventArgs
+ {
+ public WindowMoveCompletedEventArgs(Position2D completedPosition)
+ {
+ WindowCompletedPosition = completedPosition;
+ }
+
+ public Position2D WindowCompletedPosition
+ {
+ get;
+ private set;
+ }
+ }
+
+ /// <summary>
+ /// Resize Completed event is sent when window has been resized the display server.
+ /// It is triggered by calling RequestResizeToServer().
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class WindowResizeCompletedEventArgs : EventArgs
+ {
+ public WindowResizeCompletedEventArgs(Size2D completedSize)
+ {
+ WindowCompletedSize = completedSize;
+ }
+
+ public Size2D WindowCompletedSize
+ {
+ get;
+ private set;
+ }
+ }
+
}
log.Fatal(tag, $"OnWindowMoved() called!, x:{position.X}, y:{position.Y}");
}
+ private void OnWindowMoveCompleted(object sender, WindowMoveCompletedEventArgs e)
+ {
+ Position2D position = e.WindowCompletedPosition;
+ log.Fatal(tag, $"OnWindowMoveCompleted() called!, x:{position.X}, y:{position.Y}");
+ }
+
+ private void OnWindowResizeCompleted(object sender, WindowResizeCompletedEventArgs e)
+ {
+ Size2D size = e.WindowCompletedSize;
+ log.Fatal(tag, $"OnWindowResizeCompleted() called!, width:{size.Width}, height:{size.Height}");
+ }
+
void CreateSubWindowOne()
{
if (subWindowOne == null)
subWindowOne.KeyEvent += OnKeyEvent;
subWindowOne.Moved += OnWindowMoved;
+ subWindowOne.MoveCompleted += OnWindowMoveCompleted;
+ subWindowOne.ResizeCompleted += OnWindowResizeCompleted;
}
else
{
log.Fatal(tag, $"OnWindowMoved2() called!, x:{position.X}, y:{position.Y}");
}
+ private void OnWindowMoveCompleted2(object sender, WindowMoveCompletedEventArgs e)
+ {
+ Position2D position = e.WindowCompletedPosition;
+ log.Fatal(tag, $"OnWindowMoveCompleted2() called!, x:{position.X}, y:{position.Y}");
+ }
+
+ private void OnWindowResizeCompleted2(object sender, WindowResizeCompletedEventArgs e)
+ {
+ Size2D size = e.WindowCompletedSize;
+ log.Fatal(tag, $"OnWindowResizeCompleted2() called!, width:{size.Width}, height:{size.Height}");
+ }
+
void CreateSubWindowTwo()
{
if (subWindowTwo == null)
subWindowTwo.Add(root);
subWindowTwo.Moved += OnWindowMoved2;
+ subWindowTwo.MoveCompleted += OnWindowMoveCompleted2;
+ subWindowTwo.ResizeCompleted += OnWindowResizeCompleted2;
}
else
{