[bug] double click general bug

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

[bug] double click general bug

Post by REDDemon »

probably related to that bug also:
http://irrlicht.sourceforge.net/forum/ ... =7&t=45875

double click event is always generated even if the first click triggerd something (a button for example) and even if the mouse moved in the mean while.

So that if I have a button wich when clicked open a window and inside the window there's a a element that can be activated with double click. If I click that element
only once it is triggered because a double click event was generated.

How to reproduce:

FileOpen dialog:
click anywhere and then quickly click on a folder/file. The folder file will be opened as a double click

Don't know how to fix. After I finish some other work I can start investigating this.
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: [bug] double click general bug

Post by CuteAlien »

As I already wrote in the other bug-report that element is not using the double-click but an own implementation. I could not reproduce the problem last time I tried to reproduce it, but can try again. Anyway - I'm not sure about your reason for a second bug-report saying this is more "general"... this looks to me like the exact same problem as the last you reported. Or is there something new I'm missing?
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Re: [bug] double click general bug

Post by REDDemon »

yes sorry, the other bug was in the end the same bug already posted (anyway was not noticeable and had to debug a lot to find that). reproduced and fixed on 2 different machines.

line 452 in "CGUIListBox.cpp":

Code: Select all

 
gui::EGUI_EVENT_TYPE eventType = (Selected == oldSelected && now < selectTime + 500) ? EGET_LISTBOX_SELECTED_AGAIN : EGET_LISTBOX_CHANGED;
 
should be:

Code: Select all

 
s32 arbitrarySmallValue = 4;
gui::EGUI_EVENT_TYPE eventType =(
(   (oldMousePos-newMousePos).getLenghtSQ()  < arbitrarySmallValue  )  && (Selected == oldSelected && now < selectTime + 500)
) ? EGET_LISTBOX_SELECTED_AGAIN : EGET_LISTBOX_CHANGED
 
vector2di oldMousePos = newMousePos;
 
 
of course the class need 2 new members:

Code: Select all

 
vector2di oldMousePos
vector2di newMousePos;
 
and at line 410:

Code: Select all

 
case EMIE_MOUSE_MOVED:
                                        if (Selecting || MoveOverSelect)
                                        {
                                                newMousePos.set(event.MouseInput.X,event.MouseInput.Y); //  NEW LINE!
                                                if (isPointInside(p))
                                                {
                                                        selectNew(event.MouseInput.Y, true);
                                                        return true;
                                                }
                                        }
 
I know events bug are hard to reproduce ( also the time from 1 click to another click seems to change on my machine and is not fixed while is supposed to be fixed) but that code fixed the problem on my machine and now everything works fine :).
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: [bug] double click general bug

Post by CuteAlien »

OK, thanks. I hope I find time for checking it in the next days.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Jacky_J
Posts: 55
Joined: Fri Apr 27, 2007 5:01 am

Re: [bug] double click general bug

Post by Jacky_J »

This problem still happens in 1.8 if anyone cares
Post Reply