Пример #1
0
static void fix_without_wm(GtkWidget* child)
{
    GdkDisplay* default_display;
    GdkScreen* default_screen;
    gint primary_monitor;
    GdkRectangle dest;

    default_display = gdk_display_get_default();
    default_screen = gdk_display_get_default_screen(default_display);
    GdkCursor* cursor = gdk_cursor_new_for_display (default_display,
                                                    GDK_LEFT_PTR);
    gdk_window_set_cursor (gdk_get_default_root_window (), cursor);
    g_object_unref(cursor);
    // NOTE: width/height is total width/height of multiple-screens.
    // So, in this way, web-container window is forced to position in center
    // of all screens.
    //INSTALLER_WIN_WIDTH = gdk_screen_width();
    //INSTALLER_WIN_HEIGHT = gdk_screen_height();
    gtk_window_move(GTK_WINDOW(installer_container), 0, 0);
    gtk_window_fullscreen(GTK_WINDOW(installer_container));
    primary_monitor = gdk_screen_get_primary_monitor(default_screen);
    gdk_screen_get_monitor_geometry(default_screen, primary_monitor, &dest);
    INSTALLER_WIN_WIDTH = dest.width;
    INSTALLER_WIN_HEIGHT = dest.height;

    g_message("[%s] installer container, width: %d, height: %d\n",
              __func__, INSTALLER_WIN_WIDTH, INSTALLER_WIN_HEIGHT);
    BackgroundInfo* bg_info = create_background_info(installer_container,
                                                     child);
    background_info_set_background_by_file(bg_info, BACKGROUND);

    setup_monitor_background();
}
Пример #2
0
// object hierarchy:
//     g_vbox
//       |-- g_wlan_onoff
//       |-- g_background_idspc
//       |-- vbox
//       |     |-- g_background_onoff
//       |     |-- g_background_interval
//       |-- g_background_info
//
GtkWidget* iLiad_autoconnect_create(void)
{
    GtkWidget* vbox;

    ST_LOGPRINTF("entry");

    g_vbox = gtk_vbox_new(FALSE, BACKGROUNDSCREEN_ITEM_SPACING);

    g_wlan_onoff = create_wlan_onoff();
    gtk_box_pack_start(GTK_BOX(g_vbox), GTK_WIDGET(g_wlan_onoff), FALSE, FALSE, 0);

    g_background_idspc = create_background_idspc();
    gtk_box_pack_start(GTK_BOX(g_vbox), GTK_WIDGET(g_background_idspc), FALSE, FALSE, 0);

    vbox = gtk_vbox_new(FALSE, SETTINGITEM_ITEM_SPACING);
    gtk_box_pack_start(GTK_BOX(g_vbox), GTK_WIDGET(vbox), FALSE, FALSE, 0);
    gtk_widget_show(vbox);

    g_background_onoff = create_background_onoff();
    gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(g_background_onoff), FALSE, FALSE, 0);

    g_background_interval = create_background_interval();
    gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(g_background_interval), FALSE, FALSE, 0);

    g_background_info = create_background_info();
    gtk_box_pack_start(GTK_BOX(g_vbox), GTK_WIDGET(g_background_info), FALSE, FALSE, 0);

    gtk_widget_show(g_vbox);

    return g_vbox;
}
Пример #3
0
void fix_without_wm(GtkWidget* child)
{
    GdkCursor* cursor = gdk_cursor_new (GDK_LEFT_PTR);
    gdk_window_set_cursor (gdk_get_default_root_window (), cursor);
    g_object_unref(cursor);
    INSTALLER_WIN_WIDTH = gdk_screen_width();
    INSTALLER_WIN_HEIGHT = gdk_screen_height();
    gtk_window_move(GTK_WINDOW(installer_container), 0, 0);
    BackgroundInfo* bg_info = create_background_info(installer_container, child);
    background_info_set_background_by_file(bg_info, "/usr/share/backgrounds/default_background.jpg");
}
Пример #4
0
void setup_background(GtkWidget* container, GtkWidget* webview,
                      const char* xatom_name)
{
    _BG_ATOM = gdk_x11_get_xatom_by_name(xatom_name);

    BackgroundInfo* info = create_background_info(container, webview);
    background_info_set_background_by_drawable(info, get_blurred_background());

    //TODO:
    //we shoul use xatom_name window to set events instead of root window
    //because the monitors changed signal will came before root window rect changed
    //so the Xroot window rect maybe keep old rect in update_bg function
    gdk_window_set_events(gdk_get_default_root_window(),
                          GDK_PROPERTY_CHANGE_MASK);
    gdk_window_add_filter(gdk_get_default_root_window(),
                          (GdkFilterFunc)update_bg, info);
}