Opened 12 years ago

Closed 7 years ago

#521 closed patch (fixed)

Make tray icon widget available to plugins

Reported by: jwendell Owned by: charkins
Milestone: 3.0.0 Component: pidgin (gtk)
Version: 2.0 Keywords:
Cc:

Description

This is an updated version of patch attached in SF.net bug tracker. (https://sourceforge.net/tracker/?func=detail&atid=300235&aid=1636037&group_id=235)

With this patch, the tray icon object becomes available to everyone, including any plugin.

As a example, i have patched gaim-libnotify plugin to point notification into gaim status icon.

Attachments (3)

tray.diff (1.4 KB) - added by jwendell 12 years ago.
patch
docklet-get-geometry.patch (9.9 KB) - added by charkins 12 years ago.
API for getting docklet geometry
docklet-geometry-test.c (3.2 KB) - added by charkins 12 years ago.
plugin to test docklet geometry api

Download all attachments as: .zip

Change History (17)

Changed 12 years ago by jwendell

patch

comment:1 Changed 12 years ago by charkins

  • Owner set to charkins
  • Status changed from new to assigned

For this to be accepted, it would need to be added implemented as a ui_op. This requires adding a function pointer to the docklet_ui_ops structure (in gtkdocklet.h), then implementations added to gtkdocklet-x11.c and win32/gtkdocklet-win32.c (these should be static). Finally, a public function needs to be added to gtkdocklet.c which delegates to the ui_ops function.

Feel free to take another stab at the patch if you're up for it. Otherwise, I'll get to it soon.

comment:2 Changed 12 years ago by rlaager

Also, this needs some checks to make sure the pointers aren't NULL before dereferencing them to set them.

comment:3 Changed 12 years ago by charkins

I'll take care of that when I re-factor this using ui_ops. I should be back home for a couple days next week (with access to my windows box), so I'll try to get this patch whipped up and tested then. I'll attach the patch here (so it doesn't get lost), but will hold off on pushing it until the 2.1.0 cycle.

comment:4 Changed 12 years ago by charkins

jwendell: Would it be better to have access to the gtk widget rather than the x,y coordinates? See ticket #1632.

comment:5 Changed 12 years ago by jwendell

My first patch was exactly like you want, but it was rejected because windows stuff

Read the hole story in: http://sourceforge.net/tracker/index.php?func=detail&aid=1636037&group_id=235&atid=300235

comment:6 Changed 12 years ago by charkins

  • Resolution set to wontfix
  • Status changed from assigned to closed

I'm going to go ahead and close this ticket in favor of #1632. As far as I can tell, it is not possible to get the x,y coordinates of a notification area icon on win32. So, if there is going to be any cross platform api, it's going to have to be something other than x,y being returned.

comment:7 Changed 12 years ago by charkins

  • Milestone set to 2.3.0
  • Resolution wontfix deleted
  • Status changed from closed to reopened

Re-opening ticket and targeting 2.3.0. The x,y approach is going to be easier to implement against EggTrayIcon?, GtkStatusIcon? and win32's NotifyIcon? (using an approximate x,y on win32) than trying to handle multiple object types that could be returned in #1632.

Changed 12 years ago by charkins

API for getting docklet geometry

comment:8 Changed 12 years ago by charkins

I've attached a patch showing what the API is going to look like. The X11 implementation currently uses gtk_widget_get_screen(), which isn't available before gtk+2.2, I'll do something to deal with that before this gets applied.

Turns out we can get the position of the icon under win32 if the user is running the standard windows shell. If we run into problems, we return FALSE, indicating that the geometry was not returned (this will also happen in all cases when the docklet is not visible). Any of the parameters passed to pidgin_docklet_get_geometry() can be NULL if the value is not desired.

We'll likely be getting a GtkStatusIcon? implementation of the docklet for 2.3.0 as well, so I'll make sure this ui_op gets implemented there as well.

Changed 12 years ago by charkins

plugin to test docklet geometry api

comment:9 Changed 12 years ago by charkins

Sorry for the ticket SPAM, I attached source for a plugin to test the new API (adds an option under the buddy list tools menu to log the geometry to the debug log).

comment:10 Changed 12 years ago by charkins@…

(In 03054fd9afde1bcdafb721ed7712638568c3a3e1) Add new API to the docklet for retrieving the geometry (x,y,w,h) and the GdkScreen? (if available). The win32 implementation of this is really ugly and could use some testing.

Refs #521 and #1632.

comment:11 Changed 12 years ago by charkins@…

  • Resolution set to fixed
  • Status changed from reopened to closed

(In 433b476c9aefc965849a15060e0feeccb640d283) ChangeLog.API the new docklet geometry API. Fixes #521. Refs #1632.

comment:12 Changed 12 years ago by charkins

  • Milestone changed from 2.3.0 to 3.0.0
  • Resolution fixed deleted
  • Status changed from closed to reopened

Re-opening this and targeting 3.0.0. This change requires new ui_ops in the docklet which will have to wait until the next major version. Code is done, just need to wait until appropriate time to commit it.

comment:13 Changed 10 years ago by Halan

hm this is needed for pidgin-libnotify to work work properly. Atm it is covering gnome/xfce panels.

comment:14 Changed 7 years ago by Elliott Sales de Andrade <qulogic@…>

  • Resolution set to fixed
  • Status changed from new to closed

(In [b9a5b8ddf92c]):
Add API to access the underlying GtkStatusIcon? for the docklet.

Fixes #521.

Note: See TracTickets for help on using tickets.
All information, including names and email addresses, entered onto this website or sent to mailing lists affiliated with this website will be public. Do not post confidential information, especially passwords!