Commit Graph

497 Commits (2c169e4bca46289536eb96ed105e63d0b5714772)

Author SHA1 Message Date
Martin Gräßlin dfa89cc050 Port reading Motif hints to XCB
A wrapper class for MotifHints is added to xcbutils. This class manages
the information about the read Motif hints, so that Client doesn't need
to have a copy of the read states.

The class is designed in a way that during Client::manage we get rid of
another roundtrip.

REVIEW: 122378
2015-02-06 13:43:57 +01:00
Thomas Lübking 93fb58aa88 Merge branch 'Plasma/5.2' 2015-02-06 00:29:55 +01:00
Thomas Lübking ff700a8db5 fix e3768b4355
accidentally picked the patch from the wrong branch
just about comments
2015-02-06 00:27:31 +01:00
Thomas Lübking 74e3167732 save geom_restore before calling for border update
otherwise the stored geometry would be correct for
maximized borders, thus the unmaximized borders
make the window to small on unmaximizing

BUG: 343691
FIXED-IN: 5.2.1
REVIEW: 122416
2015-02-05 21:37:34 +01:00
Thomas Lübking f496a91e59 updateFocusMousePosition() before some actions
in particular artificial geometry updates that should not
update the focus and are prone to a static cursor

BUG: 343319
REVIEW: 122299
FIXED-IN: 5.2.1
2015-02-05 21:37:33 +01:00
Thomas Lübking 92aa2fb553 save geom_restore before calling for border update
otherwise the stored geometry would be correct for
maximized borders, thus the unmaximized borders
make the window to small on unmaximizing

BUG: 343691
FIXED-IN: 5.2.1
REVIEW: 122416
2015-02-05 17:15:11 +01:00
Thomas Lübking e3768b4355 updateFocusMousePosition() before some actions
in particular artificial geometry updates that should not
update the focus and are prone to a static cursor

BUG: 343319
REVIEW: 122299
FIXED-IN: 5.2.1
2015-02-05 17:05:34 +01:00
Martin Gräßlin 2076e458d3 Use Xcb::GeometryHints instead of XGetWMNormalHints
Xcb::GeometryHints is a convenient wrapper around the size hints
as described in ICCCM combined with the sanity checks so far applied
by KWin after reading the property.

Instead of accessing the members of the property structure, we are
now using the convenience methods.

During ::manage no further actions are triggered when reading the
size hints. Only when they are read later on the previous checks
are applied. During ::manage they can be ignored as it had a dedicated
isManaged check.

The method ::resizeWithCheck got a new argument of type xcb_gravity_t
which defaults to 0. This is needed from ::configureRequest which so
far temporarily changed the xSizeHints structure. By passing as an
argument this is no longer needed.

REVIEW: 122185
2015-01-27 12:48:03 +01:00
Thomas Lübking f82a6a545c preserve actual geom_restore on QuickTileMaximize
BUG: 342981
REVIEW: 122118

The geometry of the window when entering QTM is
a technical detail (caused by the maximizing action
of moving the window to the upper edge) and thus
does not qualify as geometry the window should be
restored to (using a deoc button, shortcut etc.)
2015-01-24 22:20:29 +01:00
Martin Gräßlin 38849215d5 Recursion check while decoration updates the borders
Mostly a safety check, but fixes a crash with borderless maximized
windows. If that option is set we also do not notify the decoration
at all, as the deco will be destroyed anyway.

BUG: 341675
REVIEW: 121858
2015-01-08 12:50:05 +01:00
Thomas Lübking 8de4e4d84e determine screenArea by geom_restore in checkWSP
checkWorkspacePosition() operates on geom_restore
to preserve window positions on temporary
(without moving/resizing the window by the user)
screen layout/geometry changes.

Therefore, in the multiscreen case the
screenbound check must be done towards
the screen the window *would* be on
according to geom_restore, not the one
it is right now.

CCBUG: 161325
REVIEW: 121320
FIXED-IN: 5.2
2015-01-08 00:09:11 +01:00
Martin Gräßlin 5ceb1b4f75 Merge branch 'Plasma/5.1'
Conflicts:
	CMakeLists.txt
	geometry.cpp
	kcmkwin/kwincompositing/kcmkwineffects.desktop
	kcmkwin/kwincompositing/kwincompositing.desktop
	kcmkwin/kwindecoration/kwindecoration.desktop
	kcmkwin/kwindesktop/desktop.desktop
	kcmkwin/kwinoptions/kwinactions.desktop
	kcmkwin/kwinoptions/kwinadvanced.desktop
	kcmkwin/kwinoptions/kwinfocus.desktop
	kcmkwin/kwinoptions/kwinmoving.desktop
	kcmkwin/kwinoptions/kwinoptions.desktop
	kcmkwin/kwinrules/kwinrules.desktop
	kcmkwin/kwinscreenedges/kwinscreenedges.desktop
	kcmkwin/kwintabbox/kwintabbox.desktop
	scripts/enforcedeco/metadata.desktop
2014-12-10 13:52:27 +01:00
Martin Gräßlin d6014927e7 Cleanup electric border handling in leaveMoveResize
If a Client closed during move/resize with the outline being shown
for quick tile/maximize area, the outline never got removed.

BUG: 341673
FIXED-IN: 5.1.2
REVIEW: 121410
2014-12-10 07:45:39 +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 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 d4e2f19ef0 Workspace does not need to inherit from KDecorationDefines 2014-12-02 11:17:43 +01:00
Martin Gräßlin fa4332754c Move Position from KDecorationDefines to Client 2014-12-02 11:15:54 +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 6bdd0e96f6 [kdecoration] Decoration::client returns a QWeakPointer
In aurorae a wrapper property is added.
2014-11-28 16:28:39 +01:00
Martin Gräßlin cc98c5d9c7 Use screens()->geometry() in Workspace::desktopResized
It used to get the individual screen geometries from QDesktopWidget.
We don't need to go through QDesktopWidget any more as Screens
contains all the information we need in a more reliable way.
2014-11-27 09:00:19 +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 7154cfee42 Drop size from Client::resizeDecoration
No longer used.
2014-07-25 14:02:27 +02:00
Martin Gräßlin d3a91b67d9 Emit a signal if the QuickTileMode changes 2014-07-25 14:02:27 +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 75a298a4fb allow FS mapping of geometry restricted windows
and copy isSpecialWindow() check as rulebook input
to setFullscreen()

Client::isFullScreenable() checks:
* fullscreen rule
* fullscreen_hack (-> for normal windows)
* geometry restrictions
* special window

Client::manage() for fullscreeining checks:
* fullscreen rule (with correct "initial" parameter)
* fullscreen_hack

-> this breaks the fullscreen rule for geometry restricted windows
and causes inconsistent behavior between client requests at runtime
(which do not test ::isFullScreenable()) and on mapping.

Otoh, the specialWindow() protection should apply generally - those
kind of windows should not be fullscreened since the user can not
exit this state via kwin for them - and there's hardly a good reason
for them to be fullscreen, esp. not to enter that state at runtime

REVIEW: 118442
CCBUG: 335617

Cherry-picked from kde-workspace
43229afee9fac4303e3d280ea63f96f034b3ffb5
2014-07-10 13:36:50 +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 90fb9a5aa9 prevent moving of FS windows on 1-screen setup
CCBUG: 332565

Forward port of 124b6783de6f8f4cfb05289fa3398a7be164691b from kde-workspace
2014-06-04 16:30:29 +02:00
Martin Gräßlin 4a7f293078 Port sendSyntheticConfigureNotify to xcb
REVIEW: 118143
2014-05-19 09:13:46 +02:00
Martin Gräßlin 9cce470c35 Turn Client::delayedMoveResize() into a lambda slot
Only used for the delayedMoveResizeTimer as timeout slot. Code is small
so a lambda makes more sense. At the same time the code is slightly
improved to ensure that startDelayedMoveResize is never called while
the timer is already active.

This means that mousePressEvents are now required to come from the
decoration.

REVIEW: 117843
2014-05-07 10:21:03 +02: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 d6b346df92 [kwin] Remove TemporaryAssign from utils.h
Only used in geometry.cpp for MaximizationState and that's no
longer needed.

REVIEW: 116902
2014-03-20 07:05:41 +01:00
Martin Gräßlin abecbf2369 [kwin] Port away from deprecated functionality in KWindowSystem
Less warnings and more type safety.
2014-03-17 10:22:20 +01:00
Martin Gräßlin 2675b5d4e7 Merge branch 'KDE/4.11'
Conflicts:
	CMakeLists.txt
	kcontrol/screensaver/screensaver.desktop
	kdm/kfrontend/themes/elarun/KdmGreeterTheme.desktop
	khotkeys/kcm_hotkeys/kcm_hotkeys.cpp
	kinfocenter/main.cpp
	kscreensaver/kblank_screensaver/blankscrn.cpp
	kscreensaver/krandom_screensaver/random.cpp
	kstyles/oxygen/config/main.cpp
	kstyles/oxygen/demo/main.cpp
	ksysguard/gui/ksysguard.cpp
	kwin/clients/oxygen/demo/main.cpp
	kwin/kcmkwin/kwincompositing/kwincompositing.desktop
	kwin/tabbox/qml/clients/text/metadata.desktop
	kwin/tabbox/qml/clients/window_strip/metadata.desktop
	libs/plasmagenericshell/widgetsexplorer/package/metadata.desktop
	plasma/desktop/applets/pager/package/metadata.desktop
	plasma/desktop/shell/activitymanager/package/metadata.desktop
	plasma/desktop/shell/data/layouts/org.kde.plasma-desktop.defaultPanel/contents/layout.js
	plasma/desktop/shell/desktopcorona.cpp
	plasma/desktop/shell/main.cpp
	plasma/desktop/toolboxes/plasma-toolbox-desktoptoolbox.desktop
	plasma/desktop/toolboxes/plasma-toolbox-paneltoolbox.desktop
	plasma/generic/applets/batterymonitor/contents/ui/batterymonitor.qml
	plasma/generic/applets/systemtray/protocols/fdo/fdographicswidget.cpp
	plasma/generic/applets/systemtray/protocols/fdo/fdographicswidget.h
	plasma/generic/applets/systemtray/protocols/fdo/x11embeddelegate.cpp
	plasma/generic/runners/nepomuksearch/plasma-runner-nepomuksearch.desktop
	plasma/generic/wallpapers/color/plasma-wallpaper-color.desktop
	plasma/generic/wallpapers/image/plasma-wallpaper-image.desktop
	plasma/netbook/shell/nettoolbox/plasma-toolbox-nettoolbox.desktop
	statusnotifierwatcher/statusnotifierwatcher.cpp
	systemsettings/app/main.cpp
2014-03-10 21:21:16 +01:00
Thomas Lübking 65f86baceb fix off-by-1 on multiscreen toppanel strutting 2014-02-24 20:12:24 +01:00
Thomas Lübking aecd5af0b4 fix sendToScreen for QuickTiled windows
two-fold issue
a) setMaximize implicitly sets QuickTileMaximize; setting it again toggles it off
b) setting quicktile mode needs to happen in keyboard mode and thenn the target
   still depends on the current windo position, so the untiled window needs to
   be in a sane location (while geom_restore will typically be off-screen when
   quick tiling by mouse)

BUG: 330819
FIXED-IN:4.11.7
REVIEW: 115521
2014-02-24 20:11:31 +01:00
Martin Gräßlin fdee4ea8c8 Adjust kde-workspace to introduction of flags in NET classes 2014-02-05 17:40:19 +01:00
Martin Gräßlin a6b12108c9 Merge branch 'KDE/4.11'
Conflicts:
	kwin/clients/oxygen/config/oxygendetectwidget.cpp
2014-02-02 12:01:38 +01:00
Marek Marczykowski-Górecki 2ccf1bc3f0 kwin: fix handling of window size hints with PResizeInc
Use base_width/base_height if provided by the application and fallback to
min_width/min_height only if not (according to ICCCM 4.1.2.3).

This fixes long standing bug with shrinking gnome-terminal window.

REVIEW: 115396
2014-02-02 11:57:19 +01:00
Thomas Lübking ffaa9d336e Merge branch 'KDE/4.11'
Conflicts:
	kcontrol/workspaceoptions/workspaceoptions.desktop
	kwin/sm.cpp
2014-01-29 20:28:27 +01:00
Thomas Lübking edf0ed895f 1-pass change maximized <-> quicktiled geometry
REVIEW: 115307
2014-01-29 19:57:32 +01:00
Thomas Lübking 4bb88df714 Merge branch 'KDE/4.11' 2014-01-14 22:51:24 +01:00
Thomas Lübking 9de60604c0 properly reset quick_tile_mode on MaxRestore
BUG: 329864
FIXED-IN: 4.11.6
2014-01-14 22:28:50 +01:00
Thomas Lübking 3d389961ff preserve offsets when sending client to screen
for that purpose, move sendToScreen and updateLayer
functions from Workspace to Client, keep wrappers

BUG: 327361
FIXED-IN: 4.11.6
REVIEW: 114078
2014-01-14 22:28:46 +01:00
Thomas Lübking c4d014eb8c do not ask the deco for borders on every move
REVIEW: 114126
2014-01-14 22:24:38 +01:00
Thomas Lübking 03b23e21d9 fix shortcut driven quicktiling
1. swapping direction would rather toggle tiling
2. the next screen was calculated wrongly (found outmost)
3. the electrictborder geometry was not updated when swapping the mode on screen changes

BUG: 329136
FIXED-IN: 4.11.6
CCBUG: 222921
REVIEW: 114648
2014-01-14 22:23:09 +01:00
Martin Gräßlin d6a69aea4f [kwin] NETRootInfo::setDesktopGeometry doesn't expect a desktop argument any more 2013-11-18 13:57:06 +01:00
Martin Gräßlin ba66fd9ef6 [kwin] NETWinInfo2 becomes NETWinInfo
And takes a xcb_connection_t instead of Display. Also our own class
is adjusted to no longer need the connection being passed in.
2013-11-18 13:56:28 +01:00
Martin Gräßlin 0056302652 [kwin] updateXTime before establishing grab for move resize mode
Grabbing the pointer failed causing unrestricted move resize to
operate incorrectly (position didn't update).
2013-11-13 11:28:05 +01:00
Bhushan Shah 935851a2b5 kDebug -> qDebug in kwin 2013-11-01 17:00:41 +05:30
Thomas Lübking 3594550b14 Merge branch 'KDE/4.11'
Conflicts:
	kwin/eglonxbackend.cpp
	kwin/glxbackend.cpp
2013-09-25 23:21:36 +02:00