Initial popup window.

This commit is contained in:
James Grogan 2022-12-02 13:44:52 +00:00
parent f16dd7c0d9
commit 70220fc6e9
22 changed files with 253 additions and 15 deletions

View file

@ -14,6 +14,7 @@
#include "NullUiInterface.h"
#include "FontsManager.h"
#include "Widget.h"
std::unique_ptr<AbstractUIInterface> UiInterfaceFactory::create(DesktopManager* desktopManager, Backend backend)
{

View file

@ -17,6 +17,7 @@
#include "Screen.h"
#include "XcbScreen.h"
#include "Color.h"
#include "Widget.h"
#include "UiEvent.h"
#include "XcbKeyboard.h"
#include "XcbWindow.h"

View file

@ -1,6 +1,7 @@
#include "XcbWindow.h"
#include "Window.h"
#include "Widget.h"
#include "XcbScreen.h"
#include "XcbImage.h"
#include "Screen.h"
@ -40,10 +41,17 @@ void XcbWindow::add(mt::Window* window, xcb_connection_t* connection, mt::Screen
const auto hwnd = xcb_generate_id(connection);
const uint32_t mask = XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK;
const uint32_t values[2] = {xcb_screen->GetNativeScreen()->white_pixel, eventMask};
xcb_window_t parent_hwnd = xcb_screen->GetNativeScreen()->root;
if (auto parent = window->getParent())
{
parent_hwnd = dynamic_cast<XcbWindow*>(parent->getPlatformWindow())->getHandle();
}
xcb_create_window (connection, /* connection */
XCB_COPY_FROM_PARENT, /* depth */
hwnd, /* window Id */
xcb_screen->GetNativeScreen()->root, /* parent window */
parent_hwnd, /* parent window */
0, 0, /* x, y */
window->getWidth(), window->getHeight(), /* width, height */
10, /* border_width */