[gnome-flashback] common: update change_keygrab parameters
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-flashback] common: update change_keygrab parameters
- Date: Mon, 28 Sep 2015 04:33:55 +0000 (UTC)
commit ae8f1c0f53181d8f890f12697e2c1d400b5c0594
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Mon Sep 28 00:27:28 2015 +0300
common: update change_keygrab parameters
gnome-flashback/libcommon/gf-keybindings.c | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/gnome-flashback/libcommon/gf-keybindings.c b/gnome-flashback/libcommon/gf-keybindings.c
index af5ccae..eac476d 100644
--- a/gnome-flashback/libcommon/gf-keybindings.c
+++ b/gnome-flashback/libcommon/gf-keybindings.c
@@ -189,14 +189,17 @@ filter_func (GdkXEvent *xevent,
static void
change_keygrab (GfKeybindings *keybindings,
gboolean grab,
- gint keyval,
- guint keycode,
- guint modifiers)
+ Keybinding *keybinding)
{
guint ignore_mask;
+ guint keycode;
+ guint mask;
gint error_code;
ignore_mask = 0;
+ keycode = keybinding->keycode;
+ mask = keybinding->mask;
+
while (ignore_mask <= keybindings->ignore_mask)
{
if (ignore_mask & ~(keybindings->ignore_mask))
@@ -209,12 +212,12 @@ change_keygrab (GfKeybindings *keybindings,
if (grab)
{
- XGrabKey (keybindings->xdisplay, keycode, modifiers | ignore_mask,
+ XGrabKey (keybindings->xdisplay, keycode, mask | ignore_mask,
keybindings->xwindow, True, GrabModeAsync, GrabModeSync);
}
else
{
- XUngrabKey (keybindings->xdisplay, keycode, modifiers | ignore_mask,
+ XUngrabKey (keybindings->xdisplay, keycode, mask | ignore_mask,
keybindings->xwindow);
}
@@ -448,8 +451,7 @@ gf_keybindings_grab (GfKeybindings *keybindings,
keybinding = keybinding_new (accelerator, keyval, modifiers,
keycode, mask, action);
- change_keygrab (keybindings, TRUE, keyval, keycode, mask);
-
+ change_keygrab (keybindings, TRUE, keybinding);
g_hash_table_insert (keybindings->table, paction, keybinding);
return action;
@@ -479,9 +481,7 @@ gf_keybindings_ungrab (GfKeybindings *keybindings,
if (keybinding == NULL)
return FALSE;
- change_keygrab (keybindings, FALSE, keybinding->keyval,
- keybinding->keycode, keybinding->mask);
-
+ change_keygrab (keybindings, FALSE, keybinding);
g_hash_table_remove (keybindings->table, paction);
return TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]