void MainWindow::init() { Expects(!windowHandle()); createWinId(); initHook(); updateWindowIcon(); connect(windowHandle(), &QWindow::activeChanged, this, [this] { handleActiveChanged(); }, Qt::QueuedConnection); connect(windowHandle(), &QWindow::windowStateChanged, this, [this](Qt::WindowState state) { handleStateChanged(state); }); _positionUpdatedTimer->setSingleShot(true); connect(_positionUpdatedTimer, SIGNAL(timeout()), this, SLOT(savePositionByTimer())); updatePalette(); if ((_title = Platform::CreateTitleWidget(this))) { _title->init(); } initSize(); updateUnreadCounter(); }
void MainWindow::mainFrame_javaScriptWindowObjectCleared() { ui->webView->page()->mainFrame()->addToJavaScriptWindowObject("bridge", jsBridge_); updateWindowIcon(); }
void MainWindow::webView_loadFinished(bool) { updateWindowIcon(); }
WindowsModel::WindowsModel (QObject *parent) : QAbstractItemModel (parent) , CurrentDesktop_ (Util::XWrapper::Instance ().GetCurrentDesktop ()) , ImageProvider_ (new TaskbarImageProvider (QIcon::fromTheme ("xorg"))) { auto& w = Util::XWrapper::Instance (); auto windows = w.GetWindows (); for (auto wid : windows) AddWindow (wid, w); connect (&w, SIGNAL (windowListChanged ()), this, SLOT (updateWinList ())); connect (&w, SIGNAL (activeWindowChanged ()), this, SLOT (updateActiveWindow ())); connect (&w, SIGNAL (windowNameChanged (ulong)), this, SLOT (updateWindowName (ulong))); connect (&w, SIGNAL (windowIconChanged (ulong)), this, SLOT (updateWindowIcon (ulong))); connect (&w, SIGNAL (windowStateChanged (ulong)), this, SLOT (updateWindowState (ulong))); connect (&w, SIGNAL (windowActionsChanged (ulong)), this, SLOT (updateWindowActions (ulong))); connect (&w, SIGNAL (windowDesktopChanged (ulong)), this, SLOT (updateWindowDesktop (ulong))); connect (&w, SIGNAL (desktopChanged ()), this, SLOT (updateCurrentDesktop ())); QHash<int, QByteArray> roleNames; roleNames [Role::WindowName] = "windowName"; roleNames [Role::WindowID] = "windowID"; roleNames [Role::IconGenID] = "iconGenID"; roleNames [Role::IsCurrentDesktop] = "isCurrentDesktop"; roleNames [Role::IsActiveWindow] = "isActiveWindow"; roleNames [Role::IsMinimizedWindow] = "isMinimizedWindow"; setRoleNames (roleNames); int eventBase, errorBase; if (XCompositeQueryExtension (w.GetDisplay (), &eventBase, &errorBase)) { int major = 0, minor = 2; XCompositeQueryVersion (w.GetDisplay (), &major, &minor); if (major > 0 || minor >= 2) qDebug () << "all good, has NamePixmap"; } }