[haiku-development] Re: Issue adding deskbar replicant from a server

  • From: Brian Hill <brianh@xxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Thu, 19 Jan 2017 21:10:05 -0500

Axel Dörfler wrote:

Am 16/01/2017 um 01:06 schrieb Brian Hill:
I am having difficulty with the AddItem functions of Deskbar?  I am
trying to add a view to the Deskbar tray from the notification_server
but the view never shows in the Deskbar and I am getting an (not so
helpful) error on the terminal:
"Can't add deskbar replicant: General system error"

Attach a debugger to the Deskbar (at http://cgit.haiku-os.org/haiku/tree/src/apps/deskbar/BarWindow.cpp#n514), and see where it takes you :-)

That should help you narrow down the issue, at least.
OK wow I think I just had a major crash course in debugging!
I traced it down into TReplicantTray::AddIcon, which then eventually gets into BShelf::_AddReplicant. In there it calls _InstantiateObject, which then returns and quickly returns back up the call chain and where I get the error message.

So I think what is happening is this: I created a new class DeskbarShelfView which will draw the icon (and eventually do something simple like send a message to tell the notification center to show/hide). I am building this in the Haiku source tree, and the newly compiled server binary is located in /Data/haiku/haiku/generated.x86gcc2/objects yada yada.

Now to test my version of the notification_server I blacklisted the system notification_server in /boot/system/settings/packages. So this prevents the system version from running, and I manually run my version to test the updated notification_server.

But, when I send an archived instance of my DeskbarShelfView class to add to the deskbar, is it looking for my class in the system's notification_server binary in /boot/system/servers? Because that file doesn't exist. Does it try to find a match by the server signature but fails to find my version? It seems like it can't instantiate my new class and throws the error. That is my best guess.

-Brian

Other related posts: