Move current cursor value to bar class

It doesn't really belong to bar_settings
This commit is contained in:
patrick96 2022-03-20 20:03:51 +01:00 committed by Patrick Ziegler
parent ae32b5ff29
commit d018adcf91
3 changed files with 7 additions and 7 deletions

View File

@ -99,6 +99,11 @@ class bar : public xpp::event::sink<evt::button_press, evt::expose, evt::propert
bar_settings m_opts{};
/**
* Name of currently active cursor
*/
string m_cursor{};
string m_lastinput{};
bool m_dblclicks{false};

View File

@ -211,11 +211,6 @@ struct bar_settings {
int double_click_interval{400};
/**
* Name of currently active cursor
*/
string cursor{};
/**
* Name of cursor to use for clickable areas
*/

View File

@ -918,11 +918,11 @@ bool bar::on(const signals::ui::dim_window& sig) {
#if WITH_XCURSOR
void bar::change_cursor(const string& name) {
// This is already the same cursor, no need to update
if (m_opts.cursor == name) {
if (m_cursor == name) {
return;
}
m_cursor = name;
m_opts.cursor = name;
if (!cursor_util::set_cursor(m_connection, m_connection.screen(), m_opts.window, name)) {
m_log.warn("Failed to create cursor context for cursor name '%s'", name);
}