Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
4cc76151
Commit
4cc76151
authored
Sep 23, 1994
by
Paul Reilly
Browse files
*** empty log message ***
parent
30d653c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
28 deletions
+40
-28
lwlib/xlwmenu.c
lwlib/xlwmenu.c
+40
-28
No files found.
lwlib/xlwmenu.c
View file @
4cc76151
...
...
@@ -1327,28 +1327,21 @@ Start (w, ev, params, num_params)
if
(
!
mw
->
menu
.
popped_up
)
{
menu_post_event
=
*
ev
;
next_release_must_exit
=
0
;
pop_up_menu
(
mw
,
ev
)
;
}
else
/* If we push a button while the menu is posted semipermanently,
releasing the button should always pop the menu down. */
next_release_must_exit
=
1
;
{
/* If we push a button while the menu is posted semipermanently,
releasing the button should always pop the menu down. */
next_release_must_exit
=
1
;
XtCallCallbackList
((
Widget
)
mw
,
mw
->
menu
.
open
,
NULL
);
/* notes the absolute position of the menubar window */
mw
->
menu
.
windows
[
0
].
x
=
ev
->
xmotion
.
x_root
-
ev
->
xmotion
.
x
;
mw
->
menu
.
windows
[
0
].
y
=
ev
->
xmotion
.
y_root
-
ev
->
xmotion
.
y
;
/* notes the absolute position of the menubar window */
mw
->
menu
.
windows
[
0
].
x
=
ev
->
xmotion
.
x_root
-
ev
->
xmotion
.
x
;
mw
->
menu
.
windows
[
0
].
y
=
ev
->
xmotion
.
y_root
-
ev
->
xmotion
.
y
;
/* handles the down like a move, slots are compatible */
handle_motion_event
(
mw
,
&
ev
->
xmotion
);
XtGrabPointer
((
Widget
)
mw
,
False
,
(
PointerMotionMask
|
PointerMotionHintMask
|
ButtonReleaseMask
|
ButtonPressMask
),
GrabModeAsync
,
GrabModeAsync
,
None
,
mw
->
menu
.
cursor_shape
,
((
XButtonPressedEvent
*
)
ev
)
->
time
);
pointer_grabbed
=
1
;
/* handles the down like a move, slots are compatible */
handle_motion_event
(
mw
,
&
ev
->
xmotion
);
}
}
static
void
...
...
@@ -1390,12 +1383,17 @@ Select (w, ev, params, num_params)
{
mw
->
menu
.
popped_up
=
False
;
XtUngrabPointer
((
Widget
)
mw
,
ev
->
xmotion
.
time
);
XtPopdown
(
XtParent
(
mw
));
if
(
XtIsShell
(
XtParent
(
mw
)))
XtPopdown
(
XtParent
(
mw
));
else
{
XtRemoveGrab
((
Widget
)
mw
);
display_menu
(
mw
,
0
,
False
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
}
}
/* callback */
XtCallCallbackList
((
Widget
)
mw
,
mw
->
menu
.
select
,
(
XtPointer
)
selected_item
);
}
...
...
@@ -1416,7 +1414,8 @@ pop_up_menu (mw, event)
XtCallCallbackList
((
Widget
)
mw
,
mw
->
menu
.
open
,
NULL
);
size_menu
(
mw
,
0
);
if
(
XtIsShell
(
XtParent
(
mw
)))
size_menu
(
mw
,
0
);
w
=
mw
->
menu
.
windows
[
0
].
width
;
h
=
mw
->
menu
.
windows
[
0
].
height
;
...
...
@@ -1433,10 +1432,26 @@ pop_up_menu (mw, event)
y
=
HeightOfScreen
(
screen
)
-
h
-
2
*
borderwidth
;
mw
->
menu
.
popped_up
=
True
;
XtConfigureWidget
(
XtParent
(
mw
),
x
,
y
,
w
,
h
,
XtParent
(
mw
)
->
core
.
border_width
);
XtPopup
(
XtParent
(
mw
),
XtGrabExclusive
);
display_menu
(
mw
,
0
,
False
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
if
(
XtIsShell
(
XtParent
(
mw
)))
{
XtConfigureWidget
(
XtParent
(
mw
),
x
,
y
,
w
,
h
,
XtParent
(
mw
)
->
core
.
border_width
);
XtPopup
(
XtParent
(
mw
),
XtGrabExclusive
);
display_menu
(
mw
,
0
,
False
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
mw
->
menu
.
windows
[
0
].
x
=
x
+
borderwidth
;
mw
->
menu
.
windows
[
0
].
y
=
y
+
borderwidth
;
}
else
{
XEvent
*
ev
=
(
XEvent
*
)
event
;
XtAddGrab
((
Widget
)
mw
,
True
,
True
);
/* notes the absolute position of the menubar window */
mw
->
menu
.
windows
[
0
].
x
=
ev
->
xmotion
.
x_root
-
ev
->
xmotion
.
x
;
mw
->
menu
.
windows
[
0
].
y
=
ev
->
xmotion
.
y_root
-
ev
->
xmotion
.
y
;
}
#ifdef emacs
x_catch_errors
();
#endif
...
...
@@ -1455,8 +1470,5 @@ pop_up_menu (mw, event)
x_uncatch_errors
();
#endif
mw
->
menu
.
windows
[
0
].
x
=
x
+
borderwidth
;
mw
->
menu
.
windows
[
0
].
y
=
y
+
borderwidth
;
handle_motion_event
(
mw
,
(
XMotionEvent
*
)
event
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment