Commit Graph

204 Commits (c094c7e7cd26ae7622b6e05db932e1d438d6ce1b)

Author SHA1 Message Date
Martin Gräßlin 6d0d9cfe43 Remove KWin::Notifications
Overall all notifications except compositing suspended by DBus were
configured by default to not have any action. This means all the time we
emit a notification we keep DBus and KDED busy for nothing.

All the cases when a notification is triggered ire also exported to
KWin scripting, so if one really needs to handle something in case a
window is moved, it could be done through a KWin script with much more
context about the event.

REVIEW: 110113
BUG: 258097
FIXED-IN: 4.11
2013-04-23 16:23:55 +02:00
Martin Gräßlin a82689a2d2 Remove new dialog notification 2013-04-23 16:21:29 +02:00
Martin Gräßlin c8c2550eb6 Remove new window notification 2013-04-23 16:21:29 +02:00
Martin Gräßlin edb074cbc2 Split out screen handling from Workspace into own class Screens
Following the approaches of other split out functionality Screens is a
singleton class created by Workspace.

The class takes over the responsibility for:
* screenChanged signal delayed by timer
* number of screens
* geometry of given screen
* active screen
* config option for active screen follows mouse

The class contains a small abstraction layer and has a concrete subclass
wrapping around QDesktopWidget, but the idea is to go more low level and
interact with XRandR directly to get more detailed information.

All over KWin the usage from QDesktopWidget is ported over to the new
Screens class.

REVIEW: 109839
2013-04-15 10:25:10 +02:00
Martin Gräßlin da85b5fdc7 Split out Activities related code from Workspace
All activities related code moves into new singleton class Activities.
This class gets only included into the build if the build option is
enabled which means there are less ifdefs all over the code and it also
handles better the moc doesn't like ifdef case.

The class holds the list of open and all activites, the current and the
previous activity and the KActivities::Controller. It also emits the
signals for any activities related changes.

Workspace still contains some activities related code. That is the
adjustment on change of current activity. Nevertheless the code looks
much cleaner now and does not contain the confusing naming conflict with
takeActivity() which existed before.

In all the places where Activities got used the code got adjusted and
quite often the ifdef got added with a fallback for the disabled case.
2013-04-11 13:01:36 +02:00
Thomas Lübking 158d060b5f turn "ignore geometry" forcerule into a setrule
and btw. replace legacy "ignoreposition" by "ignoregeometry"

this will allow to use "apply initially" as "force" used to act
(ignore position on placement) and "force" to prevent clients
from reconfiguring themselves (to not break a tabgroup or to just
not be annoying)

BUG: 311720
CCBUG: 252314
REVIEW: 109691
FIXED-IN: 4.11
2013-03-28 20:31:08 +01:00
Martin Gräßlin 15aa42c565 Remove doNotManage hack for Java Applets
The hack used to be used to hide windows before they get embedded into
another window. This has been wrong on multiple levels:
1. it does not belong into a window manager - the window should take care
   of this by itself
2. Window title is not a proper way to identify windows
3. Using D-Bus to inform an X11 window manager about windows which should
   not get managed is rather strange
4. The hack only works with KWin, but not with any other X Window Manager
5. Windows identified with this hack still appear in Alt+Tab, that is
   they are managed after all. Only a flicker is suppressed
6. Such windows are shown in the taskbar which nicely illustrates how
   wrong a D-Bus call to the window manager is

That the hack has been introduced for Java Applets in KHTML also shows
that this is wrong. Why does Gecko and WebKit not need such a hack? Why
is KHTML tied so closely to X11 and KWin? Having a hack for a technology
which is obsoleted (Java Applets) and shouldn't be used due to security
issues is another reason to no longer support this hack. This usage has
been removed from KHTML as of 67939b1 of kdelibs git repo.

REVIEW: 109450
2013-03-22 09:54:45 +01:00
Martin Gräßlin f12cf0efba Replacement class for QCursor
With Qt5 QCursor does no longer provide ::handle() which was used to
set a cursor on a native XWindow for which we do not have a QWidget.

Also KWin has had for quite some time an optimized version to get the
cursor position without doing XQueryPointer each time ::pos() is called.

These two features are merged into a new class Cursor providing more or
less the same API as QCursor.

In addition the new class provides a facility to perform mouse polling
replacing the implementations in Compositor and ScreenEdges.

For more information about the new class see the documentation for the
new class in cursor.h.
2013-02-25 13:35:14 +01:00
Thomas Lübking 32efd0f1e0 add stricter heuristics to initial maximization
instead of just checking whether the decorated client will be bigger
than the workarea and take that as reason to maximize it, we will not do
so if it's smaller than the full are and the managed client bigger than
the screen (because it makes sense for the user to move it around and the
requested dimension is out of what the client could have stored when closing
maximized)

REVIEW: 108705
2013-02-18 21:55:14 +01:00
Martin Gräßlin b967527db3 Use XCB to resolve the X11 Extensions
The extension handling is removed from kwinglobals and moved into the
xcbutils in KWin core in namespace KWin::Xcb. The motivation for this
change is that the Extensions are only used in KWin core and are marked
as internal. So there is no need to have them in the library.

What remains in Extensions are the non-native pixmaps. This will be
removed once we are on Qt 5 as QPixmap can no longer reference an XPixmap.

The remaining code in kwinglobals also still initialize the XLib versions
of extensions emitting events. It seems like there are no XEvents emitted
if not done so even if the extension is correctly initialized with xcb.
This needs to be removed once the event handling is ported over to xcb.

REVIEW: 107832
2013-01-22 07:50:03 +01:00
Martin Gräßlin a4ef906b14 Fix warnings
SVN_SILENT
2013-01-08 11:08:46 +01:00
Martin Gräßlin 334b4bf622 Move handling of Virtual Desktops into a VirtualDesktopManager
The ownership for virtual desktops is moved from Workspace into a new
VirtualDesktopManager. The manager is responsible for providing the count
of virtual desktops and keeping track of the currently used virtual
desktop.

All methods related to moving between desktops are also moved from
Workspace to the new manager, though all methods related to Clients on
Virtual Desktops remain in Workspace for the time being. This is to have
the new manager as independent from KWin core as possible.

An rather important change for the handling of virtual desktops is that
the count and the id of a desktop is now an unsinged integer instead of
an integer. The reason for that is that we cannot have a negative count
of desktops as well as it is not possible to be on a desktop with a
negative identifier.

In that regard it is important to remember that a Client can be on a
desktop with a negative identifier. The special value for a Client being
on all desktops is handled by using -1 as a desktop. For the time being
this is not adjusted but instead of comparing the virtual desktop ids one
should prefer to use the convenient methods like isOnDesktop and
isOnAllDesktops. This would allow in future to internally change the
representation for on all desktops.
2013-01-07 09:47:51 +01:00
Martin Gräßlin a084d34ccb Fix Krazy2 issues reported by doublequote_chars checker 2013-01-02 18:35:46 +01:00
Martin Gräßlin 8ea46b7f2d Fix narrowing conversion warnings
With this change KWin core is free of narrowing conversion warnings.

SVN_SILENT
2012-12-27 11:14:08 +01:00
Martin Gräßlin f689df14d5 Remove Placement wrappers from Workspace
The two methods:
* place
* placeSmart
have only forwarded the call to the Placement object. Now that Placement
is a singleton there is no need to have them. Every user can call them
directly without going over Workspace.
2012-12-20 07:19:53 +01:00
Fredrik Höglund 19aaf48a02 kwin: Port Client::embedClient() to xcb 2012-11-07 22:13:13 +01:00
Thomas Lübking 850c1e6f0d add screen rule 2012-09-19 20:21:43 +02:00
Thomas Lübking f18230fe99 ignore dockers for showingDesktop state
also use a common funciton to decide whether or
not to break the state

BUG: 305874
FIXED-IN: 4.9.1
2012-08-28 21:08:28 +02:00
Thomas Lübking 9390b270f8 substitute mapping_state == Withdrawn by m_managed
as the flamewar pointed out, resetShowingDesktop invalidly keeps hidden windows
the reason is that there're several updateVisiblity calls (notably one from the compositor)
which  break the showingDesktop state as a side effect (before ::manage() does it's thing)

Since they also invalidate the Withdrawn mapping state, that will fail as isManaged() test
(it's also invalidly used by the compositor to set up the decoration, isManaged() used to be
true because of the updateVisibility() call before) since the result is never Withdrawn

CCBUG: 299655
REVIEW: 105303
2012-07-10 01:00:00 +02:00
Thomas Lübking 9f172ad9a7 fix overzealous but autogroup by id breaking optimization
BUG: 302084
FIXD-IN: 4.9
REVIEW: 105296
2012-06-18 22:11:44 +02:00
Thomas Lübking 0bf8e0cc80 check whether SessionInfo::tabGroupClient is (still) in workspace before using it
BUG: 301456
FIXED-IN: 4.9
REVIEW: 105186
2012-06-09 12:03:22 +02:00
Ivan Čukić 0d60a7049d Adds activity window rules to KWin
- adds the kcm rule option to set the activity - one or all option like
  for virtual desktops
- makes the windows obey the rule
- makes the rule enforced even when the user tries to change the
  window's activity via the alt+f3 menu

REVIEW:104972
2012-05-17 16:32:06 +02:00
Thomas Lübking 93729709e6 merge geom_pretile & geom_restore
remove some patch bodies
checkWorkspacePosition on geom_restore

CCBUG: 80265
reviewed-by: graesslin
2012-04-20 23:59:25 +02:00
Thomas Lübking eb83686d56 [Janitorial] Remove legacy "rules" to ignore position request and focus stealing prevention
REVIEW: 104274
2012-03-21 22:32:33 +01:00
Thomas Lübking 357b6b5338 resolve merge conflict 2012-03-07 22:02:26 +01:00
Thomas Lübking c885d88f28 set desktop w/o desktop hint on all desktops
helps with legacy desktops replacing decorations like IceWM which withdraw the desktop settings

REVIEW: 104112
2012-03-07 20:52:15 +01:00
Martin Gräßlin 212908ee88 Refactoring of KWin::Options: getter methods instead of public variables 2012-02-27 19:31:58 +01:00
Thomas Lübking 85635dd485 fix tabbing
BUG: 290959
BUG: 265160
BUG: 229292
BUG: 238279
BUG: 290758
BUG: 222831
BUG: 278275
BUG: 245747
BUG: 230000

BUG: 253697
BUG: 230570
BUG: 265977
BUG: 225337
BUG: 225339

REVIEW: 103855
2012-02-11 16:30:22 +01:00
Thomas Lübking bf88ec09ac Revert "fix tabbing"
pushed out of branch, not master - leading to absent revision, found hash collision??

This reverts commit 94b2ad7b85801e37e2df4671cdc4f26b6d7e5506.
2012-02-11 16:29:14 +01:00
Thomas Lübking d245035a17 fix tabbing
BUG: 290959
BUG: 265160
BUG: 229292
BUG: 238279
BUG: 290758
BUG: 222831
BUG: 278275
BUG: 245747
BUG: 230000

BUG: 253697
BUG: 230570
BUG: 265977
BUG: 225337
BUG: 225339

REVIEW: 103855
2012-02-11 16:01:41 +01:00
Thomas Lübking 033ae96f89 selective rule remembering
REVIEW: 103875
2012-02-09 17:34:08 +01:00
Martin Gräßlin 7c6155a865 Drop xinerama related options
Behavior is now like all xinerama related options are enabled.
There seems to be no valid reasons to run multi screen without
xinerama support and even if a user would wish to do so she can
just disable xinerama in xorg.conf.

Furhtermore thanks to KWin scripting it is possible to achieve the
behavior as it used to be with the options disabled. E.g. it is
possible to span a window in fullscreen mode over all screens.

This change is in accordance to the discussion on kwin and plasma
mailinglists:
http://mail.kde.org/pipermail/plasma-devel/2012-January/018542.html
2012-02-09 16:52:39 +01:00
Martin Gräßlin 507ff411d6 Drop the WorkspaceProxy in Scripting
Unlike stated at several places in the code it is not difficult to
setup the connections to all Clients.

It would have been nice if the failed attempts to connect the Clients
would not have made it into the code as emitted signals which are
nowhere used. Not to mention that like in all places the signals to
inform that a state changed were emitted before the state changed was
performed.
2012-01-21 10:51:22 +01:00
Jekyll Wu ab936e40ab Merge remote-tracking branch 'origin/KDE/4.8'
I did something wrong. The recent four fixes for klipper bugs were
cherry-picked from master into KDE/4.8. So they appear twice in the
merged history.

Conflicts:
	klipper/urlgrabber.cpp
2011-12-25 19:37:15 +08:00
Philipp Knechtges 27a7238f44 kwin: respect the autogroup configuration when restarting kwin
BUG: 279468
FIXED-IN: 4.8
2011-12-23 22:23:22 +01:00
Martin Gräßlin f644c28180 Support for sticky items in TabBox list
This is needed for Plasma Active's home screen which should always
be the first element in the list.
2011-12-01 13:15:11 +01:00
Thomas Lübking 6b148f1866 Move maximization when managing client
Maximization of oversized windows must happen BEFORE keepInArea() is called
because that will through resizeWithChecks() lead to an artificial constrainment
to the WorkArea which is the combination of all screens minus all struts
this fails if only one screen struts and as a result the window is no more
bigger than FullArea which is used as maximization enforcing condition.
(Maximization must also happen AFTER placement, because otherwise the window
will eventually be maximized to the wrong MaximizeArea - Screens(s) - (local) struts
depending on xinerama settings)

BUG:285967
CCBUG:286146
CCBUG:183694

FIXED-IN:4.8
2011-11-13 18:50:37 +01:00
Fredrik Höglund 9fa2feabc8 kwin: Insert an input-only window above each decorated client
This input-only window is used to capture events above the
client window and preventing them from reaching the client.

It is currently used to enlarge the borders by an invisible
amount, using the ExtendedBorderRegion provided by the
decoration.
2011-11-11 03:02:10 +01:00
Anton Kreuzkamp 98c89bcfd0 Make the window-tabbing group of a window public via an XProperty. 2011-11-07 20:52:21 +01:00
Philipp Knechtges 2c08a14ff4 kwin: implement _KDE_NET_WM_OPAQUE_REGION
This patch implements an XProperty named _KDE_NET_WM_OPAQUE_REGION
which gives the compositor the information which part of a window
is opaque although it is an ARGB visual. The basic ideas are from
http://www.mail-archive.com/wm-spec-list@gnome.org/msg00715.html

Additionally the patch makes kwin  use this information to do a better
clipping in Scene::paintSimpleScreen which should result in a higher
performance.

REVIEW: 102933
2011-10-23 17:09:44 +02:00
Thomas Lübking c071056913 fix yet another fun-with-pointers tabbing segfault
BUG: 281596
(cherry picked from commit f3ca7234ef4329b45bcd369aa49a70972a754302)
2011-09-09 18:23:50 +02:00
Thomas Lübking 12b9b1c79e fix xsync protocol
BUG: 160393
REVIEW: 102311
2011-08-24 01:39:34 +02:00
Martin Gräßlin 32a82141f0 Adding a build option for KWin Scripting
It is possible that adding this build option broke the Scripting
component. This is something that should not happen. Unfortunately
by just ifdefing everything scripting related with scripting enabled
we have build errors. These are caused by the fact that the scripting
code includes e.g. client.h through "./../client.h". At one offending
place I changed that to "client.h", but there is also a client.h in
the scripting directory.

The includes and naming of the scripting files clearly have to be fixed!
2011-07-10 10:48:25 +02:00
Arthur Arlt 25654f25b8 Removing TopMenu
Since the funtionality of TopMenu did no longer work in KDE4 this feature was
removed from Workspace. Every reference to it was removed as well as commentaries
and documentation.

REVIEW: 101485
2011-06-24 12:27:56 +02:00
Thomas Lübking 31278d570e add rule/property based composite blocking 2011-04-04 01:59:52 +02:00
Martin Gräßlin 0a7e48f7aa KWin uses kdelibs coding style. 2011-01-31 20:07:03 +01:00
Chani Armitage ad718933d0 oh hey this comment isn't true any more :)
svn path=/trunk/KDE/kdebase/workspace/; revision=1207074
2010-12-16 20:36:39 +00:00
Chani Armitage 7ce380497f Merge branch 'allactivities'
svn path=/trunk/KDE/kdebase/workspace/; revision=1207069
2010-12-16 20:14:22 +00:00
Ivan Čukić af7c8e347f Added TODO notice for non-heuristic based deciding whether a window should be on a single activity or not
svn path=/trunk/KDE/kdebase/workspace/; revision=1196906
2010-11-14 10:35:16 +00:00
Ivan Čukić ff82383f8d Borderless windows by default on all activities:
- plasma extenders (callendar etc.)
 - applet browser, activity manager
 - programs like chromium - since there's no border, there is
   no obvious way of moving them between activities.
   (alt+f3 menu is not commonly known)


svn path=/trunk/KDE/kdebase/workspace/; revision=1196797
2010-11-14 08:45:55 +00:00