static gint luaH_window_unmaximize(lua_State *L) { widget_t *w = luaH_checkwidget(L, 1); gtk_window_unmaximize(GTK_WINDOW(w->widget)); return 0; }
void wxTopLevelWindowGTK::Maximize(bool maximize) { if (maximize) gtk_window_maximize( GTK_WINDOW( m_widget ) ); else gtk_window_unmaximize( GTK_WINDOW( m_widget ) ); }
static void open_window (NautilusApplication *application, GFile *location, GdkScreen *screen, const char *geometry) { NautilusWindow *window; nautilus_profile_start (NULL); window = nautilus_application_create_window (application, screen); if (location != NULL) { nautilus_window_go_to (window, location); } else { nautilus_window_slot_go_home (nautilus_window_get_active_slot (window), 0); } if (geometry != NULL && !gtk_widget_get_visible (GTK_WIDGET (window))) { /* never maximize windows opened from shell if a * custom geometry has been requested. */ gtk_window_unmaximize (GTK_WINDOW (window)); eel_gtk_window_set_initial_geometry_from_string (GTK_WINDOW (window), geometry, APPLICATION_WINDOW_MIN_WIDTH, APPLICATION_WINDOW_MIN_HEIGHT, FALSE); } nautilus_profile_end (NULL); }
static void open_window (NemoMainApplication *application, GFile *location, GdkScreen *screen, const char *geometry) { NemoWindow *window; gchar *uri; gboolean have_geometry; uri = g_file_get_uri (location); DEBUG ("Opening new window at uri %s", uri); window = nemo_main_application_create_window (application, screen); nemo_window_go_to (window, location); have_geometry = geometry != NULL && strcmp(geometry, "") != 0; if (have_geometry && !gtk_widget_get_visible (GTK_WIDGET (window))) { /* never maximize windows opened from shell if a * custom geometry has been requested. */ gtk_window_unmaximize (GTK_WINDOW (window)); eel_gtk_window_set_initial_geometry_from_string (GTK_WINDOW (window), geometry, APPLICATION_WINDOW_MIN_WIDTH, APPLICATION_WINDOW_MIN_HEIGHT, FALSE); } g_free (uri); }
void preview_set_render_size(signal_user_data_t *ud, int width, int height) { GtkWidget * widget; GtkWindow * window; GdkWindow * w; GdkGeometry geo; widget = GHB_WIDGET (ud->builder, "preview_image"); gtk_widget_set_size_request(widget, width, height); window = GTK_WINDOW(GHB_WIDGET(ud->builder, "preview_window")); gtk_window_unmaximize(window); gtk_window_resize(window, width, height); w = gtk_widget_get_window(GTK_WIDGET(window)); if (w != NULL) { geo.min_aspect = (double)(width - 4) / height; geo.max_aspect = (double)(width + 4) / height; geo.width_inc = geo.height_inc = 2; gdk_window_set_geometry_hints(w, &geo, GDK_HINT_ASPECT|GDK_HINT_RESIZE_INC); } ud->preview->render_width = width; ud->preview->render_height = height; }
gboolean af_window_restore() { if (!af_window_get_visible()) return FALSE; GtkWidget *window = global_get("window"); switch(af_window_get_state()){ case GDK_WINDOW_STATE_WITHDRAWN: af_window_set_visible(TRUE); break; case GDK_WINDOW_STATE_ICONIFIED: gtk_window_deiconify(GTK_WINDOW(window)); break; case GDK_WINDOW_STATE_MAXIMIZED: gtk_window_unmaximize(GTK_WINDOW(window)); break; case GDK_WINDOW_STATE_STICKY: gtk_window_unstick(GTK_WINDOW(window)); break; case GDK_WINDOW_STATE_FULLSCREEN: af_window_set_fullscreen(FALSE); break; case GDK_WINDOW_STATE_ABOVE: af_window_set_above(FALSE); break; case GDK_WINDOW_STATE_BELOW: af_window_set_below(FALSE); break; default: return FALSE; } return TRUE; }
static void geometry_load (GtkWindow *window) { GSettings *ui_settings; gboolean maximized; gint x, y, w, h; ui_settings = g_object_get_data (G_OBJECT (window), GEOMETRY_DATA_NAME); maximized = g_settings_get_boolean (ui_settings, TWITUX_UI_WINDOW_MAXIMISED); x = g_settings_get_int (ui_settings, TWITUX_UI_WINDOW_X_POS); y = g_settings_get_int (ui_settings, TWITUX_UI_WINDOW_Y_POS); w = g_settings_get_int (ui_settings, TWITUX_UI_WINDOW_WIDTH); h = g_settings_get_int (ui_settings, TWITUX_UI_WINDOW_HEIGHT); if ((x > 0) || (y > 0)){ gtk_window_move (window, x, y); } if ((w > 0) && (h > 0)){ gtk_window_resize (window, w, h); } if (maximized) { gtk_window_maximize (window); } else { gtk_window_unmaximize (window); } }
static void update_small_screen_settings (GnomeControlCenter *self) { CcSmallScreen small; update_monitor_number (self); small = is_small (self); if (small == SMALL_SCREEN_TRUE) { gtk_window_set_resizable (GTK_WINDOW (self->priv->window), TRUE); if (self->priv->small_screen != small) gtk_window_maximize (GTK_WINDOW (self->priv->window)); } else { if (self->priv->small_screen != small) gtk_window_unmaximize (GTK_WINDOW (self->priv->window)); gtk_window_set_resizable (GTK_WINDOW (self->priv->window), FALSE); } self->priv->small_screen = small; /* And update the minimum sizes */ notebook_page_notify_cb (GTK_NOTEBOOK (self->priv->notebook), NULL, self->priv); }
void Restore(CefWindowHandle handle) { GtkWindow* window = GetWindow(handle); if (IsMaximized(window)) gtk_window_unmaximize(window); else gtk_window_present(window); }
int dt_control_load_config(dt_control_t *c) { GtkWidget *widget = dt_ui_main_window(darktable.gui->ui); dt_conf_set_int("ui_last/view", DT_MODE_NONE); int width = dt_conf_get_int("ui_last/window_w"); int height = dt_conf_get_int("ui_last/window_h"); #ifndef __WIN32__ gint x = dt_conf_get_int("ui_last/window_x"); gint y = dt_conf_get_int("ui_last/window_y"); gtk_window_move(GTK_WINDOW(widget), x, y); #endif gtk_window_resize(GTK_WINDOW(widget), width, height); int fullscreen = dt_conf_get_bool("ui_last/fullscreen"); if(fullscreen) gtk_window_fullscreen(GTK_WINDOW(widget)); else { gtk_window_unfullscreen(GTK_WINDOW(widget)); int maximized = dt_conf_get_bool("ui_last/maximized"); if(maximized) gtk_window_maximize(GTK_WINDOW(widget)); else gtk_window_unmaximize(GTK_WINDOW(widget)); } return 0; }
void Minimize(CefWindowHandle handle) { GtkWindow* window = GetWindow(handle); // Unmaximize the window before minimizing so restore behaves correctly. if (IsMaximized(window)) gtk_window_unmaximize(window); gtk_window_iconify(window); }
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkFramePeer_unmaximize (JNIEnv *env, jobject obj) { void *ptr; gdk_threads_enter (); ptr = gtkpeer_get_widget (env, obj); gtk_window_unmaximize (GTK_WINDOW (ptr)); gdk_threads_leave (); }
/** * gedit_app_create_window: * @app: the #GeditApp * @screen: (allow-none): * * Create a new #GeditWindow part of @app. * * Return value: (transfer none): the new #GeditWindow */ GeditWindow * gedit_app_create_window (GeditApp *app, GdkScreen *screen) { GeditAppPrivate *priv; GeditWindow *window; gchar *role; GdkWindowState state; gint w, h; gedit_debug (DEBUG_APP); priv = gedit_app_get_instance_private (app); window = GEDIT_APP_GET_CLASS (app)->create_window (app); if (screen != NULL) { gtk_window_set_screen (GTK_WINDOW (window), screen); } role = gen_role (); gtk_window_set_role (GTK_WINDOW (window), role); g_free (role); state = g_settings_get_int (priv->window_settings, GEDIT_SETTINGS_WINDOW_STATE); g_settings_get (priv->window_settings, GEDIT_SETTINGS_WINDOW_SIZE, "(ii)", &w, &h); gtk_window_set_default_size (GTK_WINDOW (window), w, h); if ((state & GDK_WINDOW_STATE_MAXIMIZED) != 0) { gtk_window_maximize (GTK_WINDOW (window)); } else { gtk_window_unmaximize (GTK_WINDOW (window)); } if ((state & GDK_WINDOW_STATE_STICKY ) != 0) { gtk_window_stick (GTK_WINDOW (window)); } else { gtk_window_unstick (GTK_WINDOW (window)); } return window; }
void gMainWindow::setMaximized(bool vl) { if (!isTopLevel()) return; _maximized = vl; if (vl) gtk_window_maximize(GTK_WINDOW(border)); else gtk_window_unmaximize(GTK_WINDOW(border)); }
JNIEXPORT void JNICALL Java_org_gnome_gtk_GtkWindow_gtk_1window_1unmaximize ( JNIEnv* env, jclass cls, jlong _self ) { GtkWindow* self; // convert parameter self self = (GtkWindow*) _self; // call function gtk_window_unmaximize(self); // cleanup parameter self }
/* * Restore the window position from the values saved into gconf. Note * that this does not display/present/show the mainwindow. */ static void liferea_shell_restore_position (void) { /* load window position */ int x, y, w, h; gboolean last_window_maximized; conf_get_int_value (LAST_WINDOW_X, &x); conf_get_int_value (LAST_WINDOW_Y, &y); conf_get_int_value (LAST_WINDOW_WIDTH, &w); conf_get_int_value (LAST_WINDOW_HEIGHT, &h); debug4 (DEBUG_GUI, "Retrieved saved setting: size %dx%d position %d:%d", w, h, x, y); /* Restore position only if the width and height were saved */ if (w != 0 && h != 0) { if (x >= gdk_screen_width ()) x = gdk_screen_width () - 100; else if (x + w < 0) x = 100; if (y >= gdk_screen_height ()) y = gdk_screen_height () - 100; else if (y + w < 0) y = 100; debug4 (DEBUG_GUI, "Restoring to size %dx%d position %d:%d", w, h, x, y); gtk_window_move (GTK_WINDOW (shell->priv->window), x, y); /* load window size */ gtk_window_resize (GTK_WINDOW (shell->priv->window), w, h); } conf_get_bool_value (LAST_WINDOW_MAXIMIZED, &last_window_maximized); if (last_window_maximized) gtk_window_maximize (GTK_WINDOW (shell->priv->window)); else gtk_window_unmaximize (GTK_WINDOW (shell->priv->window)); }
static NemoWindow * nemo_main_application_create_window (NemoApplication *application, GdkScreen *screen) { NemoWindow *window; char *geometry_string; gboolean maximized; g_return_val_if_fail (NEMO_IS_APPLICATION (application), NULL); window = nemo_window_new (GTK_APPLICATION (application), screen); maximized = g_settings_get_boolean (nemo_window_state, NEMO_WINDOW_STATE_MAXIMIZED); if (maximized) { gtk_window_maximize (GTK_WINDOW (window)); } else { gtk_window_unmaximize (GTK_WINDOW (window)); } geometry_string = g_settings_get_string (nemo_window_state, NEMO_WINDOW_STATE_GEOMETRY); if (geometry_string != NULL && geometry_string[0] != 0) { /* Ignore saved window position if a window with the same * location is already showing. That way the two windows * wont appear at the exact same location on the screen. */ eel_gtk_window_set_initial_geometry_from_string (GTK_WINDOW (window), geometry_string, NEMO_WINDOW_MIN_WIDTH, NEMO_WINDOW_MIN_HEIGHT, TRUE); } g_free (geometry_string); nemo_undo_manager_attach (application->undo_manager, G_OBJECT (window)); DEBUG ("Creating a new navigation window"); return window; }
NautilusWindow * nautilus_application_create_window (NautilusApplication *application, GdkScreen *screen) { NautilusWindow *window; char *geometry_string; gboolean maximized; g_return_val_if_fail (NAUTILUS_IS_APPLICATION (application), NULL); nautilus_profile_start (NULL); window = nautilus_window_new (screen); maximized = g_settings_get_boolean (nautilus_window_state, NAUTILUS_WINDOW_STATE_MAXIMIZED); if (maximized) { gtk_window_maximize (GTK_WINDOW (window)); } else { gtk_window_unmaximize (GTK_WINDOW (window)); } geometry_string = g_settings_get_string (nautilus_window_state, NAUTILUS_WINDOW_STATE_GEOMETRY); if (geometry_string != NULL && geometry_string[0] != 0) { /* Ignore saved window position if a window with the same * location is already showing. That way the two windows * wont appear at the exact same location on the screen. */ eel_gtk_window_set_initial_geometry_from_string (GTK_WINDOW (window), geometry_string, NAUTILUS_WINDOW_MIN_WIDTH, NAUTILUS_WINDOW_MIN_HEIGHT, another_navigation_window_already_showing (application, window)); } g_free (geometry_string); DEBUG ("Creating a new navigation window"); nautilus_profile_end (NULL); return window; }
void SetPos(CefWindowHandle handle, int x, int y, int width, int height) { GtkWindow* window = GetWindow(handle); GdkWindow* gdk_window = gtk_widget_get_window(GTK_WIDGET(window)); // Make sure the window isn't minimized or maximized. if (IsMaximized(window)) gtk_window_unmaximize(window); else gtk_window_present(window); // Retrieve information about the display that contains the window. GdkScreen* screen = gdk_screen_get_default(); gint monitor = gdk_screen_get_monitor_at_window(screen, gdk_window); GdkRectangle rect; gdk_screen_get_monitor_geometry(screen, monitor, &rect); // Make sure the window is inside the display. CefRect display_rect(rect.x, rect.y, rect.width, rect.height); CefRect window_rect(x, y, width, height); ModifyBounds(display_rect, window_rect); gdk_window_move_resize(gdk_window, window_rect.x, window_rect.y, window_rect.width, window_rect.height); }
static void on_session_load (AnjutaShell *shell, AnjutaSessionPhase phase, AnjutaSession *session, AnjutaWindow *win) { if (phase == ANJUTA_SESSION_PHASE_START) { AnjutaApplication *app; app = ANJUTA_APPLICATION (gtk_window_get_application (GTK_WINDOW (win))); if (app != NULL) { if (anjuta_application_get_no_session (app)) { /* Clear session */ anjuta_session_clear (session); } else if (anjuta_application_get_no_files (app)) { /* Clear files from session */ anjuta_session_set_string_list (session, "File Loader", "Files", NULL); } if (anjuta_application_get_geometry (app)) { /* Set new geometry */ anjuta_session_set_string (session, "Anjuta", "Geometry", anjuta_application_get_geometry (app)); } } } /* We load layout at last so that all plugins would have loaded by now */ if (phase == ANJUTA_SESSION_PHASE_LAST) { gchar *geometry; gchar *layout_file; /* Restore geometry */ geometry = anjuta_session_get_string (session, "Anjuta", "Geometry"); anjuta_window_set_geometry (win, geometry); g_free (geometry); /* Restore window state */ if (anjuta_session_get_int (session, "Anjuta", "Fullscreen")) { /* bug #304495 */ AnjutaUI* ui = anjuta_shell_get_ui(shell, NULL); GtkAction* action = anjuta_ui_get_action (ui, "ActionGroupToggleView", "ActionViewFullscreen"); gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), TRUE); gtk_window_fullscreen (GTK_WINDOW (shell)); } else if (anjuta_session_get_int (session, "Anjuta", "Maximized")) { gtk_window_maximize (GTK_WINDOW (shell)); } else { gtk_window_unmaximize (GTK_WINDOW (shell)); } gtk_widget_show (GTK_WIDGET (win)); /* Restore layout */ layout_file = g_build_filename (anjuta_session_get_session_directory (session), "dock-layout.xml", NULL); anjuta_window_layout_load (win, layout_file, NULL); g_free (layout_file); } }
int iupdrvDialogSetPlacement(Ihandle* ih) { char* placement; int old_state = ih->data->show_state; ih->data->show_state = IUP_SHOW; if (iupAttribGetBoolean(ih, "FULLSCREEN")) { gtk_window_fullscreen((GtkWindow*)ih->handle); return 1; } placement = iupAttribGet(ih, "PLACEMENT"); if (!placement) { if (old_state == IUP_MAXIMIZE || old_state == IUP_MINIMIZE) ih->data->show_state = IUP_RESTORE; gtk_window_unmaximize((GtkWindow*)ih->handle); gtk_window_deiconify((GtkWindow*)ih->handle); return 0; } if (iupStrEqualNoCase(placement, "MINIMIZED")) { ih->data->show_state = IUP_MINIMIZE; gtk_window_iconify((GtkWindow*)ih->handle); } else if (iupStrEqualNoCase(placement, "MAXIMIZED")) { ih->data->show_state = IUP_MAXIMIZE; gtk_window_maximize((GtkWindow*)ih->handle); } else if (iupStrEqualNoCase(placement, "FULL")) { int width, height, x, y; int border, caption, menu; iupdrvDialogGetDecoration(ih, &border, &caption, &menu); /* position the decoration outside the screen */ x = -(border); y = -(border+caption+menu); /* the dialog client area will cover the task bar */ iupdrvGetFullSize(&width, &height); height += menu; /* menu is inside the client area. */ /* set the new size and position */ /* The resize evt will update the layout */ gtk_window_move((GtkWindow*)ih->handle, x, y); gtk_window_resize((GtkWindow*)ih->handle, width, height); if (old_state == IUP_MAXIMIZE || old_state == IUP_MINIMIZE) ih->data->show_state = IUP_RESTORE; } iupAttribSetStr(ih, "PLACEMENT", NULL); /* reset to NORMAL */ return 1; }
void unmaximize() { gtk_window_unmaximize(GTK_WINDOW(window)); gtk_window_unfullscreen(GTK_WINDOW(window)); gtk_window_set_decorated(GTK_WINDOW(window), TRUE); gtk_window_resize(GTK_WINDOW(window), 1280, 768); }
MainWindow::MainWindow(GladeSearchpath * gladeSearchPath, Control * control) : GladeGui(gladeSearchPath, "main.glade", "mainWindow") { XOJ_INIT_TYPE(MainWindow); this->control = control; this->toolbarIntialized = false; this->toolbarGroup = NULL; this->selectedToolbar = NULL; this->toolbarWidgets = new GtkWidget*[TOOLBAR_DEFINITIONS_LEN]; for (int i = 0; i < TOOLBAR_DEFINITIONS_LEN; i++) { GtkWidget * w = get(TOOLBAR_DEFINITIONS[i].guiName); g_object_ref(w); this->toolbarWidgets[i] = w; } this->maximized = false; this->toolbarMenuData = NULL; this->toolbarMenuitems = NULL; GtkWidget * tableXournal = get("tableXournal"); this->xournal = new XournalView(tableXournal, control); ScrollbarHideType type = control->getSettings()->getScrollbarHideType(); if (type == SCROLLBAR_HIDE_NONE || type == SCROLLBAR_HIDE_VERTICAL) { Layout * layout = gtk_xournal_get_layout(this->xournal->getWidget()); gtk_table_attach(GTK_TABLE(tableXournal), layout->getScrollbarHorizontal(), 1, 2, 1, 2, (GtkAttachOptions)( GTK_EXPAND | GTK_FILL), GTK_FILL, 0, 0); } setSidebarVisible(control->getSettings()->isSidebarVisible()); // Window handler g_signal_connect(this->window, "delete-event", (GCallback) & deleteEventCallback, this->control); g_signal_connect(this->window, "window_state_event", G_CALLBACK(&windowStateEventCallback), this); g_signal_connect(get("buttonCloseSidebar"), "clicked", G_CALLBACK(buttonCloseSidebarClicked), this); this->toolbar = new ToolMenuHandler(this->control, this->control->getZoomControl(), this, this->control->getToolHandler(), GTK_WINDOW(getWindow())); char * file = gladeSearchPath->findFile(NULL, "toolbar.ini"); ToolbarModel * tbModel = this->toolbar->getModel(); if (!tbModel->parse(file, true)) { GtkWidget* dlg = gtk_message_dialog_new(GTK_WINDOW(this->window), GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, _("Could not parse general toolbar.ini file: %s\nNo Toolbars will be available"), file); gtk_window_set_transient_for(GTK_WINDOW(dlg), GTK_WINDOW(getWindow())); gtk_dialog_run(GTK_DIALOG(dlg)); gtk_widget_hide(dlg); gtk_widget_destroy(dlg); } g_free(file); file = g_build_filename(g_get_home_dir(), G_DIR_SEPARATOR_S, CONFIG_DIR, G_DIR_SEPARATOR_S, TOOLBAR_CONFIG, NULL); if (g_file_test(file, G_FILE_TEST_EXISTS)) { if (!tbModel->parse(file, false)) { GtkWidget* dlg = gtk_message_dialog_new(GTK_WINDOW(this->window), GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, _("Could not parse custom toolbar.ini file: %s\nToolbars will not be available"), file); gtk_window_set_transient_for(GTK_WINDOW(dlg), GTK_WINDOW(this->control->getWindow()->getWindow())); gtk_dialog_run(GTK_DIALOG(dlg)); gtk_widget_hide(dlg); gtk_widget_destroy(dlg); } } g_free(file); initToolbarAndMenu(); GtkWidget * menuViewSidebarVisible = get("menuViewSidebarVisible"); g_signal_connect(menuViewSidebarVisible, "toggled", (GCallback) viewShowSidebar, this); updateScrollbarSidebarPosition(); gtk_window_set_default_size(GTK_WINDOW(this->window), control->getSettings()->getMainWndWidth(), control->getSettings()->getMainWndHeight()); if (control->getSettings()->isMainWndMaximized()) { gtk_window_maximize(GTK_WINDOW(this->window)); } else { gtk_window_unmaximize(GTK_WINDOW(this->window)); } getSpinPageNo()->addListener(this->control->getScrollHandler()); // Drag and Drop g_signal_connect(this->window, "drag-data-received", G_CALLBACK(dragDataRecived), this); gtk_drag_dest_set(this->window, GTK_DEST_DEFAULT_ALL, NULL, 0, GDK_ACTION_COPY); gtk_drag_dest_add_uri_targets(this->window); gtk_drag_dest_add_image_targets(this->window); gtk_drag_dest_add_text_targets(this->window); }