Commit cfb69fac authored by Graeme Gott's avatar Graeme Gott

Fix unable to hide menu after resize.

parent 9d038373
...@@ -19,12 +19,13 @@ ...@@ -19,12 +19,13 @@
#include "settings.h" #include "settings.h"
#include "slot.h" #include "slot.h"
#include "window.h"
using namespace WhiskerMenu; using namespace WhiskerMenu;
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
ResizeGrip::ResizeGrip(GtkWindow* window) : ResizeGrip::ResizeGrip(Window* window) :
m_window(window), m_window(window),
m_cursor(nullptr), m_cursor(nullptr),
m_shape(3) m_shape(3)
...@@ -102,8 +103,12 @@ void ResizeGrip::set_corner(Corner corner) ...@@ -102,8 +103,12 @@ void ResizeGrip::set_corner(Corner corner)
gboolean ResizeGrip::on_button_press_event(GtkWidget*, GdkEvent* event) gboolean ResizeGrip::on_button_press_event(GtkWidget*, GdkEvent* event)
{ {
m_window->set_child_has_focus();
GtkWindow* window = GTK_WINDOW(m_window->get_widget());
GdkEventButton* event_button = reinterpret_cast<GdkEventButton*>(event); GdkEventButton* event_button = reinterpret_cast<GdkEventButton*>(event);
gtk_window_begin_resize_drag(m_window, gtk_window_begin_resize_drag(window,
m_edge, m_edge,
event_button->button, event_button->button,
event_button->x_root, event_button->x_root,
......
...@@ -25,10 +25,12 @@ ...@@ -25,10 +25,12 @@
namespace WhiskerMenu namespace WhiskerMenu
{ {
class Window;
class ResizeGrip class ResizeGrip
{ {
public: public:
explicit ResizeGrip(GtkWindow* window); explicit ResizeGrip(Window* window);
~ResizeGrip(); ~ResizeGrip();
ResizeGrip(const ResizeGrip&) = delete; ResizeGrip(const ResizeGrip&) = delete;
...@@ -57,7 +59,7 @@ private: ...@@ -57,7 +59,7 @@ private:
gboolean on_draw_event(GtkWidget* widget, cairo_t* cr); gboolean on_draw_event(GtkWidget* widget, cairo_t* cr);
private: private:
GtkWindow* m_window; Window* m_window;
GtkWidget* m_drawing; GtkWidget* m_drawing;
GdkCursor* m_cursor; GdkCursor* m_cursor;
GdkWindowEdge m_edge; GdkWindowEdge m_edge;
......
...@@ -114,7 +114,7 @@ WhiskerMenu::Window::Window(Plugin* plugin) : ...@@ -114,7 +114,7 @@ WhiskerMenu::Window::Window(Plugin* plugin) :
m_command_slots[i] = g_signal_connect_slot<GtkButton*>(m_commands_button[i], "clicked", &Window::hide, this); m_command_slots[i] = g_signal_connect_slot<GtkButton*>(m_commands_button[i], "clicked", &Window::hide, this);
} }
m_resizer = new ResizeGrip(m_window); m_resizer = new ResizeGrip(this);
// Create search entry // Create search entry
m_search_entry = GTK_ENTRY(gtk_search_entry_new()); m_search_entry = GTK_ENTRY(gtk_search_entry_new());
......
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