Commit caa01e89 authored by Graeme Gott's avatar Graeme Gott

Use standard event return macros for clarity.

parent e4b64ec2
......@@ -32,7 +32,7 @@ static gboolean hover_timeout(gpointer user_data)
{
gtk_toggle_button_set_active(button, true);
}
return false;
return GDK_EVENT_PROPAGATE;
}
static gboolean on_enter_notify_event(GtkWidget* widget, GdkEvent*, gpointer)
......@@ -42,7 +42,7 @@ static gboolean on_enter_notify_event(GtkWidget* widget, GdkEvent*, gpointer)
{
g_timeout_add(150, &hover_timeout, button);
}
return false;
return GDK_EVENT_PROPAGATE;
}
static gboolean on_focus_in_event(GtkWidget* widget, GdkEvent*, gpointer)
......@@ -53,7 +53,7 @@ static gboolean on_focus_in_event(GtkWidget* widget, GdkEvent*, gpointer)
gtk_toggle_button_set_active(button, true);
gtk_widget_grab_focus(widget);
}
return false;
return GDK_EVENT_PROPAGATE;
}
//-----------------------------------------------------------------------------
......
......@@ -258,7 +258,7 @@ void LauncherIconView::reload_icon_size()
gboolean LauncherIconView::on_leave_notify_event(GtkWidget*, GdkEvent*)
{
clear_selection();
return false;
return GDK_EVENT_PROPAGATE;
}
//-----------------------------------------------------------------------------
......@@ -267,7 +267,7 @@ gboolean LauncherIconView::on_motion_notify_event(GtkWidget*, GdkEvent* event)
{
GdkEventMotion* motion_event = reinterpret_cast<GdkEventMotion*>(event);
select_path_at_pos(motion_event->x, motion_event->y);
return false;
return GDK_EVENT_PROPAGATE;
}
//-----------------------------------------------------------------------------
......@@ -276,7 +276,7 @@ gboolean LauncherIconView::on_scroll_event(GtkWidget*, GdkEvent* event)
{
GdkEventScroll* scroll_event = reinterpret_cast<GdkEventScroll*>(event);
select_path_at_pos(scroll_event->x, scroll_event->y);
return false;
return GDK_EVENT_PROPAGATE;
}
//-----------------------------------------------------------------------------
......
......@@ -268,7 +268,7 @@ gboolean LauncherTreeView::on_key_press_event(GtkWidget*, GdkEvent* event)
{
gtk_tree_view_set_hover_selection(m_view, false);
}
return false;
return GDK_EVENT_PROPAGATE;
}
//-----------------------------------------------------------------------------
......@@ -280,7 +280,7 @@ gboolean LauncherTreeView::on_key_release_event(GtkWidget*, GdkEvent* event)
{
gtk_tree_view_set_hover_selection(m_view, true);
}
return false;
return GDK_EVENT_PROPAGATE;
}
//-----------------------------------------------------------------------------
......
......@@ -245,18 +245,18 @@ gboolean Page::view_button_press_event(GtkWidget*, GdkEvent* event)
GtkTreePath* path = m_view->get_path_at_pos(button_event->x, button_event->y);
if (!path)
{
return false;
return GDK_EVENT_PROPAGATE;
}
if (gdk_event_triggers_context_menu(event))
{
create_context_menu(path, event);
return true;
return GDK_EVENT_STOP;
}
else if (button_event->button != GDK_BUTTON_PRIMARY)
{
gtk_tree_path_free(path);
return false;
return GDK_EVENT_PROPAGATE;
}
Element* element = nullptr;
......@@ -277,7 +277,7 @@ gboolean Page::view_button_press_event(GtkWidget*, GdkEvent* event)
set_reorderable(m_reorderable);
}
return false;
return GDK_EVENT_PROPAGATE;
}
//-----------------------------------------------------------------------------
......@@ -287,7 +287,7 @@ gboolean Page::view_button_release_event(GtkWidget*, GdkEvent* event)
GdkEventButton* button_event = reinterpret_cast<GdkEventButton*>(event);
if (button_event->button != 1)
{
return false;
return GDK_EVENT_PROPAGATE;
}
if (m_launcher_dragged)
......@@ -296,7 +296,7 @@ gboolean Page::view_button_release_event(GtkWidget*, GdkEvent* event)
m_launcher_dragged = false;
}
return false;
return GDK_EVENT_PROPAGATE;
}
//-----------------------------------------------------------------------------
......@@ -336,12 +336,12 @@ gboolean Page::view_popup_menu_event(GtkWidget*)
GtkTreePath* path = m_view->get_cursor();
if (!path)
{
return false;
return GDK_EVENT_PROPAGATE;
}
create_context_menu(path, nullptr);
return true;
return GDK_EVENT_STOP;
}
//-----------------------------------------------------------------------------
......
......@@ -109,7 +109,7 @@ gboolean ResizeGrip::on_button_press_event(GtkWidget*, GdkEvent* event)
event_button->x_root,
event_button->y_root,
event_button->time);
return true;
return GDK_EVENT_STOP;
}
//-----------------------------------------------------------------------------
......@@ -118,7 +118,7 @@ gboolean ResizeGrip::on_enter_notify_event(GtkWidget* widget, GdkEvent*)
{
GdkWindow* window = gtk_widget_get_window(widget);
gdk_window_set_cursor(window, m_cursor);
return false;
return GDK_EVENT_PROPAGATE;
}
//-----------------------------------------------------------------------------
......@@ -127,7 +127,7 @@ gboolean ResizeGrip::on_leave_notify_event(GtkWidget* widget, GdkEvent*)
{
GdkWindow* window = gtk_widget_get_window(widget);
gdk_window_set_cursor(window, nullptr);
return false;
return GDK_EVENT_PROPAGATE;
}
//-----------------------------------------------------------------------------
......@@ -146,7 +146,7 @@ gboolean ResizeGrip::on_draw_event(GtkWidget* widget, cairo_t* cr)
}
cairo_fill(cr);
return true;
return GDK_EVENT_STOP;
}
//-----------------------------------------------------------------------------
......@@ -611,12 +611,12 @@ gboolean WhiskerMenu::Window::on_enter_notify_event(GtkWidget*, GdkEvent* event)
|| (crossing_event->mode == GDK_CROSSING_GRAB)
|| (crossing_event->mode == GDK_CROSSING_GTK_GRAB))
{
return false;
return GDK_EVENT_PROPAGATE;
}
grab_pointer(GTK_WIDGET(m_window));
return false;
return GDK_EVENT_PROPAGATE;
}
//-----------------------------------------------------------------------------
......@@ -627,12 +627,12 @@ gboolean WhiskerMenu::Window::on_leave_notify_event(GtkWidget*, GdkEvent* event)
if ((crossing_event->detail == GDK_NOTIFY_INFERIOR)
|| (crossing_event->mode != GDK_CROSSING_NORMAL))
{
return false;
return GDK_EVENT_PROPAGATE;
}
grab_pointer(GTK_WIDGET(m_window));
return false;
return GDK_EVENT_PROPAGATE;
}
//-----------------------------------------------------------------------------
......@@ -641,7 +641,7 @@ gboolean WhiskerMenu::Window::on_button_press_event(GtkWidget*, GdkEvent* event)
{
if (wm_settings->stay_on_focus_out)
{
return false;
return GDK_EVENT_PROPAGATE;
}
// Hide menu if user clicks outside
......@@ -653,7 +653,7 @@ gboolean WhiskerMenu::Window::on_button_press_event(GtkWidget*, GdkEvent* event)
{
hide();
}
return false;
return GDK_EVENT_PROPAGATE;
}
//-----------------------------------------------------------------------------
......@@ -661,7 +661,7 @@ gboolean WhiskerMenu::Window::on_button_press_event(GtkWidget*, GdkEvent* event)
gboolean WhiskerMenu::Window::on_button_release_event(GtkWidget*, GdkEvent*)
{
unset_pressed_category();
return false;
return GDK_EVENT_PROPAGATE;
}
//-----------------------------------------------------------------------------
......@@ -674,7 +674,7 @@ gboolean WhiskerMenu::Window::on_key_press_event(GtkWidget* widget, GdkEvent* ev
if ( (key_event->keyval == GDK_KEY_Escape) && xfce_str_is_empty(gtk_entry_get_text(m_search_entry)) )
{
hide();
return true;
return GDK_EVENT_STOP;
}
Page* page = nullptr;
......@@ -724,12 +724,12 @@ gboolean WhiskerMenu::Window::on_key_press_event(GtkWidget* widget, GdkEvent* ev
else
{
page->select_first();
return true;
return GDK_EVENT_STOP;
}
}
}
return false;
return GDK_EVENT_PROPAGATE;
}
//-----------------------------------------------------------------------------
......@@ -743,13 +743,13 @@ gboolean WhiskerMenu::Window::on_key_press_event_after(GtkWidget* widget, GdkEve
GdkEventKey* key_event = reinterpret_cast<GdkEventKey*>(event);
if (key_event->is_modifier)
{
return false;
return GDK_EVENT_PROPAGATE;
}
gtk_widget_grab_focus(search_entry);
gtk_window_propagate_key_event(m_window, key_event);
return true;
return GDK_EVENT_STOP;
}
return false;
return GDK_EVENT_PROPAGATE;
}
//-----------------------------------------------------------------------------
......@@ -766,7 +766,7 @@ gboolean WhiskerMenu::Window::on_map_event(GtkWidget*, GdkEvent*)
// Focus search entry
gtk_widget_grab_focus(GTK_WIDGET(m_search_entry));
return false;
return GDK_EVENT_PROPAGATE;
}
//-----------------------------------------------------------------------------
......@@ -779,7 +779,7 @@ gboolean WhiskerMenu::Window::on_state_flags_changed_event(GtkWidget* widget, Gt
gtk_window_present(m_window);
}
return false;
return GDK_EVENT_PROPAGATE;
}
//-----------------------------------------------------------------------------
......@@ -797,7 +797,7 @@ gboolean WhiskerMenu::Window::on_configure_event(GtkWidget*, GdkEvent* event)
check_scrollbar_needed();
return false;
return GDK_EVENT_PROPAGATE;
}
//-----------------------------------------------------------------------------
......@@ -850,7 +850,7 @@ gboolean WhiskerMenu::Window::on_draw_event(GtkWidget* widget, cairo_t* cr)
gtk_render_background(context, cr, 0.0, 0.0, width, height);
}
return false;
return GDK_EVENT_PROPAGATE;
}
//-----------------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment