Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
KWin
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
17
Issues
17
List
Boards
Labels
Service Desk
Milestones
Merge Requests
41
Merge Requests
41
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Plasma
KWin
Commits
0cbe297d
Commit
0cbe297d
authored
Dec 07, 2011
by
Thomas Lübking
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sanitize closed screenshot windows, ignore deleted
CCBUG: 288271 REVIEW: 103350
parent
49b63d05
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
4 deletions
+21
-4
effects/screenshot/screenshot.cpp
effects/screenshot/screenshot.cpp
+18
-4
effects/screenshot/screenshot.h
effects/screenshot/screenshot.h
+3
-0
No files found.
effects/screenshot/screenshot.cpp
View file @
0cbe297d
...
...
@@ -43,6 +43,7 @@ bool ScreenShotEffect::supported()
ScreenShotEffect
::
ScreenShotEffect
()
:
m_scheduledScreenshot
(
0
)
{
connect
(
effects
,
SIGNAL
(
windowClosed
(
EffectWindow
*
)),
SLOT
(
windowClosed
(
EffectWindow
*
))
);
QDBusConnection
::
sessionBus
().
registerObject
(
"/Screenshot"
,
this
,
QDBusConnection
::
ExportScriptableContents
);
QDBusConnection
::
sessionBus
().
registerService
(
"org.kde.kwin.Screenshot"
);
}
...
...
@@ -137,10 +138,15 @@ void ScreenShotEffect::screenshotWindowUnderCursor(int mask)
{
m_type
=
(
ScreenShotType
)
mask
;
const
QPoint
cursor
=
effects
->
cursorPos
();
foreach
(
EffectWindow
*
w
,
effects
->
stackingOrder
())
{
if
(
w
->
geometry
().
contains
(
cursor
)
&&
w
->
isOnCurrentDesktop
()
&&
!
w
->
isMinimized
())
{
m_scheduledScreenshot
=
w
;
}
EffectWindowList
order
=
effects
->
stackingOrder
();
EffectWindowList
::
const_iterator
it
=
order
.
constEnd
(),
first
=
order
.
constBegin
();
while
(
it
!=
first
)
{
m_scheduledScreenshot
=
*
(
--
it
);
if
(
m_scheduledScreenshot
->
isOnCurrentDesktop
()
&&
!
m_scheduledScreenshot
->
isMinimized
()
&&
!
m_scheduledScreenshot
->
isDeleted
()
&&
m_scheduledScreenshot
->
geometry
().
contains
(
cursor
))
break
;
m_scheduledScreenshot
=
0
;
}
if
(
m_scheduledScreenshot
)
{
m_scheduledScreenshot
->
addRepaintFull
();
...
...
@@ -263,4 +269,12 @@ bool ScreenShotEffect::isActive() const
return
m_scheduledScreenshot
!=
NULL
;
}
void
ScreenShotEffect
::
windowClosed
(
EffectWindow
*
w
)
{
if
(
w
==
m_scheduledScreenshot
)
{
m_scheduledScreenshot
=
NULL
;
screenshotWindowUnderCursor
(
m_type
);
}
}
}
// namespace
effects/screenshot/screenshot.h
View file @
0cbe297d
...
...
@@ -73,6 +73,9 @@ public Q_SLOTS:
Q_SIGNALS:
Q_SCRIPTABLE
void
screenshotCreated
(
qulonglong
handle
);
private
slots
:
void
windowClosed
(
EffectWindow
*
w
);
private:
void
grabPointerImage
(
QImage
&
snapshot
,
int
offsetx
,
int
offsety
);
QString
blitScreenshot
(
const
QRect
&
geometry
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment