Handle back/forward mouse buttons on Win32/macOS
There is no conflict with X11/Wayland, because 4/5 are the scroll wheel, which never gets forwarded to button-press-event.
This commit is contained in:
parent
0bfd3ad4ce
commit
891420edfd
3
fiv.c
3
fiv.c
|
@ -1299,6 +1299,7 @@ on_button_press_view(G_GNUC_UNUSED GtkWidget *widget, GdkEventButton *event)
|
||||||
if ((event->state & gtk_accelerator_get_default_mod_mask()))
|
if ((event->state & gtk_accelerator_get_default_mod_mask()))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
switch (event->button) {
|
switch (event->button) {
|
||||||
|
case 4: // back (GdkWin32, GdkQuartz)
|
||||||
case 8: // back
|
case 8: // back
|
||||||
switch_to_browser();
|
switch_to_browser();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -1320,10 +1321,12 @@ on_button_press_browser_paned(
|
||||||
if ((event->state & gtk_accelerator_get_default_mod_mask()))
|
if ((event->state & gtk_accelerator_get_default_mod_mask()))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
switch (event->button) {
|
switch (event->button) {
|
||||||
|
case 4: // back (GdkWin32, GdkQuartz)
|
||||||
case 8: // back
|
case 8: // back
|
||||||
if (g.directory_back)
|
if (g.directory_back)
|
||||||
load_directory(g.directory_back->data);
|
load_directory(g.directory_back->data);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
case 5: // forward (GdkWin32, GdkQuartz)
|
||||||
case 9: // forward
|
case 9: // forward
|
||||||
if (g.directory_forward)
|
if (g.directory_forward)
|
||||||
load_directory(g.directory_forward->data);
|
load_directory(g.directory_forward->data);
|
||||||
|
|
Loading…
Reference in New Issue