Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable mouse scroll #50

Open
400thecat opened this issue Dec 8, 2019 · 8 comments
Open

disable mouse scroll #50

400thecat opened this issue Dec 8, 2019 · 8 comments

Comments

@400thecat
Copy link

When I accidentally scroll mouse wheel on the panel, it switches virtual desktops.

How can I disable this before it drives me crazy ?

Seriously, whoever thought this was a good idea ?
Who switches desktops with his mouse wheel ?

@400thecat
Copy link
Author

And when I scroll mouse on application in the task bar, it switches between applications.

Seriously, this is evil.
Is there some way to disable this ?

@eleksir
Copy link

eleksir commented Jun 14, 2020

It's not that evil as you describe it.
Actually if you give me proper PR i'll apply it to my fork of fbpanel and tag it, so you can pull it as release (it'll be 7.3 in my case).

@400thecat
Copy link
Author

thanks for looking into it.

FYI: I have also posted a question on Stack Exchange for this particular problem.

If you could implement a fix, where this behavior could be turned of with a config option, that would be terrific.

BTW, I am already using a patch, also from Stack Exchange so that I can use 3 separaste instances for 3 monitors. Would you perhaps want to include that patch as well?

@eleksir
Copy link

eleksir commented Jun 17, 2020

Already applied as

commit bfe8b29
Author: Arkadiusz Drabczyk [email protected]
Date: Sun Jan 5 00:24:09 2020 +0100

Reimplement `Xinerama support' patch for 7.0

Original patch from 2011:
https://sourceforge.net/p/fbpanel/patches/67

At least it looks like the only xinerama one that was found in one of the fbpanel forks.

@eleksir
Copy link

eleksir commented Jun 17, 2020

I just gather some patches for fbpanel in one place.

@ghost
Copy link

ghost commented Oct 9, 2020

Here's 3 patches if it helps at all.

diff --git a/fbpanel-7.0/plugins/deskno/deskno.c b/fbpanel-7.0/plugins/deskno/deskno.c
index 3d4a715..5bcc781 100644
--- fbpanel-7.0/plugins/deskno/deskno.c
+++ fbpanel-7.0.1/plugins/deskno/deskno.c
@@ -40,15 +40,7 @@ clicked(GtkWidget *widget, deskno_priv *dc)
     ENTER;
     change_desktop(dc, 1);
 }
- 
-static gboolean
-scrolled(GtkWidget *widget, GdkEventScroll *event, deskno_priv *dc)
-{
-    ENTER;
-    change_desktop(dc, (event->direction == GDK_SCROLL_UP
-            || event->direction == GDK_SCROLL_LEFT) ? -1 : 1);
-    return FALSE;
-}
+
 
 static gint
 name_update(GtkWidget *widget, deskno_priv *dc)
@@ -81,8 +73,6 @@ deskno_constructor(plugin_instance *p)
     gtk_button_set_relief(GTK_BUTTON(dc->main), GTK_RELIEF_NONE);
     g_signal_connect(G_OBJECT(dc->main), "clicked", G_CALLBACK(clicked),
         (gpointer) dc);
-    g_signal_connect(G_OBJECT(dc->main), "scroll-event", G_CALLBACK(scrolled),
-        (gpointer) dc);
     dc->namew = gtk_label_new("ww");
     gtk_container_add(GTK_CONTAINER(dc->main), dc->namew);
     gtk_container_add(GTK_CONTAINER(p->pwid), dc->main);

second patch

diff --git a/fbpanel-7.0/plugins/deskno2/deskno2.c b/fbpanel-7.0/plugins/deskno2/deskno2.c
index 1ea39c8..062a301 100644
--- fbpanel-7.0/plugins/deskno2/deskno2.c
+++ fbpanel-7.0.1/plugins/deskno2/deskno2.c
@@ -62,21 +62,6 @@ update_all(GtkWidget *widget, deskno_priv *dc)
 }
 
 
-static gboolean
-scroll (GtkWidget *widget, GdkEventScroll *event, deskno_priv *dc)
-{
-    int dno;
-    
-    ENTER;
-    dno = dc->dno + ((event->direction == GDK_SCROLL_UP) ? (-1) : (+1));
-    if (dno < 0)
-        dno = dc->dnum - 1;
-    else if (dno == dc->dnum)
-        dno = 0;
-    Xclimsg(GDK_ROOT_WINDOW(), a_NET_CURRENT_DESKTOP, dno, 0, 0, 0, 0);
-    RET(TRUE);
-
-}
 
 static int
 deskno_constructor(plugin_instance *p)
@@ -89,7 +74,6 @@ deskno_constructor(plugin_instance *p)
     gtk_container_set_border_width(GTK_CONTAINER(dc->main), 0);
     //gtk_button_set_alignment(GTK_BUTTON(dc->main), 0, 0.5);
     g_signal_connect(G_OBJECT(dc->main), "clicked", G_CALLBACK (clicked), (gpointer) dc);
-    g_signal_connect(G_OBJECT(dc->main), "scroll-event", G_CALLBACK(scroll), (gpointer) dc);
     
     update_all(dc->main, dc);

third patch


diff --git a/fbpanel-7.0/panel/panel.c b/fbpanel-7.0/panel/panel.c
index 811be95..787ff6e 100644
--- fbpanel-7.0/panel/panel.c
+++ fbpanel-7.0.1/panel/panel.c
@@ -524,26 +524,6 @@ panel_button_press_event(GtkWidget *widget, GdkEventButton *event, panel *p)
     RET(FALSE);
 }
 
-static gboolean
-panel_scroll_event(GtkWidget *widget, GdkEventScroll *event, panel *p)
-{
-    int i;
-
-    ENTER;
-    DBG("scroll direction = %d\n", event->direction);
-    i = p->curdesk;
-    if (event->direction == GDK_SCROLL_UP || event->direction == GDK_SCROLL_LEFT) {
-        i--;
-        if (i < 0)
-            i = p->desknum - 1;
-    } else {
-        i++;
-        if (i >= p->desknum)
-            i = 0;
-    }
-    Xclimsg(GDK_ROOT_WINDOW(), a_NET_CURRENT_DESKTOP, i, 0, 0, 0, 0);
-    RET(TRUE);
-}
 
 
 static void
@@ -566,8 +546,6 @@ panel_start_gui(panel *p)
         (GCallback) panel_configure_event, p);
     g_signal_connect(G_OBJECT(p->topgwin), "button-press-event",
         (GCallback) panel_button_press_event, p);
-    g_signal_connect(G_OBJECT(p->topgwin), "scroll-event",
-        (GCallback) panel_scroll_event, p);
 
     gtk_window_set_resizable(GTK_WINDOW(p->topgwin), FALSE);
     gtk_window_set_wmclass(GTK_WINDOW(p->topgwin), "panel", "fbpanel");

@halcon74
Copy link

Hi

I tried to implement all the 3 snakejr1's patches to aanatoly's 7.0 version and to eleksir's 7.2 version - it didn't help (didn't stop the desktops to be switching with the mouse wheel).

I would appreciate much too if the option to disable this switching is added to fbpanel. I like fbpanel very much, been using it for years.

@ghost
Copy link

ghost commented Sep 2, 2021

Hi

I tried to implement all the 3 snakejr1's patches to aanatoly's 7.0 version and to eleksir's 7.2 version - it didn't help (didn't stop the desktops to be switching with the mouse wheel).

I would appreciate much too if the option to disable this switching is added to fbpanel. I like fbpanel very much, been using it for years.

Ya sorry that was really meant for eleksir just to show the files and some examples of the code that causes the behavior. There are many more things in those three files that can cause the virtual desktop switching depending on your set up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants