diff --git a/gb.desktop/src/desktop.c b/gb.desktop/src/desktop.c index 9a56ee7a2..d37773f45 100644 --- a/gb.desktop/src/desktop.c +++ b/gb.desktop/src/desktop.c @@ -599,6 +599,21 @@ BEGIN_METHOD(CDESKTOP_minimize_window, GB_INTEGER window; GB_BOOLEAN minimized) END_METHOD + +BEGIN_METHOD_VOID(Desktop_Flush) + + XFlush(X11_display); + +END_METHOD + + +BEGIN_METHOD_VOID(Desktop_Sync) + + XSync(X11_display, FALSE); + +END_METHOD + + GB_DESC CDesktopDesc[] = { GB_DECLARE("_Desktop", 0), GB_VIRTUAL_CLASS(), @@ -623,6 +638,8 @@ GB_DESC CDesktopDesc[] = GB_STATIC_METHOD("GetWindowGeometry", "Integer[]", CDESKTOP_get_window_geometry, "(Window)i"), GB_STATIC_METHOD("MakeIcon", "Image", CDESKTOP_make_icon, "(Data)Array;[(Width)i(Height)h]"), GB_STATIC_METHOD("MinimizeWindow", NULL, CDESKTOP_minimize_window, "(Window)i(Minimized)b"), + GB_STATIC_METHOD("Sync", NULL, Desktop_Sync, NULL), + GB_STATIC_METHOD("Flush", NULL, Desktop_Flush, NULL), GB_END_DECLARE }; diff --git a/gb.desktop/src/gb.desktop/.info b/gb.desktop/src/gb.desktop/.info index be7626811..eb9c0415b 100644 --- a/gb.desktop/src/gb.desktop/.info +++ b/gb.desktop/src/gb.desktop/.info @@ -210,10 +210,18 @@ Width r i +W +r +i + Height r i +H +r +i + Name r s diff --git a/gb.desktop/src/gb.desktop/.settings b/gb.desktop/src/gb.desktop/.settings index c223030f2..daa35ae90 100644 --- a/gb.desktop/src/gb.desktop/.settings +++ b/gb.desktop/src/gb.desktop/.settings @@ -27,13 +27,13 @@ SearchString=True File[1]=".src/Desktop.class:219.24" File[2]=".src/DesktopWatcher.class:70.2" File[3]=".src/DesktopFile.class:296.7" -File[4]=".src/Main.module:154.16" +File[4]=".src/Main.module:147.12" File[5]=".src/_DesktopIcons.class:16.0" Active=6 -File[6]=".src/DesktopWindow.class:20.0" +File[6]=".src/DesktopWindow.class:87.34" File[7]=".src/Form1.class:14.0" File[8]=".src/Form1.form" -File[9]=".src/Atom.class:10.0" +File[9]=".src/Atom.class:10.43" Count=9 [Watches] diff --git a/gb.desktop/src/gb.desktop/.src/DesktopWindow.class b/gb.desktop/src/gb.desktop/.src/DesktopWindow.class index b6d3b5b9e..869865a75 100644 --- a/gb.desktop/src/gb.desktop/.src/DesktopWindow.class +++ b/gb.desktop/src/gb.desktop/.src/DesktopWindow.class @@ -4,8 +4,8 @@ Export Property Read X As Integer Property Read Y As Integer -Property Read Width As Integer -Property Read Height As Integer +Property Read Width, W As Integer +Property Read Height, H As Integer Property Read Name As String Property Read VisibleName As String Property Desktop As Integer @@ -37,7 +37,14 @@ End Private Sub GetDimensions() - If Not $aDim Then $aDim = _Desktop.GetWindowGeometry($iId) + Dim aExt As Integer[] + + If Not $aDim Then + $aDim = _Desktop.GetWindowGeometry($iId) + aExt = _Desktop.GetWindowProperty(Atom["_NET_FRAME_EXTENTS"], $iId) + $aDim[0] -= aExt[0] + $aDim[1] -= aExt[2] + Endif End @@ -83,12 +90,16 @@ Public Sub Move(X As Integer, Y As Integer, Optional Width As Integer, Optional Else _Desktop.SendClientMessageToRootWindow(Atom["_NET_MOVERESIZE_WINDOW"], [&X10001100000000, X, Y], $iId) Endif + _Desktop.Flush + Refresh End Public Sub Resize(Width As Integer, Height As Integer) _Desktop.SendClientMessageToRootWindow(Atom["_NET_MOVERESIZE_WINDOW"], [&X10110000000000, Width, Height], $iId) + _Desktop.Flush + Refresh End diff --git a/gb.desktop/src/gb.desktop/.src/Main.module b/gb.desktop/src/gb.desktop/.src/Main.module index 3d29031f6..eae126cd8 100644 --- a/gb.desktop/src/gb.desktop/.src/Main.module +++ b/gb.desktop/src/gb.desktop/.src/Main.module @@ -139,21 +139,15 @@ End Public Sub Main() - ' Dim hWindow As DesktopWindow - ' - ' 'Print Desktop.Path - ' - ' For Each hWindow In Desktop.Windows - ' Print Hex$(hWindow.Id, 8);; Quote(hWindow.Name); ": "; hWindow.X;; hWindow.Y;; hWindow.Height;; hWindow.Width - ' Next - Dim aWin As Integer[] Dim hWin As DesktopWindow For Each hWin In Desktop.Windows 'Print hWin.VisibleName If hWin.VisibleName Like "gambas3 3.3.0 - *" Then - hWin.Maximized = True - 'hWin.Move(200, 100, 800, 500) + Print hWin.X;; hWin.Y;; hWin.Width;; hWin.Height + hWin.Move(200, 100, 800, 500) + hWin.Refresh + Print hWin.X;; hWin.Y;; hWin.Width;; hWin.Height Endif Next