Qt5: reserve screen space for the liquid_fb title bar
With this patch, the liquid_fb title bar height gets reserved at the top of the screen, so if a Qt application wants to position a window at (0,0), there's still enough space to show the title bar above. Issue #1054.
This commit is contained in:
parent
c30415fb9b
commit
69785504c7
|
@ -23,6 +23,9 @@
|
|||
#include <nitpicker_session/connection.h>
|
||||
#include <framebuffer_session/client.h>
|
||||
|
||||
/* local includes */
|
||||
#include "window_slave_policy.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QNitpickerScreen : public QPlatformScreen
|
||||
|
@ -44,7 +47,9 @@ class QNitpickerScreen : public QPlatformScreen
|
|||
if (scr_mode.format() != Framebuffer::Mode::RGB565)
|
||||
qCritical() << "Nitpicker screen format is not RGB565";
|
||||
|
||||
_geometry.setRect(0, 0, scr_mode.width(), scr_mode.height());
|
||||
_geometry.setRect(0, 0, scr_mode.width(),
|
||||
scr_mode.height() -
|
||||
Window_slave_policy::TITLE_BAR_HEIGHT);
|
||||
|
||||
Genode::env()->parent()->close(_nitpicker.cap());
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ class Window_slave_policy : public Genode::Slave_policy
|
|||
config_doc.appendChild(config_node);
|
||||
|
||||
config_node.setAttribute("xpos", QString::number(xpos));
|
||||
config_node.setAttribute("ypos", QString::number(ypos));
|
||||
config_node.setAttribute("ypos", QString::number(ypos + TITLE_BAR_HEIGHT));
|
||||
config_node.setAttribute("width", QString::number(width));
|
||||
config_node.setAttribute("height", QString::number(height));
|
||||
|
||||
|
@ -125,6 +125,9 @@ class Window_slave_policy : public Genode::Slave_policy
|
|||
|
||||
public:
|
||||
|
||||
/* scout widgets title bar height */
|
||||
enum { TITLE_BAR_HEIGHT = 32 };
|
||||
|
||||
Window_slave_policy(Genode::Rpc_entrypoint &ep,
|
||||
int screen_width, int screen_height)
|
||||
: Genode::Slave_policy("liquid_fb", ep, env()->ram_session()),
|
||||
|
|
Loading…
Reference in New Issue