Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
glacier-home
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
NemoMobile
glacier-home
Commits
4374ed31
Commit
4374ed31
authored
Sep 24, 2014
by
Aleksi Suomalainen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[desktop] Bring the open application to front if there is a window id for it.
parent
fcf6bafe
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
7 deletions
+32
-7
glacierwindowmodel.cpp
src/glacierwindowmodel.cpp
+18
-3
glacierwindowmodel.h
src/glacierwindowmodel.h
+6
-2
LauncherItemDelegate.qml
src/qml/LauncherItemDelegate.qml
+6
-1
MainScreen.qml
src/qml/MainScreen.qml
+1
-0
compositor.qml
src/qml/compositor.qml
+1
-1
No files found.
src/glacierwindowmodel.cpp
View file @
4374ed31
...
@@ -4,11 +4,26 @@ GlacierWindowModel::GlacierWindowModel(): WindowModel()
...
@@ -4,11 +4,26 @@ GlacierWindowModel::GlacierWindowModel(): WindowModel()
{
{
}
}
GlacierWindowModel
::~
GlacierWindowModel
()
{
int
GlacierWindowModel
::
getWindowIdForTitle
(
QString
title
)
{
return
m_titles
.
value
(
title
,
0
);
}
}
bool
GlacierWindowModel
::
approveWindow
(
LipstickCompositorWindow
*
window
)
bool
GlacierWindowModel
::
approveWindow
(
LipstickCompositorWindow
*
window
)
{
{
return
window
->
isInProcess
()
==
false
&&
window
->
category
()
!=
QLatin1String
(
"overlay"
)
&&
window
->
category
()
!=
QLatin1String
(
"cover"
);
bool
accepted
=
window
->
isInProcess
()
==
false
&&
window
->
category
()
!=
QLatin1String
(
"overlay"
)
&&
window
->
category
()
!=
QLatin1String
(
"cover"
);
if
(
accepted
)
{
m_titles
.
insert
(
window
->
title
(),
window
->
windowId
());
}
return
accepted
;
}
}
void
GlacierWindowModel
::
removeWindowForTitle
(
QString
title
)
{
qDebug
()
<<
"Removing window: "
+
title
;
m_titles
.
remove
(
title
);
}
#include "moc_glacierwindowmodel.cpp"
src/glacierwindowmodel.h
View file @
4374ed31
...
@@ -7,12 +7,16 @@ class LipstickCompositorWindow;
...
@@ -7,12 +7,16 @@ class LipstickCompositorWindow;
class
QWaylandSurfaceItem
;
class
QWaylandSurfaceItem
;
class
GlacierWindowModel
:
public
WindowModel
class
Q_DECL_EXPORT
GlacierWindowModel
:
public
WindowModel
{
{
Q_OBJECT
public:
public:
explicit
GlacierWindowModel
();
explicit
GlacierWindowModel
();
~
GlacierWindowModel
();
bool
approveWindow
(
LipstickCompositorWindow
*
window
);
bool
approveWindow
(
LipstickCompositorWindow
*
window
);
Q_INVOKABLE
int
getWindowIdForTitle
(
QString
title
);
Q_INVOKABLE
void
removeWindowForTitle
(
QString
title
);
private:
QHash
<
QString
,
int
>
m_titles
;
};
};
#endif // GLACIERWINDOWMODEL_H
#endif // GLACIERWINDOWMODEL_H
src/qml/LauncherItemDelegate.qml
View file @
4374ed31
...
@@ -108,7 +108,12 @@ Item {
...
@@ -108,7 +108,12 @@ Item {
onClicked
:
{
onClicked
:
{
// TODO: disallow if close mode enabled
// TODO: disallow if close mode enabled
if
(
model
.
object
.
type
!==
LauncherModel
.
Folder
)
{
if
(
model
.
object
.
type
!==
LauncherModel
.
Folder
)
{
model
.
object
.
launchApplication
()
var
winId
=
switcher
.
switchModel
.
getWindowIdForTitle
(
model
.
object
.
title
)
console
.
log
(
"
Window id found:
"
+
winId
)
if
(
winId
==
0
)
model
.
object
.
launchApplication
()
else
Lipstick
.
compositor
.
windowToFront
(
winId
)
}
else
{
}
else
{
if
(
!
folderLoader
.
visible
)
{
if
(
!
folderLoader
.
visible
)
{
folderLoader
.
visible
=
true
folderLoader
.
visible
=
true
...
...
src/qml/MainScreen.qml
View file @
4374ed31
...
@@ -54,6 +54,7 @@ Page {
...
@@ -54,6 +54,7 @@ Page {
}
}
id
:
desktop
id
:
desktop
property
alias
lockscreen
:
lockScreen
property
alias
lockscreen
:
lockScreen
property
alias
switcher
:
switcher
// Implements back key navigation
// Implements back key navigation
Keys.onReleased
:
{
Keys.onReleased
:
{
if
(
event
.
key
===
Qt
.
Key_Back
)
{
if
(
event
.
key
===
Qt
.
Key_Back
)
{
...
...
src/qml/compositor.qml
View file @
4374ed31
...
@@ -346,7 +346,7 @@ Compositor {
...
@@ -346,7 +346,7 @@ Compositor {
onWindowRemoved
:
{
onWindowRemoved
:
{
console
.
log
(
"
Compositor: Window removed
\"
"
+
window
.
title
+
"
\"
"
+
"
category:
"
+
window
.
category
)
console
.
log
(
"
Compositor: Window removed
\"
"
+
window
.
title
+
"
\"
"
+
"
category:
"
+
window
.
category
)
Desktop
.
instance
.
switcher
.
switchModel
.
removeWindowForTitle
(
window
.
title
)
var
w
=
window
.
userData
;
var
w
=
window
.
userData
;
if
(
window
.
category
==
"
alarm
"
)
{
if
(
window
.
category
==
"
alarm
"
)
{
root
.
topmostAlarmWindow
=
null
root
.
topmostAlarmWindow
=
null
...
...
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