1. 20 Oct, 2020 1 commit
    • Andrey Butirsky's avatar
      fix KeyboardLayoutTest · f30ad51b
      Andrey Butirsky authored
      FAIL!  : KeyboardLayoutTest::testChangeLayoutThroughDBus() '!layoutChangedSpy.wait(1000)' returned FALSE. ()
         Loc: [/home/bam/kde/src/kwin/autotests/integration/keyboard_layout_test.cpp(250)]
      f30ad51b
  2. 07 Aug, 2020 2 commits
    • Vlad Zahorodnii's avatar
      Prettify license headers · 4ce853e8
      Vlad Zahorodnii authored
      4ce853e8
    • Vlad Zahorodnii's avatar
      Switch to SPDX license markers · 1fb9f6f1
      Vlad Zahorodnii authored
      The main advantage of SPDX license identifiers over the traditional
      license headers is that it's more difficult to overlook inappropriate
      licenses for kwin, for example GPL 3. We also don't have to copy a
      lot of boilerplate text.
      
      In order to create this change, I ran licensedigger -r -c from the
      toplevel source directory.
      1fb9f6f1
  3. 17 Jul, 2020 3 commits
    • Andrey Butirsky's avatar
      make keyboard layout DBus API more reliable · 0bb05d4b
      Andrey Butirsky authored
      having deferred m_dbusInterface deletion allows to send DBus signal in
      more cases.
      That addressed in unit tests.
      0bb05d4b
    • Andrey Butirsky's avatar
      save default keyboard layout · 8e1018de
      Andrey Butirsky authored
      Implemented for Global, Virtual Desktop and Application layout policies.
      Not implemented for Window policy due separate windows do not preserve
      their IDs between sessions (still could be implemented the same way as for Application policy).
      
      Layout saving/restoring happens on Session save/load.
      Covered by unit tests
      8e1018de
    • Vlad Zahorodnii's avatar
      Introduce started signal in Application · d1b35f30
      Vlad Zahorodnii authored and Vlad Zahorodnii's avatar Vlad Zahorodnii committed
      The new signal is emitted when the Application has fully been initialized.
      
      It allows us to change the startup sequence, for example create workspace
      before starting the Xwayland server, without making any adjustments in our
      test suit.
      d1b35f30
  4. 16 Jul, 2020 1 commit
    • Aleix Pol Gonzalez's avatar
      Fix keyboard layout tests · 93a08ba9
      Aleix Pol Gonzalez authored and Vlad Zahorodnii's avatar Vlad Zahorodnii committed
      Don't give the InputConfig a separate config instance. I've seen it
      being changed after having initialized the xkb instance which would
      break the shared instance.
      Using a simple config rather than reading the configuration from
      the actual code-path shouldn't make a difference as a test it will be
      using ~/.qttest which should be cleaned upp
      93a08ba9
  5. 13 Jul, 2020 1 commit
    • Aleix Pol Gonzalez's avatar
      Move inputConfig away from KWin::Application · e28e4cb1
      Aleix Pol Gonzalez authored
      We were calling it from tests that were not running a KWin::Application
      and not even including the symbols from main.cpp and main.h. The only
      reason they linked was that it was static_casting up the QCoreApplication.
      e28e4cb1
  6. 04 Mar, 2020 1 commit
    • Vlad Zahorodnii's avatar
      Use AbstractClient instead of XdgShellClient wherever possible · be759b7d
      Vlad Zahorodnii authored
      Summary:
      Currently, we have only one shell client type - XdgShellClient. We use
      it when we are dealing with Wayland clients. But it isn't really a good
      idea because we may need to support shell surfaces other than xdg-shell
      ones, for example input panel surfaces.
      
      In order to make kwin more extensible, this change replaces all usages
      of the XdgShellClient class with the AbstractClient class.
      
      Test Plan: Existing tests pass.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: davidedmundson, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D27778
      be759b7d
  7. 02 Mar, 2020 1 commit
    • Vlad Zahorodnii's avatar
      [autotests] Fix failing KeyboardLayoutTest::testNumLock() · 5d580b9f
      Vlad Zahorodnii authored
      Summary:
      Since Qt::KeypadModifier is set only for keypad keys and not the NumLock
      key, we need to press at least one keypad key to determine whether
      numlock is actually on. On the other hand, we know that when numlock is
      on, the corresponding LED is also on. So we could check the LED rather
      than press two keys.
      
      Test Plan: testKeyboardLayout passes.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D27789
      5d580b9f
  8. 23 Sep, 2019 2 commits
    • Vlad Zahorodnii's avatar
      Rename ShellClient to XdgShellClient · 168ea988
      Vlad Zahorodnii authored and Vlad Zahorodnii's avatar Vlad Zahorodnii committed
      Summary:
      Rename ShellClient to XdgShellClient in order to reflect that it
      represents only xdg-shell clients.
      
      Test Plan: Compiles, tests still pass.
      
      Reviewers: #kwin
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D23589
      168ea988
    • Vlad Zahorodnii's avatar
      [autotests] Don't test wl-shell clients · d92d6e77
      Vlad Zahorodnii authored and Vlad Zahorodnii's avatar Vlad Zahorodnii committed
      Summary:
      This change removes all traces of wl-shell in the test suite. That's a
      prerequisite for dropping wl-shell support in KWin.
      
      Given that wl-shell and xdg-shell are not interchangeable, some tests
      were removed and initialization sequence in some tests was adjusted.
      
      The most notable change is ensuring that each plasmashell window sets
      its role and initial position before committing the surface. Setting
      those properties before the first surface commit is important because
      our window placement code needs to know window type in order to
      avoid maximizing panels, popups, etc.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D23561
      d92d6e77
  9. 15 Nov, 2018 1 commit
  10. 01 Nov, 2018 1 commit
    • Martin Flöser's avatar
      Support enabling numlock on startup · 7c3a851b
      Martin Flöser authored
      Summary:
      This change brings improved num lock support to KWin. The modifier state
      is read and also mapped to Qt::KeyboardModifiers. Furthermore the input
      config is read and the NumLock key is evaluated. If the requested state
      does not match the current num lock state the state is swapped.
      
      BUG: 375708
      FIXED-IN: 5.15
      
      Test Plan: New unit test added, no manual test due to lack of hardware
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D16428
      7c3a851b
  11. 22 Apr, 2017 3 commits
    • Martin Flöser's avatar
      Add support for keyboard layout switching policy "winclass" · b132fe7c
      Martin Flöser authored
      Summary:
      This is quite similar to the policy "window" - the main difference is
      that windows from the same application share the layout. So only
      switching to a window from another application changes the layout.
      
      This change is the last policy to add for support of all the policies we
      have on X11.
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel
      
      Tags: #plasma
      
      Differential Revision: https://phabricator.kde.org/D5365
      b132fe7c
    • Martin Flöser's avatar
      Add support for keyboard layout switching policy "window" · c8274dbe
      Martin Flöser authored
      Summary:
      This policy stores the layout for each window which becomes active
      and restores the layout once it gets activated again.
      
      Test Plan: Added test case
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel
      
      Tags: #plasma
      
      Differential Revision: https://phabricator.kde.org/D5315
      c8274dbe
    • Martin Flöser's avatar
      Introduce support for keyboard layout switching policies · bf99d9ff
      Martin Flöser authored
      Summary:
      This change introduces the initial support for keyboard layout switching
      policies like in the X11 session. This first change only adds support for
      Global and Virtual Desktop policy. This means the current layout is
      stored in context to the current virtual desktop. Whenever one changes
      the virtual desktop the previous layout is restored. If the user has not
      yet navigated to this virtual desktop a switch to default layout is
      performed.
      
      This is the first code interacting with the new Virtual Desktop API which
      is not based on integer ids. To fully support this the API is slightly
      extended.
      
      Test Plan: Added test case
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D5301
      bf99d9ff
  12. 11 Feb, 2017 2 commits
  13. 06 Feb, 2017 1 commit
    • Martin Flöser's avatar
      Ensure the layoutChanged DBus signal gets emitted when changing layouts through DBus · b16bd414
      Martin Flöser authored
      Summary:
      Unfortunately Xkb does not emit a signal when the keyboard layout
      changes. Due to that we need to manually check in KeyboardLayout after
      each action which could change the layout whether the layout changed.
      
      This was not yet done for the case when the layout got changed through
      the DBus interface. Resulting in the DBus signal not emitted.
      
      This change addresses the issue by invoking the check for change after
      changing the keyboard layout.
      
      Test Plan: Added test case
      
      Reviewers: #kwin, #plasma_on_wayland
      
      Subscribers: plasma-devel, kwin
      
      Tags: #plasma_on_wayland, #kwin
      
      Differential Revision: https://phabricator.kde.org/D4387
      b16bd414
  14. 31 Jan, 2017 1 commit
  15. 30 Jan, 2017 1 commit
    • Martin Flöser's avatar
      Provide kxbk config through kwinApp · 8d9c4acf
      Martin Flöser authored
      Summary:
      So far KWin parsed the kxbkrc at multiple places (once in Xkb, once
      in KeyboardLayout). This is now replaced by one KSharedConfigPtr hold
      by kwinApp, just like the normal kwinrc. The KSharedConfigPtr is now
      passed to Xkb.
      
      As a nice side effect this makes it easier to test keyboard layout
      changes as we can now properly mock the keyboard configuration. Thus
      this change also comes with an autotest for loading keyboard layout
      configuration. This is becoming more and more a need as we start
      getting bug reports for layout specific issues like global shortcuts
      not working with Greek layout.
      
      Reviewers: #kwin, #plasma_on_wayland
      
      Subscribers: plasma-devel, kwin
      
      Tags: #plasma_on_wayland, #kwin
      
      Differential Revision: https://phabricator.kde.org/D4315
      8d9c4acf