コード例 #1
0
ファイル: GdkWindow.c プロジェクト: cyberpython/java-gnome
JNIEXPORT void JNICALL
Java_org_gnome_gdk_GdkWindow_gdk_1window_1stick
(
	JNIEnv* env,
	jclass cls,
	jlong _self
)
{
	GdkWindow* self;

	// convert parameter self
	self = (GdkWindow*) _self;

	// call function
	gdk_window_stick(self);

	// cleanup parameter self
}
コード例 #2
0
void
panel_start_gui(panel *p)
{
    ENTER;
    //gtk_rc_parse_string(transparent_rc);
    p->topgwin      = gtk_window_new(GTK_WINDOW_TOPLEVEL);

    gtk_container_set_border_width(GTK_CONTAINER(p->topgwin), 0);
    gtk_window_set_resizable(GTK_WINDOW(p->topgwin), FALSE);
    gtk_window_set_wmclass(GTK_WINDOW(p->topgwin), "panel", "trayer");
    gtk_window_set_title(GTK_WINDOW(p->topgwin), "panel");
    gtk_window_set_position(GTK_WINDOW(p->topgwin), GTK_WIN_POS_CENTER);
    g_signal_connect ( G_OBJECT(p->topgwin) , "delete-event" , G_CALLBACK(panel_delete_event) , p);
    g_signal_connect ( G_OBJECT(p->topgwin) , "destroy-event", G_CALLBACK(panel_destroy_event), p);
    g_signal_connect ( G_OBJECT (p->topgwin), "size-request" , G_CALLBACK(panel_size_req)  , p);
    g_signal_connect ( G_OBJECT (p->topgwin), "size-allocate", G_CALLBACK(panel_size_alloc), p);

    if (p->transparent) {
      g_signal_connect (G_OBJECT (p->topgwin), "configure-event", G_CALLBACK(panel_configure_event), p);
      g_signal_connect (G_OBJECT (p->topgwin), "style-set", G_CALLBACK( panel_style_set), p);
    }

    if (p->on_primary) {
        GdkDisplay *display = gdk_display_get_default ();
        GdkScreen *screen = gdk_display_get_screen(display, 0);
        g_signal_connect ( screen, "monitors-changed", G_CALLBACK(panel_monitors_changed), (gpointer)p );
        p->monitor = gdk_screen_get_primary_monitor(screen);

    }
    gtk_widget_realize(p->topgwin);
    gdk_window_set_decorations(p->topgwin->window, 0);
    gtk_widget_set_app_paintable(p->topgwin, TRUE);

    p->lbox = p->my_box_new(FALSE, 0);
    gtk_container_set_border_width(GTK_CONTAINER(p->lbox), 0);
    gtk_container_add(GTK_CONTAINER(p->topgwin), p->lbox);
    gtk_widget_show(p->lbox);

    if (p->allign == ALLIGN_RIGHT) {
        GtkWidget * expander = p->my_box_new(FALSE, 0);
        gtk_box_pack_start(GTK_BOX(p->lbox), expander, TRUE, TRUE, 0);
        gtk_widget_show(expander);
    }

    p->box = p->my_box_new(FALSE, 1);
    gtk_container_set_border_width(GTK_CONTAINER(p->box), 1);
    gtk_box_pack_start(GTK_BOX(p->lbox), p->box, FALSE, TRUE, padding);
    gtk_widget_show(p->box);

    // get properties on topgwin
    p->topGdkWindow = gtk_widget_get_window(p->topgwin);
    p->topxwin = GDK_WINDOW_XWINDOW(GTK_WIDGET(p->topgwin)->window);

    bg_init(gdk_helper_display());

    /* make our window unfocusable */
    gdk_window_set_accept_focus(p->topGdkWindow,False);

    if (p->setdocktype) {
        gdk_window_set_type_hint(p->topGdkWindow,GDK_WINDOW_TYPE_HINT_DOCK);
    }

    Xclimsg(p->topxwin, a_NET_WM_DESKTOP, 0xFFFFFFFF, 0, 0, 0, 0);

    /************************/
    /* Window Mapping Point */
    gtk_widget_show_all(p->topgwin);
    Xclimsg(p->topxwin, a_NET_WM_DESKTOP, 0xFFFFFFFF, 0, 0, 0, 0);

    gdk_window_stick                 ( p->topGdkWindow);
    gdk_window_set_skip_pager_hint   ( p->topGdkWindow, True );
    gdk_window_set_skip_taskbar_hint ( p->topGdkWindow, True );

    XSelectInput (gdk_helper_display(), GDK_ROOT_WINDOW(), PropertyChangeMask);
    XSelectInput (gdk_helper_display(), p->topxwin, PropertyChangeMask | FocusChangeMask | StructureNotifyMask);
    gdk_window_add_filter(gdk_get_default_root_window (), (GdkFilterFunc)panel_wm_events, p);

    calculate_position(p, distance,distancefrom);
    gdk_window_move_resize(p->topgwin->window, p->ax, p->ay, p->aw, p->ah);
    if (p->setstrut)
        panel_set_wm_strut(p);
    if (p->lower)
        XLowerWindow(gdk_helper_display(), p->topxwin);

    RET();
}
コード例 #3
0
ファイル: rbgdkwindow.c プロジェクト: geoffyoungs/ruby-gnome2
static VALUE
gdkwin_stick(VALUE self)
{
    gdk_window_stick(_SELF(self));
    return self;
}
コード例 #4
0
ファイル: shutdowndialog.c プロジェクト: electricface/dde
int main (int argc, char **argv)
{
    /* if (argc == 2 && 0 == g_strcmp0(argv[1], "-d")) */
    g_setenv("G_MESSAGES_DEBUG", "all", FALSE);
    if (is_application_running(SHUTDOWN_ID_NAME)) {
        g_warning("another instance of application shutdown is running...\n");
        return 0;
    }

    singleton(SHUTDOWN_ID_NAME);

    //remove  option -f
    parse_cmd_line (&argc, &argv);


    check_version();
    init_i18n ();
    gtk_init (&argc, &argv);


    gdk_window_set_cursor (gdk_get_default_root_window (), gdk_cursor_new (GDK_LEFT_PTR));

    container = create_web_container (FALSE, TRUE);
    ensure_fullscreen (container);

    gtk_window_set_decorated (GTK_WINDOW (container), FALSE);
    gtk_window_set_skip_taskbar_hint (GTK_WINDOW (container), TRUE);
    gtk_window_set_skip_pager_hint (GTK_WINDOW (container), TRUE);
    /*gtk_window_set_keep_above (GTK_WINDOW (container), TRUE);*/

    gtk_window_fullscreen (GTK_WINDOW (container));
    gtk_widget_set_events (GTK_WIDGET (container),
                           gtk_widget_get_events (GTK_WIDGET (container))
                           | GDK_POINTER_MOTION_MASK
                           | GDK_BUTTON_PRESS_MASK
                           | GDK_BUTTON_RELEASE_MASK
                           | GDK_KEY_PRESS_MASK
                           | GDK_KEY_RELEASE_MASK
                           | GDK_EXPOSURE_MASK
                           | GDK_VISIBILITY_NOTIFY_MASK
                           | GDK_ENTER_NOTIFY_MASK
                           | GDK_LEAVE_NOTIFY_MASK);

    webview = d_webview_new_with_uri (SHUTDOWN_HTML_PATH);
    gtk_container_add (GTK_CONTAINER(container), GTK_WIDGET (webview));
    /*g_signal_connect (container, "show", G_CALLBACK (show_cb), NULL);*/
    /*g_signal_connect (webview, "focus-out-event", G_CALLBACK( focus_out_cb), NULL);*/

    gtk_widget_realize (container);
    gtk_widget_realize (webview);

    GdkWindow* gdkwindow = gtk_widget_get_window (container);
    GdkRGBA rgba = { 0, 0, 0, 0.0 };
    gdk_window_set_background_rgba (gdkwindow, &rgba);
    gdk_window_set_skip_taskbar_hint (gdkwindow, TRUE);
    gdk_window_set_cursor (gdkwindow, gdk_cursor_new(GDK_LEFT_PTR));

    /*gdk_window_set_override_redirect (gdkwindow, TRUE);*/
    /*select_popup_events ();*/
    /*gdk_window_add_filter (NULL, (GdkFilterFunc)xevent_filter, gdkwindow);*/

    dde_bg_g_settings = g_settings_new(SCHEMA_ID);
    set_background(gtk_widget_get_window(webview), dde_bg_g_settings,
                            gdk_screen_width(), gdk_screen_height());

    grab = gs_grab_new ();
    gtk_widget_show_all (container);

    gdk_window_focus (gtk_widget_get_window (container), 0);
    gdk_window_stick (gdkwindow);


    gtk_main ();

    return 0;
}