Commit 5b480e1b authored by Alexander Larsson's avatar Alexander Larsson

[broadway] Copy X backend to broadway

parent eb5a5004
......@@ -258,13 +258,13 @@ else
gdktarget=x11
fi
AC_ARG_WITH(gdktarget, [ --with-gdktarget=[[x11/win32/quartz]] select non-default GDK target],
AC_ARG_WITH(gdktarget, [ --with-gdktarget=[[x11/win32/quartz/broadway]] select non-default GDK target],
gdktarget=$with_gdktarget)
AC_SUBST(gdktarget)
case $gdktarget in
x11|win32|quartz) ;;
*) AC_MSG_ERROR([Invalid target for GDK: use x11, quartz or win32.]);;
x11|win32|quartz|broadway) ;;
*) AC_MSG_ERROR([Invalid target for GDK: use x11, broadway, quartz or win32.]);;
esac
gdktargetlib=libgdk-$gdktarget-$GTK_API_VERSION.la
......@@ -367,15 +367,18 @@ PKG_CHECK_MODULES(BASE_DEPENDENCIES,
## In addition to checking that cairo is present, we also need to
## check that the correct cairo backend is there. E.g. if the GDK
## target is win32 we need the cairo-win32 backend and so on.
cairo_backend=$gdktarget
cairo_backend=cairo-$gdktarget
# GDK calls the xlib backend "x11," cairo calls it "xlib." Other
# backend names are identical.
if test "x$cairo_backend" = "xx11"; then
cairo_backend=xlib
if test "x$cairo_backend" = "xcairo-x11"; then
cairo_backend=cairo-xlib
fi
if test "x$cairo_backend" = "xcairo-broadway"; then
cairo_backend=cairo
fi
PKG_CHECK_MODULES(CAIRO_BACKEND,
[cairo-$cairo_backend >= cairo_required_version])
[$cairo_backend >= cairo_required_version])
if test "$os_win32" != yes; then
# libtool option to control which symbols are exported
......@@ -1185,6 +1188,250 @@ else
AM_CONDITIONAL(USE_QUARTZ, false)
fi
if test "x$gdktarget" = "xbroadway" ; then
X_PACKAGES=fontconfig
#
# We use fontconfig very peripherally when decoding the default
# settings.
#
if $PKG_CONFIG --exists fontconfig; then : ; else
AC_MSG_ERROR([
*** fontconfig (http://www.fontconfig.org) is required by the X11 backend.])
fi
#
# Check for basic X packages; we use pkg-config if available
#
if $PKG_CONFIG --exists x11 xext; then
have_base_x_pc=true
X_PACKAGES="$X_PACKAGES x11 xext"
x_libs="`$PKG_CONFIG --libs x11 xext`"
X_CFLAGS="`$PKG_CONFIG --cflags x11 xext`"
# Strip out any .la files that pkg-config might give us (this happens
# with -uninstalled.pc files)
x_libs_for_checks=
for I in $x_libs ; do
case $I in
*.la) ;;
*) x_libs_for_checks="$x_libs_for_checks $I" ;;
esac
done
GTK_PACKAGES_FOR_X="x11"
else
have_base_x_pc=false
AC_PATH_XTRA
if test x$no_x = xyes ; then
AC_MSG_ERROR([X development libraries not found])
fi
x_cflags="$X_CFLAGS"
x_libs_for_checks="$X_LIBS -lXext -lX11 $X_EXTRA_LIBS"
GTK_DEP_LIBS_FOR_X="$X_LIBS -lX11 $X_EXTRA_LIBS"
fi
# Extra libraries found during checks (-lXinerama, etc), not from pkg-config.
x_extra_libs=
gtk_save_cppflags="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
gtk_save_LIBS=$LIBS
LIBS="$x_libs_for_checks $LIBS"
# Sanity check for the X11 and Xext libraries. While everything we need from
# Xext is optional, the chances a system has *none* of these things is so
# small that we just unconditionally require it.
AC_CHECK_FUNC(XOpenDisplay, :,
AC_MSG_ERROR([*** libX11 not found. Check 'config.log' for more details.]))
AC_CHECK_FUNC(XextFindDisplay, :,
AC_MSG_ERROR([*** libXext not found. Check 'config.log' for more details.]))
# Check for xReply
AC_MSG_CHECKING([if <X11/extensions/XIproto.h> is needed for xReply])
AC_TRY_COMPILE([#include <X11/Xlibint.h>],
[xReply *rep;],
[AC_MSG_RESULT([no])],
[AC_TRY_COMPILE([#include <X11/extensions/XIproto.h>
#include <X11/Xlibint.h>],
[xReply *rep;],
[AC_MSG_RESULT([yes])
AC_DEFINE([NEED_XIPROTO_H_FOR_XREPLY], 1,
[Define if <X11/extensions/XIproto.h> needed for xReply])],
[AC_MSG_RESULT([unknown])
AC_MSG_ERROR([xReply type unavailable. X11 is too old])])])
# Check for XConvertCase, XInternAtoms (X11R6 specific)
AC_CHECK_FUNCS(XConvertCase XInternAtoms)
# Generic X11R6 check needed for XIM support; we could
# probably use this to replace the above, but we'll
# leave the separate checks for XConvertCase and XInternAtoms
# for clarity
have_x11r6=false
AC_CHECK_FUNC(XAddConnectionWatch,
have_x11r6=true)
if $have_x11r6; then
AC_DEFINE(HAVE_X11R6, 1, [Define if we have X11R6])
fi
AM_CONDITIONAL(HAVE_X11R6, $have_x11r6)
# Check for XKB support.
if test "x$enable_xkb" = "xyes"; then
AC_MSG_WARN(XKB support explicitly enabled)
AC_DEFINE(HAVE_XKB, 1, [Define to use XKB extension])
elif test "x$enable_xkb" = "xmaybe"; then
AC_CHECK_FUNC(XkbQueryExtension,
AC_DEFINE(HAVE_XKB, 1, [Define to use XKB extension]))
else
AC_MSG_WARN(XKB support explicitly disabled)
fi
# Check for shaped window extension
AC_CHECK_FUNC(XShapeCombineMask, :,
[AC_MSG_ERROR([Shape extension not found, check your development headers])])
# X SYNC check
gtk_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $x_cflags"
AC_CHECK_FUNC(XSyncQueryExtension,
[AC_CHECK_HEADER(X11/extensions/sync.h,
AC_DEFINE(HAVE_XSYNC, 1, [Have the SYNC extension library]),
:, [#include <X11/Xlib.h>])])
CFLAGS="$gtk_save_CFLAGS"
if test "x$enable_xinerama" = "xyes"; then
# Check for Xinerama extension (Solaris impl or Xfree impl)
gtk_save_cppflags="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $x_cflags"
# Check for XFree
AC_MSG_CHECKING(for Xinerama support on XFree86)
have_xfree_xinerama=false
if $PKG_CONFIG --exists xinerama ; then
have_xfree_xinerama=true
X_PACKAGES="$X_PACKAGES xinerama"
else
AC_CHECK_LIB(Xinerama, XineramaQueryExtension,
[AC_CHECK_HEADER(X11/extensions/Xinerama.h,
[GTK_ADD_LIB(x_extra_libs,Xinerama)
have_xfree_xinerama=true], :,
[#include <X11/Xlib.h>])])
fi
if $have_xfree_xinerama ; then
AC_DEFINE(HAVE_XFREE_XINERAMA, 1,
[Define to 1 if XFree Xinerama is available])
AC_DEFINE(HAVE_XINERAMA, 1,
[Define to 1 is Xinerama is available])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
case "$host" in
*-*-solaris*)
# Check for solaris
AC_MSG_CHECKING(for Xinerama support on Solaris)
have_solaris_xinerama=false
AC_CHECK_FUNC(XineramaGetInfo,
[AC_CHECK_HEADER(X11/extensions/xinerama.h,
[have_solaris_xinerama=true], :,
[#include <X11/Xlib.h>])])
if $have_solaris_xinerama ; then
AC_DEFINE(HAVE_SOLARIS_XINERAMA, 1,
[Define to 1 if solaris xinerama is available])
AC_DEFINE(HAVE_XINERAMA, 1,
[Define to 1 if xinerama is available])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
;;
*)
;;
esac
fi
fi
AC_DEFINE(XINPUT_NONE, 1, [Define to 1 if no XInput should be used])
AM_CONDITIONAL(XINPUT_XFREE, false)
AM_CONDITIONAL(XINPUT_2, false)
# Check for the RANDR extension
if $PKG_CONFIG --exists "xrandr >= 1.2.99" ; then
AC_DEFINE(HAVE_RANDR, 1, [Have the Xrandr extension library])
X_PACKAGES="$X_PACKAGES xrandr"
fi
# Checks for Xcursor library
if $PKG_CONFIG --exists xcursor ; then
AC_DEFINE(HAVE_XCURSOR, 1, [Have the Xcursor library])
X_PACKAGES="$X_PACKAGES xcursor"
fi
# Checks for XFixes extension
if $PKG_CONFIG --exists xfixes ; then
AC_DEFINE(HAVE_XFIXES, 1, [Have the XFIXES X extension])
X_PACKAGES="$X_PACKAGES xfixes"
GTK_PACKAGES_FOR_X="$GTK_PACKAGES_FOR_X xfixes"
fi
# Checks for Xcomposite extension
if $PKG_CONFIG --exists xcomposite ; then
AC_DEFINE(HAVE_XCOMPOSITE, 1, [Have the XCOMPOSITE X extension])
X_PACKAGES="$X_PACKAGES xcomposite"
GTK_PACKAGES_FOR_X="$GTK_PACKAGES_FOR_X xcomposite"
fi
# Checks for Xdamage extension
if $PKG_CONFIG --exists xdamage ; then
AC_DEFINE(HAVE_XDAMAGE, 1, [Have the XDAMAGE X extension])
X_PACKAGES="$X_PACKAGES xdamage"
GTK_PACKAGES_FOR_X="$GTK_PACKAGES_FOR_X xdamage"
fi
if $have_base_x_pc ; then
GDK_EXTRA_LIBS="$x_extra_libs"
else
GDK_EXTRA_LIBS="$X_LIBS $x_extra_libs -lXext -lX11 $GDK_EXTRA_LIBS"
fi
CPPFLAGS="$gtk_save_cppflags"
LIBS="$gtk_save_libs"
AM_CONDITIONAL(USE_X11, true)
else
XPACKAGES=
AM_CONDITIONAL(XINPUT_XFREE, false)
AM_CONDITIONAL(XINPUT_2, false)
AM_CONDITIONAL(USE_X11, false)
AM_CONDITIONAL(HAVE_X11R6, false)
fi
# Check for Pango flags
if test "x$gdktarget" = "xwin32"; then
......@@ -1223,10 +1470,10 @@ CFLAGS="$saved_cflags"
LDFLAGS="$saved_ldflags"
# Pull in gio-unix for GDesktopAppInfo usage, see at least gdkapplaunchcontext-x11.c
if test "x$gdktarget" = "xx11"; then
GDK_PACKAGES="$PANGO_PACKAGES gio-unix-2.0 $X_PACKAGES gdk-pixbuf-2.0 cairo-$cairo_backend cairo-gobject"
if test "x$gdktarget" = "xx11" || test "x$gdktarget" = "xbroadway" ; then
GDK_PACKAGES="$PANGO_PACKAGES gio-unix-2.0 $X_PACKAGES gdk-pixbuf-2.0 $cairo_backend cairo-gobject"
else
GDK_PACKAGES="$PANGO_PACKAGES gio-2.0 gdk-pixbuf-2.0 cairo-$cairo_backend cairo-gobject"
GDK_PACKAGES="$PANGO_PACKAGES gio-2.0 gdk-pixbuf-2.0 $cairo_backend cairo-gobject"
fi
GDK_DEP_LIBS="$GDK_EXTRA_LIBS `$PKG_CONFIG --libs $GDK_PACKAGES`"
......@@ -1584,6 +1831,9 @@ elif test "x$gdktarget" = "xwin32" ; then
elif test "x$gdktarget" = "xquartz" ; then
gdk_windowing='
#define GDK_WINDOWING_QUARTZ'
elif test "x$gdktarget" = "xbroadway" ; then
gdk_windowing='
#define GDK_WINDOWING_BROADWAY'
fi
if test x$gdk_wchar_h = xyes; then
......@@ -1653,6 +1903,7 @@ build/Makefile
build/win32/Makefile
build/win32/vs9/Makefile
gdk/Makefile
gdk/broadway/Makefile
gdk/x11/Makefile
gdk/win32/Makefile
gdk/win32/rc/Makefile
......
......@@ -9,7 +9,7 @@ INTROSPECTION_COMPILER_ARGS = \
--includedir=.
SUBDIRS = $(gdktarget) . tests
DIST_SUBDIRS = win32 x11 quartz tests
DIST_SUBDIRS = win32 x11 quartz broadway tests
CLEANFILES =
......@@ -158,6 +158,10 @@ common_sources = \
gdkmarshalers.c \
gdkmarshalers.h
libgdk_broadway_3_0_la_SOURCES = $(common_sources)
libgdk_broadway_3_0_la_LIBADD = broadway/libgdk-broadway.la $(GDK_DEP_LIBS)
libgdk_broadway_3_0_la_LDFLAGS = $(LDADD)
libgdk_x11_3_0_la_SOURCES = $(common_sources)
libgdk_x11_3_0_la_LIBADD = x11/libgdk-x11.la $(GDK_DEP_LIBS)
libgdk_x11_3_0_la_LDFLAGS = $(LDADD)
......@@ -288,7 +292,7 @@ endif
lib_LTLIBRARIES = $(gdktargetlib)
EXTRA_LTLIBRARIES = libgdk-x11-3.0.la libgdk-win32-3.0.la libgdk-quartz-3.0.la
EXTRA_LTLIBRARIES = libgdk-broadway-3.0.la libgdk-x11-3.0.la libgdk-win32-3.0.la libgdk-quartz-3.0.la
MAINTAINERCLEANFILES = $(gdk_built_sources) stamp-gdkenumtypes.h
EXTRA_DIST += $(gdk_built_sources)
......
## Process this file with automake to produce Makefile.in
include $(top_srcdir)/Makefile.decl
libgdkincludedir = $(includedir)/gtk-3.0/gdk
INCLUDES = \
-DG_LOG_DOMAIN=\"Gdk\" \
-DGDK_COMPILATION \
-I$(top_srcdir) \
-I$(top_srcdir)/gdk \
-I$(top_builddir)/gdk \
$(GTK_DEBUG_FLAGS) \
$(GDK_DEP_CFLAGS)
LDADDS = $(GDK_DEP_LIBS)
noinst_LTLIBRARIES = libgdk-broadway.la
libgdk_broadway_la_SOURCES = \
MwmUtil.h \
gdkapplaunchcontext-broadway.c \
gdkasync.c \
gdkasync.h \
gdkcursor-broadway.c \
gdkdevice-broadway.h \
gdkdevice-broadway.c \
gdkdevicemanager-broadway.h \
gdkdevicemanager-broadway.c \
gdkdisplay-broadway.c \
gdkdisplay-broadway.h \
gdkdnd-broadway.c \
gdkdrawable-broadway.c \
gdkdrawable-broadway.h \
gdkeventsource.c \
gdkeventsource.h \
gdkeventtranslator.c \
gdkeventtranslator.h \
gdkgeometry-broadway.c \
gdkglobals-broadway.c \
gdkim-broadway.c \
gdkinput.c \
gdkkeys-broadway.c \
gdkmain-broadway.c \
gdkproperty-broadway.c \
gdkscreen-broadway.c \
gdkscreen-broadway.h \
gdkselection-broadway.c \
gdkspawn-broadway.c \
gdktestutils-broadway.c \
gdkvisual-broadway.c \
gdkwindow-broadway.c \
gdkwindow-broadway.h \
gdkxftdefaults.c \
gdkxid.c \
gdkx.h \
gdkprivate-broadway.h \
xsettings-client.h \
xsettings-client.c \
xsettings-common.h \
xsettings-common.c
libgdkinclude_HEADERS = \
gdkx.h
# We need to include all these C files here since the conditionals
# don't seem to be correctly expanded for the dist files.
EXTRA_DIST += \
gdksettings.c
-include $(top_srcdir)/git.mk
/**
*
* $Id$
*
* Copyright (C) 1995 Free Software Foundation, Inc.
*
* This file is part of the GNU LessTif Library.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*
* * Feb 21 1999 - George Lebl (jirka@5z.com)
* Owen Taylor (otaylor@redhat.com)
*
* Modified so that the MotifWmHints structure defined here
* is suitable for client side use on 64-bit architectures.
* X expects fields with a format of 32 to be longs, even
* when sizeof(long) == 8.
**/
#ifndef MWMUTIL_H_INCLUDED
#define MWMUTIL_H_INCLUDED
#include <X11/Xmd.h>
G_BEGIN_DECLS
typedef struct {
unsigned long flags;
unsigned long functions;
unsigned long decorations;
long input_mode;
unsigned long status;
} MotifWmHints, MwmHints;
#define MWM_HINTS_FUNCTIONS (1L << 0)
#define MWM_HINTS_DECORATIONS (1L << 1)
#define MWM_HINTS_INPUT_MODE (1L << 2)
#define MWM_HINTS_STATUS (1L << 3)
#define MWM_FUNC_ALL (1L << 0)
#define MWM_FUNC_RESIZE (1L << 1)
#define MWM_FUNC_MOVE (1L << 2)
#define MWM_FUNC_MINIMIZE (1L << 3)
#define MWM_FUNC_MAXIMIZE (1L << 4)
#define MWM_FUNC_CLOSE (1L << 5)
#define MWM_DECOR_ALL (1L << 0)
#define MWM_DECOR_BORDER (1L << 1)
#define MWM_DECOR_RESIZEH (1L << 2)
#define MWM_DECOR_TITLE (1L << 3)
#define MWM_DECOR_MENU (1L << 4)
#define MWM_DECOR_MINIMIZE (1L << 5)
#define MWM_DECOR_MAXIMIZE (1L << 6)
#define MWM_INPUT_MODELESS 0
#define MWM_INPUT_PRIMARY_APPLICATION_MODAL 1
#define MWM_INPUT_SYSTEM_MODAL 2
#define MWM_INPUT_FULL_APPLICATION_MODAL 3
#define MWM_INPUT_APPLICATION_MODAL MWM_INPUT_PRIMARY_APPLICATION_MODAL
#define MWM_TEAROFF_WINDOW (1L<<0)
/*
* atoms
*/
#define _XA_MOTIF_BINDINGS "_MOTIF_BINDINGS"
#define _XA_MOTIF_WM_HINTS "_MOTIF_WM_HINTS"
#define _XA_MOTIF_WM_MESSAGES "_MOTIF_WM_MESSAGES"
#define _XA_MOTIF_WM_OFFSET "_MOTIF_WM_OFFSET"
#define _XA_MOTIF_WM_MENU "_MOTIF_WM_MENU"
#define _XA_MOTIF_WM_INFO "_MOTIF_WM_INFO"
#define _XA_MWM_HINTS _XA_MOTIF_WM_HINTS
#define _XA_MWM_MESSAGES _XA_MOTIF_WM_MESSAGES
#define _XA_MWM_MENU _XA_MOTIF_WM_MENU
#define _XA_MWM_INFO _XA_MOTIF_WM_INFO
/*
* _MWM_INFO property
*/
typedef struct {
long flags;
Window wm_window;
} MotifWmInfo;
typedef MotifWmInfo MwmInfo;
#define MWM_INFO_STARTUP_STANDARD (1L<<0)
#define MWM_INFO_STARTUP_CUSTOM (1L<<1)
/*
* _MWM_HINTS property
*/
typedef struct {
unsigned long flags;
unsigned long functions;
unsigned long decorations;
long inputMode;
unsigned long status;
} PropMotifWmHints;
typedef PropMotifWmHints PropMwmHints;
#define PROP_MOTIF_WM_HINTS_ELEMENTS 5
#define PROP_MWM_HINTS_ELEMENTS PROP_MOTIF_WM_HINTS_ELEMENTS
/*
* _MWM_INFO property, slight return
*/
typedef struct {
unsigned long flags;
unsigned long wmWindow;
} PropMotifWmInfo;
typedef PropMotifWmInfo PropMwmInfo;
#define PROP_MOTIF_WM_INFO_ELEMENTS 2
#define PROP_MWM_INFO_ELEMENTS PROP_MOTIF_WM_INFO_ELEMENTS
G_END_DECLS
#endif /* MWMUTIL_H_INCLUDED */
/* gdkapplaunchcontext-x11.c - Gtk+ implementation for GAppLaunchContext
Copyright (C) 2007 Red Hat, Inc.
The Gnome Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The Gnome Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: Alexander Larsson <alexl@redhat.com>
*/
#include "config.h"
#include "gdkapplaunchcontext.h"
#include "gdkx.h"
#include "gdkscreen.h"
#include "gdkinternals.h"
#include "gdkintl.h"
#include <glib.h>
#include <gio/gdesktopappinfo.h>
#include <string.h>
#include <unistd.h>
static char *
get_display_name (GFile *file)
{
GFileInfo *info;
char *name, *tmp;
/* This does sync I/O, which isn't ideal.
* It should probably use the NautilusFile machinery
*/
name = NULL;
info = g_file_query_info (file,
G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME, 0, NULL, NULL);
if (info)
{
name = g_strdup (g_file_info_get_display_name (info));
g_object_unref (info);
}
if (name == NULL)
{
name = g_file_get_basename (file);
if (!g_utf8_validate (name, -1, NULL))
{
tmp = name;
name =
g_uri_escape_string (name, G_URI_RESERVED_CHARS_ALLOWED_IN_PATH,
TRUE);
g_free (tmp);
}
}
return name;
}
static GIcon *
get_icon (GFile *file)
{
GFileInfo *info;
GIcon *icon;
icon = NULL;
info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_ICON, 0, NULL, NULL);
if (info)
{
icon = g_file_info_get_icon (info);
if (icon)
g_object_ref (icon);
g_object_unref (info);
}
return icon;
}
static char *
gicon_to_string (GIcon *icon)
{
GFile *file;
const char *const *names;
if (G_IS_FILE_ICON (icon))
{
file = g_file_icon_get_file (G_FILE_ICON (icon));
if (file)
return g_file_get_path (file);
}
else if (G_IS_THEMED_ICON (icon))
{
names = g_themed_icon_get_names (G_THEMED_ICON (icon));
if (names)
return g_strdup (names[0]);
}
else if (G_IS_EMBLEMED_ICON (icon))
{
GIcon *base;
base = g_emblemed_icon_get_icon (G_EMBLEMED_ICON (icon));
return gicon_to_string (base);
}
return NULL;
}
static void
end_startup_notification (GdkDisplay *display,
const char *startup_id)
{
gdk_x11_display_broadcast_startup_message (display, "remove",
"ID", startup_id,
NULL);
}
/* This should be fairly long, as it's confusing to users if a startup
* ends when it shouldn't (it appears that the startup failed, and
* they have to relaunch the app). Also the timeout only matters when
* there are bugs and apps don't end their own startup sequence.
*
* This timeout is a "last resort" timeout that ignores whether the
* startup sequence has shown activity or not. Metacity and the
* tasklist have smarter, and correspondingly able-to-be-shorter
* timeouts. The reason our timeout is dumb is that we don't monitor
* the sequence (don't use an SnMonitorContext)
*/
#define STARTUP_TIMEOUT_LENGTH_SECONDS 30
#define STARTUP_TIMEOUT_LENGTH (STARTUP_TIMEOUT_LENGTH_SECONDS * 1000)
typedef struct
{
GdkDisplay *display;
char *startup_id;
GTimeVal time;
} StartupNotificationData;
static void
free_startup_notification_data (gpointer data)
{
StartupNotificationData *sn_data = data;
g_object_unref (sn_data->display);
g_free (sn_data->startup_id);
g_free (sn_data);
}
typedef struct
{
GSList *contexts;
guint timeout_id;
} StartupTimeoutData;
static void
free_startup_timeout (void *data)
{
StartupTimeoutData *std;
std = data;
g_slist_foreach (std->contexts, (GFunc) free_startup_notification_data, NULL);
g_slist_free (std->contexts);
if (std->timeout_id != 0)
{
g_source_remove (std->timeout_id);
std->timeout_id = 0;
}
g_free (std);
}
static gboolean
startup_timeout (void *data)
{
StartupTimeoutData *std;
GSList *tmp;
GTimeVal now;
int min_timeout;
std = data;