Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible Integration with tabbed? #1358

Open
xinslu opened this issue Dec 8, 2023 · 4 comments
Open

Possible Integration with tabbed? #1358

xinslu opened this issue Dec 8, 2023 · 4 comments
Labels
enhancement New feature or request feature-request User requested features help wanted Extra attention is needed platform: linux topics that directly address Linux platform (any distro) platform: X11

Comments

@xinslu
Copy link

xinslu commented Dec 8, 2023

Hi, really like the work done with this terminal. I was just wondering if it was possible to use the tabbing utility from suckless, tabbed (https://tools.suckless.org/tabbed/) along with contour. Other terminals like alacritty allow the ability to embed using the --embed flag allowing integration. Could this possibly pursued be as a short term solution to UI tab? I didn't mark this as a feature request because I'm not sure if something needs to be changed.

@christianparpart
Copy link
Member

Nice idea. And many thanks for the interest .

We should just find out how to do that when working with Qt library, which we use for the frontend. 🤔

@binex-dsk
Copy link

We should just find out how to do that when working with Qt library, which we use for the frontend. 🤔

Qt has a QTabWidget widget that can replace the current central widget in the main window. This does exactly what is needed and only really needs reorder, tab close, new tab, and tab naming schemes. With a bit of theming it can be implemented quite nicely into the terminal look and feel.

Now, if you want to have trees... that's a little more complex

@christianparpart
Copy link
Member

I tried looking up how to do embedd a QML application into an external window that is only known by its Window Id. I could not really find anything (only very old Qt 4.8-style way that would have accepted a Window-Id).

NB: On tabbed support, I planned using: https://github.com/antonypro/QGoodWindow

@christianparpart
Copy link
Member

Update: I may have found a way to get this implemented for Qt based applications (like Contour) via QWindow::fromId(WId embedInto)

PoC draft

// Target window to embed into
unsigned int windowId = 0x12345;

// Convert window ID to native X11 window handle
Window nativeWindow = XGetWindow(display, XDefaultRootWindow(display), windowId);

// Create a QWindow from the native window
QWindow* qWindow = QWindow::fromWinId(nativeWindow);

// Create a QWidget from the QWindow
QWidget* embeddedWidget = QWidget::createWindowContainer(qWindow);

// Add contour QML app here (?)
QQuickView* qmlView = new QQuickView();
embeddedWidget->layout()->addWidget(qmlView);

// Parent the embeddedWidget to the native window
embeddedWidget->setParent(nativeWindow);

// Show and manage the embeddedWidget
embeddedWidget->show();

@christianparpart christianparpart added enhancement New feature or request help wanted Extra attention is needed platform: linux topics that directly address Linux platform (any distro) feature-request User requested features platform: X11 labels Dec 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature-request User requested features help wanted Extra attention is needed platform: linux topics that directly address Linux platform (any distro) platform: X11
Projects
None yet
Development

No branches or pull requests

3 participants