lxde / lxterminal

VTE terminal emulator written in GTK
GNU General Public License v2.0
161 stars 57 forks source link

Added remembering of window size (need help) #29

Closed SauronfromMordor closed 6 years ago

SauronfromMordor commented 7 years ago

Hello LXTerminal developers! I want to make pull-request for remembering of window size for LXTerminal, but I need help. When compiling I get this one:

sauron@mordor:~/lxterminal$ make make all-recursive make[1]: entering directory «/home/maxpayne/lxterminal» Making all in src make[2]: entering directory «/home/maxpayne/lxterminal/src» CC lxterminal-setting.o In file included from /usr/include/glib-2.0/gobject/gobject.h:24:0, from /usr/include/glib-2.0/gobject/gbinding.h:29, from /usr/include/glib-2.0/glib-object.h:23, from /usr/include/glib-2.0/gio/gioenums.h:28, from /usr/include/glib-2.0/gio/giotypes.h:28, from /usr/include/glib-2.0/gio/gio.h:26, from /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30, from /usr/include/gtk-2.0/gdk/gdk.h:32, from /usr/include/gtk-2.0/gtk/gtk.h:32, from setting.c:22: setting.c: In function ‘save_setting’: setting.c:169:36: error: ‘terminal’ undeclared (first use in this function) gtk_window_get_size(GTK_WINDOW(terminal->window), &setting->width, &setting->height); ^ /usr/include/glib-2.0/gobject/gtype.h:2207:57: note: in definition of macro ‘_G_TYPE_CIC’ ((ct) g_type_check_instance_cast ((GTypeInstance) ip, gt)) ^ /usr/include/gtk-2.0/gtk/gtkwindow.h:42:28: note: in expansion of macro ‘G_TYPE_CHECK_INSTANCE_CAST’

define GTK_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_WINDOW, GtkWindow))

^ setting.c:169:25: note: in expansion of macro ‘GTK_WINDOW’ gtk_window_get_size(GTK_WINDOW(terminal->window), &setting->width, &setting->height); ^ setting.c:169:36: note: each undeclared identifier is reported only once for each function it appears in gtk_window_get_size(GTK_WINDOW(terminal->window), &setting->width, &setting->height); ^ /usr/include/glib-2.0/gobject/gtype.h:2207:57: note: in definition of macro ‘_G_TYPE_CIC’ ((ct) g_type_check_instance_cast ((GTypeInstance) ip, gt)) ^ /usr/include/gtk-2.0/gtk/gtkwindow.h:42:28: note: in expansion of macro ‘G_TYPE_CHECK_INSTANCE_CAST’

define GTK_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_WINDOW, GtkWindow))

^ setting.c:169:25: note: in expansion of macro ‘GTK_WINDOW’ gtk_window_get_size(GTK_WINDOW(terminal->window), &setting->width, &setting->height); ^ Makefile:447: recipe for target «lxterminal-setting.o» failed make[2]: [lxterminal-setting.o] Error 1 make[2]: leaving directory «/home/maxpayne/lxterminal/src» Makefile:400: recipe for target «all-recursive» failed make[1]: [all-recursive] Error 1 make[1]: leaving directory «/home/maxpayne/lxterminal» Makefile:341: recipe for target «all» failed make: *** [all] Error 2

I am not programmer at all, so please, help me to fix it.

SauronfromMordor commented 7 years ago

OK, thanks for this very detailed answer. By the way, you told about the feature "Default window size". So, could you make a feature for maximized/unmaximized terminal window along with it? It's not comfortable to maximize the window every time after start.

medicalwei commented 7 years ago

Konsole also have the feature to maximize the window on launch. But since we are close to release a new version the new feature could be done in the next major release. Or, if you want to do it by yourself:

  1. Add a toggle in preference window using glide 2.x (there's a glide file for preferences GUI).
  2. Modify preferences.c to control the toggle and if checked, disable the default size adjustment.
  3. Modify settings.c to read/write the new configuration.
  4. Modify lxterminal.c to implement maximization when a new terminal window is created, according to the configuration.