Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multi-monitor support. #4

Open
alspore opened this issue Feb 24, 2014 · 8 comments
Open

Add multi-monitor support. #4

alspore opened this issue Feb 24, 2014 · 8 comments

Comments

@alspore
Copy link
Contributor

alspore commented Feb 24, 2014

At minimum allow for the same config to appear across all monitors.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@alspore
Copy link
Contributor Author

alspore commented Feb 27, 2014

#16

@Lokaltog
Copy link
Owner

What's the status on this issue? I can't test this myself, how does the statusline behave on multi-monitor setups?

@alspore
Copy link
Contributor Author

alspore commented Mar 19, 2014

I just pulled from your develop branch and I'm getting a seg fault after setting the monitor to anything but 0. I'll look into it later today.

Other than that multi-monitor support was working fine previously.

@Lokaltog
Copy link
Owner

Hm, that's a bit strange. I've only done a couple of changes, I've renamed "monitor" --> "screen" in the config, and I've updated the desktop/window title widgets to use the screen specified in the config file: int screen_nbr = widget->wkline->screen;. Other than that it should be exactly the same. It would be awesome if you could help debug this issue!

@Lokaltog
Copy link
Owner

There's definitely some weird stuff going on here, it almost looks like a pointer address is being used instead of a value somewhere when initializing the window? I don't have two monitors, but I get some random behavior where the window will either crash, show up as a square box or not show up at all, with random error messages:

kim@regiontog ~> projects/wkline/out/bin/wkline -s 1
[11:30:18] INFO wkline beta-git-294.c8775a0 (Mar 19 2014 11:30:12)
[11:30:18] INFO using config file '/home/kim/.config/wkline/config.json'

(wkline:24204): Gdk-CRITICAL **: gdk_screen_get_monitor_geometry: assertion 'monitor_num < gdk_screen_get_n_monitors (screen)' failed
[11:30:18] INFO loading theme 'file:///home/kim/projects/wkline-theme-default/webroot/index.html'

(wkline:24204): Gdk-WARNING **: Native Windows wider or taller than 32767 pixels are not supported
[11:30:18] DEBUG webkit: window object cleared
[11:30:18] DEBUG starting 10 widget threads
^C^C^C^C^C^C^[[A^[[B^C^C^C^Cfish: Job 1, “projects/wkline/out/bin/wkline -s 1” terminated by signal SIGKILL (Forced quit)
kim@regiontog ~> projects/wkline/out/bin/wkline -s 1
[11:30:56] INFO wkline beta-git-294.c8775a0 (Mar 19 2014 11:30:12)
[11:30:56] INFO using config file '/home/kim/.config/wkline/config.json'

(wkline:24550): Gdk-CRITICAL **: gdk_screen_get_monitor_geometry: assertion 'monitor_num < gdk_screen_get_n_monitors (screen)' failed

(wkline:24550): Gtk-CRITICAL **: gtk_window_set_default_size: assertion 'width >= -1' failed

(wkline:24550): Gtk-CRITICAL **: gtk_widget_set_size_request: assertion 'width >= -1' failed
[11:30:56] INFO loading theme 'file:///home/kim/projects/wkline-theme-default/webroot/index.html'
fish: Job 1, “projects/wkline/out/bin/wkline -s 1” terminated by signal SIGSEGV (Address boundary error)
kim@regiontog ~> projects/wkline/out/bin/wkline -s 1
[11:31:23] INFO wkline beta-git-294.c8775a0 (Mar 19 2014 11:30:12)
[11:31:23] INFO using config file '/home/kim/.config/wkline/config.json'

(wkline:24705): Gdk-CRITICAL **: gdk_screen_get_monitor_geometry: assertion 'monitor_num < gdk_screen_get_n_monitors (screen)' failed
[11:31:23] INFO loading theme 'file:///home/kim/projects/wkline-theme-default/webroot/index.html'

(wkline:24705): Gdk-WARNING **: Native Windows wider or taller than 32767 pixels are not supported
[11:31:23] DEBUG webkit: window object cleared
[11:31:23] DEBUG starting 10 widget threads
^C[11:31:24] DEBUG gracefully shutting down widget threads...
^C[11:31:25] DEBUG gracefully shutting down widget threads...
^C^C^C^Cfish: Job 1, “projects/wkline/out/bin/wkline -s 1” terminated by signal SIGSEGV (Address boundary error)
kim@regiontog ~> projects/wkline/out/bin/wkline -s 1
[11:32:55] INFO wkline beta-git-294.c8775a0 (Mar 19 2014 11:32:52)
[11:32:55] INFO using config file '/home/kim/.config/wkline/config.json'

(wkline:25152): Gdk-CRITICAL **: gdk_screen_get_monitor_geometry: assertion 'monitor_num < gdk_screen_get_n_monitors (screen)' failed
[11:32:55] INFO loading theme 'file:///home/kim/projects/wkline-theme-default/webroot/index.html'

(wkline:25152): Gdk-WARNING **: Native Windows wider or taller than 32767 pixels are not supported

(wkline:25152): Gdk-ERROR **: The program 'wkline' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadAlloc (insufficient resources for operation)'.
  (Details: serial 228 error_code 11 request_code 53 minor_code 0)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the GDK_SYNCHRONIZE environment
   variable to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
fish: Job 1, “projects/wkline/out/bin/wkline -s 1” terminated by signal SIGTRAP (Trace or breakpoint trap)

@alspore
Copy link
Contributor Author

alspore commented Mar 19, 2014

I think you're confusing screens and displays/monitors. For whatever reason X makes the distinction that a screen is the sum of one or more display outputs, while a display is the actual hardware device. This means that multi-monitor systems generally only have one combined screen, and multiple displays. This means that screen_nbr should be zero 99% of the time.

What I don't quite get is that after changing screen_nbr to zero, I still get a seg fault.

@Lokaltog
Copy link
Owner

Haha, oh man. The display/monitor stuff is really confusing, I'll revert the related commits and set screen_nbr back to zero.

@Lokaltog
Copy link
Owner

After this commit I still get the random segfaults and wrong window sizes like I did before, I think we should verify the monitor config option with gdk_screen_get_n_monitors and not allow monitor numbers higher than the amount of monitors returned from this function. It's still a bit weird that it randomly segfaults, and I don't understand why it doesn't work on an actual multi-monitor setup anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants