# Window position is not changed when a window was moved

**URL:** <https://forum.xojo.com/t/window-position-is-not-changed-when-a-window-was-moved/88260>\
**Category:** Linux\
**Created:** [May 16, 2026, 10:53am UTC](https://forum.xojo.com/t/window-position-is-not-changed-when-a-window-was-moved/88260 "2026-05-16T10:53:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Horst\_Jehle](https://forum.xojo.com/user_avatar/forum.xojo.com/horst_jehle/32/5432_2.png) [@Horst\_Jehle](https://forum.xojo.com/u/Horst_Jehle)\
**Post date:** [May 16, 2026, 10:53am UTC](https://forum.xojo.com/t/window-position-is-not-changed-when-a-window-was-moved/88260/1 "2026-05-16T10:53:36Z")

</div>

Why Window Position is not changed when a Window was moved?

> Sub Moved() Handles Moved  
> System.DebugLog “Top=” + self.Top.ToString + " Left = " + self.Left.ToString  
> End Sub

Top is always 41 and Left is always 0

Example: Linux

 ![Linux](https://forum.xojo.com/uploads/default/original/3X/c/8/c814bd795ab725b8230d371b23df9447a617bbc9.png)

Example: macOS

 ![macOS](https://forum.xojo.com/uploads/default/original/3X/b/2/b206c5f7d017758d088cad969836f093ef01de00.jpeg)

---

<div class="post-metadata">

**Author:** ![Stefan\_von\_Allmen](https://forum.xojo.com/letter_avatar_proxy/v4/letter/s/e5b9ba/32.png) [@Stefan\_von\_Allmen](https://forum.xojo.com/u/Stefan_von_Allmen)\
**Post date:** [May 16, 2026, 11:12am UTC](https://forum.xojo.com/t/window-position-is-not-changed-when-a-window-was-moved/88260/2 "2026-05-16T11:12:39Z")

</div>

How do you move the window? By Code? Using .Top and/or .Left?

What version of Xojo? There was a bug fixed in Xojo 2025r3 ([Issue #80786](https://tracker.xojo.com/xojoinc/xojo/-/issues/80786))

It worked for me using Window.Bounds in that version.

---

<div class="post-metadata">

**Author:** ![Horst\_Jehle](https://forum.xojo.com/user_avatar/forum.xojo.com/horst_jehle/32/5432_2.png) [@Horst\_Jehle](https://forum.xojo.com/u/Horst_Jehle)\
**Post date:** [May 16, 2026, 11:17am UTC](https://forum.xojo.com/t/window-position-is-not-changed-when-a-window-was-moved/88260/3 "2026-05-16T11:17:50Z")

</div>

Xojo 2026R1.2

Linux Ubuntu 24.04.3

Window moved interactive by mouse.

---

<div class="post-metadata">

**Author:** ![Horst\_Jehle](https://forum.xojo.com/user_avatar/forum.xojo.com/horst_jehle/32/5432_2.png) [@Horst\_Jehle](https://forum.xojo.com/u/Horst_Jehle)\
**Post date:** [May 16, 2026, 12:29pm UTC](https://forum.xojo.com/t/window-position-is-not-changed-when-a-window-was-moved/88260/4 "2026-05-16T12:29:53Z")

</div>

I’ve tried the following, but the values are always 0.

> Public Function GetWindowPosition(w As DesktopWindow) As Point  
> Soft Declare Function gtk\_widget\_get\_window Lib “libgtk-3.so.0” (widget As Ptr) As Ptr  
> Soft Declare Sub gdk\_window\_get\_origin Lib “libgdk-3.so.0” (window As Ptr, x As Integer, y As Integer)
> 
> // Get the underlying native widget pointer  
> Dim widgetPtr As Ptr = w.Handle  
> If widgetPtr = Nil Then Return New Point(0,0)
> 
> Dim gdkWin As Ptr = gtk\_widget\_get\_window(widgetPtr)  
> If gdkWin = Nil Then Return New Point(0,0)
> 
> Dim x As Integer  
> Dim y As Integer  
> // Call; Xojo passes integers by reference to the C function  
> gdk\_window\_get\_origin(gdkWin, x, y)
> 
> Return New Point(x, y)
> 
> End Function

> Sub Moved() Handles Moved  
> var p As Point  
> p = GetWindowPosition(self)
> 
> System.DebugLog "MOVED Top = " + p.Y.ToString + " Left = " + p.x.ToString  
> End Sub
