[nautilus-actions] src/nact/base-window.c: get ride of base_application_get_main_window() calls
- From: Pierre Wieser <pwieser src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus-actions] src/nact/base-window.c: get ride of base_application_get_main_window() calls
- Date: Fri, 21 Jan 2011 18:47:38 +0000 (UTC)
commit 1e42034684022a817b31322b564ed68ef9afd75e
Author: Pierre Wieser <pwieser trychlos org>
Date: Thu Jan 20 23:53:22 2011 +0100
src/nact/base-window.c: get ride of base_application_get_main_window() calls
ChangeLog | 6 ++++--
src/nact/base-window.c | 17 +++++++++++------
2 files changed, 15 insertions(+), 8 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index bda2861..1b0a9de 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,9 @@
2011-01-20 Pierre Wieser <pwieser trychlos org>
- * src/nact/nact-tree-model-dnd.c (drop_inside, is_drop_possible,
- drop_uri_list): Remove base_application_get_main_window() invocations.
+ * src/nact/nact-tree-model-dnd.c
+ (drop_inside, is_drop_possible, drop_uri_list):
+ * src/nact/base-window.c (is_main):
+ Remove base_application_get_main_window() invocations.
* src/nact/nact-main.c: Renamed as main.c
diff --git a/src/nact/base-window.c b/src/nact/base-window.c
index 6a14ff2..7e5a5d0 100644
--- a/src/nact/base-window.c
+++ b/src/nact/base-window.c
@@ -93,9 +93,10 @@ enum {
LAST_SIGNAL
};
-static GObjectClass *st_parent_class = NULL;
+static GObjectClass *st_parent_class = NULL;
static gint st_signals[ LAST_SIGNAL ] = { 0 };
-static gboolean st_debug_signal_connect = FALSE;
+static gboolean st_debug_signal_connect = FALSE;
+static BaseWindow *st_first_window = NULL;
static GType register_type( void );
static void class_init( BaseWindowClass *klass );
@@ -351,6 +352,13 @@ instance_init( GTypeInstance *instance, gpointer klass )
self = BASE_WINDOW( instance );
+ /* at a first glance, we may suppose that this first window is the main one
+ * if this is not the case, we have to write some more code
+ */
+ if( !st_first_window ){
+ st_first_window = self;
+ }
+
self->private = g_new0( BaseWindowPrivate, 1 );
self->private->dispose_has_run = FALSE;
@@ -1172,10 +1180,7 @@ is_main_window( BaseWindow *window )
if( !window->private->dispose_has_run ){
- BaseApplication *appli = window->private->application;
- BaseWindow *main_window = BASE_WINDOW( base_application_get_main_window( appli ));
-
- is_main = ( main_window->private->toplevel_window == window->private->toplevel_window );
+ is_main = ( window == st_first_window );
}
return( is_main );
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]