Re: [AD] mouse presses and releases skipped when double clicking |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Thu, Aug 24, 2000 at 03:56:33PM +0100, Vincent Penquerc'h wrote:
> I fixed this one.
OK, I've applied the patch to CVS, and I'm attaching a proper
patch.
George
--
Random project update:
09/05/2000: Libnet 0.10.8 uploaded -- a few bugfixes
http://www.canvaslink.com/libnet/ (try changes-0.10.8.txt)
Index: src/gui.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/gui.c,v
retrieving revision 1.8
diff -u -r1.8 gui.c
--- src/gui.c 2000/08/12 10:44:34 1.8
+++ src/gui.c 2000/08/24 15:18:42
@@ -783,6 +783,38 @@
if (player->res & D_CLOSE)
return FALSE;
+ /* deal with mouse buttons presses and releases */
+ if (gui_mouse_b() != player->mouse_b) {
+ player->res |= offer_focus(player->dialog, player->mouse_obj, &player->focus_obj, FALSE);
+
+ if (player->mouse_obj >= 0) {
+ /* send press and release messages */
+ if ((gui_mouse_b() & 1) && !(player->mouse_b & 1))
+ MESSAGE(player->mouse_obj, MSG_LPRESS, gui_mouse_b());
+ if (!(gui_mouse_b() & 1) && (player->mouse_b & 1))
+ MESSAGE(player->mouse_obj, MSG_LRELEASE, gui_mouse_b());
+
+ if ((gui_mouse_b() & 4) && !(player->mouse_b & 4))
+ MESSAGE(player->mouse_obj, MSG_MPRESS, gui_mouse_b());
+ if (!(gui_mouse_b() & 4) && (player->mouse_b & 4))
+ MESSAGE(player->mouse_obj, MSG_MRELEASE, gui_mouse_b());
+
+ if ((gui_mouse_b() & 2) && !(player->mouse_b & 2))
+ MESSAGE(player->mouse_obj, MSG_RPRESS, gui_mouse_b());
+ if (!(gui_mouse_b() & 2) && (player->mouse_b & 2))
+ MESSAGE(player->mouse_obj, MSG_RRELEASE, gui_mouse_b());
+
+ player->mouse_b = gui_mouse_b();
+
+ if (player->res == D_O_K)
+ player->click_wait = TRUE;
+ }
+ else
+ dialog_message(player->dialog, MSG_IDLE, 0, &nowhere);
+
+ goto getout;
+ }
+
/* need to reinstall the dclick and switch handlers? */
if (gui_install_time != _allegro_count) {
install_int(dclick_check, 20);
@@ -866,43 +898,6 @@
dialog_message(player->dialog, MSG_IDLE, 0, &nowhere);
/* goto getout; */
- }
-
- /* deal with mouse buttons presses and releases */
- if (gui_mouse_b() != player->mouse_b) {
- player->res |= offer_focus(player->dialog, player->mouse_obj, &player->focus_obj, FALSE);
-
- if (player->mouse_obj >= 0) {
- dclick_time = 0;
- dclick_status = DCLICK_START;
- player->mouse_ox = gui_mouse_x();
- player->mouse_oy = gui_mouse_y();
-
- /* send press and release messages */
- if ((gui_mouse_b() & 1) && !(player->mouse_b & 1))
- MESSAGE(player->mouse_obj, MSG_LPRESS, gui_mouse_b());
- if (!(gui_mouse_b() & 1) && (player->mouse_b & 1))
- MESSAGE(player->mouse_obj, MSG_LRELEASE, gui_mouse_b());
-
- if ((gui_mouse_b() & 4) && !(player->mouse_b & 4))
- MESSAGE(player->mouse_obj, MSG_MPRESS, gui_mouse_b());
- if (!(gui_mouse_b() & 4) && (player->mouse_b & 4))
- MESSAGE(player->mouse_obj, MSG_MRELEASE, gui_mouse_b());
-
- if ((gui_mouse_b() & 2) && !(player->mouse_b & 2))
- MESSAGE(player->mouse_obj, MSG_RPRESS, gui_mouse_b());
- if (!(gui_mouse_b() & 2) && (player->mouse_b & 2))
- MESSAGE(player->mouse_obj, MSG_RRELEASE, gui_mouse_b());
-
- player->mouse_b = gui_mouse_b();
-
- if (player->res == D_O_K)
- player->click_wait = TRUE;
- }
- else
- dialog_message(player->dialog, MSG_IDLE, 0, &nowhere);
-
- goto getout;
}
/* deal with mouse wheel clicks */