[gimp] libgimp: change signature of get_window() of GimpProgressVtable.



commit a021b1999af2d5a62372deb594479b19bc048f78
Author: Jehan <jehan girinstud io>
Date:   Wed Sep 28 22:41:05 2022 +0200

    libgimp: change signature of get_window() of GimpProgressVtable.
    
    As diagnosed in #8649, using a guint32 for windows identifier may have been
    right long ago (was it?), but is definitely not anymore. I can see that a XID is
    an unsigned long nowadays (usually 64-bit on 64-bit Linux).
    
    As far as I can see, on Windows, it would be a void* behind (which also
    corresponds to the error message in #8649 description):
    
    > typedef void *PVOID;
    > typedef PVOID HANDLE;
    > typedef HANDLE HWND;
    
    Cf. https://learn.microsoft.com/en-us/windows/win32/winprog/windows-data-types
    
    I *think* that pointers would be 64-bit on Windows 64-bit, though I'm unsure
    (after all, this is an OS with 32-bit long int on 64-bit arch!).
    
    Anyway, it's just better to move to 64-bit window identifiers.

 libgimp/gimpprogress.c    | 2 +-
 libgimp/gimpprogress.h    | 2 +-
 libgimp/gimpprogressbar.c | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/libgimp/gimpprogress.c b/libgimp/gimpprogress.c
index 72a9aa8cd7..58de97c689 100644
--- a/libgimp/gimpprogress.c
+++ b/libgimp/gimpprogress.c
@@ -382,7 +382,7 @@ gimp_temp_progress_run (GimpProcedure        *procedure,
     case GIMP_PROGRESS_COMMAND_GET_WINDOW:
       {
         GimpValueArray *return_vals;
-        guint32         window_id = 0;
+        guint64         window_id = 0;
 
         if (progress_data->vtable.get_window)
           window_id = progress_data->vtable.get_window (progress_data->data);
diff --git a/libgimp/gimpprogress.h b/libgimp/gimpprogress.h
index 30f33f7255..82aa2a9658 100644
--- a/libgimp/gimpprogress.h
+++ b/libgimp/gimpprogress.h
@@ -81,7 +81,7 @@ typedef void (* GimpProgressVtablePulseFunc) (gpointer user_data);
  *
  * Returns: the ID of the window where the progress is displayed.
  */
-typedef guint32 (* GimpProgressVtableGetWindowFunc) (gpointer user_data);
+typedef guint64 (* GimpProgressVtableGetWindowFunc) (gpointer user_data);
 
 
 typedef struct _GimpProgressVtable GimpProgressVtable;
diff --git a/libgimp/gimpprogressbar.c b/libgimp/gimpprogressbar.c
index e026854dbe..a397c4d914 100644
--- a/libgimp/gimpprogressbar.c
+++ b/libgimp/gimpprogressbar.c
@@ -63,7 +63,7 @@ static void     gimp_progress_bar_set_text   (const gchar *message,
 static void     gimp_progress_bar_set_value  (gdouble      percentage,
                                               gpointer     user_data);
 static void     gimp_progress_bar_pulse      (gpointer     user_data);
-static guint32  gimp_progress_bar_get_window (gpointer     user_data);
+static guint64  gimp_progress_bar_get_window (gpointer     user_data);
 
 
 G_DEFINE_TYPE (GimpProgressBar, gimp_progress_bar, GTK_TYPE_PROGRESS_BAR)
@@ -180,7 +180,7 @@ gimp_progress_bar_pulse (gpointer user_data)
       gtk_main_iteration ();
 }
 
-static guint32
+static guint64
 gimp_window_get_native_id (GtkWindow *window)
 {
   GdkWindow *surface;
@@ -209,7 +209,7 @@ gimp_window_get_native_id (GtkWindow *window)
   return 0;
 }
 
-static guint32
+static guint64
 gimp_progress_bar_get_window (gpointer user_data)
 {
   GimpProgressBar *bar = GIMP_PROGRESS_BAR (user_data);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]