]> Pileus Git - ~andy/gtk/blobdiff - gdk/x11/gdkevents-x11.c
Updated Azeri and Walloon files
[~andy/gtk] / gdk / x11 / gdkevents-x11.c
index 8767c33a7006a2316a95fbb264c6934ea18347af..a102e2b82717fa2a52c1a6295795a717870c71a1 100644 (file)
@@ -650,11 +650,23 @@ gdk_event_translate (GdkEvent *event,
       
       /* If we get a ButtonPress event where the button is 4 or 5,
         it's a Scroll event */
-      if (xevent->xbutton.button == 4 || xevent->xbutton.button == 5)
-       {
+      switch (xevent->xbutton.button)
+        {
+        case 4: /* up */
+        case 5: /* down */
+        case 6: /* left */
+        case 7: /* right */
          event->scroll.type = GDK_SCROLL;
-         event->scroll.direction = (xevent->xbutton.button == 4) ? 
-           GDK_SCROLL_UP : GDK_SCROLL_DOWN;
+
+          if (xevent->xbutton.button == 4)
+            event->scroll.direction = GDK_SCROLL_UP;
+          else if (xevent->xbutton.button == 5)
+            event->scroll.direction = GDK_SCROLL_DOWN;
+          else if (xevent->xbutton.button == 6)
+            event->scroll.direction = GDK_SCROLL_LEFT;
+          else
+            event->scroll.direction = GDK_SCROLL_RIGHT;
+
          event->scroll.window = window;
          event->scroll.time = xevent->xbutton.x;
          event->scroll.x = xevent->xbutton.x + xoffset;
@@ -663,9 +675,9 @@ gdk_event_translate (GdkEvent *event,
          event->scroll.y_root = (gfloat)xevent->xbutton.y_root;
          event->scroll.state = (GdkModifierType) xevent->xbutton.state;
          event->scroll.device = gdk_core_pointer;
-       }
-      else
-       {
+          break;
+          
+        default:
          event->button.type = GDK_BUTTON_PRESS;
          event->button.window = window;
          event->button.time = xevent->xbutton.time;
@@ -679,6 +691,7 @@ gdk_event_translate (GdkEvent *event,
          event->button.device = gdk_core_pointer;
          
          gdk_event_button_generate (event);
+          break;
        }
 
       break;
@@ -699,7 +712,8 @@ gdk_event_translate (GdkEvent *event,
        }
       
       /* We treat button presses as scroll wheel events, so ignore the release */
-      if (xevent->xbutton.button == 4 || xevent->xbutton.button == 5)
+      if (xevent->xbutton.button == 4 || xevent->xbutton.button == 5 ||
+          xevent->xbutton.button == 6 || xevent->xbutton.button ==7)
        {
          return_val = FALSE;
          break;
@@ -1487,8 +1501,16 @@ gdk_wm_protocols_filter (GdkXEvent *xev,
       GdkWindow *win = event->any.window;
       Window focus_win = GDK_WINDOW_IMPL_X11(((GdkWindowObject *)win)->impl)->focus_window;
 
-      XSetInputFocus (GDK_WINDOW_XDISPLAY (win), focus_win,
-                     RevertToParent, xevent->xclient.data.l[1]);
+      /* There is no way of knowing reliably whether we are viewable so we need
+       * to trap errors so we don't cause a BadMatch.
+       */
+      gdk_error_trap_push ();
+      XSetInputFocus (GDK_WINDOW_XDISPLAY (win),
+                     focus_win,
+                     RevertToParent,
+                     xevent->xclient.data.l[1]);
+      XSync (GDK_WINDOW_XDISPLAY (win), False);
+      gdk_error_trap_pop ();
     }
   else if ((Atom) xevent->xclient.data.l[0] == gdk_atom_intern ("_NET_WM_PING", FALSE))
     {
@@ -1903,8 +1925,13 @@ static struct
   const char *xsettings_name;
   const char *gdk_name;
 } settings_map[] = {
-  { "Net/DoubleClickTime", "double-click-timeout" },
-  { "Net/DragThreshold", "drag-threshold" }
+  { "Net/DoubleClickTime", "gtk-double-click-timeout" },
+  { "Net/DragThreshold", "gtk-drag-threshold" },
+  { "Gtk/ColorPalette", "gtk-color-palette" },
+  { "Gtk/ToolbarStyle", "gtk-toolbar-style" },
+  { "Gtk/ToolbarIconSize", "gtk-toolbar-icon-size" },
+  { "Net/CursorBlink", "gtk-cursor-blink" },
+  { "Net/CursorBlinkTime", "gtk-cursor-blink-time" }
 };
 
 static void
@@ -1973,6 +2000,7 @@ gdk_setting_get (const gchar *name,
   XSettingsSetting *setting;
   gboolean success = FALSE;
   gint i;
+  GValue tmp_val = { 0, };
 
   for (i = 0; i < G_N_ELEMENTS (settings_map) ; i++)
     if (strcmp (settings_map[i].gdk_name, name) == 0)
@@ -1993,14 +2021,20 @@ gdk_setting_get (const gchar *name,
     case XSETTINGS_TYPE_INT:
       if (check_transform (xsettings_name, G_TYPE_INT, G_VALUE_TYPE (value)))
        {
-         g_value_set_int (value, setting->data.v_int);
+         g_value_init (&tmp_val, G_TYPE_INT);
+         g_value_set_int (&tmp_val, setting->data.v_int);
+         g_value_transform (&tmp_val, value);
+
          success = TRUE;
        }
       break;
     case XSETTINGS_TYPE_STRING:
       if (check_transform (xsettings_name, G_TYPE_STRING, G_VALUE_TYPE (value)))
        {
-         g_value_set_string (value, setting->data.v_string);
+         g_value_init (&tmp_val, G_TYPE_STRING);
+         g_value_set_string (&tmp_val, setting->data.v_string);
+         g_value_transform (&tmp_val, value);
+
          success = TRUE;
        }
       break;
@@ -2009,17 +2043,23 @@ gdk_setting_get (const gchar *name,
        {
          GdkColor color;
          
+         g_value_init (&tmp_val, GDK_TYPE_COLOR);
+
          color.pixel = 0;
          color.red = setting->data.v_color.red;
          color.green = setting->data.v_color.green;
          color.blue = setting->data.v_color.blue;
          
-         g_value_set_boxed (value, &color);
+         g_value_set_boxed (&tmp_val, &color);
+         
+         g_value_transform (&tmp_val, value);
          
          success = TRUE;
        }
       break;
     }
+  
+  g_value_unset (&tmp_val);
 
   xsettings_setting_free (setting);