After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 84986 - gedit not fully session aware
gedit not fully session aware
Status: VERIFIED DUPLICATE of bug 90133
Product: gedit
Classification: Applications
Component: general
git master
Other Solaris
: High major
: ---
Assigned To: Federico Mena Quintero
gedit QA volunteers
Depends on:
Blocks:
 
 
Reported: 2002-06-12 09:25 UTC by Shane O'Connor
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch with proposed fix. (10.07 KB, patch)
2002-06-17 19:53 UTC, Federico Mena Quintero
none Details | Review
xprop output before opening file in gedit or saving gnome session - gedit is in workspace2 (21.17 KB, text/plain)
2002-08-02 09:46 UTC, Shane O'Connor
  Details
xprop output after opening file in gedit and before saving gnome session (21.54 KB, text/plain)
2002-08-02 09:47 UTC, Shane O'Connor
  Details
xprop output after logging out, saving session and logging back in - gedit has moved from workspace2 to workspace1 (21.54 KB, text/plain)
2002-08-02 09:48 UTC, Shane O'Connor
  Details
gedit session file (325 bytes, text/plain)
2002-08-02 09:49 UTC, Shane O'Connor
  Details
I've recreated the problem and am attaching the metacity session file. (947 bytes, text/plain)
2002-08-06 13:30 UTC, Shane O'Connor
  Details

Description Shane O'Connor 2002-06-12 09:25:06 UTC
testing on ultra 10 with solaris 8

I started gnome-session and opened the following apps in the following
       workspaces:

       workspace       app
       --------        -----
       1               gnome-calculator
       2               gedit
       3               eye of gnome

       When I logged out and in gedit had moved
       from workspace2 to workspace1.
Comment 1 Damon Chaplin 2002-06-13 20:49:04 UTC
That is a window manager issue, isn't it?
The window manager stores window positions and sizes, not the app.
The app just needs to identify its windows.

(If I'm wrong, let me know, as Glade is broken as well then!)
Comment 2 Federico Mena Quintero 2002-06-13 23:47:44 UTC
It's a GEdit bug.  It does not restore its window roles correctly.  It
should be using the same roles as it saved for the session.
Comment 3 Paolo Maggi 2002-06-14 08:13:37 UTC
Federico: are you sure? I should have fixed the role problem 2 or 3
weeks ago.
I'm not sure, but the problem could be cause by a call to
gtk_window_present. We only need to find it.
Comment 4 Federico Mena Quintero 2002-06-17 16:18:58 UTC
OK, the problem is as follows.

When bonobo-mdi-session restores a child with restore_window_child(),
it passes an "init" argument saying whether a new window should be
created for the view, or if it should just be a new view that gets
inserted in an existing window.

When restore_window_child() creates a new window in line
bonobo-mdi-session.c:143, the code in gedit_mdi_app_created_handler()
 sets a new window role; the code in bonobo_mdi_open_toplevel() then
shows the window and therefore realizes it.

But afterwards, bonobo-mdi-session.c:146 tries to re-set the role, and
you can't set the role on a window that is already realized.  The role
string does get stored in the GtkWindow structure, but it is never
passed on to the GdkWindow as it is already realized.
Comment 5 Federico Mena Quintero 2002-06-17 19:52:45 UTC
Attaching patch.  I'm just waiting on confirmation from the release
team to apply it.
Comment 6 Federico Mena Quintero 2002-06-17 19:53:05 UTC
Created attachment 9284 [details] [review]
Patch with proposed fix.
Comment 7 Federico Mena Quintero 2002-06-17 23:32:03 UTC
Fixed on CVS.
Comment 8 Shane O'Connor 2002-06-26 15:59:33 UTC
I've just looked at this on a build from cvs 25th june and problems
still exist - 

as above I set up 5 workspaces and placed apps as follows

Workspace 1 - gnome-calculator
Workspace 2 - gedit
Workspace 3 - eog

I logged out and ticked save session box. 
Logged back in and 

- Only had 2 workspaces present (3 missing)
- Workspace2 was current display
- Gedit was displayed in Worksace 2 but Nautilus application was also
opened (home folder) in Workspace 2
- Workspace 3 (with eog), 4 & 5 disappeared
- Desktop icons all sitting on top of each other.

Could fix have had an adverse impact?

I'm logging a new bug against gnome-session - bug #86539
Comment 9 Shane O'Connor 2002-07-02 15:45:05 UTC
marking as verified - gedit remains in correct workspace - see above
for details of new bug opened against gnome-session
Comment 10 Shane O'Connor 2002-07-02 15:45:29 UTC
closing
Comment 11 Shane O'Connor 2002-07-15 14:06:24 UTC
this bug is present again in  a nightly that was built from CVS on
14th July.

re-opening.

started gedit in workspace 2, logged out, saved session, logged back
in and gedit starts in workspace 1
Comment 12 Federico Mena Quintero 2002-07-15 16:22:23 UTC
Okay, it would be useful to get information about the following:

1. Start GEdit.  Open a file.
2. Use xprop to get the value of WM_WINDOW_ROLE in the GEdit window.
3. Close your session.
4. Restart your session.
5. See if the GEdit window that launches has the same value for the
WM_WINDOW_ROLE property.

If the value is the same, then it is a bug in the window manager.  If
it is not the same, it is a bug in GEdit, which is unlikely, because I
already fixed that.
Comment 13 Shane O'Connor 2002-07-15 16:42:54 UTC
wierd - i can't reproduce this.... was I dreaming it (????). sorry
about that - am closing.


fyi - i couldn't get a value for WM_WINDOW_ROLE if gedit had _any_
files open (including new files)..
Comment 14 Shane O'Connor 2002-07-16 15:43:19 UTC
.... the saga continues.... :)

I've checked this again and found that if gedit has any type of file
open (new or existing) then after logging out, saving session &
logging back in again it will always start in workspace 1.

i can't get a value for WM_WINDOW_ROLE when there is a file open in
gedit - it seems this property is only set when there is no file open.

Running xprop reveals diffs between WM_CLIENT_LEADER(WINDOW),
_NET_WM_PID(CARDINAL) & window id # of group leader.

Before logging out
===============
WM_CLIENT_LEADER(WINDOW): window id # 0x5000001
_NET_WM_PID(CARDINAL) = 27926
window id # of group leader: 0x5000001


After loggin in
============
WM_CLIENT_LEADER(WINDOW): window id # 0x5800001
_NET_WM_PID(CARDINAL) = 28079
window id # of group leader: 0x5800001


I have listed _all_ the properties returned by xprop before logging
out and after logging back in:

Before logging out
================
_XEMBED_INFO(_XEMBED_INFO) = 0x1191d8, 0x0
WM_CLASS(STRING) = "gedit", "Gedit"
WM_ICON_NAME(STRING) = "gedit"
_NET_WM_ICON_NAME(UTF8_STRING) = 0x67, 0x65, 0x64, 0x69, 0x74
WM_NAME(STRING) = "gedit"
_NET_WM_NAME(UTF8_STRING) = 0x67, 0x65, 0x64, 0x69, 0x74
WM_CLIENT_LEADER(WINDOW): window id # 0x5000001
_NET_WM_PID(CARDINAL) = 27926
WM_CLIENT_MACHINE(STRING) = "cdedesk1"
WM_HINTS(WM_HINTS):
                Initial state is Normal State.
		window id # of group leader: 0x5000001
WM_NORMAL_HINTS(WM_SIZE_HINTS):
		program specified minimum size: 150 by 10
		window gravity: NorthWest
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, WM_TAKE_FOCUS,
_NET_WM_PING



After logging in again
===================
_XEMBED_INFO(_XEMBED_INFO) = 0x1191d8, 0x0
WM_CLASS(STRING) = "gedit", "Gedit"
WM_ICON_NAME(STRING) = "gedit"
_NET_WM_ICON_NAME(UTF8_STRING) = 0x67, 0x65, 0x64, 0x69, 0x74
WM_NAME(STRING) = "gedit"
_NET_WM_NAME(UTF8_STRING) = 0x67, 0x65, 0x64, 0x69, 0x74
WM_CLIENT_LEADER(WINDOW): window id # 0x5800001
_NET_WM_PID(CARDINAL) = 28079
WM_CLIENT_MACHINE(STRING) = "cdedesk1"
WM_HINTS(WM_HINTS):
                Initial state is Normal State.
		window id # of group leader: 0x5800001
WM_NORMAL_HINTS(WM_SIZE_HINTS):
		program specified minimum size: 150 by 10
		window gravity: NorthWest
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, WM_TAKE_FOCUS,
_NET_WM_PING
Comment 15 Federico Mena Quintero 2002-08-01 18:40:31 UTC
Okay, please do this:

1. Run gedit.

2. Run "xprop > before.txt" and click on the gedit window.

3. Open a text file in that gedit window.

4. Run "xprop > after.txt" and click on the gedit window.

5. Close your session while saving it.

6. Ssh into your machine from another box and find a file called
"~/.gnome2/gedit-XXXXXX", where XXXXXX is six random letters.  Make
sure it is the file with the latest modification date.  Please attach
it to this bug report.

6. Restart your session.

7. Find the gedit window, run "xprop > session.txt" and click on the
gedit window.

5. Please attach before.txt, after.txt, and session.txt to this bug
report.

The client leader, PID, and group leader will be different when you
restart your session because you have a different process with a PID
that is different from the original one, and because your X windows
will not have the same IDs, either.  The role should be the same.
Comment 16 Shane O'Connor 2002-08-02 09:46:19 UTC
Created attachment 10210 [details]
xprop output before opening file in gedit or saving gnome session - gedit is in workspace2
Comment 17 Shane O'Connor 2002-08-02 09:47:16 UTC
Created attachment 10211 [details]
xprop output after opening file in gedit and before saving gnome session
Comment 18 Shane O'Connor 2002-08-02 09:48:07 UTC
Created attachment 10212 [details]
xprop output after logging out, saving session and logging back in - gedit has moved from workspace2 to workspace1
Comment 19 Shane O'Connor 2002-08-02 09:49:00 UTC
Created attachment 10213 [details]
gedit session file
Comment 20 Federico Mena Quintero 2002-08-02 20:00:13 UTC
Hmm, these all indicate that GEdit is doing the right thing.  Are you
using metacity?  If so, could you please attach its corresponding
session file from ~/.metacity/sessions?  Thanks!
Comment 21 Shane O'Connor 2002-08-06 13:30:35 UTC
Created attachment 10296 [details]
I've recreated the problem and am attaching the metacity session file.
Comment 22 Federico Mena Quintero 2002-08-07 18:21:37 UTC
I have confirmed that this is a Metacity bug, so marking as duplicate.

This works fine in Sawfish.

*** This bug has been marked as a duplicate of 90133 ***