mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-31 02:41:52 +00:00
client: menu: make RedWindow::set_menu() return an error-code (#758260)
RedWindow::set_menu() can fail (on Windows when in fullscreen mode).
For Windows spice-client, when in fullscreen mode, the system-menu
is NULL.
Returns 0 upon success, non-0 (currently only -1) upon failure.
(cherry picked from commit 24d5852611)
(seperator vs separator --> a small typo that got fixed)
This commit is contained in:
parent
baa375e8b5
commit
67e785f4fc
@ -70,7 +70,7 @@ public:
|
||||
void release_mouse();
|
||||
void start_key_interception();
|
||||
void stop_key_interception();
|
||||
void set_menu(Menu* menu);
|
||||
int set_menu(Menu* menu);
|
||||
|
||||
#ifdef USE_OGL
|
||||
void untouch_context();
|
||||
|
||||
@ -1066,18 +1066,26 @@ void RedWindow_p::release_menu(Menu* menu)
|
||||
}
|
||||
}
|
||||
|
||||
void RedWindow::set_menu(Menu* menu)
|
||||
int RedWindow::set_menu(Menu* menu)
|
||||
{
|
||||
release_menu(_menu);
|
||||
_menu = NULL;
|
||||
|
||||
if (!menu) {
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
_menu = menu->ref();
|
||||
|
||||
_sys_menu = GetSystemMenu(_win, FALSE);
|
||||
if (! _sys_menu) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
_menu = menu->ref();
|
||||
|
||||
insert_seperator(_sys_menu);
|
||||
insert_menu(_menu, _sys_menu, _commands_map);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static LRESULT CALLBACK MessageFilterProc(int nCode, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
@ -2215,8 +2215,9 @@ void RedWindow::on_pointer_leave()
|
||||
}
|
||||
}
|
||||
|
||||
void RedWindow::set_menu(Menu* menu)
|
||||
int RedWindow::set_menu(Menu* menu)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void RedWindow::init()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user