[Libreoffice-commits] core.git: include/vcl

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Thu Oct 22 06:06:56 UTC 2020


 include/vcl/sysdata.hxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5d422c0348efd1df6b3d44dd6efcf5c5490fc321
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Wed Oct 21 17:41:53 2020 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Thu Oct 22 08:06:15 2020 +0200

    Revert "sal_uIntPtr->unsigned long in SystemEnvData"
    
    This reverts commit c0f1d211eff5f89f5c9298743f6e7d91d187b799, which states that
    it changed the type of UNX-only SystemEnvData::aWindow from sal_uIntPtr to
    unsigned long "to match the type used by X11".  (And while resource IDs used for
    windows etc. are apparently 32-bit in the X11 protocol, see e.g.
    <https://www.x.org/releases/X11R7.7/doc/xproto/x11protocol.html>, Xlib and the
    underlying /usr/include/X11/Xdefs.h indeed appear to be somewhat confused
    whether the typedef for XID should be unsigned long (presumably stemming from
    times when long was universally 32-bit) or CARD32, see e.g.
    <https://gitlab.freedesktop.org/xorg/proto/xorgproto/-/blob/master/include/X11/
    Xdefs.h>.)
    
    But at least for GTK3/Wayland, the sal_uIntPtr values returned by
    GtkSalFrame::GetNativeWindowHandle (in vcl/unx/gtk3/gtk3gtkframe.cxx, and which
    are stored in SystemEnvData::aWindow in GtkSalFrame::InitCommon,
    vcl/unx/gtk3/gtk3gtkframe.cxx, and GtkSalObjectBase::Init,
    vcl/unx/gtk3/gtk3gtkobject.cxx) as
    
    > return reinterpret_cast<sal_uIntPtr>(gdk_wayland_window_get_wl_surface(pWindow));
    
    are struct wl_surface* values, so sal_uIntPtr looks like the overall more
    appropriate type after all.
    
    (The part of c0f1d211eff5f89f5c9298743f6e7d91d187b799 that dropped the somewhat
    needless C-style-cast converting aWindow from sal_uIntPtr to sal_IntPtr in
    SystemChildWindow::GetParentWindowHandle, vcl/source/window/syschild.cxx, has
    not been reverted, though.)
    
    Change-Id: I8fea062126eacd2d6dc44dab14d5240c4b9946e9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104639
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/include/vcl/sysdata.hxx b/include/vcl/sysdata.hxx
index 14685c3b9d61..0957f5cc11a7 100644
--- a/include/vcl/sysdata.hxx
+++ b/include/vcl/sysdata.hxx
@@ -62,7 +62,7 @@ struct SystemEnvData
     enum class Platform { Wayland, Xcb };
 
     void*               pDisplay;       // the relevant display connection
-    unsigned long       aWindow;        // the window of the object
+    sal_uIntPtr         aWindow;        // the window of the object
     void*               pSalFrame;      // contains a salframe, if object has one
     void*               pWidget;        // the corresponding widget
     void*               pVisual;        // the visual in use


More information about the Libreoffice-commits mailing list