This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

[BUG] Some picture-based buttons are not recognized by Wayland.
#1
Hello forum.


So, long story short, I'm trying to launch Hybrid on Linux (Pop_OS!) via Bottles. It's honestly the best way to run the thing on Linux.

However, while Hybrid runs flawlessly, it appears that some of Hybrid's buttons aren't registring when clicked. I think these are the buttons that were implemented as images with a click event,  for example:
- start workers (the icon of a guy with the shovel in the 'base' tab)
- preview (the icon of the film frames under 'filtering' tab)

Basically none of them work. Other buttons that actually use the button GUI element work just fine. I know it's probably a Wayland issue, but I was wondering whether these icons could be replaced with proper buttons to make the application usable.


Thanks
Reply
#2
So basically all buttons?
Strange, my guess is that the OS is messing with the Qt binaries. (this was years ago an issue with Qt as well)
Does it help to switch from icons to text for the buttons? View->Icon/Text?

'via Bottles' => so you are running Hybrids Windows version instead of the AppImage?

Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
#3
Not all buttons. Just the buttons I mentioned.

Altho, you actually had a fix in plain sight - I just didn't know about it.

Under "View" window context tab there's a "Text/Icon" option. Once I pressed it, these problematic buttons were replaced with proper ones.

Problem solved!


On another note. Is there any way to make Hybrid not minimize to the tray? Tray interractions are problematic in Linux, or at least they are in COSMIC. So I'd like to prevent Hybrid from trying to go into the tray altogether.
Reply
#4
Quote: Is there any way to make Hybrid not minimize to the tray?
Yes. disable "Config->View->Design->Minimize to system tray". Smile

Quote:Not all buttons. Just the buttons I mentioned.
That is strange since all buttons, are still buttons and are treated the same.
void ModelGuiMediator::setButtonImage(QPushButton* button, const QIcon* icon, const double& mult) const { if (!button) return; if (!icon) { // Reset button if icon is null button->setFlat(false); button->setIcon(QIcon()); button->setText(button->text()); button->setMinimumSize(QSize(0, 0)); button->setMaximumSize(QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX)); button->setStyleSheet(""); return; } // Ensure tooltip exists if (button->toolTip().trimmed().isEmpty()) { button->setToolTip(button->text().trimmed()); } // Remove native padding/margins button->setStyleSheet("QPushButton { " "padding: 0px; " "margin: 0px; " "border: none; " "}"); // Calculate button size button->adjustSize(); const QSize buttonSize = button->size(); QList<QSize> sizes = icon->availableSizes(); if (sizes.isEmpty()) { sizes << buttonSize; // e.g. SVG icons } QFontMetrics fm(button->font()); const double baseScale = static_cast<double>(fm.height() + 7) / button->height(); QSize iconSize = sizes.first().scaled(buttonSize * baseScale, Qt::KeepAspectRatio); if (mult > 0.0) { iconSize = iconSize * mult; } button->setFlat(true); button->setText(QString()); button->setIcon(*icon); button->setIconSize(iconSize); button->setMinimumSize(iconSize); button->setMaximumSize(iconSize); }

Okay, if these two are the only buttons that do not work.
Quote:- start workers (the icon of a guy with the shovel in the 'base' tab)
- preview (the icon of the film frames under 'filtering' tab)
As a side note: the 'Add&Start Queue' can be avoided, by using the 'Add to Queue'-button and then start the "Job Queue" manually. (I never used the 'Add&Start Queue'-button. Smile)
I do not plan spending much time of investigation on why Hybrid doesn't run in some wine environment, but I checked the code and all buttons are buttons to begin with, and the text just gets 'replaced' with an icon (the button is still a button):
void ModelGuiMediator::setButtonImage(QPushButton* button, const QIcon* icon, const double& mult) const { if (!button) return; if (!icon) { // Reset button if icon is null button->setFlat(false); button->setIcon(QIcon()); button->setText(button->text()); button->setMinimumSize(QSize(0, 0)); button->setMaximumSize(QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX)); button->setStyleSheet(""); return; } // Ensure tooltip exists if (button->toolTip().trimmed().isEmpty()) { button->setToolTip(button->text().trimmed()); } // Remove native padding/margins button->setStyleSheet("QPushButton { " "padding: 0px; " "margin: 0px; " "border: none; " "}"); // Calculate button size button->adjustSize(); const QSize buttonSize = button->size(); QList<QSize> sizes = icon->availableSizes(); if (sizes.isEmpty()) { sizes << buttonSize; // e.g. SVG icons } QFontMetrics fm(button->font()); const double baseScale = static_cast<double>(fm.height() + 7) / button->height(); QSize iconSize = sizes.first().scaled(buttonSize * baseScale, Qt::KeepAspectRatio); if (mult > 0.0) { iconSize = iconSize * mult; } button->setFlat(true); button->setText(QString()); button->setIcon(*icon); button->setIconSize(iconSize); button->setMinimumSize(iconSize); button->setMaximumSize(iconSize); }
Switching icon/text basically just calls setButtonImage for each button with an icon or without one.
# replace text with icon m_mediator->setButtonImage(m_ui.startQueuePushButton, icons->value(QStringLiteral("startQueue"))); # reset text and remove icon m_ui.startQueuePushButton->setText(QStringLiteral("Add&Start Queue")); m_mediator->setButtonImage(m_ui.startQueuePushButton,nullptr);
Basically all buttons are treated the same, which is why I suspect the button get triggered, but maybe something else gets blocked. (there doesn't seem to be anything special about the two buttons you mentioned)

If you (read the sticky and) create a debug output of trying to press one of these, does the debug output file show any reaction at all?

Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
#5
Good to know. It's definetely possible there's an issue with the translation layer.

I wouldn't mind using Hybrid locally, however the build scripts are broken (most plugins fail to build with nothing printed) and when I launch AppImage, the app doesn't appear to detect half the binaries and there's no way manually specify the paths.

I wouldn't mind building a flatpak for the tool either to keep everything self-contained, but Hybrid is not open source and flatpak and appimages don't mix.

Hybrid is literally the only thing that prevents me from wiping Windows off my hard drive.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)