|
wxMaxima
|
Regression test: the tray icon's menu items must work with an AppIndicator. More...
#include <wx/app.h>#include <wx/frame.h>#include <wx/log.h>#include <wx/menu.h>#include "EventIDs.h"#include "StatusBar.h"#include "TrayIcon.h"#include <catch2/catch.hpp>Data Structures | |
| class | TestApp |
Functions | |
| wxDECLARE_APP (TestApp) | |
| int | main (int argc, char **argv) |
Regression test: the tray icon's menu items must work with an AppIndicator.
With a StatusNotifier/AppIndicator tray, wxGTK (3.3) builds the indicator's menu once from CreatePopupMenu() and then calls menu->SetEventHandler(taskBarIcon), which replaces the menu as the first handler its events go to. Handlers bound to the menu itself were therefore never called, and "Show wxMaxima" (as well as Interrupt and Exit) silently did nothing. The classic GtkStatusIcon/XEmbed tray, and the other ports, pop the menu up from a hidden window the icon is pushed onto instead, which is why the bug didn't show there.
No tray needs to exist for this: wxMenu::SendEvent() is what every port calls for a clicked menu item, so it is called directly, with exactly the handler arrangement each kind of tray sets up.