Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Multihead SWT problem

Hello Mathias, for future question please use the newsgroup.

I don't really understand what you did in Display. Display#getMonitors() 
already does use GDK multihead support. 
"The problem is now that SWT does not provide a way to open a new shell on
Screen1 if the main application was started on Screen0."
That is not true. Try:
        Monitor monitor = display.getPrimaryMonitor();
        Rectangle bounds = monitor.getBounds();
        shell.setBounds(bounds.x + 100, bounds.y + 100, 400, 640);

My guess is  that call to gtk_window_set_screen that is causing problem to 
you.

Regards,
Felipe




Mathias.Engelhardt@xxxxxxxxxx 
Sent by: platform-swt-dev-bounces@xxxxxxxxxxx
09/08/2006 07:07 AM
Please respond to
"Eclipse Platform SWT component developers list." 
<platform-swt-dev@xxxxxxxxxxx>


To
platform-swt-dev@xxxxxxxxxxx
cc

Subject
[platform-swt-dev] Multihead SWT problem






Hi all,

I'm currently trying to improve the SWT multihead support in a Linux/GTK
environment. I use an X configuration with multiple screens
served by a single X server:

Sample xorg.conf------------------------
Section "Device"
      Identifier  "Videocard0"
      Driver      "nvidia"
      BusID     "6:0:0"
      Screen          0
EndSection

Section "Device"
      Identifier  "Videocard1"
      Driver      "nvidia"
      BusID     "6:0:0"
      Screen          1
EndSection

Section "Screen"
      Identifier "Screen0"
      Device     "Videocard0"
      Monitor    "Monitor0"
      DefaultDepth     24
      SubSection "Display"
            Viewport   0 0
            Depth     24
            Modes    "1280x1024"
      EndSubSection
EndSection

Section "Screen"
      Identifier "Screen1"
      Device     "Videocard1"
      Monitor    "Monitor0"
      DefaultDepth     24
      SubSection "Display"
            Viewport   0 0
            Depth     24
            Modes    "1280x1024"
      EndSubSection
EndSection
=========================================

The problem is now that SWT does not provide a way to open a new shell on
Screen1 if the main application was started on Screen0.

So I created an enhancement that uses the GDK multihead support API. I
extended the Display.getMonitors method to query the screens of the 
current
display
for all monitors. So the display now returns a list of all monitors known
to the current (X) display. Then I added a setMonitor method to the Shell
class that
internally calls the gtk_window_set_screen with the shell's handle to set
the screen on which the shell appears. This seems to work pretty well and 
I
even
managed to get a GLCanvas working.

But I still have several problems:
* When using images, the application crashes and the X server reports a
BadMatch error:
The program '' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadMatch (invalid parameter attributes)'.
  (Details: serial 2204 error_code 8 request_code 157 minor_code 8)
  (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 --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error()
function.)

The error occurs after a call to GC.drawImageXRender and the stack trace 
is
as follows:
org.eclipse.swt.SWTError: Unspecified error
      at org.eclipse.swt.graphics.Device.XErrorProc(Device.java:813)
      at org.eclipse.swt.internal.gtk.OS._XRenderComposite(Native Method)
      at org.eclipse.swt.internal.gtk.OS.XRenderComposite(OS.java:984)
      at org.eclipse.swt.graphics.GC.drawImageXRender(GC.java:925)
      at org.eclipse.swt.graphics.GC.drawImage(GC.java:681)
      at org.eclipse.swt.graphics.GC.drawImage(GC.java:671)
      at org.eclipse.swt.graphics.GC.drawImage(GC.java:606)
      at
org.eclipse.swt.graphics.ImageData.fillGradientRectangle(ImageData.java:3576)
      at org.eclipse.swt.graphics.GC.fillGradientRectangle(GC.java:1792)
      at
org.eclipse.swt.custom.CTabFolder.drawBackground(CTabFolder.java:664)
      at org.eclipse.swt.custom.CTabItem.drawSelected(CTabItem.java:323)
      at org.eclipse.swt.custom.CTabItem.onPaint(CTabItem.java:586)
      at
org.eclipse.swt.custom.CTabFolder.drawTabArea(CTabFolder.java:1070)
      at org.eclipse.swt.custom.CTabFolder.onPaint(CTabFolder.java:2215)
      at
org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:293)
...

* When starting an RCP workbench on another than the default screen,
drag&drop does not work properly: when dragging a view, the bounding
rectangle is displayed
  on the default screen. When dropping it on the desktop, it appears at 
the
correct position on the correct screen. But there's no chance to dock it
back
  into the workbench.

Do you have any ideas what I could do to solve the problem?
Are there any plans to integrate such a multihead support to SWT?

Thank you and regards
Mathias


_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev




Back to the top