mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1234026 - Pass a --display option to gtk_init in content processes. r=karlt
This commit is contained in:
parent
5779cae156
commit
9d12d36bfb
@ -618,7 +618,26 @@ ContentChild::Init(MessageLoop* aIOLoop,
|
||||
IPC::Channel* aChannel)
|
||||
{
|
||||
#ifdef MOZ_WIDGET_GTK
|
||||
gtk_init(nullptr, nullptr);
|
||||
// We need to pass a display down to gtk_init because it's not going to
|
||||
// use the one from the environment on its own when deciding which backend
|
||||
// to use, and when starting under XWayland, it may choose to start with
|
||||
// the wayland backend instead of the x11 backend.
|
||||
// The DISPLAY environment variable is normally set by the parent process.
|
||||
char* display_name = PR_GetEnv("DISPLAY");
|
||||
if (display_name) {
|
||||
int argc = 3;
|
||||
char option_name[] = "--display";
|
||||
char* argv[] = {
|
||||
nullptr,
|
||||
option_name,
|
||||
display_name,
|
||||
nullptr
|
||||
};
|
||||
char** argvp = argv;
|
||||
gtk_init(&argc, &argvp);
|
||||
} else {
|
||||
gtk_init(nullptr, nullptr);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_WIDGET_QT
|
||||
|
Loading…
Reference in New Issue
Block a user