Skip to content

Instantly share code, notes, and snippets.

@danielhams
Created July 20, 2020 11:27
Show Gist options
  • Save danielhams/6c48e347160447b8a70acc4a2d72c38c to your computer and use it in GitHub Desktop.
Save danielhams/6c48e347160447b8a70acc4a2d72c38c to your computer and use it in GitHub Desktop.
diff -u -r gtk+-2.24.32-orig/demos/testpixbuf-color.c gtk+-2.24.32/demos/testpixbuf-color.c
--- gtk+-2.24.32-orig/demos/testpixbuf-color.c 2016-10-22 05:10:51.000000000 +0000
+++ gtk+-2.24.32/demos/testpixbuf-color.c 2020-07-18 15:49:18.220881080 +0000
@@ -6,7 +6,7 @@
#include <gtk/gtk.h>
-#define ICC_PROFILE "/usr/share/color/icc/bluish.icc"
+#define ICC_PROFILE "/usr/sgug/share/color/icc/bluish.icc"
#define ICC_PROFILE_SIZE 3966
static gboolean
diff -u -r gtk+-2.24.32-orig/docs/tools/shadow.c gtk+-2.24.32/docs/tools/shadow.c
--- gtk+-2.24.32-orig/docs/tools/shadow.c 2016-10-22 05:12:59.000000000 +0000
+++ gtk+-2.24.32/docs/tools/shadow.c 2020-07-18 15:49:18.222453640 +0000
@@ -1,3 +1,7 @@
+#if defined(__sgi)
+#include <math.h>
+#endif
+
#include "shadow.h"
#include <math.h>
diff -u -r gtk+-2.24.32-orig/gdk/x11/gdkasync.c gtk+-2.24.32/gdk/x11/gdkasync.c
--- gtk+-2.24.32-orig/gdk/x11/gdkasync.c 2016-10-22 05:09:13.000000000 +0000
+++ gtk+-2.24.32/gdk/x11/gdkasync.c 2020-07-18 15:49:18.224551720 +0000
@@ -43,6 +43,10 @@
in this Software without prior written authorization from The Open Group.
*/
+#if defined(__sgi)
+#include <string.h>
+#include <bstring.h>
+#endif
#include "config.h"
#ifdef NEED_XIPROTO_H_FOR_XREPLY
#include <X11/extensions/XIproto.h>
diff -u -r gtk+-2.24.32-orig/gdk/x11/gdkdisplay-x11.c gtk+-2.24.32/gdk/x11/gdkdisplay-x11.c
--- gtk+-2.24.32-orig/gdk/x11/gdkdisplay-x11.c 2016-10-22 05:09:11.000000000 +0000
+++ gtk+-2.24.32/gdk/x11/gdkdisplay-x11.c 2020-07-18 15:49:18.227380280 +0000
@@ -368,11 +368,13 @@
XkbNewKeyboardNotifyMask | XkbMapNotifyMask | XkbStateNotifyMask,
XkbNewKeyboardNotifyMask | XkbMapNotifyMask | XkbStateNotifyMask);
+#if !defined(__sgi)
/* keep this in sync with _gdk_keymap_state_changed() */
XkbSelectEventDetails (display_x11->xdisplay,
XkbUseCoreKbd, XkbStateNotify,
XkbAllStateComponentsMask,
XkbGroupLockMask|XkbModifierLockMask);
+#endif
XkbSetDetectableAutoRepeat (display_x11->xdisplay,
True,
diff -u -r gtk+-2.24.32-orig/gdk/x11/gdkevents-x11.c gtk+-2.24.32/gdk/x11/gdkevents-x11.c
--- gtk+-2.24.32-orig/gdk/x11/gdkevents-x11.c 2016-10-22 05:09:13.000000000 +0000
+++ gtk+-2.24.32/gdk/x11/gdkevents-x11.c 2020-07-18 15:49:18.232055800 +0000
@@ -2139,7 +2139,7 @@
break;
case XkbStateNotify:
- _gdk_keymap_state_changed (display, xevent);
+ _gdk_keymap_state_changed (display);
break;
}
}
diff -u -r gtk+-2.24.32-orig/gdk/x11/gdkkeys-x11.c gtk+-2.24.32/gdk/x11/gdkkeys-x11.c
--- gtk+-2.24.32-orig/gdk/x11/gdkkeys-x11.c 2016-10-22 05:09:19.000000000 +0000
+++ gtk+-2.24.32/gdk/x11/gdkkeys-x11.c 2020-07-18 15:49:23.398296920 +0000
@@ -658,10 +658,12 @@
}
static gboolean
-update_direction (GdkKeymapX11 *keymap_x11,
- gint group)
+update_direction (GdkKeymapX11 *keymap_x11)
{
XkbDescPtr xkb = get_xkb (keymap_x11);
+ XkbStateRec state_rec;
+ GdkDisplay *display = GDK_KEYMAP (keymap_x11)->display;
+ gint group;
Atom group_atom;
gboolean had_direction;
PangoDirection old_direction;
@@ -669,6 +671,9 @@
had_direction = keymap_x11->have_direction;
old_direction = keymap_x11->current_direction;
+ XkbGetState (GDK_DISPLAY_XDISPLAY (display), XkbUseCoreKbd, &state_rec);
+ group = XkbGroupLock (&state_rec);
+
group_atom = xkb->names->groups[group];
/* a group change? */
@@ -695,25 +700,34 @@
return caps_lock_state != keymap_x11->caps_lock_state;
}
+static void
+_gdk_keymap_direction_changed (GdkKeymapX11 *keymap_x11)
+{
+ gboolean had_direction;
+ PangoDirection direction;
+
+ had_direction = keymap_x11->have_direction;
+ direction = keymap_x11->current_direction;
+
+ update_direction (keymap_x11);
+
+ if( !had_direction || direction != keymap_x11->current_direction)
+ g_signal_emit_by_name (keymap_x11, "direction_changed");
+}
+
/* keep this in sync with the XkbSelectEventDetails() call
* in gdk_display_open()
*/
void
-_gdk_keymap_state_changed (GdkDisplay *display,
- XEvent *xevent)
+_gdk_keymap_state_changed (GdkDisplay *display)
{
GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (display);
- XkbEvent *xkb_event = (XkbEvent *)xevent;
if (display_x11->keymap)
{
GdkKeymapX11 *keymap_x11 = GDK_KEYMAP_X11 (display_x11->keymap);
-
- if (update_direction (keymap_x11, XkbStateGroup (&xkb_event->state)))
- g_signal_emit_by_name (keymap_x11, "direction-changed");
- if (update_lock_state (keymap_x11, xkb_event->state.locked_mods))
- g_signal_emit_by_name (keymap_x11, "state-changed");
+ _gdk_keymap_direction_changed (keymap_x11);
}
}
@@ -754,14 +768,7 @@
GdkKeymapX11 *keymap_x11 = GDK_KEYMAP_X11 (keymap);
if (!keymap_x11->have_direction)
- {
- GdkDisplay *display = GDK_KEYMAP (keymap_x11)->display;
- XkbStateRec state_rec;
-
- XkbGetState (GDK_DISPLAY_XDISPLAY (display), XkbUseCoreKbd,
- &state_rec);
- update_direction (keymap_x11, XkbStateGroup (&state_rec));
- }
+ update_direction (keymap_x11);
return keymap_x11->current_direction;
}
diff -u -r gtk+-2.24.32-orig/gdk/x11/gdkprivate-x11.h gtk+-2.24.32/gdk/x11/gdkprivate-x11.h
--- gtk+-2.24.32-orig/gdk/x11/gdkprivate-x11.h 2016-10-22 05:09:19.000000000 +0000
+++ gtk+-2.24.32/gdk/x11/gdkprivate-x11.h 2020-07-18 15:49:18.236913480 +0000
@@ -149,8 +149,7 @@
gboolean _gdk_moveresize_configure_done (GdkDisplay *display,
GdkWindow *window);
-void _gdk_keymap_state_changed (GdkDisplay *display,
- XEvent *event);
+void _gdk_keymap_state_changed (GdkDisplay *display);
void _gdk_keymap_keys_changed (GdkDisplay *display);
gint _gdk_x11_get_group_for_state (GdkDisplay *display,
GdkModifierType state);
diff -u -r gtk+-2.24.32-orig/tests/testfilechooser.c gtk+-2.24.32/tests/testfilechooser.c
--- gtk+-2.24.32-orig/tests/testfilechooser.c 2016-10-22 05:10:08.000000000 +0000
+++ gtk+-2.24.32/tests/testfilechooser.c 2020-07-18 15:49:18.238859800 +0000
@@ -632,7 +632,7 @@
/* Shortcuts */
gtk_file_chooser_add_shortcut_folder_uri (GTK_FILE_CHOOSER (dialog),
- "file:///usr/share/pixmaps",
+ "file:///usr/sgug/share/pixmaps",
NULL);
/* Initial filename or folder */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment