improve compatibility with non-X11 backends

This commit is contained in:
Daniel Micay 2015-06-22 13:26:19 -04:00
parent 2b5af377aa
commit 0652af0220
1 changed files with 18 additions and 9 deletions

View File

@ -28,10 +28,13 @@
#include <set> #include <set>
#include <string> #include <string>
#include <gdk/gdkx.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <vte/vte.h> #include <vte/vte.h>
#ifdef GDK_WINDOWING_X11
#include <gdk/gdkx.h>
#endif
#include "url_regex.hh" #include "url_regex.hh"
#include "util/clamp.hh" #include "util/clamp.hh"
#include "util/maybe.hh" #include "util/maybe.hh"
@ -1582,6 +1585,10 @@ int main(int argc, char **argv) {
gtk_widget_hide(info.panel.panel); gtk_widget_hide(info.panel.panel);
gtk_widget_hide(info.panel.da); gtk_widget_hide(info.panel.da);
char **env = g_get_environ();
#ifdef GDK_WINDOWING_X11
if (GDK_IS_X11_SCREEN(gtk_widget_get_screen(window))) {
GdkWindow *gdk_window = gtk_widget_get_window(window); GdkWindow *gdk_window = gtk_widget_get_window(window);
if (!gdk_window) { if (!gdk_window) {
g_printerr("no window\n"); g_printerr("no window\n");
@ -1589,8 +1596,10 @@ int main(int argc, char **argv) {
} }
char xid_s[std::numeric_limits<long unsigned>::digits10 + 1]; char xid_s[std::numeric_limits<long unsigned>::digits10 + 1];
snprintf(xid_s, sizeof(xid_s), "%lu", GDK_WINDOW_XID(gdk_window)); snprintf(xid_s, sizeof(xid_s), "%lu", GDK_WINDOW_XID(gdk_window));
char **env = g_get_environ();
env = g_environ_setenv(env, "WINDOWID", xid_s, TRUE); env = g_environ_setenv(env, "WINDOWID", xid_s, TRUE);
}
#endif
env = g_environ_setenv(env, "TERM", term, TRUE); env = g_environ_setenv(env, "TERM", term, TRUE);
GPid child_pid; GPid child_pid;