Bug 89890 - kmenu is displayed in the wrong location in RTL desktops
Summary: kmenu is displayed in the wrong location in RTL desktops
Status: RESOLVED FIXED
Alias: None
Product: kicker
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: John Firebaugh
URL:
Keywords:
: 98326 102335 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-09-20 18:15 UTC by Diego Iastrubni
Modified: 2005-09-16 23:34 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Diego Iastrubni 2004-09-20 18:15:07 UTC
Version:            (using KDE KDE 3.3.0)
Installed from:    Compiled From Sources

move the kmenu to the right
run "kicker -reverse"
press the windows key
*only* the first time, the kmenu will be showed in the wrong location.
the next times the kmenu will be opened in the correct location
Comment 1 Aaron J. Seigo 2004-11-18 21:54:52 UTC
i followed your description precisely, and this works in CVS HEAD properly =)
this could well be due to the fact that we now use QLayouts in kicker rather than do it all by hand (which was error prone)
Comment 2 Diego Iastrubni 2004-12-25 02:13:37 UTC
I can still see this bus in CVS HEAD. 

I quited kicker (dcop kicker MainApplication-Interface quit), then deleted all config files for kicker (rm -f ~/.kde/share/config/kickerrc)
and then restarted kicker. Still happens.
Comment 3 Diego Iastrubni 2004-12-25 02:14:50 UTC
i can still see this bug in currect CVS
Comment 4 Stefan Nikolaus 2005-01-23 20:01:03 UTC
CVS commit by nikolaus: 

Set the correct kmenu position, if we use a keyboard shortcut and if it wasn't shown before.

BUG: 89890


  M +6 -0      menumanager.cpp   1.5


--- kdebase/kicker/core/menumanager.cpp  #1.4:1.5
@@ -150,4 +150,10 @@ void MenuManager::kmenuAccelActivated()
     else
     {
+        // We need the kmenu's size to place it at the right position.
+        // We cannot rely on the popup menu's current size(), if it wasn't
+        // shown before, so we resize it here according to its sizeHint().
+        const QSize size = m_kmenu->sizeHint();
+        m_kmenu->resize(size.width(),size.height());
+
         PanelPopupButton* button = m_kbuttons.at(0);
         m_kmenu->popup(popupPosition(button->popupDirection(),


Comment 5 Diego Iastrubni 2005-01-24 11:58:38 UTC
actually it does not. Not with keyboard and not with
the mouse. I still get the menu in the other side. 

I tested it also with -reversed (or --reversed) on LTR
desktops and still I see the bug.


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - now with 250MB free storage. Learn more.
http://info.mail.yahoo.com/mail_250

Comment 6 Meni Livne 2005-02-03 17:51:04 UTC
Yes, the bug is still there. The previous commit didn't change anything.
The problem is probably in share/global.cpp, in popupPosition():
--8<--
case( KPanelApplet::Up ):
  return QApplication::reverseLayout() ?
       QPoint( r.right() - popup->width() - (r.width() - p.x())
                               + 1, r.top() - popup->height() ) :
       QPoint( r.left() + p.x(),      r.top() - popup->height() );
--8<--

When in an RTL layout, we rely on the menu's width to display it in the right location, but its width isn't set right the first time it's displayed. There's our problem...
Comment 7 Stefan Nikolaus 2005-02-03 22:24:20 UTC
Okay, the original report stated that the misplacement occured after pressing the window key. I have followed the description and could confirm that. With the patch this behaviour is corrected.

Now, the misplacement should occur on both, mouse and key activation. I can't confirm that. I suppose the steps to reproduce should be the same, shouldn't they?

To #6:
For key activation the kmenu's size is initialized before the popupPosition calculation, introduced by the shown patch.
You blame the width for the problem. Is the kmenu shown the first time near the correct position and is only shifted horizontally?


Comment 8 Stefan Nikolaus 2005-02-03 22:29:12 UTC
http://bugs.kde.org/attachment.cgi?id=9419&action=view

Just a guess: Does this picture show the problem?
Comment 9 Meni Livne 2005-02-04 13:02:38 UTC
The misplacement seems to occur regardless of the way the kmenu is brought up the first time. You can even issue 'dcop kicker kicker showKMenu'...
The menu is shown at the right height, but it is at the far left edge of the screen, instead of above the k-button, which I have on the right in RTL mode.
As to your screenshot, that seems to be it. I also get it when the panel's horizontal and the k-button's on the right. Did you get it this way with 'kicker --reverse' or without?
Comment 10 Stefan Nikolaus 2005-02-04 14:35:26 UTC
*** Bug 98326 has been marked as a duplicate of this bug. ***
Comment 11 Stefan Nikolaus 2005-02-04 14:46:28 UTC
It seems that I've misinterpreted the original post and stumbled over another issue, which is solved by my patch. I should switch my brain to fuzzy logic mode while reading bug reports. ;-)

The reporters of the closed bug are using Gentoo 3.3.5-r1 and Fedora Core 3. I use SuSE 9.0. Which distribution do you use? Maybe this problem has something to do with the kmenu-patch for Qt living in qt-copy. I know that it is applied by SuSE in their packages.

The screenshot was taken from the closed bug report.
Comment 12 Diego Iastrubni 2005-02-04 15:55:37 UTC
I use qt-copy from CVS (quite outdated I need to
admit), but I still see the problem.

As Meni sayd, the problem accurs no matter how you
open the k-menu. 

I will update qt-copy and report back. IMHO, if
qt3.3.4 has a bug, hack arround it. I guess the trolls
will not release a new version until Qt 4.


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - 250MB free storage. Do more. Manage less. 
http://info.mail.yahoo.com/mail_250

Comment 13 Stefan Nikolaus 2005-02-04 16:33:09 UTC
I've just compiled qt-copy (04.02.2005). Without the 0047-fix-kmenu-width.diff patch I can see the described behaviour in reverse mode. Applying this patch solves the problem for me.
Comment 14 Diego Iastrubni 2005-02-04 17:42:52 UTC
Ok, I am using qt-copy and kde-cvs. I still see the
bug... am I missing something?


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Easier than ever with enhanced search. Learn more.
http://info.mail.yahoo.com/mail_250

Comment 15 Stefan Nikolaus 2005-02-04 17:56:44 UTC
I have reconfigured kdelibs and kdebase after applying the patches and the build of qt-copy, because the Qt directory changed on my system.
After that I have compiled kdelibs/kdeui and kdebase/kicker again. That's maybe superflous, because the patch(es) does/do not break BC.
Have you applied the patch(es)?
Comment 16 Diego Iastrubni 2005-02-05 20:41:04 UTC
me? not.

which patch are we talking about again?

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Comment 17 Stefan Nikolaus 2005-02-05 20:42:41 UTC
qt-copy/patches/0047-fix-kmenu-width.diff
Comment 18 Stefan Nikolaus 2005-02-09 09:37:42 UTC
cuco:
It would be nice, if you could state wether it works for you with the applied patches. I don't want to close it again while it does not work for you. You can can apply all of the patches by calling

./apply_patches

in your qt-copy directory. Or only the relevant one with

patch -p0 < patches/0047-fix-kmenu-width.diff
Comment 19 Diego Iastrubni 2005-02-09 10:14:59 UTC
be patient, i am a sttudent, on exams time... and I
managed to complete qt locally, since I trying
patching it in a way that it did not compile (nothing
related to this patch).

dont worry, i will try it... :)


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Helps protect you from nasty viruses. 
http://promotions.yahoo.com/new_mail

Comment 20 Aaron J. Seigo 2005-02-27 08:03:27 UTC
it's been confirmed. it's the 0047-fix-kmenu-width.diff patch that must be applied. it's a Qt bug, and there's a fix for it.
Comment 21 Thiago Macieira 2005-03-24 02:39:06 UTC
*** Bug 102335 has been marked as a duplicate of this bug. ***
Comment 22 Kurt Bechstein 2005-03-24 04:07:33 UTC
Just a note for any Gentoo users.  You need to be running at least qt-3.3.4-r3 from portage to fix this problem.  The 0047-fix-kmenu-width.diff is included in this version.
Comment 23 Russell East 2005-08-10 00:12:44 UTC
Well it's been some time since I came across this bug and I've been avidly waiting for Fedora to include appropriate KDE updates with the promised fix.  I can now report that after upgrading to FC4, which included KDE 3.4.0, and subsequently updating to KDE 3.4.2, that this problem is not fixed for me.  :-(
Comment 24 Russell East 2005-09-16 23:34:33 UTC
Ah haha - the folks at Fedora had not yet pushed that update into their queue.  I finally got it today and the menu panel works just fine (in all 4 locations) !!!   Thanx for fixing this!