aboutsummaryrefslogtreecommitdiffstats
path: root/src/xterm.c
diff options
context:
space:
mode:
authorJan Djärv2003-03-09 20:43:04 +0000
committerJan Djärv2003-03-09 20:43:04 +0000
commit257f40f26707cf9aa825b16c19d601a71bf27d66 (patch)
treea44ba2d64baa024327666df9eb5a63354c7adb0c /src/xterm.c
parent3a8a22fc3d5817b031cb40febeb000bf33d80a60 (diff)
downloademacs-257f40f26707cf9aa825b16c19d601a71bf27d66.tar.gz
emacs-257f40f26707cf9aa825b16c19d601a71bf27d66.zip
Implement Ctrl-Mouse-2 (split vertically) for toolkit scrollbars
Diffstat (limited to 'src/xterm.c')
-rw-r--r--src/xterm.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 56a57b23b1e..f6566c1b32e 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -8436,6 +8436,10 @@ x_window_to_scroll_bar (window_id)
8436{ 8436{
8437 Lisp_Object tail; 8437 Lisp_Object tail;
8438 8438
8439#ifdef USE_GTK
8440 window_id = (Window) xg_get_scroll_id_for_window (window_id);
8441#endif /* USE_GTK */
8442
8439 for (tail = Vframe_list; 8443 for (tail = Vframe_list;
8440 XGCTYPE (tail) == Lisp_Cons; 8444 XGCTYPE (tail) == Lisp_Cons;
8441 tail = XCDR (tail)) 8445 tail = XCDR (tail))
@@ -9860,7 +9864,6 @@ x_scroll_bar_expose (bar, event)
9860 This may be called from a signal handler, so we have to ignore GC 9864 This may be called from a signal handler, so we have to ignore GC
9861 mark bits. */ 9865 mark bits. */
9862 9866
9863#ifndef USE_TOOLKIT_SCROLL_BARS
9864 9867
9865static void 9868static void
9866x_scroll_bar_handle_click (bar, event, emacs_event) 9869x_scroll_bar_handle_click (bar, event, emacs_event)
@@ -9914,6 +9917,7 @@ x_scroll_bar_handle_click (bar, event, emacs_event)
9914 XSETINT (bar->dragging, y - XINT (bar->start)); 9917 XSETINT (bar->dragging, y - XINT (bar->start));
9915#endif 9918#endif
9916 9919
9920#ifndef USE_TOOLKIT_SCROLL_BARS
9917 /* If the user has released the handle, set it to its final position. */ 9921 /* If the user has released the handle, set it to its final position. */
9918 if (event->type == ButtonRelease 9922 if (event->type == ButtonRelease
9919 && ! NILP (bar->dragging)) 9923 && ! NILP (bar->dragging))
@@ -9924,6 +9928,7 @@ x_scroll_bar_handle_click (bar, event, emacs_event)
9924 x_scroll_bar_set_handle (bar, new_start, new_end, 0); 9928 x_scroll_bar_set_handle (bar, new_start, new_end, 0);
9925 bar->dragging = Qnil; 9929 bar->dragging = Qnil;
9926 } 9930 }
9931#endif
9927 9932
9928 /* Same deal here as the other #if 0. */ 9933 /* Same deal here as the other #if 0. */
9929#if 0 9934#if 0
@@ -9941,6 +9946,8 @@ x_scroll_bar_handle_click (bar, event, emacs_event)
9941 } 9946 }
9942} 9947}
9943 9948
9949#ifndef USE_TOOLKIT_SCROLL_BARS
9950
9944/* Handle some mouse motion while someone is dragging the scroll bar. 9951/* Handle some mouse motion while someone is dragging the scroll bar.
9945 9952
9946 This may be called from a signal handler, so we have to ignore GC 9953 This may be called from a signal handler, so we have to ignore GC
@@ -11421,10 +11428,18 @@ handle_one_xevent (dpyinfo, eventp, bufp_r, numcharsp, finish)
11421 } 11428 }
11422 else 11429 else
11423 { 11430 {
11424#ifndef USE_TOOLKIT_SCROLL_BARS
11425 struct scroll_bar *bar 11431 struct scroll_bar *bar
11426 = x_window_to_scroll_bar (event.xbutton.window); 11432 = x_window_to_scroll_bar (event.xbutton.window);
11427 11433
11434#ifdef USE_TOOLKIT_SCROLL_BARS
11435 /* Make the "Ctrl-Mouse-2 splits window" work for toolkit
11436 scroll bars. */
11437 if (bar && event.xbutton.state & ControlMask)
11438 {
11439 x_scroll_bar_handle_click (bar, &event, &emacs_event);
11440 *finish = X_EVENT_DROP;
11441 }
11442#else /* not USE_TOOLKIT_SCROLL_BARS */
11428 if (bar) 11443 if (bar)
11429 x_scroll_bar_handle_click (bar, &event, &emacs_event); 11444 x_scroll_bar_handle_click (bar, &event, &emacs_event);
11430#endif /* not USE_TOOLKIT_SCROLL_BARS */ 11445#endif /* not USE_TOOLKIT_SCROLL_BARS */
@@ -11534,7 +11549,8 @@ handle_one_xevent (dpyinfo, eventp, bufp_r, numcharsp, finish)
11534 OTHER: 11549 OTHER:
11535#ifdef USE_X_TOOLKIT 11550#ifdef USE_X_TOOLKIT
11536 BLOCK_INPUT; 11551 BLOCK_INPUT;
11537 XtDispatchEvent (&event); 11552 if (*finish != X_EVENT_DROP)
11553 XtDispatchEvent (&event);
11538 UNBLOCK_INPUT; 11554 UNBLOCK_INPUT;
11539#endif /* USE_X_TOOLKIT */ 11555#endif /* USE_X_TOOLKIT */
11540 break; 11556 break;