<p>A while ago, tilix (gtk3 terminal emulator) had the same problem and they got it fixed</p>
<p><a href="https://github.com/gnunn1/tilix/issues/849" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="216388018" data-permission-text="Issue title is private" data-url="https://github.com/gnunn1/tilix/issues/849">gnunn1/tilix#849</a><br>
<a href="https://github.com/gnunn1/tilix/issues/932" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="229870580" data-permission-text="Issue title is private" data-url="https://github.com/gnunn1/tilix/issues/932">gnunn1/tilix#932</a></p>
<blockquote>
<p>Was that commit supposed to fix it? Because tilix --focus-window --action=app-new-session still doesn't work. A new tab is opened, the window just isn't focused.</p>
</blockquote>
<p>They talk about the same GTK bug in the discussion.</p>
<p><a href="https://github.com/gnunn1/tilix/commit/84abb55043b5ad6273bb8fc74967b90ab24535e9?diff=split" class="commit-link">gnunn1/tilix@<tt>84abb55</tt>?diff=split</a></p>
<p>The fix seems to be along the lines of what <a href="https://github.com/b4n" class="user-mention">@b4n</a> mentioned above. The code is in D but but idea seems to be the same</p>
<pre><code>     if (isWayland(window)) {
+        trace("Present Window for Wayland");
+        window.presentWithTime(Main.getCurrentEventTime);
     } else {
+        trace("Present Window for X11");
         window.present();
         activateX11Window(window);
     }
</code></pre>
<p>it did fix the problem - bug 932 above about window focus problems under Wayland was mine and was solved</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/issues/1698#issuecomment-347375316">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJ7t9X2Ejo5YNGZrUBh_GxG164uFDks5s61XFgaJpZM4Qq4fP">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJ8OlxzG1gGsvfi7BcRmdhIHZpbxLks5s61XFgaJpZM4Qq4fP.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/geany/geany/issues/1698#issuecomment-347375316"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/geany/geany","title":"geany/geany","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/geany/geany"}},"updates":{"snippets":[{"icon":"PERSON","message":"@arigit in #1698: A while ago, tilix (gtk3 terminal emulator) had the same problem and they got it fixed\r\n\r\nhttps://github.com/gnunn1/tilix/issues/849\r\nhttps://github.com/gnunn1/tilix/issues/932\r\n\r\n\u003e Was that commit supposed to fix it? Because tilix --focus-window --action=app-new-session still doesn't work. A new tab is opened, the window just isn't focused.\r\n\r\nThey talk about the same GTK bug in the discussion. \r\n\r\nhttps://github.com/gnunn1/tilix/commit/84abb55043b5ad6273bb8fc74967b90ab24535e9?diff=split\r\n\r\nThe fix seems to be along the lines of what @b4n mentioned above. The code is in D but but idea seems to be the same\r\n\r\n```\r\n     if (isWayland(window)) {\r\n+        trace(\"Present Window for Wayland\");\r\n+        window.presentWithTime(Main.getCurrentEventTime);\r\n     } else {\r\n+        trace(\"Present Window for X11\");\r\n         window.present();\r\n         activateX11Window(window);\r\n     }\r\n```\r\n\r\nit did fix the problem - bug 932 above about window focus problems under Wayland was mine and was solved\r\n\r\n\r\n\r\n\r\n"}],"action":{"name":"View Issue","url":"https://github.com/geany/geany/issues/1698#issuecomment-347375316"}}}</script>