Skip to content

Commit

Permalink
xworkspaces: Remove desktop offset member
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick96 committed Nov 2, 2019
1 parent f224bfa commit dd787d6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions include/modules/xworkspaces.hpp
Expand Up @@ -33,10 +33,9 @@ namespace modules {
};

struct desktop {
explicit desktop(unsigned int index, unsigned int offset, desktop_state state, label_t&& label)
: index(index), offset(offset), state(state), label(label) {}
explicit desktop(unsigned int index, desktop_state state, label_t&& label)
: index(index), state(state), label(label) {}
unsigned int index;
unsigned int offset;
desktop_state state;
label_t label;
};
Expand Down
6 changes: 3 additions & 3 deletions src/modules/xworkspaces.cpp
Expand Up @@ -225,7 +225,7 @@ namespace modules {
for (size_t i = 0; i < ws_positions.size(); i++) {
auto&& ws_pos = ws_positions[i];
if (ws_pos == viewport_pos) {
viewport->desktops.emplace_back(make_unique<struct desktop>(i, 0, desktop_state::EMPTY, label_t{}));
viewport->desktops.emplace_back(make_unique<struct desktop>(i, desktop_state::EMPTY, label_t{}));
}
}

Expand Down Expand Up @@ -255,7 +255,7 @@ namespace modules {

d->label = m_labels.at(d->state)->clone();
d->label->reset_tokens();
d->label->replace_token("%index%", to_string(d->index - d->offset + 1));
d->label->replace_token("%index%", to_string(d->index + 1));
d->label->replace_token("%name%", m_desktop_names[d->index]);
d->label->replace_token("%icon%", m_icons->get(m_desktop_names[d->index], DEFAULT_ICON)->get());
}
Expand Down Expand Up @@ -292,7 +292,7 @@ namespace modules {

d->label = m_labels.at(d->state)->clone();
d->label->reset_tokens();
d->label->replace_token("%index%", to_string(d->index - d->offset + 1));
d->label->replace_token("%index%", to_string(d->index + 1));
d->label->replace_token("%name%", m_desktop_names[d->index]);
d->label->replace_token("%icon%", m_icons->get(m_desktop_names[d->index], DEFAULT_ICON)->get());
return;
Expand Down

0 comments on commit dd787d6

Please sign in to comment.