Move implementation of mousePosition to AbstractClient
Also method does not need to be virtual any more.
This commit is contained in:
parent
ad6ead1928
commit
4d61835988
4 changed files with 25 additions and 31 deletions
|
@ -1285,6 +1285,28 @@ QSize AbstractClient::resizeIncrements() const
|
|||
|
||||
AbstractClient::Position AbstractClient::mousePosition() const
|
||||
{
|
||||
if (isDecorated()) {
|
||||
switch (decoration()->sectionUnderMouse()) {
|
||||
case Qt::BottomLeftSection:
|
||||
return PositionBottomLeft;
|
||||
case Qt::BottomRightSection:
|
||||
return PositionBottomRight;
|
||||
case Qt::BottomSection:
|
||||
return PositionBottom;
|
||||
case Qt::LeftSection:
|
||||
return PositionLeft;
|
||||
case Qt::RightSection:
|
||||
return PositionRight;
|
||||
case Qt::TopSection:
|
||||
return PositionTop;
|
||||
case Qt::TopLeftSection:
|
||||
return PositionTopLeft;
|
||||
case Qt::TopRightSection:
|
||||
return PositionTopRight;
|
||||
default:
|
||||
return PositionCenter;
|
||||
}
|
||||
}
|
||||
return PositionCenter;
|
||||
}
|
||||
|
||||
|
|
|
@ -794,9 +794,10 @@ protected:
|
|||
virtual QSize resizeIncrements() const;
|
||||
|
||||
/**
|
||||
* Default implementation returns PositionCenter
|
||||
* Returns the position depending on the Decoration's section under mouse.
|
||||
* If no decoration it returns PositionCenter.
|
||||
**/
|
||||
virtual Position mousePosition() const;
|
||||
Position mousePosition() const;
|
||||
|
||||
static bool haveResizeEffect() {
|
||||
return s_haveResizeEffect;
|
||||
|
|
27
client.cpp
27
client.cpp
|
@ -1835,33 +1835,6 @@ void Client::setBlockingCompositing(bool block)
|
|||
}
|
||||
}
|
||||
|
||||
Client::Position Client::mousePosition() const
|
||||
{
|
||||
if (isDecorated()) {
|
||||
switch (decoration()->sectionUnderMouse()) {
|
||||
case Qt::BottomLeftSection:
|
||||
return PositionBottomLeft;
|
||||
case Qt::BottomRightSection:
|
||||
return PositionBottomRight;
|
||||
case Qt::BottomSection:
|
||||
return PositionBottom;
|
||||
case Qt::LeftSection:
|
||||
return PositionLeft;
|
||||
case Qt::RightSection:
|
||||
return PositionRight;
|
||||
case Qt::TopSection:
|
||||
return PositionTop;
|
||||
case Qt::TopLeftSection:
|
||||
return PositionTopLeft;
|
||||
case Qt::TopRightSection:
|
||||
return PositionTopRight;
|
||||
default:
|
||||
return PositionCenter;
|
||||
}
|
||||
}
|
||||
return PositionCenter;
|
||||
}
|
||||
|
||||
void Client::updateAllowedActions(bool force)
|
||||
{
|
||||
if (!isManaged() && !force)
|
||||
|
|
2
client.h
2
client.h
|
@ -386,8 +386,6 @@ private:
|
|||
// Use Workspace::createClient()
|
||||
virtual ~Client(); ///< Use destroyClient() or releaseWindow()
|
||||
|
||||
Position mousePosition() const override;
|
||||
|
||||
// Handlers for X11 events
|
||||
bool mapRequestEvent(xcb_map_request_event_t *e);
|
||||
void unmapNotifyEvent(xcb_unmap_notify_event_t *e);
|
||||
|
|
Loading…
Reference in a new issue