|
|
Home » U++ Library support » U++ Core » Core regression between svn 6693 -> 6697
Core regression between svn 6693 -> 6697 [message #41546] |
Sat, 28 December 2013 11:23  |
Didier
Messages: 725 Registered: November 2008 Location: France
|
Contributor |
|
|
Hi all,
Yesterday I spent most my day trying to find out why the AutoWaitCursor was not working any more.
At first I though it was my code so I dug, and dug and dug again ... without success.
I finally took my most recent app code and moved around Upp SVN versions and I found the following:
==> Events and drawing do not work the exact same way as before
- WaitCursor does not work any more (the painting of the mouse cursor is done at the end of the action you are actually wainting for ==> so it just appears very briefly while it does not appear when it should (even if the waiting lasts seconds ...)
- Opening a popup menu of a Ctrl causes refresh of all Ctrls of layout each time the mouse hovers a new selection (without having to select it)
- Closing of a popup menu is delayed until the action selected by menu is finished (mostly visible when selecting copy action in GraphCtrl for the Big data graph)
- App taking focus, by selecting top window decoration, not inside app view (switching from explorer to app for example) causes a full repaint ( while it didn't before )
Are these changes normal or is it my application that is not built correctly : like I should use a PostCallback in all Popup menu actions ??
I encountered these problems while working on my GraphCtrl package that is in SVN sandbox.
I have only tested on LINUX (not tested on win32)
The changes have been introduced somewhere between SVN versions : 6693(OK) ==> 6697(BUG)
[Updated on: Sat, 28 December 2013 12:00] Report message to a moderator
|
|
|
|
Re: Core regression between svn 6693 -> 6697 [message #41564 is a reply to message #41563] |
Mon, 30 December 2013 18:33   |
Didier
Messages: 725 Registered: November 2008 Location: France
|
Contributor |
|
|
Hi Klugier,
I was aware of the recent changes and though the problem was coming from these changes.
But I think it is important to have consistent behavior between platforms everywhere it is possible :
Before these recent changes, WIN and Linux behave the same, it probably isn't the case anymore ...
I think this is quite an important issue ( although WaitCursor is not of prior importance ) but there are probably other differences not spotted yet ( and that may be important ).
These "differences" may cause some serious problems to existing applications that are still in development and that may get recompiled without the X11 flag
With X11, I recover the original behavior but I have to admit that raw drawing performance is much higher with GTK backend rather than with X11
[Updated on: Mon, 30 December 2013 18:34] Report message to a moderator
|
|
|
|
Re: Core regression between svn 6693 -> 6697 [message #41585 is a reply to message #41573] |
Wed, 01 January 2014 20:40   |
Didier
Messages: 725 Registered: November 2008 Location: France
|
Contributor |
|
|
Hi Mirek,
Quote: | it appears to me that some of problems are just excesive repainting, which is not really a bug...It is also possible that these are caused by GTK itself, so in that case there would be no solution to that...
|
Well, if there is no correction to this, this will definitely have an impact on general Ctrl::Paint() method design in order to make them the fastest possible ( mostly impacting heavy controls ).
NB: I would be glad propose a patch for the WaitCursor() issue but I don't have sufficient knowledge about internals ( but as far as I have seen for the moment, the Paint() method is called at a different moment ... and this call seems to originate from a Gtk method ... )
Quote: | Sorry for inconvience, will fix these ASAP
|
No inconvenience at all, this is normal work
[Updated on: Wed, 01 January 2014 20:50] Report message to a moderator
|
|
|
|
|
Re: Core regression between svn 6693 -> 6697 [message #41639 is a reply to message #41638] |
Mon, 06 January 2014 23:05   |
Didier
Messages: 725 Registered: November 2008 Location: France
|
Contributor |
|
|
Hi again,
After further verifications the simple WaitCursor() call works fine but there seems to be some other issue concerning this point I previously pointed out:
Quote: | Closing of a popup menu is delayed until the action selected by menu is finished (mostly visible when selecting copy action in GraphCtrl for the Big data graph)
|
I tried these three different codes to try to fallback in a 'simple WaitCursor()' case :
bar.Add( t_("Copy"), GraphCtrlImg::COPY(), THISBACK1(SaveToClipboard, false));
bar.Add( t_("Copy_post"), GraphCtrlImg::COPY(), THISBACK2(PostCallback, THISBACK1(SaveToClipboard, false), 0));
bar.Add( t_("Copy_100ms"), GraphCtrlImg::COPY(), THISBACK3(SetTimeCallback, 100, THISBACK1(SaveToClipboard, false), 0));false));
'Copy' : works but menu stays displayed until copy is finished (can be quite long)
'Copy_post' : menu disappears immediately after pressing button BUT .... the copying action starts only after I press the mouse button somewhere in the application : it will last indefinitely if I don't press the button !!!!
'Copy_100ms': Same as 'Copy_post'
The two later cases are very strange, especially if you consider that I already use 'SetTimeCallback()' without any problems
|
|
|
|
|
|
Re: Core regression between svn 6693 -> 6697 [message #41676 is a reply to message #41675] |
Thu, 09 January 2014 23:15   |
Didier
Messages: 725 Registered: November 2008 Location: France
|
Contributor |
|
|
Hi,
I wasn't precise enough, if you modify CursorImage() a little bit:
virtual Image CursorImage(Point p, dword keyflags)
{
LOG("CursorImage " << flag << " keyflags="<<keyflags); //******* MODIFIED LINE ********
return ((keyflags & K_CTRL) !=0) ? Image::Hand() : Image::Arrow(); //******* MODIFIED LINE ********
}
I get the following logs by just pressing/unpressing CTRL key and NOT MOVING the mouse ==> the icon is inverted from what I expect !
Quote: |
CursorImage false keyflags=0
CursorImage false keyflags=0
CursorImage false keyflags=0
CursorImage false keyflags=0
CursorImage false keyflags=0
CursorImage false keyflags=0
CursorImage false keyflags=0
CursorImage true keyflags=0 ************** 1rst PRESS ==> INVERSION POINT ********************
CursorImage true keyflags=0
CursorImage true keyflags=0
CursorImage true keyflags=0 Stays inverted until mouse is moved
CursorImage true keyflags=0
CursorImage true keyflags=0
CursorImage false keyflags=131072
CursorImage false keyflags=131072
CursorImage false keyflags=131072
CursorImage false keyflags=131072
CursorImage false keyflags=131072
CursorImage false keyflags=131072
CursorImage false keyflags=131072
CursorImage false keyflags=131072
CursorImage false keyflags=131072
CursorImage false keyflags=131072
CursorImage false keyflags=131072
CursorImage false keyflags=131072
CursorImage false keyflags=131072
CursorImage false keyflags=131072
CursorImage false keyflags=131072
CursorImage false keyflags=131072
CursorImage false keyflags=131072
CursorImage true keyflags=0
CursorImage true keyflags=0
CursorImage true keyflags=0
CursorImage true keyflags=0
CursorImage true keyflags=0
CursorImage true keyflags=0
CursorImage true keyflags=0
CursorImage true keyflags=0
CursorImage true keyflags=0
CursorImage false keyflags=131072
CursorImage false keyflags=131072
CursorImage false keyflags=131072
|
For the other problem, just modify the 'Action()' method:
void Action()
{
LOG("Action " << msecs());
ProcessEvents();
WaitCursor h; // ********* ADDED LINE ***********
Sleep(2000);
LOG("Action end " << msecs());
}
The logs show that everything works fine:
Quote: | Action 11095902
Action end 11097903
|
But the WaitCursor does not show, maybe this is a bad usage case ??
[Updated on: Thu, 09 January 2014 23:17] Report message to a moderator
|
|
|
|
|
|
|
Goto Forum:
Current Time: Tue Apr 29 09:21:39 CEST 2025
Total time taken to generate the page: 0.00936 seconds
|
|
|