Kaydet (Commit) 16772323 authored tarafından Enrico Tröger's avatar Enrico Tröger

Improved code to avoid hiding the messages window (caused by last commit).


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1599 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 38d45d25
......@@ -3,10 +3,13 @@
* po/POTFILES.in: Add navqueue.c.
* po/intl_stats.sh: Add revision time to the output.
* src/callbacks.c, src/callbacks.h:
Removed unneeded function destroyapp.
Remove unneeded functions destroyapp and on_window_configure_event.
* src/keyfile.c, src/main.c:
Re-maximize the main window on startup when closed in maximized state
(closes #1730369).
* src/geany.h, src/keyfile.c, src/main.c:
Improved code to avoid hiding the messages window
(caused by last commit).
2007-06-04 Enrico Tröger <enrico.troeger@uvena.de>
......
......@@ -945,20 +945,6 @@ on_color_ok_button_clicked (GtkButton *button,
}
gboolean
on_window_configure_event (GtkWidget *widget,
GdkEventConfigure *event,
gpointer user_data)
{
app->geometry[0] = event->x;
app->geometry[1] = event->y;
app->geometry[2] = event->width;
app->geometry[3] = event->height;
return FALSE;
}
gboolean
on_window_key_press_event (GtkWidget *widget,
GdkEventKey *event,
......
......@@ -237,11 +237,6 @@ void
on_fullscreen1_activate (GtkMenuItem *menuitem,
gpointer user_data);
gboolean
on_window_configure_event (GtkWidget *widget,
GdkEventConfigure *event,
gpointer user_data);
void
on_show_toolbar1_toggled (GtkCheckMenuItem *checkmenuitem,
gpointer user_data);
......
......@@ -78,8 +78,8 @@ typedef struct _GeanyProject GeanyProject;
typedef struct MyApp
{
gint toolbar_icon_style;
// 0:x, 1:y, 2:width, 3:height
gint geometry[4];
// 0:x, 1:y, 2:width, 3:height, flag for maximized state
gint geometry[5];
gboolean debug_mode;
// represents the state at startup while opening session files
gboolean opening_session_files;
......
......@@ -237,15 +237,13 @@ void configuration_save()
if (app->pref_main_save_winpos && ! app->fullscreen)
{
gtk_window_get_position(GTK_WINDOW(app->window), &app->geometry[0], &app->geometry[1]);
gtk_window_get_size(GTK_WINDOW(app->window), &app->geometry[2], &app->geometry[3]);
if (gdk_window_get_state(app->window->window) & GDK_WINDOW_STATE_MAXIMIZED)
{ // use -1 for width and height if the window is maximized
app->geometry[2] = -1;
app->geometry[3] = -1;
}
app->geometry[4] = 1;
else
gtk_window_get_size(GTK_WINDOW(app->window), &app->geometry[2], &app->geometry[3]);
app->geometry[4] = 0;
g_key_file_set_integer_list(config, PACKAGE, "geometry", app->geometry, 4);
g_key_file_set_integer_list(config, PACKAGE, "geometry", app->geometry, 5);
}
g_key_file_set_integer(config, PACKAGE, "pref_editor_tab_width", editor_prefs.tab_width);
g_key_file_set_boolean(config, PACKAGE, "pref_editor_use_tabs", editor_prefs.use_tabs);
......@@ -351,7 +349,6 @@ static void load_file_lists(GKeyFile *config)
gboolean configuration_load()
{
guint geo_len;
gint *geo;
gchar *configfile = g_strconcat(app->configdir, G_DIR_SEPARATOR_S, "geany.conf", NULL);
gchar *tmp_string, *tmp_string2;
......@@ -421,7 +418,7 @@ gboolean configuration_load()
scribble_text = utils_get_setting_string(config, PACKAGE, "scribble_text",
_("Type here what you want, use it as a notice/scratch board"));
geo = g_key_file_get_integer_list(config, PACKAGE, "geometry", &geo_len, &error);
geo = g_key_file_get_integer_list(config, PACKAGE, "geometry", NULL, &error);
if (error)
{
app->geometry[0] = -1;
......@@ -434,6 +431,7 @@ gboolean configuration_load()
app->geometry[1] = geo[1];
app->geometry[2] = geo[2];
app->geometry[3] = geo[3];
app->geometry[4] = geo[4];
}
hpan_position = utils_get_setting_integer(config, PACKAGE, "treeview_position", 156);
vpan_position = utils_get_setting_integer(config, PACKAGE, "msgwindow_position", (geo) ?
......
......@@ -205,11 +205,9 @@ static void apply_settings(void)
if (app->pref_main_save_winpos && app->geometry[0] != -1)
{
gtk_window_move(GTK_WINDOW(app->window), app->geometry[0], app->geometry[1]);
if (app->geometry[2] == -1 && app->geometry[3] == -1)
gtk_window_set_default_size(GTK_WINDOW(app->window), app->geometry[2], app->geometry[3]);
if (app->geometry[4] == 1)
gtk_window_maximize(GTK_WINDOW(app->window));
else
gtk_window_set_default_size(GTK_WINDOW(app->window), app->geometry[2], app->geometry[3]);
}
// hide statusbar if desired
......@@ -679,7 +677,6 @@ gint main(gint argc, gchar **argv)
// registering some basic events
g_signal_connect(G_OBJECT(app->window), "delete_event", G_CALLBACK(on_exit_clicked), NULL);
g_signal_connect(G_OBJECT(app->window), "configure-event", G_CALLBACK(on_window_configure_event), NULL);
g_signal_connect(G_OBJECT(app->window), "key-press-event", G_CALLBACK(on_window_key_press_event), NULL);
g_signal_connect(G_OBJECT(app->toolbar), "button-press-event", G_CALLBACK(toolbar_popup_menu), NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment