LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 01-31-2014, 10:38 PM   #1
wealthychef
LQ Newbie
 
Registered: Jun 2010
Posts: 2

Rep: Reputation: 0
Programmatically creating X11 window to span multiple displays


I'm having the exact problem described here. How to make X11 window span multiple monitors
I have six monitors and am trying to create a window larger than the size of one of the monitors. It keeps getting resized by the window manager.
Apologize if I should post within that thread, the etiquette is not clear to me.
Anhow, I do the following in my code:

Code:
/* Pass some information along to the window manager to size the window */
  sizeHints.flags = USSize; //  | PMinSize;
  sizeHints.width = sizeHints.base_width = width; 
  sizeHints.height = sizeHints.base_height = height; 
  // sizeHints.min_width = width;
  // sizeHints.min_height = height;
  // sizeHints.max_width = mScreenWidth;
  // sizeHints.max_height = mScreenHeight;
  if (geometry->x != DONT_CARE && geometry->y != DONT_CARE) {
    sizeHints.x = geometry->x;
    sizeHints.y = geometry->y;
    sizeHints.flags |= USPosition;
  }

  XSetNormalHints(mDisplay, mWindow, &sizeHints);


  SetTitle(suggestedName); 
  XSetStandardProperties(mDisplay, mWindow, 
                         suggestedName.toAscii(), suggestedName.toAscii(), 
                             None, (char **)NULL, 0, &sizeHints);
  /* Bring it up; then wait for it to actually get here. */
  XMapWindow(mDisplay, mWindow);
The problem I'm having is that if I set min_width and min_height, the user cannot resize the window, which is not what I want. But if I don't, then when I do any X11 call later, such as

Code:
  XGetWindowAttributes(mDisplay, mWindow, &win_attributes);
the window manager resizes my window to fit into one monitor instead of being larger than the monitor. I cannot just get a window of the desired size for some reason. Note that WidthOfScreen and HeightOfScreen give me the combined width and height of all monitors as expected.
Can anyone help? I hope I'm explaining myself clearly enough.
 
Old 02-07-2014, 10:00 AM   #2
wealthychef
LQ Newbie
 
Registered: Jun 2010
Posts: 2

Original Poster
Rep: Reputation: 0
I "solved" this with a workaround. For certain circumstances, when it is more important that a window open with a size bigger than a certain monitor, then I use the PMinSize flag combined with sizeHints.min_width and min_height to force the window to not shrink. In this case, the tradeoff is that the user cannot shrink the window too. But I allow the user to click a button that allows them to shrink the window if desired.
 
Old 02-07-2014, 02:07 PM   #3
mjolnir
Member
 
Registered: Apr 2003
Posts: 815

Rep: Reputation: 99
Quote:
Originally Posted by wealthychef View Post
I "solved" this with a workaround. For certain circumstances, when it is more important that a window open with a size bigger than a certain monitor, then I use the PMinSize flag combined with sizeHints.min_width and min_height to force the window to not shrink. In this case, the tradeoff is that the user cannot shrink the window too. But I allow the user to click a button that allows them to shrink the window if desired.
Thanks for posting back a workaround.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
creating iso image programmatically from a file descriptor rohini447 SUSE / openSUSE 2 06-11-2011 03:42 AM
How to make a figure span multiple column in Latex lunarbof Programming 5 04-11-2011 04:33 AM
Is it possible for a LVM group to span multiple raid devices? mikesjays Linux - Hardware 2 01-28-2009 08:35 AM
Will K3B span file over multiple DVD disks chmasy Linux - General 2 12-28-2007 11:19 PM
untarring archives that span multiple tapes? BrianK Linux - General 2 11-29-2005 09:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 10:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration