blob: 84d6d6beceabcd35b0e14c1f41a03d702df10dcb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
From afceb3e697934780b487db1e11e21fb23cbe9e28 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Fri, 01 Jul 2011 12:28:51 +0000
Subject: common: Use defines instead of variables for ranges
Seeing as those won't ever change.
---
diff --git a/plugins/common/gsd-keygrab.c b/plugins/common/gsd-keygrab.c
index 464f6e8..17e287c 100644
--- a/plugins/common/gsd-keygrab.c
+++ b/plugins/common/gsd-keygrab.c
@@ -42,8 +42,10 @@ static GdkModifierType gsd_ignored_mods = 0;
static GdkModifierType gsd_used_mods = 0;
/* Taken from a comment in XF86keysym.h */
-static guint gsd_unmodified_keysym_min = 0x10080001;
-static guint gsd_unmodified_keysym_max = 0x1008FFFF;
+#define XF86KEYS_RANGE_MIN 0x10080001
+#define XF86KEYS_RANGE_MAX 0x1008FFFF
+
+#define IN_RANGE(x, min, max) (x >= min && x <= max)
static void
setup_modifiers (void)
@@ -141,8 +143,7 @@ grab_key_unsafe (Key *key,
* a modifier).
*/
if ((modifiers & gsd_used_mods) == 0 &&
- ((key->keysym < gsd_unmodified_keysym_min) ||
- (key->keysym > gsd_unmodified_keysym_max))) {
+ (IN_RANGE(key->keysym, XF86KEYS_RANGE_MIN, XF86KEYS_RANGE_MAX))) {
GString *keycodes;
keycodes = g_string_new ("");
--
cgit v0.9
|