当某个窗口已经获得焦点时,如何使 Gnome 中的窗口移动到其他窗口的顶部?

发布于 2024-07-23 20:13:24 字数 178 浏览 1 评论 0原文

我有一个应用程序将焦点发送到其他窗口,但这些窗口不会自动显示在前台,即显示在所有其他窗口之上。 我可以在哪里配置窗口管理器的首选项,以便这是默认行为?

特别是,我在 MATLAB IDE 中使用 Ctrl-0 和 Ctrl-Shft-0 快捷键在命令窗口和编辑器窗口之间移动,尽管焦点似乎已转移,但新窗口不会自动在前景。

I have an application that sends the focus to other windows but those windows then don't automatically display themselves in the foreground, i.e. on top of all the other windows. Where can I configure the preferences of my window manager so that this is the default behaviour?

In particular I'm using the Ctrl-0 and Ctrl-Shft-0 shortcuts in the MATLAB IDE to move between the command window and the editor window and although the focus seems to be transferred the new window doesn't automatically redraw itself in the foreground.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

鹿港小镇 2024-07-30 20:13:25

不确定是否有按键绑定可以做到这一点,但如果您按住 Alt 键并单击窗口(允许您拖动窗口),它应该会出现在前面。

正如 codeDr 所说,MATLAB 在重新绘制窗口方面也有点糟糕。 如果您在代码执行时绘制图窗,则图窗不会更新,除非您执行drawnow或在执行中进行类似的暂停以允许 GUI 重新绘制。 由于我们讨论的是 MATLAB,figure 命令也会导致指示的图形出现在前面(事实上,很难让它出现在前面)正面)。 因此,您可以执行 figure(gcf) 将当前图形置于前面,或者使用 h =figure; 保存图形编号,然后执行 figure( h)。 顺便说一句,如果您想在不切换焦点的情况下切换当前图形,set(0, 'CurrentFigure', h) 应将 h 设置为当前图形。

Not sure of a key binding off hand that does it, but if you alt-click on a window (which allows you to drag a window) it should come to the front.

As codeDr suggests, MATLAB is also kind of bad about repainting its windows. If you draw to a figure while code is executing, the figure does not update unless you execute drawnow or have some similar pause in the execution to allow the GUI to repaint. Since we're talking about MATLAB, the figure command will also cause the indicated figure to come to the front (in fact, it's harder to get it to not come to the front). So you could do figure(gcf) to bring the current figure to the front, or save the figure number with h = figure; and then later do figure(h). Incidentally, if you want to switch current figures without switching focus, set(0, 'CurrentFigure', h) should set h to the current figure.

萤火眠眠 2024-07-30 20:13:25

您的窗口管理器(可能是 Metacity?)实施了焦点窃取预防措施,以便流氓应用程序不会弹出会干扰您打字的窗口。 Matlab 需要升高其窗口,并为其提供具有正确时间戳的输入焦点。 如果这是通过 KeyPress 事件处理程序完成的,则用于设置输入焦点的时间戳将是来自 KeyPress 事件的时间戳(即导致窗口升起/聚焦的用户生成事件的时间戳)。

要礼貌地将输入焦点赋予窗口,请在 google 中搜索 _NET_ACTIVE_WINDOW。

Your window manager (probably Metacity?) implements focus-stealing prevention so that rogue apps don't pop up windows that would disturb your typing. Matlab needs to raise its window, and give it the input focus with the correct timestamp. If this is being done from a KeyPress event handler, the timestamp for setting the input focus would be the timestamp from the KeyPress event (i.e. the timestamp of the user-generated event that caused a window to be raised/focused).

To politely give the input focus to a window, google for _NET_ACTIVE_WINDOW.

沙与沫 2024-07-30 20:13:25

通常,当窗口不重新绘制时,这意味着应用程序的主应用程序循环没有运行来刷新窗口。 当您在窗口之间切换时,Matlab 是否正在执行一些计算或磁盘活动?

Usually when the window doesn't repaint, it means that the application's main application loop isn't running to refresh the window. Could it be that Matlab is doing some computation or disk activity when you are switching between windows?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文