summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
f622e66)
This fixes a bug leftover from
fe0a1c48c648f683b3691132fb2b12b01d1ace32.
The obvious symptom is that the currently-playing track's progress
indication goes screwy when you use the pause button in the same
DisObedience instance. (Other DisObediences work correctly, and all of
them work fine if you use some other mechanism to frob the pause
status.)
The bug is caused because the preemptive state update introduced in the
previous fix suppresses the internal event which used to raised once the
server acknowledged the state change.
Fix this by explicitly raising the relevant event.
/** @brief Events that change this icon, separated by spaces */
const char *events;
/** @brief Events that change this icon, separated by spaces */
const char *events;
+ /** @brief Event to raise when the icon is frobbed */
+ const char *raise;
+
/** @brief @ref eclient.h function to call to go from off to on
*
* For action buttons, this should be NULL.
/** @brief @ref eclient.h function to call to go from off to on
*
* For action buttons, this should be NULL.
.action_go_on = pause_track,
.action_go_off = resume_track,
.events = "pause-changed playing-changed rights-changed playing-track-changed",
.action_go_on = pause_track,
.action_go_off = resume_track,
.events = "pause-changed playing-changed rights-changed playing-track-changed",
+ .raise = "pause-changed",
.menu_invert = TRUE,
},
{
.menu_invert = TRUE,
},
{
.action_go_on = enable_random,
.action_go_off = disable_random,
.events = "random-changed rights-changed",
.action_go_on = enable_random,
.action_go_off = disable_random,
.events = "random-changed rights-changed",
+ .raise = "random-changed",
.action_go_on = enable_playing,
.action_go_off = disable_playing,
.events = "enabled-changed rights-changed",
.action_go_on = enable_playing,
.action_go_off = disable_playing,
.events = "enabled-changed rights-changed",
+ .raise = "playing-changed",
if(suppress_actions)
return;
icon->action_go_off(client, icon_action_completed, 0);
if(suppress_actions)
return;
icon->action_go_off(client, icon_action_completed, 0);
+ if(icon->raise)
+ event_raise(icon->raise, 0);
}
static void toggled_icon(GtkToggleToolButton attribute((unused)) *button,
}
static void toggled_icon(GtkToggleToolButton attribute((unused)) *button,
else
icon->action_go_on(client, icon_action_completed, 0);
icon_changed(0, 0, user_data);
else
icon->action_go_on(client, icon_action_completed, 0);
icon_changed(0, 0, user_data);
+ if(icon->raise)
+ event_raise(icon->raise, 0);
}
static void clicked_menu(GtkMenuItem attribute((unused)) *menuitem,
}
static void clicked_menu(GtkMenuItem attribute((unused)) *menuitem,