Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#12599 closed patch (fixed)

It's impossible to override TAB key autocompletion behaviour in plugin

Reported by: kawaii.neko Owned by:
Milestone: 2.8.0 Component: pidgin (gtk)
Version: 2.7.3 Keywords: tab autocomplete


The reason is very simple: key-press-event handler for gtkconv->entry in multi user chat always return TRUE when Tab key is pressed. So even when text entry is empty, for MUC's key event won't be passed to plugin because tab_complete function returns TRUE in this case. It is also not an option to use key-release-event because in this case plugin handler will be invoked after pidgin's core tab_complete function.

This bug blocks, for example ticket #9748

Attachments (1)

chat-nick-signals.diff (3.4 KB) - added by kawaii.neko 9 years ago.
New signals: chat-nick-clicked and chat-nick-autocomplete

Download all attachments as: .zip

Change History (6)

Changed 9 years ago by kawaii.neko

New signals: chat-nick-clicked and chat-nick-autocomplete

comment:1 Changed 9 years ago by kawaii.neko

chat-nick-signals.diff patch addstwo new signals pidgin conversation handles: chat-nick-clicked and chat-nick-autocomplete.

gboolean chat_nick_clicked(PurpleConversation *conv, const char *nick, guint button) is emitted when chat user's nick has been clicked on the side pane or in chat (buddy tag event). If handler returns true, the default action is not performed. It may be useful to implement click-to-insert nick plugin or to override nick's context menu (but it's a bad idea in my opinion).

gboolean chat_nick_autocomplete(PurpleConversation *conv, gboolean backwards) is emitted when Tab or Shift-Tab hit in conversation entry. This handler may override default autocomplete action by returning TRUE. In this case tab_complete won't be called.

comment:2 Changed 8 years ago by Robby

  • Milestone set to Patches Needing Review
  • Type changed from defect to patch

comment:3 Changed 8 years ago by rekkanoryo@…

  • Milestone changed from Patches Needing Review to 2.8.0
  • Resolution set to fixed
  • Status changed from new to closed

(In 373dc479b854c8d458fc52ec78483ec5b9dfeec0):
Patch from kawaii.neko that adds chat-nick-clicked and chat-nick-autocomplete signals to do interesting stuff like allowing a plugin to override tab completion or do stuff when a nick in a chat userlist is clocked. Still need a name to credit kawaii.neko properly. Fixes #12599.

comment:4 Changed 8 years ago by rekkanoryo@…

(In cc383a4eb70377666f731757dcae709bf80aea37):
Restructure that patch a bit. The marshal function should have been with all the others, even if it's only used in Pidgin. It may be useful for other API in the future. Refs #12599.

comment:5 Changed 8 years ago by rekkanoryo@…

(In 496c99950b3b59a8894379f6b9a9b1d13d5a163e):
Credit for kawaii.neto's patch. Refs #12599.

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!