[gnotepad-users] new user questions/suggestions
Brought to you by:
ackahn
From: Stephen I. <S....@ed...> - 2001-08-24 11:56:07
|
Hello, I've only recently started looking into gnp while trying to create a mouse-friendly linux environment for a refugee from Windows. I like it. I may start using it myself. One thing that isn't behaving the way I'd expect is the saving of screen position. Maybe I'm misunderstanding something. 1. If I click the "Save window position on exit" box in preferences->window, gnp always starts up a bit lower on the screen than the position it was in when I last exited. So if I open and close it several times in succession, without moving the window while it is open, it gradually creeps downward. I've never programmed gtk before, but from groping around in the documentation, it looks as if this behaviour is caused by getting the saved coordinates from a call to gdk_window_get_position, and then giving them to gtk_widget_set_uposition when gnp restarts. gdk_window_get_position seems to get the upper left corner of the gnp screen itself, ignoring the window manager's title bar at the top, while gtk_widget_set_uposition puts the upper left corner of the window manager's frame at the coordinates it is given. I tried replacing the call to gdk_window_get_position in win.c with one to gdk_window_get_root_origin, and the creeping stopped. Is that a reasonable move, or will I have broken something else? Here's the patch: *** win.c Wed Dec 13 18:23:08 2000 --- win.c.new Thu Aug 23 13:46:17 2001 *************** *** 1044,1048 **** /* update preferences */ if (IS_SAVE_WIN_POS()) { ! gdk_window_get_position(w->toplev->window, &prefs.win_xpos, &prefs.win_ypos); GNPDBG_WIN(("win_close_common: xpos = %d, ypos = %d\n", --- 1044,1048 ---- /* update preferences */ if (IS_SAVE_WIN_POS()) { ! gdk_window_get_root_origin(w->toplev->window, &prefs.win_xpos, &prefs.win_ypos); GNPDBG_WIN(("win_close_common: xpos = %d, ypos = %d\n", 2. I can't find preferences settings that will let me choose coordinates that I like and have gnp start there every time, regardless of whether the window gets moved around during a session. The reason seems to be that the default coordinates only get consulted if "Save window position on exit" is in force. Shouldn't the test for whether to call gtk_widget_set_uposition in win.c be something on the lines of whether either default coordinate is set to -1, rather than IS_SAVE_WIN_POS()? While I'm writing, there are a couple of standard unix features that look to me (in my ignorance) as if they wouldn't be very hard to incorporate, nor create much bloat. One would be to read from standard input if the input file is specified as '-' on the command line, and the other would be to let the user specify an alternative preferences file. I want to use gnp as a viewer for some program output, and want fewer buttons, tabs, etc. in this context than when I'm using it as a general purpose editor. If these features are already present and I've missed them, then I'm ashamed of myself and please tell me how to invoke them. Thanks, Stephen Isard |