lanoxx / tilda

A Gtk based drop down terminal for Linux and Unix
GNU General Public License v2.0
1.28k stars 161 forks source link

<alt> modifier does not work. #90

Closed Ghoughpteighbteau closed 10 years ago

Ghoughpteighbteau commented 10 years ago

latest build, <Alt> <Shift> and <Primary> don't seem to have an effect on the "Pull Down Terminal" keybinding.

I tried to set tilda to appear on <Alt>1, this only binds tilda to appear when I press 1 not <Alt>1

lanoxx commented 10 years ago

I am sorry, I accidentally pushed a commit that I hadn't tested yet and which seems to have broken the modifieres. I have reverted that commit.

Ghoughpteighbteau commented 10 years ago

wuh.. what kind of case insensitive checking is that?! lol.

that fixed the issue, thanks.

lanoxx commented 10 years ago

I pushed a new commit: 08c81147a6578fb39cc1c97fe5552193606d2405 to branch features/simplifystringcomparison could you try if this works too?

Ghoughpteighbteau commented 10 years ago
alex@alex-work ~/t/tilda (origin/features/simplifystringcomparison)> git status
# On branch origin/features/simplifystringcomparison
nothing to commit, working directory clean

It didn't work.

if I may...

sizeof returns the size of the string pointer.

:kissing:

Do this:

diff --git a/src/eggaccelerators.c b/src/eggaccelerators.c
index a092f95..7370bf9 100644
--- a/src/eggaccelerators.c
+++ b/src/eggaccelerators.c
@@ -45,13 +45,13 @@ static inline gboolean
 is_alt (const gchar *string)
 {
     const char *sample = "<ALT>";
-    return g_ascii_strncasecmp(string, sample, sizeof(sample) - 1) == 0;
+    return g_ascii_strncasecmp(string, sample, strlen(sample)) == 0;
 }

 static inline gboolean
 is_ctl (const gchar *string) {
     const char *sample = "<CTL>";
-    return g_ascii_strncasecmp(string, sample, sizeof(sample) - 1) == 0;
+    return g_ascii_strncasecmp(string, sample, strlen(sample)) == 0;
 }

 static inline gboolean
@@ -67,55 +67,55 @@ is_modx (const gchar *string) {
 static inline gboolean
 is_ctrl (const gchar *string) {
     const char *sample = "<CTRL>";
-    return g_ascii_strncasecmp(string, sample, sizeof(sample) - 1) == 0;
+    return g_ascii_strncasecmp(string, sample, strlen(sample)) == 0;
 }

 static inline gboolean
 is_shft (const gchar *string) {
     const char *sample = "<SHFT>";
-    return g_ascii_strncasecmp(string, sample, sizeof(sample) - 1) == 0;
+    return g_ascii_strncasecmp(string, sample, strlen(sample)) == 0;
 }

 static inline gboolean
 is_shift (const gchar *string) {
     const char *sample = "<SHIFT>";
-    return g_ascii_strncasecmp(string, sample, sizeof(sample) - 1) == 0;
+    return g_ascii_strncasecmp(string, sample, strlen(sample)) == 0;
 }

 static inline gboolean
 is_control (const gchar *string) {
     const char *sample = "<CONTROL>";
-    return g_ascii_strncasecmp(string, sample, sizeof(sample) - 1) == 0;
+    return g_ascii_strncasecmp(string, sample, strlen(sample)) == 0;
 }

 static inline gboolean
 is_release (const gchar *string) {
     const char *sample = "<RELEASE>";
-    return g_ascii_strncasecmp(string, sample, sizeof(sample) - 1) == 0;
+    return g_ascii_strncasecmp(string, sample, strlen(sample)) == 0;
 }

 static inline gboolean
 is_meta (const gchar *string) {
     const char *sample = "<META>";
-    return g_ascii_strncasecmp(string, sample, sizeof(sample) - 1) == 0;
+    return g_ascii_strncasecmp(string, sample, strlen(sample)) == 0;
 }

 static inline gboolean
 is_super (const gchar *string) {
     const char *sample = "<SUPER>";
-    return g_ascii_strncasecmp(string, sample, sizeof(sample) - 1) == 0;
+    return g_ascii_strncasecmp(string, sample, strlen(sample)) == 0;
 }

 static inline gboolean
 is_hyper (const gchar *string) {
     const char *sample = "<HYPER>";
-    return g_ascii_strncasecmp(string, sample, sizeof(sample) - 1) == 0;
+    return g_ascii_strncasecmp(string, sample, strlen(sample)) == 0;
 }

 static inline gboolean
 is_primary (const gchar *string) {
     const char *sample = "<PRIMARY>";
-    return g_ascii_strncasecmp(string, sample, sizeof(sample) - 1) == 0;
+    return g_ascii_strncasecmp(string, sample, strlen(sample)) == 0;
 }
lanoxx commented 10 years ago

You are right. Stupid oversight of mine. Thanks.