Add a patch to fix app menu crashers

This commit is contained in:
Cosimo Cecchi 2012-08-22 17:54:56 +02:00
parent 12bcf76bac
commit 8611a747dd
3 changed files with 46 additions and 81 deletions

View File

@ -1,80 +0,0 @@
From 18406b7b04da088f8a3efe7cca5ac1647080dc0b Mon Sep 17 00:00:00 2001
From: Matthias Clasen <mclasen@redhat.com>
Date: Thu, 22 Dec 2011 15:44:28 +0000
Subject: [PATCH] Revert "x11: Avoid spurious focus events on grabs"
This reverts commit db4a6040afd3d1cabbb306037e811f37d62e2e76.
This is causing bad focus confusion e.g. in gnome-terminal.
---
gdk/x11/gdkdevicemanager-core-x11.c | 5 -----
gdk/x11/gdkdevicemanager-xi2.c | 1 -
gdk/x11/gdkdevicemanagerprivate-core.h | 3 ---
3 files changed, 0 insertions(+), 9 deletions(-)
diff --git a/gdk/x11/gdkdevicemanager-core-x11.c b/gdk/x11/gdkdevicemanager-core-x11.c
index 503ad54..156ba8b 100644
--- a/gdk/x11/gdkdevicemanager-core-x11.c
+++ b/gdk/x11/gdkdevicemanager-core-x11.c
@@ -665,7 +665,6 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator,
case FocusIn:
case FocusOut:
_gdk_device_manager_core_handle_focus (window,
- xevent->xfocus.window,
device_manager->core_keyboard,
NULL,
xevent->type == FocusIn,
@@ -796,7 +795,6 @@ _gdk_x11_event_translate_keyboard_string (GdkEventKey *event)
*/
void
_gdk_device_manager_core_handle_focus (GdkWindow *window,
- Window original,
GdkDevice *device,
GdkDevice *source_device,
gboolean focus_in,
@@ -821,9 +819,6 @@ _gdk_device_manager_core_handle_focus (GdkWindow *window,
if (!toplevel)
return;
- if (toplevel->focus_window == original)
- return;
-
had_focus = HAS_FOCUS (toplevel);
switch (detail)
diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c
index f9e4d11..273ca7d 100644
--- a/gdk/x11/gdkdevicemanager-xi2.c
+++ b/gdk/x11/gdkdevicemanager-xi2.c
@@ -1228,7 +1228,6 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
GUINT_TO_POINTER (xev->sourceid));
_gdk_device_manager_core_handle_focus (window,
- xev->event,
device,
source_device,
(ev->evtype == XI_FocusIn) ? TRUE : FALSE,
diff --git a/gdk/x11/gdkdevicemanagerprivate-core.h b/gdk/x11/gdkdevicemanagerprivate-core.h
index 54463bb..428b34f 100644
--- a/gdk/x11/gdkdevicemanagerprivate-core.h
+++ b/gdk/x11/gdkdevicemanagerprivate-core.h
@@ -20,8 +20,6 @@
#ifndef __GDK_DEVICE_MANAGER_PRIVATE_CORE_H__
#define __GDK_DEVICE_MANAGER_PRIVATE_CORE_H__
-#include <X11/Xlib.h>
-
#include "gdkx11devicemanager-core.h"
#include "gdkdevicemanagerprivate.h"
@@ -40,7 +38,6 @@ struct _GdkX11DeviceManagerCoreClass
};
void _gdk_device_manager_core_handle_focus (GdkWindow *window,
- Window original,
GdkDevice *device,
GdkDevice *source_device,
gboolean focus_in,
--
1.7.8

View File

@ -0,0 +1,38 @@
commit 81e76746ffc1a9ad77ab7c3c7b9f43e344401e3c
Author: Ryan Lortie <desrt@desrt.ca>
Date: Wed Aug 22 00:54:57 2012 -0400
GtkActionHelper: two small fixups in _set_target_value()
First, ensure we always consume floating values, as documented.
Second (and more serious), don't try to query the action if the
action name is not set yet. This will cause crashes...
diff --git a/gtk/gtkactionhelper.c b/gtk/gtkactionhelper.c
index 6047a43..a3a0c46 100644
--- a/gtk/gtkactionhelper.c
+++ b/gtk/gtkactionhelper.c
@@ -523,7 +523,10 @@ gtk_action_helper_set_action_target_value (GtkActionHelper *helper,
return;
if (target_value && helper->target && g_variant_equal (target_value, helper->target))
- return;
+ {
+ g_variant_unref (g_variant_ref_sink (target_value));
+ return;
+ }
if (helper->target)
{
@@ -534,6 +537,10 @@ gtk_action_helper_set_action_target_value (GtkActionHelper *helper,
if (target_value)
helper->target = g_variant_ref_sink (target_value);
+ /* The action_name has not yet been set. Don't do anything yet. */
+ if (helper->action_name == NULL)
+ return;
+
was_enabled = helper->enabled;
was_active = helper->active;

View File

@ -10,7 +10,7 @@
Summary: The GIMP ToolKit (GTK+), a library for creating GUIs for X
Name: gtk3
Version: 3.5.12
Release: 1%{?dist}
Release: 2%{?dist}
License: LGPLv2+
Group: System Environment/Libraries
URL: http://www.gtk.org
@ -18,6 +18,8 @@ URL: http://www.gtk.org
Source: http://download.gnome.org/sources/gtk+/3.5/gtk+-%{version}.tar.xz
Source1: im-cedilla.conf
Patch0: actionhelper-crashfix.patch
BuildRequires: gnome-common autoconf automake intltool gettext
BuildRequires: atk-devel >= %{atk_version}
BuildRequires: at-spi2-atk-devel
@ -112,6 +114,8 @@ widget toolkit.
%prep
%setup -q -n gtk+-%{version}
%patch0 -p1 -b .actionhelper-crashfix
%build
(if ! test -x configure; then NOCONFIGURE=1 ./autogen.sh; CONFIGFLAGS=--enable-gtk-doc; fi;
@ -245,6 +249,9 @@ gtk-query-immodules-3.0-%{__isa_bits} --update-cache
%{_datadir}/gtk-doc
%changelog
* Wed Aug 22 2012 Cosimo Cecchi <cosimoc@redhat.com> - 3.5.12-2
- Backport a patch from upstream fixing crashers with app menus
* Tue Aug 21 2012 Richard Hughes <hughsient@gmail.com> - 3.5.12-1
- Update to 3.5.12