[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
> If it's causing too much trouble then the auto-opening should go.
Well, it seems I overreacted a little bit ;-)
The problem has been introduced in rev 1.31 of src/gui.c by the following
patch from David:
--- gui.c Fri Oct 12 11:45:06 2001
+++ gui.new.c Fri Oct 12 11:52:04 2001
@@ -1779,7 +1779,7 @@
MENU_INFO m;
int ret = D_O_K;
- int x;
+ int x, i;
switch (msg) {
@@ -1805,10 +1805,25 @@
case MSG_GOTMOUSE:
case MSG_CLICK:
+ /* steal the focus */
+ i = find_dialog_focus(active_dialog);
+ if (i >= 0) {
+ active_dialog[i].flags &= ~D_GOTMOUSE;
+ SEND_MESSAGE(active_dialog+i, MSG_LOSTMOUSE, 0);
+ }
+
+ /* run the menu */
_do_menu(d->dp, NULL, TRUE, d->x-1, d->y-1, FALSE, &x, d->w+2, d->h+2);
ret |= x;
do {
} while (gui_mouse_b());
+
+ /* put the focus */
+ i = find_mouse_object(active_dialog);
+ if (i >= 0) {
+ active_dialog[i].flags |= D_GOTMOUSE;
+ SEND_MESSAGE(active_dialog+i, MSG_GOTMOUSE, 0);
+ }
break;
}
What's exactly the purpose of this patch ? The cvs log reads "David A.
Capello made d_menu_proc steal/return focus when activated/deactivated".
--
Eric Botcazou
ebotcazou@xxxxxxxxxx