Warning dialog on broken preferences.xml should not be modal

Bug #1297779 reported by Maris Nartiss
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
New
Undecided
Unassigned

Bug Description

If the preferences.xml file is broken, inkscape displays a modal dialog with a warning at the launch. Still there is no parent window yet for the warning message. As warning message dialog has properties _NET_WM_STATE_MODAL and _NET_WM_STATE_SKIP_TASKBAR, it is not shown on the task bar, it blocks inkscape for starting up till user clicks on OK. The problem is - if window manager prevents focus stealing, the dialog is created behind other windows and _NET_WM_STATE_SKIP_TASKBAR prevents it from appearing on the task bar thus user has no idea that such dialog exists! It can be discovered only by an accident - when using alt+tab or minimizing any other windows. As the dialog provides only a warning, it should not be modal. If warnings modality is kept, it should not have _NET_WM_STATE_SKIP_TASKBAR property set.

Steps to reproduce with inkscape-0.48.4-r1:
rm .config/inkscape/preferences.xml && touch .config/inkscape/preferences.xml
start Firefox or any other application and maximize it
start inkscape

KWin: 4.11.7
xprop
_KDE_NET_WM_ACTIVITIES(STRING) = "00000000-0000-0000-0000-000000000000"
_NET_WM_ALLOWED_ACTIONS(ATOM) = _NET_WM_ACTION_MOVE, _NET_WM_ACTION_MINIMIZE, _NET_WM_ACTION_SHADE, _NET_WM_ACTION_CHANGE_DESKTOP, _NET_WM_ACTION_CLOSE
_KDE_NET_WM_FRAME_STRUT(CARDINAL) = 7, 7, 33, 11
_NET_FRAME_EXTENTS(CARDINAL) = 7, 7, 33, 11
_NET_WM_DESKTOP(CARDINAL) = 0
WM_STATE(WM_STATE):
                window state: Normal
                icon window: 0x0
_NET_WM_STATE(ATOM) = _NET_WM_STATE_MODAL, _NET_WM_STATE_SKIP_TASKBAR
WM_HINTS(WM_HINTS):
                Client accepts input or input focus: True
                Initial state is Normal State.
                bitmap id # to use for icon: 0x5600018
                bitmap id # of mask for icon: 0x560001b
                window id # of group leader: 0x5600001
_NET_WM_ICON(CARDINAL) = <<< icon code removed >>>
_NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 90177541
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_DIALOG
_KDE_NET_WM_USER_CREATION_TIME(CARDINAL) = 1413945
_NET_WM_USER_TIME_WINDOW(WINDOW): window id # 0x5600004
WM_CLIENT_LEADER(WINDOW): window id # 0x5600001
_NET_WM_PID(CARDINAL) = 3566
WM_LOCALE_NAME(STRING) = "lv_LV.utf8"
WM_CLIENT_MACHINE(STRING) = "glacier"
WM_NORMAL_HINTS(WM_SIZE_HINTS):
                program specified minimum size: 597 by 170
                program specified maximum size: 597 by 170
                window gravity: NorthWest
WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST
WM_CLASS(STRING) = "inkscape", "Inkscape"
WM_ICON_NAME(STRING) =
_NET_WM_ICON_NAME(UTF8_STRING) =
WM_NAME(STRING) =
_NET_WM_NAME(UTF8_STRING) =

Tags: preferences ui
Revision history for this message
Alvin Penner (apenner) wrote :

could you attach an example of a broken preferences.xml file?

Revision history for this message
su_v (suv-lp) wrote :

Related reports (not duplicates):
- Bug #500961 “Preferences dialog / location of preferences.xml”
  <https://bugs.launchpad.net/inkscape/+bug/500961>
- Bug #784811 “Avoid discarding preferences.xml because of bad Location string”
  <https://bugs.launchpad.net/inkscape/+bug/784811>
- Bug #911700 “Preferences.xml file recovery”
  <https://bugs.launchpad.net/inkscape/+bug/911700>

tags: added: preferences ui
Revision history for this message
Maris Nartiss (maris-nartiss) wrote :

Oh, sorry. I see - the steps to reproduce are missing rm part. My bad. Unfortunately Launchpad does not support uploading empty files thus I can't attach broken file. Just rm && touch preferences.xml to trigger the issue.

su_v (suv-lp)
description: updated
Revision history for this message
Alvin Penner (apenner) wrote :

on Windows, recent development build, the behavior is somewhat different than above. If I edit the preferences.xml file and just randomly delete the last three lines or so, just enough to make it invalid xml code, then I get the following behavior.

- starting Inkscape from the gui, I get the attached popup dialog. The dialog shows up as the top window, so it is easy to see. The dialog also shows up as a minimized icon on the taskbar. At this point the Inkscape window does not yet exist. Acknowledging the dialog, makes it disappear on the taskbar, and then about 5 seconds later the Inkscape window is created for the first time. After this, Inkscape will not save the new preferences file

- starting Inkscape from the console I get the above behavior plus console messages like the messages below:

- the problem is that it is not entirely clear what to do here. On the one hand, refusing to fix the error and refusing to save a new preferences file is rather annoying. On the other hand, overwriting this preferences file would not be welcomed, because the file is 95% correct in this case, and could conceivably have been patched by hand.

..................................................................................................

Entity: line 1637: parser error : Premature end of data in tag group line 1636
     id="debug">
                ^
Entity: line 1637: parser error : Premature end of data in tag inkscape line 2
     id="debug">
                ^
Entity: line 1637: parser error : Premature end of data in tag group line 1636
     id="debug">
                ^
Entity: line 1637: parser error : Premature end of data in tag inkscape line 2
     id="debug">
                ^

Revision history for this message
Maris Nartiss (maris-nartiss) wrote :

Current approach is to overwrite broken file by default and thus it doesn't make sense to block the application to notify the user if there is no option to cancel the overwrite of broken file.

Still the issue of hawing wrong properties for the error message window should be fixed in either way as current approach is really not good one. The behaviour of pop-up window depends on the window manager and thus on Windows it will look totally different. KWin just honours user preferences (do not steal focus) and window properties (do not show in task bar) and thus it's an issue.

Revision history for this message
Alvin Penner (apenner) wrote :

@Maris - could you confirm that your broken preferences.xml file actually gets overwritten? On Windows, this definitely does not happen. Instead there is a refusal to save any preferences file at all, and the original broken file is kept forever.

Revision history for this message
Maris Nartiss (maris-nartiss) wrote :

@Alvin sorry, you are right. Broken file stays forever. Still - on Linux with KWin the issue is that dialog is invisible by default. Also it doesn't make sense to block program as there is no choice given to the user (no Cancel button).

Revision history for this message
jazzynico (jazzynico) wrote :

Tested again on Windows XP, Inkscape trunk revision 13511.

The dialog shows correctly in the task bar.

The fact that the dialog is modal is not a problem IMHO, but it should at least give some hints on how to fix the preferences file (or better, give the choice to recover from an autosaved or a default file - see https://blueprints.launchpad.net/inkscape/+spec/multiple-preferences-management) and report where in the file the error is (as it is already done when launching Inkscape from the console).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.