BlackBerry: implement QWidget::showMinimized()
Add window minimization capability on the plugin. Change-Id: I4539d29b8ebbef935213edde634f0a85b6a21766 Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
This commit is contained in:
parent
0d866c35d6
commit
67faba073d
@ -87,7 +87,7 @@ void QQnxBpsEventFilter::installOnEventDispatcher(QAbstractEventDispatcher *disp
|
|||||||
{
|
{
|
||||||
qBpsEventFilterDebug() << Q_FUNC_INFO << "dispatcher=" << dispatcher;
|
qBpsEventFilterDebug() << Q_FUNC_INFO << "dispatcher=" << dispatcher;
|
||||||
|
|
||||||
if (navigator_request_events(0) != BPS_SUCCESS)
|
if (navigator_request_events(NAVIGATOR_EXTENDED_DATA) != BPS_SUCCESS)
|
||||||
qWarning("QQNX: failed to register for navigator events");
|
qWarning("QQNX: failed to register for navigator events");
|
||||||
|
|
||||||
dispatcher->installNativeEventFilter(this);
|
dispatcher->installNativeEventFilter(this);
|
||||||
|
@ -53,6 +53,11 @@
|
|||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
#ifdef Q_OS_BLACKBERRY
|
||||||
|
#include <sys/pps.h>
|
||||||
|
#include <bps/navigator.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef QQNXWINDOW_DEBUG
|
#ifdef QQNXWINDOW_DEBUG
|
||||||
#define qWindowDebug qDebug
|
#define qWindowDebug qDebug
|
||||||
#else
|
#else
|
||||||
@ -624,12 +629,20 @@ void QQnxWindow::setWindowState(Qt::WindowState state)
|
|||||||
|
|
||||||
switch (state) {
|
switch (state) {
|
||||||
|
|
||||||
// WindowMinimized is not supported - navigator does not have an API to minimize a window
|
|
||||||
// WindowActive is not an accepted parameter according to the docs
|
// WindowActive is not an accepted parameter according to the docs
|
||||||
case Qt::WindowMinimized:
|
|
||||||
case Qt::WindowActive:
|
case Qt::WindowActive:
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
case Qt::WindowMinimized:
|
||||||
|
minimize();
|
||||||
|
|
||||||
|
if (m_unmaximizedGeometry.isValid())
|
||||||
|
setGeometry(m_unmaximizedGeometry);
|
||||||
|
else
|
||||||
|
setGeometry(m_screen->geometry());
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
case Qt::WindowMaximized:
|
case Qt::WindowMaximized:
|
||||||
case Qt::WindowFullScreen:
|
case Qt::WindowFullScreen:
|
||||||
m_unmaximizedGeometry = geometry();
|
m_unmaximizedGeometry = geometry();
|
||||||
@ -689,6 +702,27 @@ void QQnxWindow::blitFrom(QQnxWindow *sourceWindow, const QPoint &sourceOffset,
|
|||||||
blitHelper(sourceBuffer, targetBuffer, sourceOffset, QPoint(0, 0), targetRegion, true);
|
blitHelper(sourceBuffer, targetBuffer, sourceOffset, QPoint(0, 0), targetRegion, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QQnxWindow::minimize()
|
||||||
|
{
|
||||||
|
#if defined(Q_OS_BLACKBERRY) && !defined(Q_OS_BLACKBERRY_TABLET)
|
||||||
|
qWindowDebug() << Q_FUNC_INFO;
|
||||||
|
|
||||||
|
pps_encoder_t encoder;
|
||||||
|
|
||||||
|
pps_encoder_initialize(&encoder, false);
|
||||||
|
pps_encoder_add_string(&encoder, "msg", "minimizeWindow");
|
||||||
|
|
||||||
|
if (navigator_raw_write(pps_encoder_buffer(&encoder),
|
||||||
|
pps_encoder_length(&encoder)) != BPS_SUCCESS) {
|
||||||
|
qWindowDebug() << Q_FUNC_INFO << "navigator_raw_write failed:" << strerror(errno);
|
||||||
|
}
|
||||||
|
|
||||||
|
pps_encoder_cleanup(&encoder);
|
||||||
|
#else
|
||||||
|
qWarning("Qt::WindowMinimized is not supported by this OS version");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void QQnxWindow::updateZorder(int &topZorder)
|
void QQnxWindow::updateZorder(int &topZorder)
|
||||||
{
|
{
|
||||||
errno = 0;
|
errno = 0;
|
||||||
|
@ -116,6 +116,7 @@ public:
|
|||||||
QQnxWindow *findWindow(screen_window_t windowHandle);
|
QQnxWindow *findWindow(screen_window_t windowHandle);
|
||||||
|
|
||||||
void blitFrom(QQnxWindow *sourceWindow, const QPoint &sourceOffset, const QRegion &targetRegion);
|
void blitFrom(QQnxWindow *sourceWindow, const QPoint &sourceOffset, const QRegion &targetRegion);
|
||||||
|
void minimize();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QRect setGeometryHelper(const QRect &rect);
|
QRect setGeometryHelper(const QRect &rect);
|
||||||
|
Loading…
Reference in New Issue
Block a user