aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/objects
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/objects')
-rw-r--r--src/modules/objects/class_widget.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/modules/objects/class_widget.cpp b/src/modules/objects/class_widget.cpp
index f670ad538..2ba146bb0 100644
--- a/src/modules/objects/class_widget.cpp
+++ b/src/modules/objects/class_widget.cpp
@@ -1059,8 +1059,10 @@ bool KviKvsObject_widget::function_fontMetricsHeight(KviKvsObjectFunctionCall *
bool KviKvsObject_widget::function_screenResolution(KviKvsObjectFunctionCall * c)
{
KviKvsArray * a = new KviKvsArray();
- a->set(0,new KviKvsVariant((kvs_int_t)g_pApp->desktop()->width()));
- a->set(1,new KviKvsVariant((kvs_int_t)g_pApp->desktop()->height()));
+ QRect rect = g_pApp->desktop()->screenGeometry(g_pApp->desktop()->primaryScreen());
+
+ a->set(0,new KviKvsVariant((kvs_int_t)rect.width()));
+ a->set(1,new KviKvsVariant((kvs_int_t)rect.height()));
c->returnValue()->setArray(a);
return true;
}
@@ -1185,7 +1187,12 @@ bool KviKvsObject_widget::function_mapFromGlobal(KviKvsObjectFunctionCall *c)
bool KviKvsObject_widget::function_centerToScreen(KviKvsObjectFunctionCall *c)
{
- if(widget()) widget()->move((g_pApp->desktop()->width() - widget()->width())/2,(g_pApp->desktop()->height() - widget()->height())/2);
+ if(widget())
+ {
+ QRect rect = g_pApp->desktop()->screenGeometry(g_pApp->desktop()->primaryScreen());
+ widget()->move((rect.width() - widget()->width())/2,(rect.height() - widget()->height())/2);
+ }
+
return true;
}