[Fedora-i18n-bugs] [eekboard] Update to 1.0.3-2.
Daiki Ueno
ueno at fedoraproject.org
Mon Sep 12 02:15:45 UTC 2011
commit da036bb52e1c398183c16fb088bd6844c36cc514
Author: Daiki Ueno <ueno at unixuser.org>
Date: Mon Sep 12 11:15:24 2011 +0900
Update to 1.0.3-2.
eekboard-fix-key-release-race-condition.patch | 109 ++++++++++++++++++
eekboard-window-size-constraint.patch | 150 +++++++++++++++++++++++++
eekboard.spec | 12 ++-
3 files changed, 269 insertions(+), 2 deletions(-)
---
diff --git a/eekboard-fix-key-release-race-condition.patch b/eekboard-fix-key-release-race-condition.patch
new file mode 100644
index 0000000..bd63ffd
--- /dev/null
+++ b/eekboard-fix-key-release-race-condition.patch
@@ -0,0 +1,109 @@
+From f72e9f5293c14181b836fdc9c524b8b037296a40 Mon Sep 17 00:00:00 2001
+From: Daiki Ueno <ueno at unixuser.org>
+Date: Mon, 12 Sep 2011 11:06:26 +0900
+Subject: [PATCH 2/2] Copy pressed_keys list before sending released/cancelled
+ signal (RHBZ#737396).
+
+---
+ eek/eek-gtk-keyboard.c | 35 ++++++++++++++++++++++++++---------
+ eek/eek-keyboard.c | 14 +++++---------
+ 2 files changed, 31 insertions(+), 18 deletions(-)
+
+diff --git a/eek/eek-gtk-keyboard.c b/eek/eek-gtk-keyboard.c
+index 8de188d..991b886 100644
+--- a/eek/eek-gtk-keyboard.c
++++ b/eek/eek-gtk-keyboard.c
+@@ -229,12 +229,17 @@ eek_gtk_keyboard_real_button_release_event (GtkWidget *self,
+ GdkEventButton *event)
+ {
+ EekGtkKeyboardPrivate *priv = EEK_GTK_KEYBOARD_GET_PRIVATE(self);
+- GList *head;
+-
+- head = eek_keyboard_get_pressed_keys (priv->keyboard);
+- for (; head; head = g_list_next (head)) {
++ GList *head = eek_keyboard_get_pressed_keys (priv->keyboard);
++
++ /* Make a copy of HEAD before sending "released" signal on
++ elements, so that the default handler of
++ EekKeyboard::key-released signal can remove elements from its
++ internal copy */
++ head = g_list_copy (head);
++ for (; head; head = g_list_next (head))
+ g_signal_emit_by_name (head->data, "released", priv->keyboard);
+- }
++ g_list_free (head);
++
+ return TRUE;
+ }
+
+@@ -251,12 +256,20 @@ eek_gtk_keyboard_real_motion_notify_event (GtkWidget *self,
+ if (key) {
+ GList *head = eek_keyboard_get_pressed_keys (priv->keyboard);
+ gboolean found = FALSE;
++
++ /* Make a copy of HEAD before sending "cancelled" signal on
++ elements, so that the default handler of
++ EekKeyboard::key-cancelled signal can remove elements from its
++ internal copy */
++ head = g_list_copy (head);
+ for (; head; head = g_list_next (head)) {
+ if (head->data == key)
+ found = TRUE;
+ else
+ g_signal_emit_by_name (head->data, "cancelled", priv->keyboard);
+ }
++ g_list_free (head);
++
+ if (!found)
+ g_signal_emit_by_name (key, "pressed", priv->keyboard);
+ }
+@@ -269,12 +282,16 @@ eek_gtk_keyboard_real_unmap (GtkWidget *self)
+ EekGtkKeyboardPrivate *priv = EEK_GTK_KEYBOARD_GET_PRIVATE(self);
+
+ if (priv->keyboard) {
+- GList *head;
++ GList *head = eek_keyboard_get_pressed_keys (priv->keyboard);
+
+- head = eek_keyboard_get_pressed_keys (priv->keyboard);
+- for (; head; head = g_list_next (head)) {
++ /* Make a copy of HEAD before sending "released" signal on
++ elements, so that the default handler of
++ EekKeyboard::key-released signal can remove elements from its
++ internal copy */
++ head = g_list_copy (head);
++ for (; head; head = g_list_next (head))
+ g_signal_emit_by_name (head->data, "released", priv->keyboard);
+- }
++ g_list_free (head);
+ }
+
+ GTK_WIDGET_CLASS (eek_gtk_keyboard_parent_class)->unmap (self);
+diff --git a/eek/eek-keyboard.c b/eek/eek-keyboard.c
+index 0f5e5b8..138dd73 100644
+--- a/eek/eek-keyboard.c
++++ b/eek/eek-keyboard.c
+@@ -331,16 +331,12 @@ eek_keyboard_real_key_cancelled (EekKeyboard *self,
+ EekKeyboardPrivate *priv = EEK_KEYBOARD_GET_PRIVATE(self);
+ GList *head;
+
+- for (head = priv->pressed_keys; head; ) {
+- EekKey *pressed_key = head->data;
+- if (pressed_key == key) {
+- GList *next = g_list_next (head);
+- priv->pressed_keys =
+- g_list_remove_link (priv->pressed_keys, head);
++ for (head = priv->pressed_keys; head; head = g_list_next (head)) {
++ if (head->data == key) {
++ priv->pressed_keys = g_list_remove_link (priv->pressed_keys, head);
+ g_list_free1 (head);
+- head = next;
+- } else
+- head = g_list_next (head);
++ break;
++ }
+ }
+ }
+
+--
+1.7.6.2
+
diff --git a/eekboard-window-size-constraint.patch b/eekboard-window-size-constraint.patch
new file mode 100644
index 0000000..6ac4b81
--- /dev/null
+++ b/eekboard-window-size-constraint.patch
@@ -0,0 +1,150 @@
+From 0d93f31eea1e751045030c9cbd89b2086cfba437 Mon Sep 17 00:00:00 2001
+From: Daiki Ueno <ueno at unixuser.org>
+Date: Fri, 2 Sep 2011 17:12:13 +0900
+Subject: [PATCH 1/2] Add window size constraint option in gsettings.
+
+---
+ data/org.fedorahosted.eekboard.gschema.xml.in | 10 ++++
+ src/server-context-service.c | 63 ++++++++++++++++++++++++-
+ 2 files changed, 72 insertions(+), 1 deletions(-)
+
+diff --git a/data/org.fedorahosted.eekboard.gschema.xml.in b/data/org.fedorahosted.eekboard.gschema.xml.in
+index c0182dd..7f37e32 100644
+--- a/data/org.fedorahosted.eekboard.gschema.xml.in
++++ b/data/org.fedorahosted.eekboard.gschema.xml.in
+@@ -46,6 +46,16 @@
+ <summary>Switch to fullscreen mode when startup</summary>
+ <description>If true, switch to fullscreen mode when startup.</description>
+ </key>
++ <key name="size-constraint-landscape" type="(dd)">
++ <default>(1.0, 0.3)</default>
++ <summary>Constraint of the maximum window size on landscape screen</summary>
++ <description>Constraint of maximum window size on landscape screen</description>
++ </key>
++ <key name="size-constraint-portrait" type="(dd)">
++ <default>(1.0, 0.5)</default>
++ <summary>Constraint of the maximum window size on portrait screen</summary>
++ <description>Constraint of maximum window size on portrait screen</description>
++ </key>
+ <key name="theme" type="s">
+ <default>'default'</default>
+ <summary>Theme</summary>
+diff --git a/src/server-context-service.c b/src/server-context-service.c
+index 1513006..a46ca16 100644
+--- a/src/server-context-service.c
++++ b/src/server-context-service.c
+@@ -36,6 +36,8 @@
+ enum {
+ PROP_0,
+ PROP_UI_TOOLKIT,
++ PROP_SIZE_CONSTRAINT_LANDSCAPE,
++ PROP_SIZE_CONSTRAINT_PORTRAIT,
+ PROP_LAST
+ };
+
+@@ -59,6 +61,8 @@ struct _ServerContextService {
+
+ GSettings *settings;
+ UIToolkitType ui_toolkit;
++ gdouble size_constraint_landscape[2];
++ gdouble size_constraint_portrait[2];
+ };
+
+ struct _ServerContextServiceClass {
+@@ -238,7 +242,16 @@ set_geometry (ServerContextService *context)
+ context);
+
+ if (eekboard_context_service_get_fullscreen (EEKBOARD_CONTEXT_SERVICE(context))) {
+- gint width = rect.width, height = rect.height / 2;
++ gint width = rect.width;
++ gint height = rect.height;
++
++ if (width > height) {
++ width *= context->size_constraint_landscape[0];
++ height *= context->size_constraint_landscape[1];
++ } else {
++ width *= context->size_constraint_portrait[0];
++ height *= context->size_constraint_portrait[1];
++ }
+
+ if (width * bounds.height > height * bounds.width)
+ width = (height / bounds.height) * bounds.width;
+@@ -402,6 +415,7 @@ server_context_service_set_property (GObject *object,
+ {
+ ServerContextService *context = SERVER_CONTEXT_SERVICE(object);
+ const gchar *ui_toolkit;
++ GVariant *variant;
+
+ switch (prop_id) {
+ case PROP_UI_TOOLKIT:
+@@ -415,6 +429,19 @@ server_context_service_set_property (GObject *object,
+ else
+ g_warning ("unknown UI toolkit %s", ui_toolkit);
+ break;
++ case PROP_SIZE_CONSTRAINT_LANDSCAPE:
++ variant = g_value_get_variant (value);
++ g_variant_get (variant, "(dd)",
++ &context->size_constraint_landscape[0],
++ &context->size_constraint_landscape[1]);
++ break;
++ case PROP_SIZE_CONSTRAINT_PORTRAIT:
++ variant = g_value_get_variant (value);
++ g_variant_get (variant, "(dd)",
++ &context->size_constraint_portrait[0],
++ &context->size_constraint_portrait[1]);
++ break;
++
+ default:
+ g_object_set_property (object,
+ g_param_spec_get_name (pspec),
+@@ -459,6 +486,26 @@ server_context_service_class_init (ServerContextServiceClass *klass)
+ g_object_class_install_property (gobject_class,
+ PROP_UI_TOOLKIT,
+ pspec);
++
++ pspec = g_param_spec_variant ("size-constraint-landscape",
++ "Size constraint landscape",
++ "Size constraint landscape",
++ G_VARIANT_TYPE("(dd)"),
++ NULL,
++ G_PARAM_WRITABLE);
++ g_object_class_install_property (gobject_class,
++ PROP_SIZE_CONSTRAINT_LANDSCAPE,
++ pspec);
++
++ pspec = g_param_spec_variant ("size-constraint-portrait",
++ "Size constraint portrait",
++ "Size constraint portrait",
++ G_VARIANT_TYPE("(dd)"),
++ NULL,
++ G_PARAM_WRITABLE);
++ g_object_class_install_property (gobject_class,
++ PROP_SIZE_CONSTRAINT_PORTRAIT,
++ pspec);
+ }
+
+ static void
+@@ -484,6 +531,20 @@ server_context_service_init (ServerContextService *context)
+ g_settings_bind (context->settings, "ui-toolkit",
+ context, "ui-toolkit",
+ G_SETTINGS_BIND_GET);
++ g_settings_bind_with_mapping (context->settings, "size-constraint-landscape",
++ context, "size-constraint-landscape",
++ G_SETTINGS_BIND_GET,
++ (GSettingsBindGetMapping *)g_value_set_variant,
++ NULL,
++ NULL,
++ NULL);
++ g_settings_bind_with_mapping (context->settings, "size-constraint-portrait",
++ context, "size-constraint-portrait",
++ G_SETTINGS_BIND_GET,
++ (GSettingsBindGetMapping *)g_value_set_variant,
++ NULL,
++ NULL,
++ NULL);
+ }
+
+ ServerContextService *
+--
+1.7.6.2
+
diff --git a/eekboard.spec b/eekboard.spec
index 8c676ee..371bf43 100644
--- a/eekboard.spec
+++ b/eekboard.spec
@@ -1,12 +1,14 @@
Name: eekboard
Version: 1.0.3
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: An Easy-to-use Virtual Keyboard Toolkit
Group: Applications/System
License: GPLv3+
URL: http://fedorahosted.org/eekboard/
Source0: http://github.com/downloads/ueno/eekboard/eekboard-%{version}.tar.gz
+Patch0: eekboard-window-size-constraint.patch
+Patch1: eekboard-fix-key-release-race-condition.patch
BuildRequires: libfakekey-devel
# older libfakekey-devel has missing BR: libXtst-devel (#680878)
BuildRequires: libXtst-devel
@@ -64,13 +66,15 @@ This package contains the Python language binding of eekboard client library.
%prep
%setup -q
+%patch0 -p1 -b .window-size-constraint
+%patch1 -p1 -b .fix-key-release-race-condition
%build
%configure --disable-static --with-gtk=3.0 --enable-atspi
make %{?_smp_mflags}
-
+p
%install
make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
rm -rf $RPM_BUILD_ROOT%{_libdir}/*.la
@@ -146,6 +150,10 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%changelog
+* Mon Sep 12 2011 Daiki Ueno <dueno at redhat.com> - 1.0.3-2
+- add eekboard-window-size-constraint.patch
+- add eekboard-fix-key-release-race-condition.patch (#737396)
+
* Thu Sep 1 2011 Daiki Ueno <dueno at redhat.com> - 1.0.3-1
- new upstream release
More information about the i18n-bugs
mailing list