! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
lauches command on button-release even if unfocused
Status:
RESOLVED: FIXED
Product:
Xfce4-mailwatch-plugin
Component:
General

Comments

Description Jani Monoses 2006-01-21 13:29:39 CET
I don't know if it's intentional but it is surprising :)

The plugin handles the button release event instead of the clicked signal

 g_signal_connect(mwp->button, "button-release-event",
            G_CALLBACK(mailwatch_button_release_cb), mwp);

this results in launching the associated command even if after a press I move
the cursor away from the plugin, which is unlike how buttons usually behave.

Reproducible: Always
Steps to Reproduce:
1. 
2. 
3.
Comment 1 Pasi Orovuo 2006-01-21 14:30:21 CET
It's intentional, as we have different actions on different buttons (left button
launches the configured program, middle button forces an update) and "clicked"
signal does not reveal the button clicked.
Comment 2 Jani Monoses 2006-01-21 14:40:22 CET
then maybe check if the widget still has focus in the handler before doing
anything?  I haven't used it, maybe with GTK_WIDGET_HAS_FOCUS().
other plugins have properties in one button and action on left but they still
behave traditionally
Comment 3 Pasi Orovuo 2006-01-21 15:18:45 CET
GTK_WIDGET_HAS_FOCUS() won't work, as the panel doesn't accept focus (and so the
button never gets it). But checking if the event coordinates lie inside the
widget's allocation would probably work. Brian?
Comment 4 Pasi Orovuo 2006-01-21 17:58:53 CET
Created attachment 396 
Adds a check for cursor position in button-release-event

For reference, here's what I meant.
Comment 5 Brian J. Tarricone (not reading bugmail) 2006-01-21 22:22:10 CET
Y'know, I also wish the button would show itself being pressed in and released
when you middle click as well.  I wonder if there's a way to do that.  But I
digress.

Pasi, it looks fine to me.  If it works, go ahead and commit it.
Comment 6 Brian J. Tarricone (not reading bugmail) 2006-01-21 22:35:43 CET
Ok, nevermind, I did it myself.  Fixed.

Bug #1336

Reported by:
Jani Monoses
Reported on: 2006-01-21
Last modified on: 2011-02-26

People

Assignee:
Brian J. Tarricone (not reading bugmail)
CC List:
1 user

Version

Version:
1.1.0 or older
Target Milestone:
1.1.0 or older

Attachments

Additional information