Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » problems with popup/pulldown menus on Gentoo/kde linux
problems with popup/pulldown menus on Gentoo/kde linux [message #7859] Sat, 27 January 2007 02:36 Go to next message
ebojd is currently offline  ebojd
Messages: 225
Registered: January 2007
Location: USA
Experienced Member
Hello all,

I am having problems with popup and pulldown menus on theIDE and all examples both with precompiled versions (upp-linux386-605) and compiling (upp-src-2007.1beta, upp-src-2007.1beta2, upp-0.701.1, and directly from the SVN tree with borrowed Makefiles from the linux version).

The basic problem is all popup and pulldown menus disappear as soon as I attempted to move into them from the direction of the original click, but will allow to enter them by first moving away and entering them from a different side than the closest. As an example, if I choose the AddressBook demo I can only get it to build by either using the F7 hot-key or by clicking on build, moving up and away from the pulldown list (without moving the mouse over Debug, Assist, or Setup), and then move into the list from the side or below. Similar behavior occurs with popups. My guess is that there is a logical flip somewhere in the menus code.

Anyone have ideas what's going on before I start wading through the code with a debugger?

BTW, I am running Gentoo-Linux(2.6.18-r6), gcc(4.1.1), xorg-x11(7.1), kde(3.5.5)

Thanks,

EBo --
Re: problems with popup/pulldown menus on Gentoo/kde linux [message #7890 is a reply to message #7859] Mon, 29 January 2007 15:06 Go to previous messageGo to next message
ebojd is currently offline  ebojd
Messages: 225
Registered: January 2007
Location: USA
Experienced Member
Hello all,

Since I have had no reply in a few days I thought I would post a hack that is helping some...

Looking in the code I found that GetKbdDelay() was passed into SetTimeCallback at or near line 326 of CtrlMouse.cpp. In X11App.cpp (line 366), it is hard coded to 250ms, and the GetKbdSpeed is likewise hard coded at 25. I bumped the callback time delay up, and it seemed to help some. As a note, there are numerous postings regarding Gnome/KDE development where they have attempted to address this (see http://lists.kde.org/?l=kde-accessibility&m=105268584821 487&w=2 for example). I do not know how they correct this, but the windows implementation is considerably more sophisticated than the hardcoded values.

But I think the real problem is that the mouse is not inside the bounding box/rectangle of the menu button or during a click within an active window. To test this I modified DispatchMouse() and added 5 pxels to the x and y values of the pointer. This is a total hack, but things work mostly better. The menus stay up for awhile, and behave mostly as I expect. They still terminate a little early sometimes, but it is essentially workable now.

Thanks and best regards,

EBo --

Re: problems with popup/pulldown menus on Gentoo/kde linux [message #7910 is a reply to message #7890] Wed, 31 January 2007 09:52 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
ebojd wrote on Mon, 29 January 2007 09:06

Hello all,

Since I have had no reply in a few days I thought I would post a hack that is helping some...

Looking in the code I found that GetKbdDelay() was passed into SetTimeCallback at or near line 326 of CtrlMouse.cpp. In X11App.cpp (line 366), it is hard coded to 250ms, and the GetKbdSpeed is likewise hard coded at 25.



Correct. And it is true this should be improved. Anyway, how this can be related to popups?


Quote:


But I think the real problem is that the mouse is not inside the bounding box/rectangle of the menu button or during a click within an active window. To test this I modified DispatchMouse() and added 5 pxels to the x and y values of the pointer. This is a total hack, but things work mostly better. The menus stay up for awhile, and behave mostly as I expect. They still terminate a little early sometimes, but it is essentially workable now.



Interesting.

Well, I have to apologize to not responing sooner (due to limited time, I was recently responding just to library issues; this is the library issue but placed into the wrong forum...).

Recently I tried to install KDE on my ubuntu to reproduce the behaviour, but everything seems OK so far.

Anyway, the possible problem is with X11 focus settings... There is a behaviour setting in KDE I guess, are not you using something like "Focus follows the mouse"?

Mirek
Re: problems with popup/pulldown menus on Gentoo/kde linux [message #7913 is a reply to message #7910] Wed, 31 January 2007 11:12 Go to previous messageGo to next message
ebojd is currently offline  ebojd
Messages: 225
Registered: January 2007
Location: USA
Experienced Member
oops. Sorry to have posted in the incorrect forum... Hopefully after awhile I will know my way around. I'll continue this here unless you want it moved.

> Correct. And it is true this should be improved. Anyway,
> how this can be related to popups?

Well, it probably shouldn't, but when I was poking at things I noticed that this was hardcoded and less than what was set for wince. When I bumped it up it actually seemd to help so I left and reported if for now.

> Anyway, the possible problem is with X11 focus settings...
> There is a behaviour setting in KDE I guess, are not you using
> something like "Focus follows the mouse"?

I expected it was X11 settings and played with them a little, but to no avail. I am currently using "Focus strictly under mouse", so will try setting it to "Focus under mouse" instead (after I get some sleep Wink

Thanks again,
Re: problems with popup/pulldown menus on Gentoo/kde linux [message #7916 is a reply to message #7913] Wed, 31 January 2007 11:54 Go to previous messageGo to next message
ebojd is currently offline  ebojd
Messages: 225
Registered: January 2007
Location: USA
Experienced Member

I decided to remove my hacks and make a quick check before turing in for the night. Setting "Focus under mouse" instead of "Focus strictly under mouse" fixed the problem. It is interesting that I only have this weird popup/menu problem with upp and strict focus, and no other applications. That is probably a bug, but at least we can document it and possibly set up a debug proceedure Wink

Thanks Mirek!

Re: problems with popup/pulldown menus on Gentoo/kde linux [message #7925 is a reply to message #7916] Wed, 31 January 2007 17:23 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Excellent, now I know where to look Smile

BTW, those keyboard settings do not in fact affect keyboard, but scrollbar arrows - these timing constants are used for "autorepeat" there.

Mirek
Re: problems with popup/pulldown menus on Gentoo/kde linux [message #7926 is a reply to message #7925] Wed, 31 January 2007 18:24 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Please, check this fix (before we roll out another beta):

CtrlCore/X11Wnd.cpp 637:

void Ctrl::FocusSync()
{
	Window fw = GetXServerFocusWindow();
	if(fw != focusWindow) {
		LLOG("FocusSync to " << FormatIntHex(fw));
		if(fw) {
			int q = Xwindow().Find(fw);
			if(q < 0)
				return;
			focusWindow = fw;
			XWindow& w = Xwindow()[q];
			if(w.ctrl) {
				if(w.ctrl->IsPopUp())
					return;
				KillFocus(focusWindow);
				focusWindow = None;
				w.ctrl->SetFocusWnd();
				return;
			}
		}
		KillFocus(focusWindow);
		focusWindow = None;
	}
}


Mirek
Re: problems with popup/pulldown menus on Gentoo/kde linux [message #7935 is a reply to message #7926] Thu, 01 February 2007 07:55 Go to previous messageGo to next message
ebojd is currently offline  ebojd
Messages: 225
Registered: January 2007
Location: USA
Experienced Member
Thanks Mirek,

I just made the patch and will start playing with it tomorrow.

As a note, I made the previous hacks based on stepping through one of my apps with a debugger. I ended up running through a method that called those functions. I thought it was strange that it called them at all, but I tweaked a couple of things just to see if they made a difference -- which they did enough that I could work more effectively... Go figure...

Thanks again, and as I said I will test tomorrow.

Re: problems with popup/pulldown menus on Gentoo/kde linux [message #7949 is a reply to message #7935] Thu, 01 February 2007 18:16 Go to previous messageGo to next message
ebojd is currently offline  ebojd
Messages: 225
Registered: January 2007
Location: USA
Experienced Member
I've been running upp for several hours and the changes seem to work wonderfully.

Thanks Mirek!

Re: problems with popup/pulldown menus on Gentoo/kde linux [message #8659 is a reply to message #7949] Thu, 22 March 2007 21:00 Go to previous messageGo to next message
ebojd is currently offline  ebojd
Messages: 225
Registered: January 2007
Location: USA
Experienced Member
After rebuilding and installing U++ after all the GCC.bm problems I find that the popup problem has once again reared it's head. Wasn't this patch rolled into the source tree for RC3? If not, will it be added to RC4/final?

EBo --
Re: problems with popup/pulldown menus on Gentoo/kde linux [message #8685 is a reply to message #8659] Sat, 24 March 2007 16:27 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Please, can you check the code listed here is in our sources?

Another possible explanation is that the fix is broken by another fix:)

BTW, this does not belong here, moving to appropriate forum.

Mirek
Re: problems with popup/pulldown menus on Gentoo/kde linux [message #8701 is a reply to message #8685] Mon, 26 March 2007 09:50 Go to previous messageGo to next message
ebojd is currently offline  ebojd
Messages: 225
Registered: January 2007
Location: USA
Experienced Member
Just checked the code, and yes it is in the source I compiled against. I'm not sure what changed to make it no longer work. My only guess is that when I had my personal copy of the uppsrc, etc., made to my ~/upp directory that something got confuesed when I upgraded...

Just a guess.

EBo --
Re: problems with popup/pulldown menus on Gentoo/kde linux [message #8702 is a reply to message #8701] Mon, 26 March 2007 11:11 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
ebojd wrote on Mon, 26 March 2007 03:50

Just checked the code, and yes it is in the source I compiled against. I'm not sure what changed to make it no longer work. My only guess is that when I had my personal copy of the uppsrc, etc., made to my ~/upp directory that something got confuesed when I upgraded...

Just a guess.

EBo --



The one related fix that could affect this is X11Proc.cpp 104:

	case FocusOut:
		if(w.xic)
			XUnsetICFocus(w.xic);
		if(this == focusCtrlWnd) // this was
			KillFocusWnd();  // added
		break;


Please, check whether this matches your code and if it does, try to comment it out:

	case FocusOut:
		if(w.xic)
			XUnsetICFocus(w.xic);
//		if(this == focusCtrlWnd) // this was
//			KillFocusWnd();  // added
		break;


and report the result...

Mirek
Re: problems with popup/pulldown menus on Gentoo/kde linux [message #8704 is a reply to message #8702] Mon, 26 March 2007 15:27 Go to previous messageGo to next message
ebojd is currently offline  ebojd
Messages: 225
Registered: January 2007
Location: USA
Experienced Member
luzr wrote on Mon, 26 March 2007 04:11


	case FocusOut:
		if(w.xic)
			XUnsetICFocus(w.xic);
//		if(this == focusCtrlWnd) // this was
//			KillFocusWnd();  // added
		break;


and report the result...

Mirek


Mirek,

Commenting out the these lines appeared to make a difference. I will recompile without this patch and see if the problem comes back...

EBo --
Re: problems with popup/pulldown menus on Gentoo/kde linux [message #8705 is a reply to message #8704] Mon, 26 March 2007 15:56 Go to previous messageGo to next message
ebojd is currently offline  ebojd
Messages: 225
Registered: January 2007
Location: USA
Experienced Member

Yep, I've verified that commenting out those last couple of lines fixed the problem, and compiled it back in just to double check...


Here's the pactch:

--- uppsrc/CtrlCore/X11Proc.cpp 2007-03-06 23:01:46.000000000 -0500
+++ uppsrc/CtrlCore/X11Proc.cpp 2007-03-26 08:47:24.000000000 -0400
@@ -104,8 +104,8 @@
        case FocusOut:
                if(w.xic)
                        XUnsetICFocus(w.xic);
-               if(this == focusCtrlWnd)
-                       KillFocusWnd();
+//             if(this == focusCtrlWnd)
+//                     KillFocusWnd();
                break;
        case KeyPress:
                pressed = true;


Thanks Mirek!

EBo --
Re: problems with popup/pulldown menus on Gentoo/kde linux [message #8706 is a reply to message #8705] Mon, 26 March 2007 17:07 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
ebojd wrote on Mon, 26 March 2007 09:56


Yep, I've verified that commenting out those last couple of lines fixed the problem, and compiled it back in just to double check...



Unfortunately, this is not the end of story, because it was an important bug fix Smile (Without this, menu open in U++ does not get closed when you click e.g. system menu or another window).

I will have to figure out how to fix this fix...

Mirek
Re: problems with popup/pulldown menus on Gentoo/kde linux [message #8707 is a reply to message #8706] Mon, 26 March 2007 18:42 Go to previous messageGo to next message
ebojd is currently offline  ebojd
Messages: 225
Registered: January 2007
Location: USA
Experienced Member
DoH! Razz

For now I can pull it out and set "focus under mouse" until we sort things...

Thanks,

EBo --
Re: problems with popup/pulldown menus on Gentoo/kde linux [message #8712 is a reply to message #8707] Mon, 26 March 2007 20:39 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
ebojd wrote on Mon, 26 March 2007 12:42

DoH! Razz

For now I can pull it out and set "focus under mouse" until we sort things...

Thanks,

EBo --



Unfortunately, that is not the solution for 2007.1... (I wish it was Wink

Mirek
Re: problems with popup/pulldown menus on Gentoo/kde linux [message #8729 is a reply to message #8712] Wed, 28 March 2007 14:45 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
OK, I spent about 10 hours fixing this, I hope it is OK now.

In the end of day, I have used the "standard" solution for X11 - popup takes mouse capture and deactivates when user clicks outside.

This slightly changes PopUp interface - the parameter "active" has changed meaning, now "true" means user interaction is expected with popup (menu, drop lists), while "false" means popup is static (tooltip).

Mirek
Re: problems with popup/pulldown menus on Gentoo/kde linux [message #8735 is a reply to message #8729] Wed, 28 March 2007 17:31 Go to previous messageGo to previous message
ebojd is currently offline  ebojd
Messages: 225
Registered: January 2007
Location: USA
Experienced Member
Thanks Mirek,

The experimental code (in Uvs) appears to have fixed it. Once the changes are setted on and posted to rc4 or 2007.1 final I'll post a new gentoo ebuild.

Thanks for the quick turnarround and great wotk!

EBo --
Previous Topic: Navigating with tab key
Next Topic: Gui Tutorial 16 oops...
Goto Forum:
  


Current Time: Thu Apr 18 04:26:35 CEST 2024

Total time taken to generate the page: 0.02263 seconds