gtk_tree_view_column_set_sizing(column,GTK_TREE_VIEW_COLUMN_FIXED);
gtk_tree_view_column_set_fixed_width(column,
- uinfo->win_width-
+ uinfo->size_hints.base_width-
(GetLengthRipWidth(ginfo)+15));
gtk_tree_view_append_column(GTK_TREE_VIEW(uinfo->track_list),column);
WINWIDTH,WINHEIGHT);
gtk_window_resize(GTK_WINDOW(uinfo->app),
- uinfo->win_width,
- uinfo->win_height);
+ uinfo->size_hints.base_width,
+ uinfo->size_hints.base_height);
}
else {
gtk_container_border_width(GTK_CONTAINER(uinfo->winbox),0);
MIN_WINWIDTH,MIN_WINHEIGHT);
gtk_window_resize(GTK_WINDOW(uinfo->app),
- uinfo->win_width_min,
- uinfo->win_height_min);
+ uinfo->size_hints.min_width,
+ uinfo->size_hints.min_height);
UpdateGTK();
}
if(!uinfo->minimized) {
if(uinfo->track_edit_visible) {
- gtk_window_get_size(GTK_WINDOW(uinfo->app),&uinfo->win_width,
+ gtk_window_get_size(GTK_WINDOW(uinfo->app),&uinfo->size_hints.base_width,
&uinfo->win_height_edit);
}
else
- gtk_window_get_size(GTK_WINDOW(uinfo->app),&uinfo->win_width,
- &uinfo->win_height);
+ gtk_window_get_size(GTK_WINDOW(uinfo->app),&uinfo->size_hints.base_width,
+ &uinfo->size_hints.base_height);
if(old_width &&
(old_width != uinfo->track_list->allocation.width)) {
old_width=uinfo->track_list->allocation.width;
}
else {
- gtk_window_get_size(GTK_WINDOW(uinfo->app),&uinfo->win_width_min,
- &uinfo->win_height_min);
+ gtk_window_get_size(GTK_WINDOW(uinfo->app),&uinfo->size_hints.min_width,
+ &uinfo->size_hints.min_height);
}
if(!ginfo->looking_up) {
{"selected_ripper",CFG_ENTRY_INT,0,&ginfo->selected_ripper},\
{"play_mode",CFG_ENTRY_INT,0,&ginfo->play_mode},\
{"playloop",CFG_ENTRY_BOOL,0,&ginfo->playloop},\
-{"win_width",CFG_ENTRY_INT,0,&uinfo->win_width},\
-{"win_height",CFG_ENTRY_INT,0,&uinfo->win_height},\
+{"win_width",CFG_ENTRY_INT,0,&uinfo->size_hints.base_width},\
+{"win_height",CFG_ENTRY_INT,0,&uinfo->size_hints.base_height},\
{"win_height_edit",CFG_ENTRY_INT,0,&uinfo->win_height_edit},\
-{"win_width_min",CFG_ENTRY_INT,0,&uinfo->win_width_min},\
-{"win_height_min",CFG_ENTRY_INT,0,&uinfo->win_height_min},\
+{"win_width_min",CFG_ENTRY_INT,0,&uinfo->size_hints.min_width},\
+{"win_height_min",CFG_ENTRY_INT,0,&uinfo->size_hints.min_height},\
{"win_pos_x",CFG_ENTRY_INT,0,&uinfo->x},\
{"win_pos_y",CFG_ENTRY_INT,0,&uinfo->y},\
{"vol_vis",CFG_ENTRY_BOOL,0,&uinfo->volvis},\
GripInfo *ginfo = (GripInfo*)data;
GripGUI *uinfo = &(ginfo->gui_info);
GdkWindowState state = event->new_window_state;
-
+
if ((state & GDK_WINDOW_STATE_WITHDRAWN) || (state & GDK_WINDOW_STATE_ICONIFIED)) {
ginfo->app_visible = FALSE;
return TRUE;
uinfo->encode_status_window=NULL;
uinfo->track_list=NULL;
- uinfo->win_width=WINWIDTH;
- uinfo->win_height=WINHEIGHT;
+ /* Size hints */
+ uinfo->size_hints.min_width = MIN_WINWIDTH;
+ uinfo->size_hints.min_height = MIN_WINHEIGHT;
+ uinfo->size_hints.base_width = WINWIDTH;
+ uinfo->size_hints.base_height = WINHEIGHT;
+ uinfo->size_hints.width_inc = 10;
+ uinfo->size_hints.height_inc = 10;
+
uinfo->win_height_edit=WINHEIGHTEDIT;
- uinfo->win_width_min=MIN_WINWIDTH;
- uinfo->win_height_min=MIN_WINHEIGHT;
-
- /* if(geometry != NULL) {
- gint x,y,w,h;
-
- if(gnome_parse_geometry(geometry,
- &x,&y,&w,&h)) {
- if(x != -1) {
- gtk_widget_set_uposition(app,x,y);
- }
-
- if(w != -1) {
- uinfo->win_width=w;
- uinfo->win_height=h;
- }
- }
- else {
- g_error(_("Could not parse geometry string `%s'"), geometry);
+
+ gtk_window_set_geometry_hints(GTK_WINDOW(app), app,
+ &uinfo->size_hints,
+ GDK_HINT_MIN_SIZE |
+ GDK_HINT_BASE_SIZE |
+ GDK_HINT_RESIZE_INC);
+
+ if(geometry != NULL) {
+ /*
+ If either a size or a position can be extracted from the geometry string,
+ gtk-window-parse-geometry returns â#tâ and calls
+ gtk-window-set-default-size and/or gtk-window-move to resize/move the
+ window.
+ */
+ if (!gtk_window_parse_geometry(GTK_WINDOW(app), geometry)) {
+ fprintf (stderr, "Failed to parse geometry string '%s'\n", geometry);
+ } else {
+ /* For saving the position */
+ gtk_window_get_position(GTK_WINDOW(uinfo->app), &uinfo->x, &uinfo->y);
}
}
- */
+
+ Debug("X = %d\n", uinfo->x);
+ Debug("Y = %d\n", uinfo->y);
if(config_filename && *config_filename)
g_snprintf(ginfo->config_filename,256,"%s",config_filename);
gtk_widget_set_size_request(GTK_WIDGET(app),MIN_WINWIDTH,
MIN_WINHEIGHT);
- gtk_window_resize(GTK_WINDOW(app),uinfo->win_width_min,
- uinfo->win_height_min);
+ gtk_window_resize(GTK_WINDOW(app),uinfo->size_hints.min_width,
+ uinfo->size_hints.min_height);
}
else {
gtk_widget_set_size_request(GTK_WIDGET(app),WINWIDTH,
WINHEIGHT);
if(uinfo->track_edit_visible) {
- gtk_window_resize(GTK_WINDOW(app),uinfo->win_width,
+ gtk_window_resize(GTK_WINDOW(app),uinfo->size_hints.base_width,
uinfo->win_height_edit);
}
else {
- gtk_window_resize(GTK_WINDOW(app),uinfo->win_width,
- uinfo->win_height);
+ gtk_window_resize(GTK_WINDOW(app),uinfo->size_hints.base_width,
+ uinfo->size_hints.base_height);
}
}
+ Debug("X = %d\n", uinfo->x);
+ Debug("Y = %d\n", uinfo->y);
+ gtk_window_move(GTK_WINDOW(app), uinfo->x, uinfo->y);
+
/* Position window from values in config file. */
gtk_window_move(GTK_WINDOW(app),uinfo->x, uinfo->y);