Opened 18 years ago

Closed 8 years ago

#661 closed bug (fixed)

CannaIM deskbar replicant popup menu not working; replicant handle menu displayed instead.

Reported by: koki@… Owned by: korli
Priority: normal Milestone: R1
Component: - General Version: R1/Development
Keywords: Cc: bxi07354@…, jackburton
Blocked By: Blocking:
Platform: All

Description (last modified by korli)

When installing Canna input method, a replicant is loaded in the Deskbar.

Clicking on this replicant with the mouse should display a popup menu, but in Haiku it doesn't. Instead, the replicant handle menu is displayed.

Was not sure what component this belonged to; feel free to change it if necessary.

Attachments (5)

after_installing.png (8.1 KB ) - added by mt 9 years ago.
after_restarting.png (7.1 KB ) - added by mt 9 years ago.
replicant_menu.png (6.9 KB ) - added by mt 9 years ago.
syslog (167.2 KB ) - added by mt 9 years ago.
0001-Revert-64-bit-fixes-for-input_server.patch (7.6 KB ) - added by mt 9 years ago.

Download all attachments as: .zip

Change History (31)

comment:1 by koki@…, 18 years ago

Cc: bxi07354@… added

comment:2 by korli, 18 years ago

This is dependent on message scripting feature. It is being fixed, but could be longer than expected.

comment:3 by korli, 18 years ago

FYI, several scripts which have to work first :

hey Deskbar get Messenger of Shelf of View Status of Window Deskbar hey Deskbar get Name of Replicant 0 of Shelf of View Status of Window Deskbar hey Deskbar get View of Replicant 0 of Shelf of View Status of Window Deskbar

BTW I think Haiku input_server should be changed to simply query (doesn't work on R5 because the replicant has no name) : hey Deskbar get View of Replicant MethodReplicant of Shelf of View Status of Window Deskbar

comment:4 by korli, 18 years ago

Resolution: fixed

comment:5 by korli, 18 years ago

should be fixed in revision 17841

comment:6 by korli, 18 years ago

Status: newclosed

comment:7 by koki@…, 18 years ago

Nice improvements! We are getting close.

As tested on build 17843, CannaIM deskbar popup menu now works, but there two small oddities:

1) For some reason the submenu that should display among other things the About window when Canna is in Japanese mode appears empty.

2) The replicant handle is still being displayed; it should not.

Should I open separate bug reports for the above?

comment:8 by korli, 18 years ago

About these oddities, they must be related to our interface kit implementation: the canna method and method replicant were working on R5 last time I tried. Stefano, could you have a look at the menu oddity ?

comment:9 by korli, 18 years ago

Cc: stefano.ceccherini@… added

comment:10 by jackburton, 18 years ago

"1) For some reason the submenu that should display among other things the About window when Canna is in Japanese mode appears empty."

I'll have a look at this. Might be a bug in BShelf or BDragger.

"2) The replicant handle is still being displayed; it should not."

This could be related to #116.

comment:11 by bxi07354@…, 18 years ago

(In reply to comment #6)

"1) For some reason the submenu that should display among other things the About window when Canna is in Japanese mode appears empty."

BMenu::Archive doesn't do deep.

if (err == B_OK && deep) {

TODO store items and rects

}

comment:12 by korli, 18 years ago

Popup menu is now working somehow. Weirdly it seems to appear disabled, and I don't know why.

comment:13 by bxi07354@…, 18 years ago

The mistake was found by BMenu::InitData(BMessage *data). data->FindBool("_disable", &fEnabled);

BSeparatorItem is not displayed. status_t BSeparatorItem::Archive(BMessage* archive, bool deep) const {

if (!archive->HasString(B_CLASS_FIELD))

  • archive->AddString(B_CLASS_FIELD, "BMenuItem");

+ archive->AddString(B_CLASS_FIELD, "BSeparatorItem");

The return value(item) is not necessarily MethodMenuItem*. void MethodReplicant::MouseDown(BPoint point) {

.... BMenuItem *item = fMenu.Go(where, true, true, BRect(where - BPoint(4, 4),

where + BPoint(4, 4)));

if (item && cast_as(item, MethodMenuItem)) {

BMessage msg(IS_SET_METHOD); msg.AddInt32("cookie", ((MethodMenuItem *)item)->Cookie()); ....

comment:14 by korli, 18 years ago

This was somehow fixed in revision 18071. Is there anything still valid ?

comment:15 by korli, 18 years ago

barber, I applied the last part of your patch in revision 18093, and even tested it successfully. Thanks a lot!

comment:16 by bxi07354@…, 18 years ago

(In reply to comment #6)

"1) For some reason the submenu that should display among other things the About window when Canna is in Japanese mode appears empty."

This was solved by revision 18093. Thank you.

comment:17 by korli, 18 years ago

Description: modified (diff)
Platform: All
Resolution: fixed
Status: closedreopened

tested again in revision 18880. The menu itself is empty in the deskbar replicant.

comment:18 by korli, 18 years ago

Cc: jackburton added

comment:19 by jackburton, 18 years ago

Korli, might this change be the culprit ? http://svn.berlios.de/viewcvs/haiku/haiku/trunk/src/kits/interface/View.cpp?rev=18490&r1=18086&r2=18490

AFAIK, we should add the "error" field to the scripting message even if it's B_OK.

comment:20 by korli, 18 years ago

Resolution: fixed
Status: reopenedclosed

thanks Stefano, indeed it was this change and another. it's now fixed.

comment:21 by mt, 9 years ago

Resolution: fixed
Status: closedreopened

Hi, I tested hrev49588 (gcc2 / gcc4 hybrid), this bug seems to occur again.

  • After installing a input method, input method menu and icon don't appear.
  • After restarting the system, draggier & replicant menu appears.
  • There is "Deskbar refuses to add method replicant: General system error" in SYSLOG, though I don't know it is related to this bug.

by mt, 9 years ago

Attachment: after_installing.png added

by mt, 9 years ago

Attachment: after_restarting.png added

by mt, 9 years ago

Attachment: replicant_menu.png added

by mt, 9 years ago

Attachment: syslog added

comment:22 by mt, 9 years ago

kcg369 pointed out it to me. http://kcg369.b.osdn.me/2014/05/20/64-bit-fixes-for-input_server/ This bug was recurrence due to the different types of messaging functions for handling cookie. We need to unify type of the functions (Int32 or Pointer).

I tested the patch for gcc2 and x86_64, it seems to fix menu and icon. But I don't know whether the cookie is int32 or a pointer.

comment:23 by mt, 9 years ago

patch: 01

comment:24 by pulkomandy, 8 years ago

Version: R1/Development

Looking at the full commit (http://cgit.haiku-os.org/haiku/commit/?id=57ab0395ad31761e27ef6d5aa3af68cc3e4d71b2), there are places where we put a pointer there. When using an int32, we only use the low part of the pointer, which can work most of the time, but in rare cases two pointers will have the same low-part and become mixed up.

We have several solutions:

  • Use void* as in the original change, and adjust Canna to still work,
  • Use int32, and on 64-bit platforms, use an hash map to map the 32-bit cookie back to a 64-bit pointer pointer,
  • Use void* on non-gcc2 platforms, keep int32 for gcc2 for binary compatibility, and apps need to take care of the difference depending on the architecture.

I'm not very happy with any of these 3 solutions, however.

comment:25 by korli, 8 years ago

I thought this was already handled in #8831.

comment:26 by pulkomandy, 8 years ago

Resolution: fixed
Status: reopenedclosed

Applied in hrev50542.

Note: See TracTickets for help on using tickets.