Skip to content
Merged
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ user@FreeBSD$ gmenudbusmenuproxy &
user@FreeBSD$ gimp
```

Same: __Initially__ the menu is empty, but when I bring a Qt applciation to the front and __then__ switch back to the Inkscape window, then the menus __work__.
Same: __Initially__ the menu is empty, but when I bring a Qt application to the front and __then__ switch back to the Inkscape window, then the menus __work__.

Seeing lots of

Expand Down
2 changes: 1 addition & 1 deletion Shutdown/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ void ignoreUnixSignals(std::initializer_list<int> ignoreSignals) {

void catchUnixSignals(std::initializer_list<int> quitSignals) {
auto handler = [](int sig) -> void {
// blocking and not aysnc-signal-safe func are valid
// blocking and not async-signal-safe func are valid
printf("\nquit the application by signal(%d).\n", sig);
QCoreApplication::quit();
};
Expand Down
2 changes: 1 addition & 1 deletion src/appmenu/appmenumodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ void AppMenuModel::onActiveWindowChanged(WId id)
if (info.hasState(NET::SkipTaskbar) ||
info.windowType(NET::UtilityMask) == NET::Utility) {

//! hide when the windows or their transiet(s) do not have a menu
//! hide when the windows or their transient(s) do not have a menu
if (filterByActive()) {

KWindowInfo transientInfo = KWindowInfo(info.transientFor(), NET::WMState | NET::WMWindowType | NET::WMGeometry, NET::WM2TransientFor);
Expand Down
4 changes: 2 additions & 2 deletions src/appmenu/com.canonical.AppMenu.Registrar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@mainpage

An interface to register menus that are associated with a window in an application.  The
main interface is docuemented here: @ref com::canonical::AppMenu::Registrar.
main interface is documented here: @ref com::canonical::AppMenu::Registrar.

The actual menus are transported using the dbusmenu protocol which is available
here: @ref com::canonical::dbusmenu.
Expand All @@ -21,7 +21,7 @@

/note this method assumes that the connection from the caller is the DBus connection
to use for the object.  Applications that use multiple DBus connections will need to
ensure this method is called with the same connection that implmenets the object.
ensure this method is called with the same connection that implements the object.
]]></dox:d>
<arg name="windowId" type="u" direction="in">
<dox:d>The XWindow ID of the window</dox:d>
Expand Down
16 changes: 8 additions & 8 deletions src/appmenuwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ void AppMenuWidget::findAppsInside(QStringList locationsContainingApps, QMenu *m
QAction *action = submenu->addAction(base);
action->setToolTip("TODO: Convert " + file.absoluteFilePath() + " to an .app bundle");
action->setProperty("path", file.absoluteFilePath());
action->setDisabled(true); // As a reminder that we consider those legacy and encourage people to swtich
action->setDisabled(true); // As a reminder that we consider those legacy and encourage people to switch
// Finding the icon file is much more involved with XDG than with our simplified .app bundles, so it is not implemented here
}
else if (file.fileName().endsWith(".AppImage") || file.fileName().endsWith(".appimage")) {
Expand Down Expand Up @@ -424,7 +424,7 @@ void AppMenuWidget::updateActionSearch(QMenuBar *menuBar) {
// TODO: https://stackoverflow.com/a/33790639
// We could customize more aspects of the list view of the completer by
//setting the CompletionMode to InlineCompletion, so there will be no popup.
// Then make your QListView indepedant of the QLineEdit;
// Then make your QListView independent of the QLineEdit;
// just react to signals that indicate when a view types some text,...

KWindowSystem::setType(actionCompleter->popup()->winId(), NET::DropdownMenu);
Expand Down Expand Up @@ -521,7 +521,7 @@ void AppMenuWidget::toggleMaximizeWindow()
if (isMax) {
restoreWindow();
} else {
maxmizeWindow();
maximizeWindow();
}
}

Expand Down Expand Up @@ -606,12 +606,12 @@ void AppMenuWidget::minimizeWindow()
KWindowSystem::minimizeWindow(KWindowSystem::activeWindow());
}

void AppMenuWidget::clsoeWindow()
void AppMenuWidget::closeWindow()
{
NETRootInfo(QX11Info::connection(), NET::CloseWindow).closeWindowRequest(KWindowSystem::activeWindow());
}

void AppMenuWidget::maxmizeWindow()
void AppMenuWidget::maximizeWindow()
{
KWindowSystem::setState(KWindowSystem::activeWindow(), NET::Max);
}
Expand Down Expand Up @@ -846,7 +846,7 @@ void AppMenuWidget::actionMinimizeAll()
// TODO: In a similar way, implement "Hide <window name>" and "Hide others". For this we need to know the window ID of the frontmost application window
qDebug() << "probono: KWindowSystem::activeWindow;" << "0x" + QString::number(KWindowSystem::activeWindow(), 16);
// NOTE: This always prints the window ID of the menu itself, rather than the one of the otherwise frontmost application window
// Hence we would need to store a variable somewhere that contains the window ID of the last non-menu window... or is there a btter way?
// Hence we would need to store a variable somewhere that contains the window ID of the last non-menu window... or is there a better way?
const auto &windows = KWindowSystem::windows();
for (WId wid : windows) {
KWindowSystem::minimizeWindow(wid);
Expand All @@ -858,7 +858,7 @@ void AppMenuWidget::actionMaximizeAll()
// TODO: In a similar way, implement "Hide <window name>" and "Hide others". For this we need to know the window ID of the frontmost application window
qDebug() << "probono: KWindowSystem::activeWindow;" << "0x" + QString::number(KWindowSystem::activeWindow(), 16);
// NOTE: This always prints the window ID of the menu itself, rather than the one of the otherwise frontmost application window
// Hence we would need to store a variable somewhere that contains the window ID of the last non-menu window... or is there a btter way?
// Hence we would need to store a variable somewhere that contains the window ID of the last non-menu window... or is there a better way?
const auto &windows = KWindowSystem::windows();
for (WId wid : windows) {
KWindowSystem::activateWindow(wid);
Expand Down Expand Up @@ -911,7 +911,7 @@ bool AppMenuWidget::eventFilter(QObject *watched, QEvent *event)
{
QMouseEvent *mouseEvent = static_cast<QMouseEvent*>(event);
QMenu *submenu = qobject_cast<QMenu*>(watched); // Workaround for: no member named 'toolTip' in 'QObject'
if(!submenu->rect().contains(mouseEvent->pos())) { // Prevent the Menu action from getting triggred when user click on actions in submenu
if(!submenu->rect().contains(mouseEvent->pos())) { // Prevent the Menu action from getting triggered when user click on actions in submenu
// Gets executed when the submenu is clicked
qDebug() << "Submenu clicked:" << submenu->property("path").toString();
this->m_systemMenu->close(); // Could instead figure out the top-level menu iterating through submenu->parent();
Expand Down
4 changes: 2 additions & 2 deletions src/appmenuwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ class AppMenuWidget : public QWidget
void onActiveWindowChanged();
void onWindowChanged(WId id, NET::Properties properties, NET::Properties2 properties2);
void minimizeWindow();
void clsoeWindow();
void maxmizeWindow();
void closeWindow();
void maximizeWindow();
Comment on lines +60 to +61
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be problematic.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In which way?

void restoreWindow();

public slots:
Expand Down
2 changes: 1 addition & 1 deletion src/mainpanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ MainPanel::MainPanel(QWidget *parent)

void MainPanel::rebuildSystemMenu()
{
qDebug() << "SIGSUR1 recived, rebuild the system menu";
qDebug() << "SIGSUR1 received, rebuild the system menu";

if(m_appMenuWidget){
m_layout->removeWidget(m_appMenuWidget);
Expand Down
4 changes: 2 additions & 2 deletions src/qtsingleapplication/qtlockedfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ QtLockedFile::LockMode QtLockedFile::lockMode() const
can be locked.

If \a block is true, this function will block until the lock is
aquired. If \a block is false, this function returns \e false
immediately if the lock cannot be aquired.
acquired. If \a block is false, this function returns \e false
immediately if the lock cannot be acquired.

If this object already has a lock of type \a mode, this function
returns \e true immediately. If this object has a lock of a
Expand Down
6 changes: 3 additions & 3 deletions src/qtsingleapplication/qtsingleapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ void QtSingleApplication::sysInit(const QString &appId)
/*!
Creates a QtSingleApplication object. The application identifier
will be QCoreApplication::applicationFilePath(). \a argc, \a
argv, and \a GUIenabled are passed on to the QAppliation constructor.
argv, and \a GUIenabled are passed on to the QApplication constructor.

If you are creating a console application (i.e. setting \a
GUIenabled to false), you may consider using
Expand All @@ -161,7 +161,7 @@ QtSingleApplication::QtSingleApplication(int &argc, char **argv, bool GUIenabled
/*!
Creates a QtSingleApplication object with the application
identifier \a appId. \a argc and \a argv are passed on to the
QAppliation constructor.
QApplication constructor.
*/

QtSingleApplication::QtSingleApplication(const QString &appId, int &argc, char **argv)
Expand All @@ -175,7 +175,7 @@ QtSingleApplication::QtSingleApplication(const QString &appId, int &argc, char *
/*!
Creates a QtSingleApplication object. The application identifier
will be QCoreApplication::applicationFilePath(). \a argc, \a
argv, and \a type are passed on to the QAppliation constructor.
argv, and \a type are passed on to the QApplication constructor.
*/
QtSingleApplication::QtSingleApplication(int &argc, char **argv, Type type)
: QApplication(argc, argv, type)
Expand Down
4 changes: 2 additions & 2 deletions src/qtsingleapplication/qtsinglecoreapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
/*!
Creates a QtSingleCoreApplication object. The application identifier
will be QCoreApplication::applicationFilePath(). \a argc and \a
argv are passed on to the QCoreAppliation constructor.
argv are passed on to the QCoreApplication constructor.
*/

QtSingleCoreApplication::QtSingleCoreApplication(int &argc, char **argv)
Expand All @@ -81,7 +81,7 @@ QtSingleCoreApplication::QtSingleCoreApplication(int &argc, char **argv)
/*!
Creates a QtSingleCoreApplication object with the application
identifier \a appId. \a argc and \a argv are passed on to the
QCoreAppliation constructor.
QCoreApplication constructor.
*/
QtSingleCoreApplication::QtSingleCoreApplication(const QString &appId, int &argc, char **argv)
: QCoreApplication(argc, argv)
Expand Down