summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRamiro Estrugo <ramiro@src.gnome.org>2000-11-01 15:25:10 +0000
committerRamiro Estrugo <ramiro@src.gnome.org>2000-11-01 15:25:10 +0000
commit8f40ddef54dcece10e5a7cb86130b4553ac65657 (patch)
treec3efd34de3dc7604fbaf23e77a3a8b8d10e436f3 /src
parent41a618499ddbfbb3e2416ffeb7c0e2bb5c4a8982 (diff)
downloadnautilus-8f40ddef54dcece10e5a7cb86130b4553ac65657.tar.gz
Keep track of NautilusWindow realization events. Do this by monitoring a
* applets/launcher/nautilus-launcher-applet.c: (image_enter_event), (window_set_cursor_for_state), (set_is_launching), (get_is_launching), (image_button_press_event), (image_button_release_event), (event_filter), (root_listen_for_property_changes), (main): Keep track of NautilusWindow realization events. Do this by monitoring a property on the root window. Use this flag in order to give the user feedback about the launching state of new Nautilus windows. Fixes bug 4300. * src/nautilus-window.c: (nautilus_window_update_launcher), (nautilus_window_realize): Notify the launcher when a NautilusWindow get realized. * src/run-nautilus: If no arguments are given, then open a window pointed to the user's home directory.
Diffstat (limited to 'src')
-rw-r--r--src/nautilus-navigation-window.c25
-rw-r--r--src/nautilus-object-window.c25
-rw-r--r--src/nautilus-spatial-window.c25
-rw-r--r--src/nautilus-window.c25
-rwxr-xr-xsrc/run-nautilus13
5 files changed, 109 insertions, 4 deletions
diff --git a/src/nautilus-navigation-window.c b/src/nautilus-navigation-window.c
index 932483841..dceca37cb 100644
--- a/src/nautilus-navigation-window.c
+++ b/src/nautilus-navigation-window.c
@@ -72,6 +72,9 @@
#include <libnautilus/nautilus-clipboard.h>
#include <libnautilus/nautilus-undo.h>
#include <math.h>
+#include <sys/time.h>
+#include <X11/Xatom.h>
+#include <gdk/gdkx.h>
/* FIXME bugzilla.eazel.com 1243:
* We should use inheritance instead of these special cases
@@ -674,6 +677,25 @@ nautilus_window_filter (GdkXEvent *xev, GdkEvent *event, gpointer data)
#endif
static void
+nautilus_window_update_launcher (GdkWindow *window)
+{
+ struct timeval tmp;
+
+ gettimeofday (&tmp, NULL);
+
+ /* Set a property on the root window to the time of day in seconds.
+ * The launcher will monitor the root window for this property change
+ * to update its launching state */
+ gdk_property_change (GDK_ROOT_PARENT (),
+ gdk_atom_intern ("_NAUTILUS_LAST_WINDOW_REALIZE_TIME", FALSE),
+ XA_CARDINAL,
+ 32,
+ PropModeReplace,
+ (guchar *) &tmp.tv_sec,
+ 1);
+}
+
+static void
nautilus_window_realize (GtkWidget *widget)
{
char *filename;
@@ -715,6 +737,9 @@ nautilus_window_realize (GtkWidget *widget)
}
g_free (filename);
}
+
+ /* Notify the launcher that our window has been realized */
+ nautilus_window_update_launcher (widget->window);
}
static void
diff --git a/src/nautilus-object-window.c b/src/nautilus-object-window.c
index 932483841..dceca37cb 100644
--- a/src/nautilus-object-window.c
+++ b/src/nautilus-object-window.c
@@ -72,6 +72,9 @@
#include <libnautilus/nautilus-clipboard.h>
#include <libnautilus/nautilus-undo.h>
#include <math.h>
+#include <sys/time.h>
+#include <X11/Xatom.h>
+#include <gdk/gdkx.h>
/* FIXME bugzilla.eazel.com 1243:
* We should use inheritance instead of these special cases
@@ -674,6 +677,25 @@ nautilus_window_filter (GdkXEvent *xev, GdkEvent *event, gpointer data)
#endif
static void
+nautilus_window_update_launcher (GdkWindow *window)
+{
+ struct timeval tmp;
+
+ gettimeofday (&tmp, NULL);
+
+ /* Set a property on the root window to the time of day in seconds.
+ * The launcher will monitor the root window for this property change
+ * to update its launching state */
+ gdk_property_change (GDK_ROOT_PARENT (),
+ gdk_atom_intern ("_NAUTILUS_LAST_WINDOW_REALIZE_TIME", FALSE),
+ XA_CARDINAL,
+ 32,
+ PropModeReplace,
+ (guchar *) &tmp.tv_sec,
+ 1);
+}
+
+static void
nautilus_window_realize (GtkWidget *widget)
{
char *filename;
@@ -715,6 +737,9 @@ nautilus_window_realize (GtkWidget *widget)
}
g_free (filename);
}
+
+ /* Notify the launcher that our window has been realized */
+ nautilus_window_update_launcher (widget->window);
}
static void
diff --git a/src/nautilus-spatial-window.c b/src/nautilus-spatial-window.c
index 932483841..dceca37cb 100644
--- a/src/nautilus-spatial-window.c
+++ b/src/nautilus-spatial-window.c
@@ -72,6 +72,9 @@
#include <libnautilus/nautilus-clipboard.h>
#include <libnautilus/nautilus-undo.h>
#include <math.h>
+#include <sys/time.h>
+#include <X11/Xatom.h>
+#include <gdk/gdkx.h>
/* FIXME bugzilla.eazel.com 1243:
* We should use inheritance instead of these special cases
@@ -674,6 +677,25 @@ nautilus_window_filter (GdkXEvent *xev, GdkEvent *event, gpointer data)
#endif
static void
+nautilus_window_update_launcher (GdkWindow *window)
+{
+ struct timeval tmp;
+
+ gettimeofday (&tmp, NULL);
+
+ /* Set a property on the root window to the time of day in seconds.
+ * The launcher will monitor the root window for this property change
+ * to update its launching state */
+ gdk_property_change (GDK_ROOT_PARENT (),
+ gdk_atom_intern ("_NAUTILUS_LAST_WINDOW_REALIZE_TIME", FALSE),
+ XA_CARDINAL,
+ 32,
+ PropModeReplace,
+ (guchar *) &tmp.tv_sec,
+ 1);
+}
+
+static void
nautilus_window_realize (GtkWidget *widget)
{
char *filename;
@@ -715,6 +737,9 @@ nautilus_window_realize (GtkWidget *widget)
}
g_free (filename);
}
+
+ /* Notify the launcher that our window has been realized */
+ nautilus_window_update_launcher (widget->window);
}
static void
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index 932483841..dceca37cb 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -72,6 +72,9 @@
#include <libnautilus/nautilus-clipboard.h>
#include <libnautilus/nautilus-undo.h>
#include <math.h>
+#include <sys/time.h>
+#include <X11/Xatom.h>
+#include <gdk/gdkx.h>
/* FIXME bugzilla.eazel.com 1243:
* We should use inheritance instead of these special cases
@@ -674,6 +677,25 @@ nautilus_window_filter (GdkXEvent *xev, GdkEvent *event, gpointer data)
#endif
static void
+nautilus_window_update_launcher (GdkWindow *window)
+{
+ struct timeval tmp;
+
+ gettimeofday (&tmp, NULL);
+
+ /* Set a property on the root window to the time of day in seconds.
+ * The launcher will monitor the root window for this property change
+ * to update its launching state */
+ gdk_property_change (GDK_ROOT_PARENT (),
+ gdk_atom_intern ("_NAUTILUS_LAST_WINDOW_REALIZE_TIME", FALSE),
+ XA_CARDINAL,
+ 32,
+ PropModeReplace,
+ (guchar *) &tmp.tv_sec,
+ 1);
+}
+
+static void
nautilus_window_realize (GtkWidget *widget)
{
char *filename;
@@ -715,6 +737,9 @@ nautilus_window_realize (GtkWidget *widget)
}
g_free (filename);
}
+
+ /* Notify the launcher that our window has been realized */
+ nautilus_window_update_launcher (widget->window);
}
static void
diff --git a/src/run-nautilus b/src/run-nautilus
index cec82de50..a7f2274d5 100755
--- a/src/run-nautilus
+++ b/src/run-nautilus
@@ -32,11 +32,16 @@ then
##
nautilus-clean.sh -q -x
else
- ##
+ ## If no arguments give, open a new new home window
+ if [ $# -eq 0 ]
+ then
+ nautilus ~
+ RETURN=$?
## Run Nautilus with optional command line arguments
- ## This should open a new window on the currently running Nautilus
- nautilus ${1+"$@"}
- RETURN=$?
+ else
+ nautilus ${1+"$@"}
+ RETURN=$?
+ fi
fi
exit $RETURN