Commit graph

318 commits

Author SHA1 Message Date
Thomas Lübking
b0dc3b3009 shuffle mnemonics in "more actions"
in a way so that each entry has its own
drawback: present mnemonics changed.
they however also change with i18n.

REVIEW: 125434
BUG: 319695
FIXED-IN: 5.5
2015-09-29 23:03:20 +02:00
Thomas Lübking
0302b97aea prevent calling xrandr w/o extension available
BUG: 343844
FIXED-IN: 5.5
REVIEW: 125074
2015-09-29 23:02:41 +02:00
Thomas Lübking
a97b6e0fd6 delete the quit process, not UserActinsMenu
BUG: 351643
FIXED-IN: 5.4.1
REVIEW: 124895
2015-08-24 21:58:49 +02:00
Martin Gräßlin
8d407157c4 Provide a base implementation for performMouseCommand in AbstractClient
Most commands can be operated directly in AbstractClient already which
means less code duplication to make the commands work for wayland
clients.
2015-07-09 16:34:19 +02:00
Martin Gräßlin
f6458fa1e8 Port away from KToolInvocation
The problem with KToolInvocation is that it creates a dead lock on
Wayland in case kdeinit is not already running. It starts kdeinit
and does a QProcess::waitForFinished and our kdeinit needs to interact
with the wayland server. So dead lock.

As KRun also calls into the dangerous code path it's no option which
leaves us with QProcess to start the processes.

A nice side-effect is that we no don't need to link KF5::Service any
more from kwin_core. Now once Plasma and Notification don't use it
any more, it will be gone completely.
2015-07-07 17:35:57 +02:00
Martin Gräßlin
a1a89d3d1e Disable Activities support on Wayland
This is a temporary workaround for bug 349992 which causes freezes
during startup as kwin and kamd dead lock each other on DBus.

To workaround we don't call Activities::create and check in every
usage of Activities::self() whether the pointer is valid.

As a result kwin_wayland now starts pretty fast.

CCBUG: 349992
2015-07-07 11:48:42 +02:00
Thomas Lübking
d053c31571 don't offer to set window shortcut if rule forced
since the rule would trump the configured shortcut

BUG: 332184
FIXED-IN: 5.4
REVIEW: 124125
2015-06-19 19:47:51 +02:00
Martin Gräßlin
9d580a628f Use screen name as additional information in UseractionsMenu
New format: Screen 1 (HDMI1)

REVIEW: 123849
2015-05-19 09:53:14 +02:00
Thomas Lübking
b3bd9ea144 make switchWindow FROM stickies act on current VD
it's probably the user expectation and few windows
are on all desktops

BUG: 331512
REVIEW: 123640
2015-05-15 23:55:26 +02:00
Martin Gräßlin
1e7a28033b Drop no longer needed dynamic_cast in Workspace::performWindowOperation 2015-05-08 12:43:46 +02:00
Martin Gräßlin
7a74413712 Drop dynamic_cast from UserActionsMenu::slotSendToDesktop 2015-05-08 12:43:46 +02:00
Martin Gräßlin
fdcaf2b86f Make Workspace::active_client an AbstractClient 2015-05-08 12:43:46 +02:00
Martin Gräßlin
4f1c98773e Workspace::showWindowMenu operates on AbstractClient 2015-05-08 12:43:45 +02:00
Martin Gräßlin
ddcd4dab59 Workspace::slotWindowTo(Previous|Next)Desktop operates on AbstractClient 2015-05-08 12:43:45 +02:00
Martin Gräßlin
d2cdd3de1d UserActionsMenu operates on AbstractClient
There are still a few areas where it's dynamic casting to Client,
e.g.:
* sendToDesktop
* window tabbing related
* activities related
2015-05-08 12:43:45 +02:00
Martin Gräßlin
519006ffa4 Workspace::performWindowOperation operates on AbstractClient
Only exception is the call to ::takeActivity which still expects a
Client.
2015-05-08 12:43:45 +02:00
Martin Gräßlin
942b49e2c4 Workspace::setupWindowShortcut operates on AbstractClient 2015-05-08 12:43:45 +02:00
Martin Gräßlin
857219546f Update x11Time when a global shortcut is pressed
KGlobalAccel sets the timestamp as a property and we need to set our
x11Time to it otherwise following keyboard grabs might fail.

Requires 61e2a156678eef033b2629f7c72530dc78d7c3ac in kglobalaccel.
2015-02-25 08:15:53 +01:00
Thomas Lübking
fdcb0e6180 correctly test whether client is on a VD
when considering if for a directional
focus switch

BUG: 331512
REVIEW: 122292
FIXED-IN: 5.3
2015-02-05 21:37:34 +01:00
Martin Gräßlin
87caab24ca Drop support for XFree86-VidModeExtension
Was only used as fallback for older NVIDIA drivers. At the same time
also drop the call to nvidia-settings which was also only used as
a fallback for refresh rate detection.

REVIEW: 122423
2015-02-04 14:45:53 +01:00
Daniel Pastushchak
0d997b1093 Introduce categorized logging for kwin core
Done by Daniel Pastushchak for KDE during GCI-2014.
2014-12-05 14:27:15 +01:00
Martin Gräßlin
4c9744fe8e Drop dependency on kdecoration.h 2014-12-02 13:50:26 +01:00
Martin Gräßlin
3d9a035312 Move MaximizeMode from KDecorationDefines to utils.h
Unfortunately it cannot be a enum defined in Client as client.h
depends on rules.h and with it in Client rules.h would depend on
client.h.
2014-12-02 13:49:08 +01:00
Martin Gräßlin
d4bf3602ce Move WindowOperation enum to Options
With this Options no longer needs to inherit from KDecorationDefines.
2014-12-02 10:41:47 +01:00
Martin Gräßlin
c2e53b9a2f Merge branch 'kdecorations2'
Conflicts:
	effects.cpp
	paintredirector.cpp
2014-12-02 08:38:10 +01:00
Martin Gräßlin
b7a8bb4f52 Drop build option KWIN_BUILD_SCREENEDGES
The build option got introduced for Plasma Active back in a time
when we did not properly aim for convergence. In a Plasma 5 world
we want to have only one shell and one window manager which adjust
itself. This means we don't want a differently compiled kwin for
plasma active, but the same one. Thus the build option doesn't
make much sense any more. A KWin for touch interface needs to support
screenedges for the case that mouse is plugged in.

CCBUG: 340960
REVIEW: 121200
2014-11-24 10:48:49 +01:00
Martin Gräßlin
482f89b91f Fix build without KF5Activities
BUG: 340961
FIXED-IN: 5.2.0
REVIEW: 121202
2014-11-24 10:47:08 +01:00
Martin Gräßlin
e32da9d9e0 Merge branch 'master' into kdecorations2
Conflicts:
	CMakeLists.txt
	paintredirector.cpp
	scene_opengl.h
	scene_qpainter.h
	scene_xrender.h
2014-10-20 16:04:52 +02:00
Montel Laurent
e4b2f14141 Remove excutable attribute 2014-10-07 19:42:28 +02:00
Jeremy Whiting
f8defc4c8f Context menu: Add "Keep Above Others" icon opposite of "Keep Below Others"
REVIEW:120465
2014-10-06 08:22:37 -06:00
Martin Gräßlin
9fae34f86f Remove Client::getWMHints in favor of functionality in NETWinInfo
We are only using the UrgencyHint, InputHint and GroupLeader from
WMHints. Those are provided by NETWinInfo, so we can use the
functionality provided by NETWinInfo instead of calling XGetWMHints.

REVIEW: 120162
2014-09-15 16:29:47 +02:00
Martin Gräßlin
0030eb7f84 Initial import of support for new KDecoration2 based decorations
NOTE: this is not working completely yet, lots of code is still ifdefed
other parts are still broken.

The main difference for the new decoration API is that it is neither
QWidget nor QWindow based. It's just a QObject which processes input
events and has a paint method to render the decoration. This means all
the workarounds for the QWidget interception are removed. Also the paint
redirector is removed. Instead each compositor has now its own renderer
which can be optimized for the specific case. E.g. the OpenGL compositor
renders to a scratch image which gets copied into the combined texture,
the XRender compositor copies into the XPixmaps.

Input events are also changed. The events are composed into QMouseEvents
and passed through the decoration, which might accept them. If they are
not accpted we assume that it's a press on the decoration area allowing
us to resize/move the window. Input events are not completely working
yet, e.g. wheel events are not yet processed and double click on deco
is not yet working.

Overall KDecoration2 is way more stateful and KWin core needs more
adjustments for it. E.g. borders are allowed to be disabled at any time.
2014-07-25 14:02:26 +02:00
Thomas Lübking
00bb767291 fix dangeling allActivitiesGroup pointer crash
CCBUG: 334152

Forward port of d3fe2391f6b36398ac671fe3cadef667919cc0e5 from kde-workspace
2014-06-04 16:30:29 +02:00
Thomas Lübking
5d8ae96a56 take fullscreen windows out of tabbing
it's not been possible to attach tabs to an (undecorated!)
fullscreen window.
now it's neither possible to attach a fullscreen window to
another tabgroup and fullscreening a window will untab it

CCBUG: 332568

Forward port of abf3d200cfc39fcc27a22224512853a96d947add from kde-workspace
2014-06-04 16:30:29 +02:00
Thomas Lübking
d8c9da0cc7 "fix" activity assignemt by popup menu
problem is that toggleOnActivity interprets "all" as "none" and
subsequent setting of any activity will move the window to that
activity *only* - what's not suggested by the GUI
-> force the user to "hold it correctly" by unchecking all
   individual activities when setting on all - this also matches
   the display when the popup is opened w/ "on all" preselected

CCBUG: 330838

Forward port of 31f9e4cf053f59b7013ff006c86290f86adfcdb5 from kde-workspace
2014-06-04 16:30:29 +02:00
Ivan Čukić
b995c9da23 KWin activities usage ported to the new library paradigm
Since the KActivities library now keeps an internal cache (and is
non-blocking), there is no point in thread-based information
fetching.

BUG: 335396
REVIEW: 118443
2014-06-01 18:58:36 +02:00
Martin Gräßlin
25155e0092 [useractions] Print debug message if launching kcmshell5 fails
If one cannot launch kcmshell5 some runtime components are missing. Thus
using kdialog (like in TabBox) or a notification would probably fail,
too. So at least print a debug warning to stdout.

BUG: 334860
REVIEW: 118161
2014-05-19 09:12:55 +02:00
Martin Gräßlin
d0fb6b22ba [kwin] Use new connect syntax in useractions.cpp
Although there are many local slots in UserActionsMenu those are not
turned into lambdas as they are rather long.

REVIEW: 117117
2014-03-27 18:11:19 +01:00
Martin Gräßlin
9075b5e2d6 [kwin] Remove cursorPos() from utils.h
Only delegated to Cursor::pos() anyway, so let's just use that directly.
Fixes the annoyances of having to mock it in the unit tests which include
utils.cpp.

REVIEW: 116900
2014-03-25 15:25:40 +01:00
Martin Gräßlin
970e8765f0 [kwin] Remove support for _NET_WM_TAKE_ACTIVITY protocol
As can be seen in [1] the patches to KWin were in CVS HEAD before the
protocol got standardized and it never got any adoption. It's neither in
the NETWM spec, nor implemented in Qt4 nor in Qt5. KWin did not even add
the protocol to the NET::Supported property.

Thus it doesn't make much sense to keep a protocol which nobody speaks.

Still the code around the protocol is kept and also the names are kept.
Only difference is that Client::takeActivity got removed and the code
moved to the only calling place in Workspace. Motivated by that change
the enum defined in utils.h is moved into Workspace, it's turned into
a proper QFlags class and used as a type in the method argument instead
of a generic long.

[1] https://mail.gnome.org/archives/wm-spec-list/2004-April/msg00013.html

REVIEW: 116922
2014-03-25 15:03:21 +01:00
Martin Gräßlin
d1d3401b9f Register KWin's global shortcuts with the new shortcut system
All the KWin core shortcuts get also registered inside the new global
shortcut system so that they are still triggered when running KWin on
Wayland.
2014-03-19 14:14:56 +01:00
Aleix Pol
c72e519d9c Remove KDE/ prefix in include directories
It's unneeded and deprecated since KF5.
2014-03-17 16:24:10 +01:00
Martin Gräßlin
32db9c109f [kwin] Add new kwineffects KCM to the KWin config center 2014-03-10 14:55:04 +01:00
Martin Gräßlin
4dff7888e3 [kwin] Drop build option to build without scripting
Scripting has proved it's point of being useful so it's time to turn it
into a mandatory part of KWin.

Also I start to use features provided by Scripting in more and more
parts of KWin core (e.g. sharing QQmlEngine) which makes it in the
long to complicated to have a build option and ifdefs for it.

REVIEW: 116587
2014-03-04 08:19:55 +01:00
Martin Gräßlin
f48aca47a5 [kwin] Use ui-file for ShortcutDialog
At the same time switching to QKeySequenceEdit for capturing the
shortcut. This allows to get rid of xmlgui.
2014-02-27 10:18:37 +01:00
Martin Gräßlin
dc9f613113 [kwin] Do not use camelcase includes for kactivities
Jenkins doesn't like them, so let's try without them.
2014-02-04 09:36:15 +01:00
Martin Gräßlin
9414d8f7f1 [kwin] Re-enable KActivities support
* KWin lists the activities in the Alt+F3 menu
* Kcmrules though looks wrong
2014-02-03 13:40:47 +01:00
Martin Gräßlin
08a09d27f8 [kwin] Remove the KActionCollection for the client keys
Not needed as we can also find the action as a child of Workspace.
2013-12-10 10:15:23 +01:00
Martin Gräßlin
a6f32bf3e8 [kwin] Do not use a KActionCollection for Workspace's global shortcut actions
The ActionCollection was only used for two features:
* setting the object name
* finding the action for retrieving it's shortcut

This can also be achieved by just setting the object name and searching
for the children of the Workspace singleton.
2013-12-10 10:01:13 +01:00
Martin Gräßlin
edeb8051e9 [kwin] Remove KActionCollection usage in TabBox
Only feature used by KActionCollection is setting the object name.
2013-12-10 09:34:11 +01:00