双显示环境中右侧显示器出现问题 - Ubuntu 15.10(Wily Werewolf)

双显示环境中右侧显示器出现问题 - Ubuntu 15.10(Wily Werewolf)

好的,这可能对某些人有帮助。

在 Ubuntu 15.10 中,guake 略有变化。要将终端更改为正确的显示器,您必须编辑:

/usr/lib/python2.7/dist-packages/guake/guake_app.py

然后在第 831 行进行更改:

window_rect = screen.get_monitor_geometry(monitor)

经过:

window_rect = screen.get_monitor_geometry(1)

终止并重启 guake

有谁知道如何才能让这件事不那么棘手吗?

答案1

我使用的是 Linux Mint,以下解决方案对我有用(它也应该适用于 Ubuntu)。编辑您的 /usr/bin/guake/ 文件,将该get_final_window_rect方法替换为:

def get_final_window_rect(self):
    """Gets the final size of the main window of guake. The height
    is the window_height property, width is window_width and the
    horizontal alignment is given by window_alignment.
    """
    screen = self.window.get_screen()
    height = self.client.get_int(KEY('/general/window_height'))
    width = 100
    halignment = self.client.get_int(KEY('/general/window_halignment'))

    # future we might create a field to select which monitor you
    # wanna use
    #monitor = 0 # use the left most monitor
    monitor = screen.get_n_monitors() - 1 # use the right most monitor

    monitor_rect = screen.get_monitor_geometry(monitor)
    window_rect = monitor_rect.copy()
    window_rect.height = window_rect.height * height / 100
    window_rect.width = window_rect.width * width / 100

    if width < monitor_rect.width:
        if halignment == ALIGN_CENTER:
            window_rect.x = monitor_rect.x + (monitor_rect.width - window_rect.width) / 2
        elif halignment == ALIGN_LEFT:
            window_rect.x = monitor_rect.x
        elif halignment == ALIGN_RIGHT:
            window_rect.x = monitor_rect.x + monitor_rect.width - window_rect.width

    window_rect.y = monitor_rect.y
    return window_rect

我从这里,但我80改为100

相关内容