diff options
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | embed/mozilla/MozDownload.cpp | 2 | ||||
-rw-r--r-- | src/ephy-main.c | 57 |
3 files changed, 70 insertions, 0 deletions
@@ -1,3 +1,14 @@ +2005-02-28 Christian Persch <chpe@cvs.gnome.org> + + * embed/mozilla/MozDownload.cpp: + + NULL check. Fixes bug #165999. + + * src/ephy-main.c: (slowly_and_stupidly_obtain_timestamp), (main): + + Try to get an approximation to the launch time if DESKTOP_STARTUP_ID + is not set. Fixes bug #168820, patch by Elijah Newren. + 2005-02-27 Christian Persch <chpe@cvs.gnome.org> * configure.ac: diff --git a/embed/mozilla/MozDownload.cpp b/embed/mozilla/MozDownload.cpp index 419123c76..081a5d5d0 100644 --- a/embed/mozilla/MozDownload.cpp +++ b/embed/mozilla/MozDownload.cpp @@ -763,6 +763,8 @@ nsresult BuildDownloadPath (const char *defaultFileName, nsILocalFile **_retval) } nsCOMPtr <nsILocalFile> destFile (do_CreateInstance(NS_LOCAL_FILE_CONTRACTID)); + NS_ENSURE_TRUE (destFile, NS_ERROR_FAILURE); + destFile->InitWithNativePath (nsEmbedCString (path)); g_free (path); diff --git a/src/ephy-main.c b/src/ephy-main.c index 5a62232ca..71b542a1a 100644 --- a/src/ephy-main.c +++ b/src/ephy-main.c @@ -32,6 +32,7 @@ #include <gtk/gtkaboutdialog.h> #include <gtk/gtkmain.h> #include <gtk/gtkmessagedialog.h> +#include <gdk/gdkx.h> #include <libgnome/gnome-program.h> #include <bonobo/bonobo-main.h> #include <glib/gi18n.h> @@ -39,6 +40,7 @@ #include <libgnomevfs/gnome-vfs-utils.h> #include <libxml/xmlversion.h> #include <errno.h> +#include <string.h> static gboolean open_in_existing = FALSE; static gboolean open_in_new_tab = FALSE; @@ -140,6 +142,57 @@ idle_unref (GObject *object) return FALSE; } +/* Copied from libnautilus/nautilus-program-choosing.c; Needed in case + * we have no DESKTOP_STARTUP_ID (with its accompanying timestamp). + */ +static Time +slowly_and_stupidly_obtain_timestamp (Display *xdisplay) +{ + Window xwindow; + XEvent event; + + { + XSetWindowAttributes attrs; + Atom atom_name; + Atom atom_type; + char* name; + + attrs.override_redirect = True; + attrs.event_mask = PropertyChangeMask | StructureNotifyMask; + + xwindow = + XCreateWindow (xdisplay, + RootWindow (xdisplay, 0), + -100, -100, 1, 1, + 0, + CopyFromParent, + CopyFromParent, + CopyFromParent, + CWOverrideRedirect | CWEventMask, + &attrs); + + atom_name = XInternAtom (xdisplay, "WM_NAME", TRUE); + g_assert (atom_name != None); + atom_type = XInternAtom (xdisplay, "STRING", TRUE); + g_assert (atom_type != None); + + name = "Fake Window"; + XChangeProperty (xdisplay, + xwindow, atom_name, + atom_type, + 8, PropModeReplace, name, strlen (name)); + } + + XWindowEvent (xdisplay, + xwindow, + PropertyChangeMask, + &event); + + XDestroyWindow(xdisplay, xwindow); + + return event.xproperty.time; +} + int main (int argc, char *argv[]) { @@ -174,6 +227,10 @@ main (int argc, char *argv[]) GNOME_PARAM_APP_DATADIR, DATADIR, NULL); + /* Get a timestamp manually if need be */ + if (user_time == 0) + user_time = slowly_and_stupidly_obtain_timestamp (gdk_display); + g_set_application_name (_("Epiphany Web Browser")); /* Set default window icon */ |