Skip to content

Commit

Permalink
[wayland] fix crash on startup with lv3:ralt_alt XKB option
Browse files Browse the repository at this point in the history
With lv3:ralt_alt ("Right Alt never chooses 3rd level") option set, we
get more layouts from libxkbcommon than it was configured, see:
xkbcommon/libxkbcommon#262
It might be correct lib's behavior, still.

The extra layouts are redundant, so we strip them out from usual usage.

BUG: 440027


(cherry picked from commit 59143ee)
  • Loading branch information
bam80 committed Oct 12, 2021
1 parent b803a60 commit ef6a9c4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/xkb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,9 @@ QString Xkb::layoutName() const
return layoutName(m_currentLayout);
}

const QString &Xkb::layoutShortName(int index) const
QString Xkb::layoutShortName(int index) const
{
return m_layoutList.at(index);
return m_layoutList.value(index);
}

void Xkb::updateConsumedModifiers(uint32_t key)
Expand Down
2 changes: 1 addition & 1 deletion src/xkb.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class KWIN_EXPORT Xkb : public QObject
}
QString layoutName(xkb_layout_index_t index) const;
QString layoutName() const;
const QString &layoutShortName(int index) const;
QString layoutShortName(int index) const;
quint32 numberOfLayouts() const;

/**
Expand Down

0 comments on commit ef6a9c4

Please sign in to comment.