Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ dnl We need libX11
dnl
AC_DEFUN([AC_X11_REQUIREMENTS],
[
AC_CHECK_LIB(X11, XOpenDisplay)
AC_CHECK_LIB(X11, XInitThreads)
X11_LIBS='-lX11'
AC_SUBST(X11_LIBS)
])
Expand Down
15 changes: 2 additions & 13 deletions src/gtkinterface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,6 @@ window_state_event_cb (GtkWidget *widget,
return gtk_interface->handle_window_state_event (ws_event);
}

bool
GtkInterface::have_x11_display()
{
static Display *display = NULL;

if (!display)
display = XOpenDisplay (NULL); // this should work if and only if we do have an X11 server we can use

return display != NULL;
}

GtkInterface::GtkInterface() :
window_xid (0),
video_width (0),
Expand All @@ -110,9 +99,9 @@ GtkInterface::init (int *argc, char ***argv, KeyHandler *handler)
{
key_handler = handler;

if (have_x11_display())
gdk_set_allowed_backends ("x11");
if (gtk_init_check (argc, argv))
{
gtk_init (argc, argv);
gtk_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_icon_name (GTK_WINDOW (gtk_window), "multimedia-player");
g_signal_connect (G_OBJECT (gtk_window), "key-press-event", G_CALLBACK (key_press_event_cb), this);
Expand Down
2 changes: 0 additions & 2 deletions src/gtkinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ class GtkInterface
void normal_size();
void set_opacity (double alpha_change);
void set_title (const std::string& title);

static bool have_x11_display();
};

#endif
3 changes: 2 additions & 1 deletion src/options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ Options::parse (int argc, char **argv)
g_option_context_add_main_entries (context, all_options, NULL);
g_option_context_add_group (context, gst_init_get_option_group());

if (GtkInterface::have_x11_display())
gdk_set_allowed_backends("x11");
if (gtk_init_check (&argc, &argv))
g_option_context_add_group (context, gtk_get_option_group (TRUE));

GError *error = NULL;
Expand Down