Commit graph

13882 commits

Author SHA1 Message Date
Martin Gräßlin
d89777bcac Make Wayland::EGL optional again
This is needed to make KWin build-able on non-Linux, but is actually
only a workaround. The dependency should also be available on non-Linux.

This disables the EGL integration in the Wayland backend (QPainter still
available) and the EGL fallback in the qpa plugin (preferred context
sharing still available, but requires a working OpenGL Scene).

REVIEW: 126202
2015-12-01 07:58:47 +01:00
Martin Gräßlin
a055e2de82 Only compile VirtualTerminal if libinput is found
The implementation of VirtualTerminal is too linux specific and doesn't
compile on e.g. freebsd. Currently the most usage is in combination with
libinput. Only usage is:
* libinput related functionality in InputRedirection
* backends without custom input handling

Thus binding the feature to whether libinput is available is currently
the least invasive approach to get it compile on non-Linux.

In the long run this needs a different solution. The functionality
provided by VirtualTerminal is required and without the backends don't
work. It's needed to get notified about VT switches, when KWin needs to
stop rendering. So a solution for non-Linux needs to be found if
non-Linux wants to provide Wayland in future.

REVIEW: 126182
2015-12-01 07:57:39 +01:00
l10n daemon script
c8e0a4b975 SVN_SILENT made messages (.desktop file) 2015-11-30 13:09:41 +00:00
l10n daemon script
f17e9c2e68 SVN_SILENT made messages (.desktop file) 2015-11-29 11:40:15 +00:00
l10n daemon script
acfef30207 SVN_SILENT made messages (.desktop file) 2015-11-26 18:12:55 +00:00
Martin Gräßlin
38cde38edf Ensure Scene doesn't render non lock screen windows while screen is locked
The last stage for window rendering is triggered by
Scene::finalDrawWindow. Adding a security check there if screen is locked
no non-lock screen window should be rendered.

Unfortunately this method is virtual so the check needs to be done in the
base and all implementing child methods (currently only OpenGL).

REVIEW: 126144
2015-11-26 08:30:57 +01:00
Martin Gräßlin
3e007b5198 [effects] Disable more effects while screen is locked
Most of those effects didn't need special screen locking handling on
X11 as they prevented screen locking. On Wayland though, we don't
want the lock screen shown on a cube.

REVIEW: 126122
2015-11-26 08:30:29 +01:00
l10n daemon script
c69c46d8ca SVN_SILENT made messages (.desktop file) 2015-11-25 18:20:33 +00:00
Thomas Lübking
3525d1ce02 explicitly update the stack track on unminimization
the stackingOrderChanged() signal came before the window turned an effect window
usually this is no problem as the change shall not be caught anyway, but
the window may have changed its stack position

BUG: 353745
FIXED-IN: 5.5
REVIEW: 126134
2015-11-24 22:38:49 +01:00
Thomas Lübking
e2632f3816 correctly scale and position logout window
window wasn't correctly represented in
zoom, present windows and desktop grid effects

on the fly code streamlining:
- logout and above windows were handled equally in different code paths
- windows were painted on 0 opacity instead of just aborting the paint

local semi-paintdata because PaintData isn't assignable
(const dptr, I think) and we're post freeze.

BUG: 355539
FIXED-IN: 5.5
REVIEW: 126133
2015-11-24 22:38:01 +01:00
Martin Gräßlin
3361373445 [backends/hwcomposer] Announce support for DPMS
Hooked up to toggle blank output dependent on state.

REVIEW: 126095
2015-11-23 11:48:39 +01:00
Jonathan Riddell
d7398c4f50 Update version number for 5.4.95
GIT_SILENT
2015-11-19 11:39:24 +00:00
Martin Gräßlin
416d8060cf Don't query for GL_CONTEXT_FLAGS if not at least OpenGL 3.0
Patch by Thomas Lübking.

BUG: 355522
2015-11-19 11:20:33 +01:00
Martin Gräßlin
23784d2038 [wayland] Introduce an additional --exit-with-session command line arg
This is similar to the applications to start. That is the value of the
command line argument is interpreted as a command to start.
The difference is that when this application exits, KWin will also quit.
The argument is so to say interpreted as a session.

Reviewed-By: Bhushan Shah
2015-11-19 09:28:51 +01:00
Martin Gräßlin
eabddf939b Add path to kwin_wayland binary to KWin's installed CMakeConfig
The absolute path is needed by e.g. startplasmacompositor.

REVIEW: 126106
2015-11-19 09:28:16 +01:00
Yuri Chornoivan
7a57e8c20a Fix minor typo 2015-11-18 19:07:09 +02:00
Martin Gräßlin
681113e4a6 [wayland] Reset internalWindow if the QWindow gets destroyed
Prevents use after free usages.

Reviewed-By: Bhushan Shah
2015-11-18 15:43:54 +01:00
Martin Gräßlin
4d883a9cda Ensure pointer position is updated before screen locker enforcement
We need to update the pointer position, also if the screen is locked.
Otherwise the pointer doesn't move on the locked screen with libinput.

In addition we need to use the m_globalPointer for finding the correct
lock screen window as updatePointerWindow also does sanity checking on
the coordinates.

Also we need to introduce security checks where we use the signal.

REVIEW: 126103
2015-11-18 14:42:23 +01:00
Martin Gräßlin
3be016fba4 [wayland] Destroy all ClientConnections on tear down
Ensures that all Wayland objects are destroyed and the cleanup handling
is performed before tearing down the Compositor. This fixes for example
a crash if a Surface with a Shadow is still around at tear down.
2015-11-18 10:29:10 +01:00
Thomas Lübking
12b63e2aa7 remove deleted windows from motionmanagers
Eg. if a window is closed while "timeline.currentValue() == 0",
slotWindowClosed() will shortcut exit and not be removed from the
managers, thus dangle around forever.

Maybe there're other ways for a window to be deleted w/o
the closed slot being entered.

CCBUG: 339970
REVIEW: 126034
2015-11-17 21:30:43 +01:00
Thomas Lübking
a4791e629d Add rule to protect the focus on a window
This allows to pin the focus on certain window as well
as to more easily give it away on others (typically launchers)

BUG: 185060
CCBUG: 337798
FIXED-IN: 5.5
REVIEW: 126059
2015-11-17 21:30:05 +01:00
Thomas Lübking
37a64dcf5f catch lost FOCUS_POINTER_ROOT FOCUS_IN events
it seems we can "loose" focus reversions when the closing client hold a grab
(eg. the screenlocker or some games) thus we catch the typical pattern
(though we don't want the focus on the root anyway)

BUG: 348935
FIXED-IN: 5.5
REVIEW: 126033
2015-11-17 21:29:45 +01:00
Martin Gräßlin
01451eea36 Revert "Handle conflicts between epoxy and manually resolved function pointers"
This reverts commit ac1dbac8b1.
2015-11-17 14:58:59 +01:00
Martin Gräßlin
e71a230213 [hwcomposer] Add support for backlight through light_device_t
We use the hw module's backlight and set the color to either 0
or FF depending on whetehr we want to have the screen on or off.
This turns the backlight off properly. It is bound to the toggleBlank
functionality so that we always turn on/off the backlight depending
on whether our compositor is on or off.

In addition we listen to key release events on the power button to
toggle the state.

REVIEW: 126083
2015-11-17 14:45:34 +01:00
Martin Gräßlin
8d00355448 [hwcomposer] Don't waitVsync if we haven't activated vsync yet
Would just hit the timeout, no need to wait 16 msec for nothing.
2015-11-17 14:45:34 +01:00
l10n daemon script
6bb9f6db7b 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"
2015-11-17 13:07:36 +00:00
Martin Gräßlin
57a3cea142 [backends/hwcomposer] Base HwcomposerScreens on BasicScreens 2015-11-17 10:49:09 +01:00
Martin Gräßlin
eb81ddfb86 [backends/fbdev] Use BaseScreens implementation 2015-11-17 10:46:32 +01:00
Martin Gräßlin
898eefc6be [backends/wayland] Use BasicScreens implementation 2015-11-17 10:43:10 +01:00
Martin Gräßlin
7b12e55857 [backends/x11] Use BasicScreens implementation 2015-11-17 10:40:17 +01:00
Martin Gräßlin
fb4d59abb7 [wayland] Add a base implementation for Screens in a basic setup
X11, Wayland, virtual, Framebuffer and hwcomposer have extremely
similar screens implementations. Let's add a base implementation
for them as a BasicScreens.
2015-11-17 10:39:39 +01:00
Martin Gräßlin
cab25fc13f [backends/wayland] Drop warning messages concerning egl backend
From a time before we split into platform plugins.
2015-11-17 09:51:50 +01:00
Martin Gräßlin
75c82fce19 [backends/wayland] Only set socket name if it got sepcified
If we don't have a dedicated device identifier we should use the default
mechanismn which involves using the WAYLAND_DISPLAY or WAYLAND_SOCKET env
variable.
2015-11-17 09:51:50 +01:00
Martin Gräßlin
930e56767e [backends/wayland] Do not query outputs
Not needed, we use a nested window.
2015-11-17 09:51:50 +01:00
Martin Gräßlin
df71c5b61b [backends/wayland] Simplify WaylandScreens by basing on ShellSurface size
It's a screen for a nested setup - no need for integrating with Wayland's
output for that.
2015-11-17 09:51:50 +01:00
Martin Gräßlin
9381d3f88c [backends/wayland] Drop XRandR updating
No longer needed as we use Xwayland.
2015-11-17 09:51:50 +01:00
Martin Gräßlin
3f6cb8812b [backends/wayland] ShellSurface opened as a toplevel instead of fullscreen
Going towards nested setup.
2015-11-17 09:51:50 +01:00
Martin Gräßlin
eafded7127 [backends/wayland] Drop subsurface for cursor
As we don't use the fullscreen shell any more, we use the "normal"
cursor image handling of wl_seat.
2015-11-17 09:51:50 +01:00
Martin Gräßlin
1ca690d4ee [backends/wayland] Drop support for fullscreen shell
We are going to switch to a proper nested approach similar to the
x11 backend. Given that we don't want to run on fullscreen anymore
but just open a nested window.
2015-11-17 09:51:50 +01:00
Bhushan Shah
42ddf685c1 [InputRedirection] Don't crash on invalid Toplevel
Reviewed-By: Martin Gräßlin
2015-11-16 20:57:23 +05:30
Martin Gräßlin
38f19dafb2 Add safety check to Deleted::~Deleted for tear-down
It's possible that the Deleted gets created before destroying Workspace
and due to the deleteLater outlives Workspace. In that case we may not
call into Workspace as this might crash.
2015-11-16 14:14:07 +01:00
Martin Gräßlin
deb63fa344 Cancel loading in EffectsLoader on tear down
When unloading all effects we should make sure that also the ones
scheduled for loading are canceled. For this a new method clear()
is added to the AbstractEffectLoader and all inheriting classes which
clears the current load queue. For the scripted and plugin effect loader
it should also cancel the future, but that's not yet implemented.
2015-11-16 14:06:23 +01:00
Bhushan Shah
e5a0af1589 [InputRedirection] Check if workspace is valid before accessing it
Reviewed-By: Martin Gräßlin
2015-11-16 16:20:29 +05:30
Bhushan Shah
e5518dffe2 [wayland] Add some restrictions for lockscreen
When screen is locked,

- No window other then screenlocker or inputmethods gets rendered
- Only screenlocker gets keyboard events
- Only screenlocker and inputmethods get mouse events

Things that are not secured/tested are :

- Touch events
- Global shortcuts for screenlocker
- Fallback/emergency screen not yet working

REVIEW: 126015
2015-11-16 16:16:20 +05:30
Bhushan Shah
450bbaafdc [wayland] Introduce property to identify lockscreen and inputmethods
This introduces Toplevel::isLockScreen() and Toplevel::isInputMethod(),
this can be used to allow only lockscreen/inputmethods to get input
events and shown when screen is locked.
2015-11-16 15:49:38 +05:30
Martin Gräßlin
5d416a0f69 Introduce additional safety checks for init debug output in SceneOpenGL
There are slight differences between GL_ARB_debug_output and GL_KHR_debug
affecting how it works on GLES. With GL_KHR_debug the context should be
created with a debug flag. With the ARB extension there is no such
requirement. Empirical data (Mali) shows that it doesn't work if the
context is not created with the flag, although the spec seems to allows
it.

So:
* if we have GL_ARB_debug_output we assume it works
* if we only have GL_KHR_debug we check whether the context is created
  with debug support (which we don't do yet, but maybe should?)
* on GLES we can only query with version 3.2 (which we don't request yet)
* with anything older we just assume it's not enabled (which is correct
  given that we don't enable the debug flag)

REVIEW: 126053
2015-11-16 09:09:34 +01:00
Martin Gräßlin
1d75cd26fb Verify that context is robust before resolving robust functions
The extensions specify that you are only allwoed to use the robust
functions if the context is robust. Given that we need to query
whether the robust is context and fall back to our workaround if
the context is not robust.

REVIEW: 126051
2015-11-16 09:08:14 +01:00
Martin Gräßlin
b383db2e2e Create robust egl context if possible 2015-11-16 09:08:14 +01:00
Martin Gräßlin
6d96b8c4af Move egl context creation into AbstractEglContext
Code was more or less copied into each backend, so it's better to
have a shared implementation.
2015-11-16 09:08:14 +01:00
Martin Gräßlin
3a610ec9f6 [backends/hwcomposer] Do not manually cleanup our HwcomposerWindow
It looks like libhybris already deletes the window when we do
eglDestroySurface resulting in a double delete if we also delete it.
2015-11-13 17:55:02 +01:00