<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>335881</bug_id>
          
          <creation_ts>2014-06-06 13:36:20 +0000</creation_ts>
          <short_desc>kwallet dialogs open in background</short_desc>
          <delta_ts>2022-09-06 14:21:53 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>10</classification_id>
          <classification>Unmaintained</classification>
          <product>kdelibs</product>
          <component>kwallet</component>
          <version>4.12.5</version>
          <rep_platform>unspecified</rep_platform>
          <op_sys>macOS</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>141267</dup_id>
          <see_also>https://bugs.kde.org/show_bug.cgi?id=337122</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="RJVB">rjvbertin</reporter>
          <assigned_to name="Michael Leupold">lemma</assigned_to>
          <cc>mk-lists</cc>
    
    <cc>mk.mateng</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1453609</commentid>
    <comment_count>0</comment_count>
    <who name="RJVB">rjvbertin</who>
    <bug_when>2014-06-06 13:36:20 +0000</bug_when>
    <thetext>It&apos;s all in the title - every time I need to enter a password to unlock a kwallet, I have to go grab the dialog from somewhere behind the window requesting the encrypted information.
This is annoying but becomes problematic when the unlock request does not stem from an immediate user action, but from a process running in the background.

Reproducible: Always

Steps to Reproduce:
1. Do anything that requires access to a wallet that&apos;s currently locked (which might just be having akonadi services run)
2. Wait until the wallet system posts a password dialog

Actual Results:  
The password dialog opens somewhere behind the current window, on the middle of the screen (so typically completely hidden by other open windows). KDE&apos;s notification system does post a message, but it only allows to ignore the request or switch back to the calling application ... which still has the input focus.

Expected Results:  
The password dialog opens in front, having obtained input focus

See https://forum.kde.org/viewtopic.php?f=60&amp;t=121478&amp;sid=050a9636469e60976277154d8fc2095f&amp;p=312556#p312536 for a discussion and proposed solutions, including one (a QtKeyChain based backend) that would provide integration with the OS X password management system (Keychain).

Additionally, on OS X there are always 2 wallet icons visible in the Dock and the app switcher (1 for kwalletd, one for the manager). This doesn&apos;t make it easier to switch to the instance that has the dialog open!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1454631</commentid>
    <comment_count>1</comment_count>
    <who name="Christoph Feck">cfeck</who>
    <bug_when>2014-06-11 21:36:41 +0000</bug_when>
    <thetext>The KWallet daemon is a separate process. I am not sure if/how OS X allows windows from alien processes steal the focus of the currently running application.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1454710</commentid>
    <comment_count>2</comment_count>
    <who name="RJVB">rjvbertin</who>
    <bug_when>2014-06-12 10:01:41 +0000</bug_when>
    <thetext>It certainly doesn&apos;t make it impossible to do that. In fact, it allows it with too much ease to my taste (there used to be a time when you could launch an app, switch to another and keep working therein while the other app prepped itself in its own &quot;layer&quot;; no longer so).

Hooking into QtKeyChain will of course make the question a moot point, because it&apos;d be the OS handling the focus control.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1459001</commentid>
    <comment_count>3</comment_count>
      <attachid>87514</attachid>
    <who name="RJVB">rjvbertin</who>
    <bug_when>2014-07-02 14:37:27 +0000</bug_when>
    <thetext>Created attachment 87514
example ObjC file that shows how to launch an application in the foreground

Kwallet isn&apos;t the only application opening elsewhere but in the foreground; in fact, it is the OS default when an application is started through system() or execve() or even NSTask. I thus had a look around and found a solution on StackExchange for launching an(y) application with arguments and have it appear in the foreground. Contrary to the standard [NSWorkSpace launchApplication: arguments:] function, this one accepts all kinds of arguments, not only documents to be opened.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1461553</commentid>
    <comment_count>4</comment_count>
    <who name="Christoph Feck">cfeck</who>
    <bug_when>2014-07-17 19:01:53 +0000</bug_when>
    <thetext>The problem isn&apos;t with launching new applications, because the kwallet daemon is already launched. But when it needs to open a window, it will have to open it in a way to force stealing the focus of the currently running application.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1812798</commentid>
    <comment_count>5</comment_count>
    <who name="Andrew Crouthamel">andrew.crouthamel</who>
    <bug_when>2018-11-12 02:53:27 +0000</bug_when>
    <thetext>Dear Bug Submitter,

This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond.

Thank you for helping us make KDE software even better for everyone!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1813117</commentid>
    <comment_count>6</comment_count>
    <who name="RJVB">rjvbertin</who>
    <bug_when>2018-11-12 10:02:59 +0000</bug_when>
    <thetext>It is, cannot be otherwise given how the password dialog is brought to the foreground under X11. That cannot work on Mac (nor under Wayland IIUC).
The only solution I found is make kwalletd force itself to the foreground (together with changes that make it do this without becoming a full GUI application with a menubar and presence in the Dock and app-switcher.

I could put this changeset up for review, but only if the overall consensus is that kwalletd has a right of existence on Mac.

The alternative would be to use a Mac-native mechanism to unlock KDE wallets, but I don&apos;t see how that would work.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2150567</commentid>
    <comment_count>7</comment_count>
    <who name="michaelk83">mk.mateng</who>
    <bug_when>2022-09-06 14:21:53 +0000</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 141267 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>87514</attachid>
            <date>2014-07-02 14:37:27 +0000</date>
            <delta_ts>2014-07-02 14:37:27 +0000</delta_ts>
            <desc>example ObjC file that shows how to launch an application in the foreground</desc>
            <filename>osxlaunch.m</filename>
            <type>application/octet-stream</type>
            <size>2622</size>
            <attacher name="RJVB">rjvbertin</attacher>
            
              <data encoding="base64">I2ltcG9ydCA8Rm91bmRhdGlvbi9Gb3VuZGF0aW9uLmg+CiNpbXBvcnQgPENvY29hL0NvY29hLmg+
CiNpbXBvcnQgPHN5cy90eXBlcy5oPgoKLy8gZnJvbSBodHRwOi8vc3RhY2tvdmVyZmxvdy5jb20v
YS80OTMzNDkyCgpAaW50ZXJmYWNlIE5TV29ya3NwYWNlIChNREFkZGl0aW9ucykKLSAocGlkX3Qp
IGxhdW5jaEFwcGxpY2F0aW9uQXRQYXRoOihOU1N0cmluZyAqKXBhdGgKCQkJCXdpdGhBcmd1bWVu
dHM6KE5TQXJyYXkgKilhcmd2CgkJCQkJICAgZXJyb3I6KE5TRXJyb3IgKiopZXJyb3I7CkBlbmQK
CiNpbXBvcnQgPENvcmVTZXJ2aWNlcy9Db3JlU2VydmljZXMuaD4KCkBpbnRlcmZhY2UgTlNTdHJp
bmcgKE1EQWRkaXRpb25zKQotIChCT09MKSBnZXRGU1JlZjooRlNSZWYgKilhbkZTUmVmIGVycm9y
OihOU0Vycm9yICoqKWFuRXJyb3I7CkBlbmQKCiNpbXBvcnQgPHN5cy9zeXNsaW1pdHMuaD4KCkBp
bXBsZW1lbnRhdGlvbiBOU1N0cmluZyAoTURBZGRpdGlvbnMpCgotIChCT09MKSBnZXRGU1JlZjoo
RlNSZWYgKilhbkZTUmVmIGVycm9yOihOU0Vycm9yICoqKWFuRXJyb3IKewoJaWYoIGFuRXJyb3Ig
KXsKCQkqYW5FcnJvciA9IG5pbDsKCX0KCU9TU3RhdHVzIHN0YXR1cyA9IG5vRXJyOwoJc3RhdHVz
ID0gRlNQYXRoTWFrZVJlZiggKGNvbnN0IFVJbnQ4ICopW3NlbGYgVVRGOFN0cmluZ10sIGFuRlNS
ZWYsIE5VTEwgK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