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
icc-effect-5.14.5
Martin Gräßlin 2012-01-22 11:04:55 +01:00
parent 311bccaca8
commit 7c6155a865
7 changed files with 8 additions and 76 deletions

View File

@ -273,40 +273,16 @@ QRect Workspace::clientArea(clientAreaOption opt, int screen, int desktop) const
switch(opt) {
case MaximizeArea:
if (is_multihead)
return sarea;
else if (options->xineramaMaximizeEnabled)
return sarea;
else
return warea;
case MaximizeFullArea:
if (is_multihead)
return Kephal::ScreenUtils::screenGeometry(screen_number);
else if (options->xineramaMaximizeEnabled)
return Kephal::ScreenUtils::screenGeometry(screen);
else
return Kephal::ScreenUtils::desktopGeometry();
case FullScreenArea:
if (is_multihead)
return Kephal::ScreenUtils::screenGeometry(screen_number);
else if (options->xineramaFullscreenEnabled)
return Kephal::ScreenUtils::screenGeometry(screen);
else
return Kephal::ScreenUtils::desktopGeometry();
case PlacementArea:
if (is_multihead)
return sarea;
else if (options->xineramaPlacementEnabled)
return sarea;
else
return warea;
case MaximizeFullArea:
case FullScreenArea:
case MovementArea:
case ScreenArea:
if (is_multihead)
return Kephal::ScreenUtils::screenGeometry(screen_number);
else if (options->xineramaMovementEnabled)
return Kephal::ScreenUtils::screenGeometry(screen);
else
return Kephal::ScreenUtils::desktopGeometry();
return Kephal::ScreenUtils::screenGeometry(screen);
case WorkArea:
if (is_multihead)
return sarea;
@ -317,11 +293,6 @@ QRect Workspace::clientArea(clientAreaOption opt, int screen, int desktop) const
return Kephal::ScreenUtils::screenGeometry(screen_number);
else
return Kephal::ScreenUtils::desktopGeometry();
case ScreenArea:
if (is_multihead)
return Kephal::ScreenUtils::screenGeometry(screen_number);
else
return Kephal::ScreenUtils::screenGeometry(screen);
}
abort();
}

View File

@ -225,13 +225,10 @@ bool Client::manage(Window w, bool isMapped)
bool partial_keep_in_area = isMapped || session;
if (isMapped || session)
area = workspace()->clientArea(FullArea, geom.center(), desktop());
else if (options->xineramaPlacementEnabled) {
int screen = options->xineramaPlacementScreen;
if (screen == -1) // Active screen
screen = asn_data.xinerama() == -1 ? workspace()->activeScreen() : asn_data.xinerama();
else {
int screen = asn_data.xinerama() == -1 ? workspace()->activeScreen() : asn_data.xinerama();
area = workspace()->clientArea(PlacementArea, workspace()->screenGeometry(screen).center(), desktop());
} else
area = workspace()->clientArea(PlacementArea, cursorPos(), desktop());
}
if (int type = checkFullScreenHack(geom)) {
fullscreen_mode = FullScreenHack;

View File

@ -136,19 +136,11 @@ unsigned long Options::updateSettings()
if (!focusPolicyIsReasonable()) // #48786, comments #7 and later
focusStealingPreventionLevel = 0;
xineramaEnabled = config.readEntry("XineramaEnabled", true);
xineramaPlacementEnabled = config.readEntry("XineramaPlacementEnabled", true);
xineramaMovementEnabled = config.readEntry("XineramaMovementEnabled", true);
xineramaMaximizeEnabled = config.readEntry("XineramaMaximizeEnabled", true);
xineramaFullscreenEnabled = config.readEntry("XineramaFullscreenEnabled", true);
#ifdef KWIN_BUILD_DECORATIONS
placement = Placement::policyFromString(config.readEntry("Placement"), true);
#else
placement = Placement::Maximizing;
#endif
xineramaPlacementScreen = qBound(-1, config.readEntry("XineramaPlacementScreen", -1),
Kephal::ScreenUtils::numScreens() - 1);
if (focusPolicy == ClickToFocus) {
autoRaise = false;

View File

@ -132,18 +132,6 @@ public:
// whether active Xinerama screen is the one with mouse (or with the active window)
bool activeMouseScreen;
/**
* Xinerama options
*/
bool xineramaEnabled;
bool xineramaPlacementEnabled;
bool xineramaMovementEnabled;
bool xineramaMaximizeEnabled;
bool xineramaFullscreenEnabled;
// number, or -1 = active screen (Workspace::activeScreen())
int xineramaPlacementScreen;
Placement::Policy placement;
bool focusPolicyIsReasonable() {

View File

@ -159,7 +159,7 @@ TabBoxClient* TabBoxHandlerImpl::clientToAddToList(TabBoxClient* client, int des
}
}
}
if (options->separateScreenFocus && options->xineramaEnabled) {
if (options->separateScreenFocus) {
if (current->screen() != workspace->activeScreen())
ret = NULL;
}

View File

@ -352,8 +352,6 @@ void Toplevel::deleteEffectWindow()
int Toplevel::screen() const
{
if (!options->xineramaEnabled)
return 0;
int s = workspace()->screenNumber(geometry().center());
if (s < 0) {
kDebug(1212) << "Invalid screen: Center" << geometry().center() << ", screen" << s;
@ -364,8 +362,6 @@ int Toplevel::screen() const
bool Toplevel::isOnScreen(int screen) const
{
if (!options->xineramaEnabled)
return screen == 0;
return workspace()->screenGeometry(screen).intersects(geometry());
}

View File

@ -1686,15 +1686,11 @@ void Workspace::toggleClientOnActivity(Client* c, const QString &activity, bool
int Workspace::numScreens() const
{
if (!options->xineramaEnabled)
return 1;
return Kephal::ScreenUtils::numScreens();
}
int Workspace::activeScreen() const
{
if (!options->xineramaEnabled)
return 0;
if (!options->activeMouseScreen) {
if (activeClient() != NULL && !activeClient()->isOnScreen(active_screen))
return activeClient()->screen();
@ -1709,8 +1705,6 @@ int Workspace::activeScreen() const
*/
void Workspace::checkActiveScreen(const Client* c)
{
if (!options->xineramaEnabled)
return;
if (!c->isActive())
return;
if (!c->isOnScreen(active_screen))
@ -1723,22 +1717,16 @@ void Workspace::checkActiveScreen(const Client* c)
*/
void Workspace::setActiveScreenMouse(const QPoint& mousepos)
{
if (!options->xineramaEnabled)
return;
active_screen = Kephal::ScreenUtils::screenId(mousepos);
}
QRect Workspace::screenGeometry(int screen) const
{
if (!options->xineramaEnabled)
return Kephal::ScreenUtils::desktopGeometry();
return Kephal::ScreenUtils::screenGeometry(screen);
}
int Workspace::screenNumber(const QPoint& pos) const
{
if (!options->xineramaEnabled)
return 0;
return Kephal::ScreenUtils::screenId(pos);
}