예제 #1
0
static void
realize (GtkWidget *widget)
{
    NemoDesktopWindow *window;
    NemoDesktopWindowDetails *details;
    GdkVisual *visual;

    window = NEMO_DESKTOP_WINDOW (widget);
    details = window->details;

    /* Make sure we get keyboard events */
    gtk_widget_set_events (widget, gtk_widget_get_events (widget)
                           | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK);

    visual = gdk_screen_get_rgba_visual (gtk_widget_get_screen (widget));
    if (visual) {
        gtk_widget_set_visual (widget, visual);
    }

    /* Do the work of realizing. */
    GTK_WIDGET_CLASS (nemo_desktop_window_parent_class)->realize (widget);

    /* This is the new way to set up the desktop window */
    set_wmspec_desktop_hint (gtk_widget_get_window (widget));

    set_desktop_window_id (window, gtk_widget_get_window (widget));

    details->size_changed_id =
        g_signal_connect (gtk_window_get_screen (GTK_WINDOW (window)), "size_changed",
                          G_CALLBACK (nemo_desktop_window_screen_size_changed), window);
}
예제 #2
0
static void
on_monitors_changed (NemoDesktopManager *manager)
{
    g_return_if_fail (NEMO_IS_DESKTOP_MANAGER (manager));

    FETCH_PRIV (manager);
    GList *l;

    DEBUG ("Monitors or workarea changed");

    if (get_run_state (manager) < RUN_STATE_RUNNING) {
        DEBUG ("...ignoring possibly bogus MonitorsChanged - we're not RUNNING or FALLBACK");
        return;
    }

    if (((guint) get_n_monitors (manager)) != g_list_length (priv->desktops)) {
        queue_update_layout (manager);
        return;
    }

    for (l = priv->desktops; l != NULL; l = l->next) {
        DesktopInfo *info = (DesktopInfo *) l->data;

        if (NEMO_IS_DESKTOP_WINDOW (info->window)) {
            nemo_desktop_window_update_geometry (NEMO_DESKTOP_WINDOW (info->window));
        }
        else
        if (NEMO_IS_BLANK_DESKTOP_WINDOW (info->window)) {
            nemo_blank_desktop_window_update_geometry (NEMO_BLANK_DESKTOP_WINDOW (info->window));
        }
    }
}
예제 #3
0
static void
nemo_desktop_window_dispose (GObject *obj)
{
	NemoDesktopWindow *window = NEMO_DESKTOP_WINDOW (obj);

	g_signal_handlers_disconnect_by_func (nemo_preferences,
					      nemo_desktop_window_update_directory,
					      window);

	G_OBJECT_CLASS (nemo_desktop_window_parent_class)->dispose (obj);
}
예제 #4
0
static void
nemo_desktop_window_set_property (GObject *object,
                                     guint property_id,
                             const GValue *value,
                               GParamSpec *pspec)
{
    NemoDesktopWindow *window = NEMO_DESKTOP_WINDOW (object);

    switch (property_id) {
    case PROP_MONITOR:
        window->details->monitor = g_value_get_int (value);
        break;
    default:
        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
        break;
    }
}
예제 #5
0
static void
nemo_desktop_window_constructed (GObject *obj)
{
	GtkActionGroup *action_group;
	GtkAction *action;
	AtkObject *accessible;
	NemoDesktopWindow *window = NEMO_DESKTOP_WINDOW (obj);
	NemoWindow *nwindow = NEMO_WINDOW (obj);

	G_OBJECT_CLASS (nemo_desktop_window_parent_class)->constructed (obj);

    g_object_set_data (G_OBJECT (window), "monitor_number",
                       GINT_TO_POINTER (window->details->monitor));

	gtk_widget_hide (nwindow->details->statusbar);
	gtk_widget_hide (nwindow->details->menubar);

	action_group = nemo_window_get_main_action_group (nwindow);

	/* Don't allow close action on desktop */
	action = gtk_action_group_get_action (action_group,
					      NEMO_ACTION_CLOSE);
	gtk_action_set_sensitive (action, FALSE);

	/* Don't allow new tab on desktop */
	action = gtk_action_group_get_action (action_group,
					      NEMO_ACTION_NEW_TAB);
	gtk_action_set_sensitive (action, FALSE);

	/* Set the accessible name so that it doesn't inherit the cryptic desktop URI. */
	accessible = gtk_widget_get_accessible (GTK_WIDGET (window));

	if (accessible) {
		atk_object_set_name (accessible, _("Desktop"));
	}

    nemo_desktop_window_update_geometry (window);

    gtk_window_set_resizable (GTK_WINDOW (window),
                  FALSE);
    gtk_window_set_decorated (GTK_WINDOW (window),
                  FALSE);

    gtk_widget_show (GTK_WIDGET (window));
}
예제 #6
0
static void
nemo_desktop_window_constructed (GObject *obj)
{
    GtkActionGroup *action_group;
    GtkAction *action;
    AtkObject *accessible;
    NemoDesktopWindow *window = NEMO_DESKTOP_WINDOW (obj);
    NemoWindow *nwindow = NEMO_WINDOW (obj);

    G_OBJECT_CLASS (nemo_desktop_window_parent_class)->constructed (obj);

    gtk_widget_hide (nwindow->details->statusbar);
    gtk_widget_hide (nwindow->details->menubar);

    action_group = nemo_window_get_main_action_group (nwindow);

    /* Don't allow close action on desktop */
    action = gtk_action_group_get_action (action_group,
                                          NEMO_ACTION_CLOSE);
    gtk_action_set_sensitive (action, FALSE);

    /* Don't allow new tab on desktop */
    action = gtk_action_group_get_action (action_group,
                                          NEMO_ACTION_NEW_TAB);
    gtk_action_set_sensitive (action, FALSE);

    /* Set the accessible name so that it doesn't inherit the cryptic desktop URI. */
    accessible = gtk_widget_get_accessible (GTK_WIDGET (window));

    if (accessible) {
        atk_object_set_name (accessible, _("Desktop"));
    }

    /* Monitor the preference to have the desktop */
    /* point to the Unix home folder */
    g_signal_connect_swapped (nemo_preferences, "changed::" NEMO_PREFERENCES_DESKTOP_IS_HOME_DIR,
                              G_CALLBACK (nemo_desktop_window_update_directory),
                              window);
}
예제 #7
0
static void
unrealize (GtkWidget *widget)
{
    NemoDesktopWindow *window;
    NemoDesktopWindowDetails *details;
    GdkWindow *root_window;

    window = NEMO_DESKTOP_WINDOW (widget);
    details = window->details;

    root_window = gdk_screen_get_root_window (
                      gtk_window_get_screen (GTK_WINDOW (window)));

    gdk_property_delete (root_window,
                         gdk_atom_intern ("NEMO_DESKTOP_WINDOW_ID", TRUE));

    if (details->size_changed_id != 0) {
        g_signal_handler_disconnect (gtk_window_get_screen (GTK_WINDOW (window)),
                                     details->size_changed_id);
        details->size_changed_id = 0;
    }

    GTK_WIDGET_CLASS (nemo_desktop_window_parent_class)->unrealize (widget);
}