Commit graph

14247 commits

Author SHA1 Message Date
Martin Gräßlin
8a1f19b145 Add support for Drag'n'Drop on Wayland
Drag'n'Drop on Wayland allows us to improve the drag'n'drop experience.
When entering a window during the drag'n'drop operation, KWin raises it.

BUG: 36065
FIXED-IN: 5.6.0 (Wayland only)
2016-03-02 08:34:41 +01:00
l10n daemon script
9472756205 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2016-03-01 13:09:20 +00:00
Thomas Lübking
9d09cf6dc9 respect motif and rules on unmaximizing
when restoring a borderless maximized, the window shall
not suddenly be decorated

BUG: 359797
FIXED-IN: 5.6
REVIEW: 127198
2016-02-29 09:48:59 +01:00
Thomas Lübking
0e80a16db5 restrict cross-vd activation to in-client distrib
QDialog or at least QMessageBox does this and I doubt Lubos' idea was to
"allow focus stealing if the client nags enough" - switching the VD is a
major interrupt and prevented when a new window shows up.
It should not be possible to stomp on ground and then receive
focus - notably not on the other desktop.

I assume the original idea was to let clients distribute focus *inside*
across virtual desktops, maybe also permit when no client was active,
but hardly otherwise.

BUG: 359683
FIXED-IN: 5.6
REVIEW: 127153
2016-02-27 11:26:51 +01:00
l10n daemon script
25b6938804 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2016-02-27 09:32:00 +00:00
Marco Martin
a104a4af7f try more aggressively to retarget
instead of deleting all animations when one is over,
try to retarget them all, and redo them only
if retargeting fails

REVIEW:127101
2016-02-26 10:28:47 +01:00
Martin Gräßlin
6ae4775651 Fix fallback resolution in WaylandCursorTheme
If we find an cursor we shouldn't return null.
2016-02-25 14:05:20 +01:00
Martin Gräßlin
166d282a9f [autotests] Specify XCUROSR_THEME and XCURSOR_SIZE in pointer input test
Try to fix test on CI system. With neither a config nor the env variables
the cursor selection falls back to the default cursor theme, which might
not contain the cursors we need.
2016-02-25 13:53:23 +01:00
Marco Martin
f7feca678d respect WindowForceBlurRole or forcecontrast
even if scaled or translated, if WindowForceBlurRole is set
do the blur anyways

same thing for backgroundcontrast

reviewed by: Martin Gräßlin <mgraesslin@kde.org>
2016-02-25 12:47:25 +01:00
Martin Gräßlin
ed7bf6e091 Send leave/enter pointer event when starting/stoping effect mouse interception
When starting effect mouse interception the current focused window
and or decoration should get a leave event. Similar when the effect mouse
interception ends the current pointer position needs to be evaluated and
a pointer enter be sent if needed.
2016-02-25 09:15:41 +01:00
Martin Gräßlin
6d495f1dc9 [autotests] New test case to verify cursor changes correctly in effects
The test case verifies that setting an override cursor during mouse
interception works and that it's also possible to change it. When
ending mouse interception the cursor image should be adjusted again.

The test shows that when mouse interception starts KWin should send
a pointer leave event to the current focused window and similar needs
to handle the stop of mouse interception.
2016-02-25 09:12:22 +01:00
Martin Gräßlin
b6677ca04e Reset stored window before setting it as focused pointer surface on seat
Updating the focused pointer surface results in the cursor to change.
The CursorImage needs the current focused window to evaluate which cursor
to use, though. Thus we need to make sure that the window reflects the
current state before updating the seat.
2016-02-25 08:14:48 +01:00
Martin Gräßlin
d15e94f326 [autotest] Add test case for cursor image
This test case verifies that the cursor image and hot spot changes
correctly when focusing a window, changes when damaged and hides.

Test shows that when focusing a window the cursor image is not
removed, neither that unfocus sets back to fallback cursor properly.
2016-02-25 08:14:48 +01:00
Martin Gräßlin
873e2b0320 Add support for Move/Resize cursor mode 2016-02-25 08:14:48 +01:00
Martin Gräßlin
2292e87b35 Clear cursor cache on theme changes
The WaylandCursorTheme emits a signal whenever it reloads the theme.
This is used by CursorImage to clear the cache and reload decoration
and fallback cursor.
2016-02-25 08:14:48 +01:00
Martin Gräßlin
a029300ce5 Rework cursor image handling for Wayland
So far updating the cursor image was not really defined. It was possible
to use the cursor image from the wayland seat or have a custom set cursor
image. But there are no rules in place to decide which one to use when.

With this change a dedicated CursorImage class is introduced which tracks
the cursor image changes on the seat, on the decoration, in the effects
and so on. In addition it tracks which is the current source for the
image, that is whether e.g. the cursor from the seat or from effects
override should be used. Whenever the cursor image changes a signal is
emitted, which is connected to the signal in AbstractBackend.

Based on that the backends can directly show the image. The existing
code in the backends to install a cursor shape or to install the cursor
from the server is completely dropped. For the backend it's irrelevant
from where the image comes from.

A new feature added is that the cursor image is marked as rendered. This
is then passed on to the frame rendered in the Surface and thus animated
cursors are finally working. Unfortunately animated cursors are broken in
Qt (see https://bugreports.qt.io/browse/QTBUG-48181 ).
2016-02-25 08:14:48 +01:00
Martin Gräßlin
5acf9abda8 Merge branch 'Plasma/5.5' 2016-02-25 08:07:30 +01:00
Martin Gräßlin
3434358acd [aurorae] Handle client palette changes
When the client's palette changes we need to update the internal colors
and emit a colorChanged, so that the decoration can repaint.

BUG: 357311
FIXED-IN: 5.5.5
REVIEW: 126891
2016-02-25 08:04:09 +01:00
l10n daemon script
5e564cdf7f SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2016-02-24 09:14:01 +00:00
David Rosca
a982367a75 Morphingpopups: Don't skip small steps
Resize may happen in smaller steps, so we should not skip them.

REVIEW: 127137
2016-02-23 19:13:45 +01:00
Martin Gräßlin
5b945d2b1c Try alternative cursor names in WaylandCursorTheme::get
If resolving a cursor fails, let's also try the alternative cursor
names.
2016-02-22 13:33:21 +01:00
Martin Gräßlin
72a25aa9ff Add Cursor::cursorAlternativeNames
Make the internal hash of cursor names available.
2016-02-22 13:33:21 +01:00
Martin Gräßlin
ecfe247598 Set proper size when loading with wl_cursor_theme_load
The theme doesn't load if we pass an incorrect size. This change
implements a resolution dependency size resolution inspired by the
one in Cursor::loadThemeSettings. Ideally this would be a size
different for each screen. As we don't have support for this yet, we
go for first screen.
2016-02-22 13:33:21 +01:00
l10n daemon script
53bc6b803b SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2016-02-22 10:55:49 +00:00
Martin Gräßlin
9eeef2d9ca Fix mouse action on (in)active window
Small regression: the command didn't get updated at all, so it was always
MouseNothing.

To prevent such a regression to sneak in again the change comes with
autotest for the action on inactive and active window.
2016-02-22 10:07:02 +01:00
Martin Gräßlin
4d7c8ac372 Connect to dbus signal reloadConfig from org.kde.keyboar /Layouts
By connecting to the signal KWin can reload the keyboard layout
configuration and adjust to changes in the configuration module.
2016-02-22 08:17:45 +01:00
l10n daemon script
606d2ce362 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2016-02-21 09:53:46 +00:00
l10n daemon script
11514079ea SVN_SILENT made messages (.desktop file) 2016-02-20 12:46:35 +00:00
l10n daemon script
406a1e5326 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2016-02-20 09:52:01 +00:00
Martin Gräßlin
bc7f33db57 Notify org.kde.osdService about keyboard layout changes
KWin starts to track which is the current layout and in case it changes
notifies the org.kde.osdService about the change through DBus. KWin has
a better knowledge about changes than the KeyboardDaemon could have, so
it's better to do in KWin. E.g. KWin can also notice changes not
triggered by the global shortcut, but by the keymap itself.
2016-02-19 14:34:49 +01:00
Martin Gräßlin
c79511b2d5 Support switching keyboard layout shortcut
KWin registers/steals the shortcut of the "KDE Keyboard Layout Switcher"
and binds it to a new method which actually switches the layout.

The actual switcher from which the shortcut is stolen should only be a
representation on Wayland. Though how to do this is a problem for the
future. Only the active window is notified about layout changes and the
plasmoid will never get the event in time. This is of course a minor
problem compared to the fact that the KeyboardDaemon is absolutely X11
dependent.
2016-02-19 13:59:02 +01:00
Martin Gräßlin
83a4fe5408 Update keyboard modifier state on seat after each key event
The layout might have changed, thus we should notify the client about
it. The server ensures that on no state change it's not sent to the
client.
2016-02-19 13:59:02 +01:00
Martin Gräßlin
2e36c4b7ca Load xkb keymap information from kxkbrc config file
This is the start for adding proper support for keyboard layouts. If
we have a configuration in kxkbrc the keymap is generated from that
information. This allows to have different layouts and also layout
switching is working (though not yet passed to Wayland clients properly).

Not yet working is the global shortcut for layout switching and
reconfiguring the layouts.
2016-02-19 13:59:02 +01:00
Martin Gräßlin
5caf331610 Ask Xkb before starting to repeat a key
The keymap knows whether the key should repeat or not. E.g. no need to
trigger repeat for modifier keys.
2016-02-19 13:59:02 +01:00
Martin Gräßlin
44205fbdb4 Install custom debug handler on xkbcommon context
Forward all debug messages from xkbcommon to our own categorized
logging.
2016-02-19 13:59:02 +01:00
Martin Gräßlin
2205c98ec2 Introduce dedicated debug category for everything xkbcommon related 2016-02-19 13:59:02 +01:00
l10n daemon script
7ac1b02d15 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2016-02-19 09:28:04 +00:00
Martin Gräßlin
cb3c6a4780 Implement internal keyboard repeat
As a Wayland server KWin does not have to emit additional key repeat
events (unlike X11). The clients are responsible for handling this based
on the provided key repeat information.

Internally KWin needs key repeat, though. E.g. the effects need key
repeat (filtering in Present Windows), window moving by keyboard needs
repeat, etc. etc.

This change introduces the internal key repeat. For each key press a
QTimer is started which gets canceled again on the key release. If the
timer fires it invoked processKey with a new KeyboardKeyAutoRepeat state.
This is handled just like a KeyPress, but states are not updated and
the QKeyEvent has autorepeat set to true.

The event filters check for the autorepeat state and filter the event
out if they are not interested in it. E.g. the filters passing the event
to the Wayland client need to filter it out.

Currently auto-repeat is bound to using libinput. This needs to be
modified. The only backend sending repeated events is X11, thus for
other backends it should be enabled.

Whether creating a timer on each key event is a good idea is something to
evaluate in future.

Reviewed-By: Bhushan Shah
2016-02-19 08:22:53 +01:00
Martin Gräßlin
b59593bd9d Invoke AbstractClient::enterEvent and ::leaveEvent on updating pointer window
This implements auto raise and focus follows mouse for Wayland.

The decoration interaction needs to be autotested.
2016-02-18 16:12:22 +01:00
Martin Gräßlin
c6e6d9a872 Move leaveNotify event handling to AbstractClient
Only most basic to cancel auto raise and delayed focus.
2016-02-18 13:00:50 +01:00
Martin Gräßlin
8ee550292f Move enterNotify handling to AbstractClient
General handling for mouse driven focus and auto raise should and can
be shared between Client and ShellClient. Thus the code is moved to
AbstractClient and invoked from Client::enterNotifyEvent.
2016-02-18 11:30:52 +01:00
Martin Gräßlin
6b06779a64 Port Workspace::requestDelayFocus to AbstractClient
And also call cancelDelayFocus when removing a ShellClient.
2016-02-18 11:18:50 +01:00
Martin Gräßlin
f0ec89f38b Merge Options::MouseLower for Client and AbstractClient
The implementation in Client::performMouseCommand can now also be
used directly in AbstractClient.
2016-02-18 10:30:58 +01:00
Martin Gräßlin
df4bb8296a Port Workspace::clientUnderMouse to AbstractClient 2016-02-18 10:28:00 +01:00
Martin Gräßlin
6d47839e95 Fix scroll direction on window wheel command
Experimental testing in real world showed it's just a signing issue
in this specific case. The events passed to wayland clients scroll
in correct direction.
2016-02-18 10:11:20 +01:00
Martin Gräßlin
e6e11f7853 Move window action handling logic into a dedicated InputEventFilter
The logic so far was in the end to decide whether the event should
be further processed or not. This can be better done by a dedicated
event filter.
2016-02-18 09:57:47 +01:00
Martin Gräßlin
f1e3c9f191 [autotests] Add test case for touch down triggers a mouse action 2016-02-18 09:57:18 +01:00
Martin Gräßlin
2a98c681d0 Implement whell command in input handling
With that all the actions are implemented just like on X11.

There are two not yet implemented differences:
* hide splash window when clicking it
* replay event on special window
2016-02-18 09:18:39 +01:00
Martin Gräßlin
1f1a4ac6e8 Add support for modifier+wheel action
Implemented in the ForwardEventFilter: before forwarding the event
to the window we check whether a modifier is pressed and perform the
wheel command.

Possible improvements: each axis event triggers the same change, there
is no adjusted scaling.
2016-02-18 08:27:28 +01:00
Martin Gräßlin
ba7c5bbd77 Add support for opacity in ShellClient 2016-02-18 08:27:02 +01:00