Commit 354951d7 authored by Graeme Gott's avatar Graeme Gott
Browse files

Save less frequently

parent b4d22fa5
......@@ -198,8 +198,6 @@ Plugin::Plugin(XfcePanelPlugin* plugin) :
Plugin::~Plugin()
{
save();
delete m_window;
m_window = nullptr;
......@@ -232,7 +230,6 @@ void Plugin::menu_hidden(bool lost_focus)
m_menu_shown = false;
}
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_button), false);
save();
}
//-----------------------------------------------------------------------------
......@@ -407,8 +404,6 @@ gboolean Plugin::remote_event(const gchar* name, const GValue* value)
void Plugin::save()
{
m_window->save();
if (wm_settings->get_modified())
{
wm_settings->save(xfce_panel_plugin_save_location(m_plugin, true));
......
......@@ -374,6 +374,10 @@ WhiskerMenu::Window::~Window()
void WhiskerMenu::Window::hide(bool lost_focus)
{
// Save size
wm_settings->menu_width = m_geometry.width;
wm_settings->menu_height = m_geometry.height;
// Scroll categories to top
GtkAdjustment* adjustment = gtk_scrolled_window_get_vadjustment(m_sidebar);
gtk_adjustment_set_value(adjustment, gtk_adjustment_get_lower(adjustment));
......@@ -583,20 +587,6 @@ void WhiskerMenu::Window::show(const Position position)
//-----------------------------------------------------------------------------
void WhiskerMenu::Window::save()
{
if (wm_settings->menu_width != m_geometry.width)
{
wm_settings->menu_width = m_geometry.width;
}
if (wm_settings->menu_height != m_geometry.height)
{
wm_settings->menu_height = m_geometry.height;
}
}
//-----------------------------------------------------------------------------
void WhiskerMenu::Window::set_child_has_focus()
{
m_child_has_focus = true;
......
......@@ -80,7 +80,6 @@ public:
void hide(bool lost_focus = false);
void show(const Position position);
void save();
void set_child_has_focus();
void set_categories(const std::vector<CategoryButton*>& categories);
void set_items();
......
Supports Markdown
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