<?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>318379</bug_id>
          
          <creation_ts>2013-04-15 10:01:45 +0000</creation_ts>
          <short_desc>kwin scripting &quot;registerShortcut&quot; does not work when starting script via dbus</short_desc>
          <delta_ts>2013-04-15 11:11:56 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Plasma</classification>
          <product>kwin</product>
          <component>scripting</component>
          <version>4.10.2</version>
          <rep_platform>Arch Linux</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <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>github</reporter>
          <assigned_to name="KWin default assignee">kwin-bugs-null</assigned_to>
          
          
          <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>1360948</commentid>
    <comment_count>0</comment_count>
    <who name="">github</who>
    <bug_when>2013-04-15 10:01:45 +0000</bug_when>
    <thetext>Hi, I have a very simgle script:

    print(&quot;script startup&quot;)
    registerShortcut(&quot;Register Desc&quot;, &quot;cool&quot;, &quot;Meta+B&quot;, function() { &quot;got key&quot; })

I start the script using:

    qdbus-qt4 org.kde.kwin /Scripting loadScript PATH_TO_SCRIPT
    qdbus-qt4 org.kde.kwin /0 run   # where 0 is the ID returned by the previous command

At this stage I notice &quot;script startup&quot; logged by kwin, however upon pressing &quot;Meta+B&quot; I get absolutely nothing.

I don&apos;t know whether the shortcut would start working after packaging my script as a plasma package... at this stage I am just in the testing stage and being able to quickly unload and reload my script is essential. I am able to connect to other signals and get output only registerShortcut seems to be broken for me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1360949</commentid>
    <comment_count>1</comment_count>
    <who name="">github</who>
    <bug_when>2013-04-15 10:05:37 +0000</bug_when>
    <thetext>Sorry I messed up that script after pasting it, it should read:

    print(&quot;script startup&quot;)
    registerShortcut(&quot;Script Binding Test&quot;, &quot;test&quot;, &quot;Meta+B&quot;, function() { print(&quot;got key&quot;) })</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1360952</commentid>
    <comment_count>2</comment_count>
    <who name="">github</who>
    <bug_when>2013-04-15 10:22:46 +0000</bug_when>
    <thetext>Here is the results of calling &quot;registerShortcut&quot; 4 times to my kglobalshortcutsrc (each time with a slightly different title):

    Script Test1=,Meta+B,cool
    Script Test2=Meta+B,Meta+B,cool
    Script Test3=,Meta+B,cool
    Script Test4=,Meta+B,cool

Now strangely enough the time I registered it with &quot;Script Test2&quot; the key binding actually worked. Seems random as to what type of entry it creates. Also... seems kinda weird I get all these duplicate entries in that file just from registering script shortcuts but I guess that&apos;s okay.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1360957</commentid>
    <comment_count>3</comment_count>
    <who name="Martin Flöser">mgraesslin</who>
    <bug_when>2013-04-15 10:30:55 +0000</bug_when>
    <thetext>seems like a worksforme. The global shortcut system is not very good and not really suited for rapid prototyping of scripts. You need to ensure in the global shortcut editor that the keybinding is actually registered.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1360959</commentid>
    <comment_count>4</comment_count>
    <who name="">github</who>
    <bug_when>2013-04-15 10:34:23 +0000</bug_when>
    <thetext>I have found the actual issue, I guess I&apos;ll open a new bug for it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1360970</commentid>
    <comment_count>5</comment_count>
    <who name="Martin Flöser">mgraesslin</who>
    <bug_when>2013-04-15 11:11:56 +0000</bug_when>
    <thetext>*** Bug 318383 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>