/[rdesktop]/sourceforge.net/branches/seamlessrdp-branch/rdesktop/xwin.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/branches/seamlessrdp-branch/rdesktop/xwin.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1133 by astrand, Wed Mar 15 13:15:51 2006 UTC revision 1143 by ossman_, Thu Mar 16 08:41:53 2006 UTC
# Line 54  typedef struct _seamless_window Line 54  typedef struct _seamless_window
54  {  {
55          Window wnd;          Window wnd;
56          unsigned long id;          unsigned long id;
57            unsigned long parent;
58            XWMHints *hints;
59          int xoffset, yoffset;          int xoffset, yoffset;
60          int width, height;          int width, height;
61          int state;              /* normal/minimized/maximized. */          int state;              /* normal/minimized/maximized. */
# Line 293  seamless_remove_window(seamless_window * Line 295  seamless_remove_window(seamless_window *
295                  if (sw == win)                  if (sw == win)
296                  {                  {
297                          *prevnext = sw->next;                          *prevnext = sw->next;
298                            XFree(sw->hints);
299                          xfree(sw);                          xfree(sw);
300                          return;                          return;
301                  }                  }
# Line 3062  ui_seamless_create_window(unsigned long Line 3065  ui_seamless_create_window(unsigned long
3065                              CWBorderPixel, &attribs);                              CWBorderPixel, &attribs);
3066    
3067          XStoreName(g_display, wnd, "SeamlessRDP");          XStoreName(g_display, wnd, "SeamlessRDP");
3068            ewmh_set_wm_name(wnd, "SeamlessRDP");
3069    
3070          mwm_hide_decorations(wnd);          mwm_hide_decorations(wnd);
3071    
# Line 3084  ui_seamless_create_window(unsigned long Line 3088  ui_seamless_create_window(unsigned long
3088          }          }
3089    
3090          /* Set WM_TRANSIENT_FOR, if necessary */          /* Set WM_TRANSIENT_FOR, if necessary */
3091          if (parent)          if ((parent != 0x00000000) && (parent != 0xFFFFFFFF))
3092          {          {
3093                  sw_parent = seamless_get_window_by_id(parent);                  sw_parent = seamless_get_window_by_id(parent);
3094                  if (sw_parent)                  if (sw_parent)
# Line 3093  ui_seamless_create_window(unsigned long Line 3097  ui_seamless_create_window(unsigned long
3097                          warning("ui_seamless_create_window: No parent window 0x%lx\n", parent);                          warning("ui_seamless_create_window: No parent window 0x%lx\n", parent);
3098          }          }
3099    
3100    
3101          /* FIXME: Support for Input Context:s */          /* FIXME: Support for Input Context:s */
3102    
3103          get_input_mask(&input_mask);          get_input_mask(&input_mask);
# Line 3108  ui_seamless_create_window(unsigned long Line 3113  ui_seamless_create_window(unsigned long
3113          sw = malloc(sizeof(seamless_window));          sw = malloc(sizeof(seamless_window));
3114          sw->wnd = wnd;          sw->wnd = wnd;
3115          sw->id = id;          sw->id = id;
3116            sw->parent = parent;
3117            sw->hints = XAllocWMHints();
3118            sw->hints->flags = 0;
3119          sw->xoffset = 0;          sw->xoffset = 0;
3120          sw->yoffset = 0;          sw->yoffset = 0;
3121          sw->width = 0;          sw->width = 0;
# Line 3189  ui_seamless_settitle(unsigned long id, c Line 3197  ui_seamless_settitle(unsigned long id, c
3197                  return;                  return;
3198          }          }
3199    
3200            /* FIXME: Might want to convert the name for non-EWMH WMs */
3201          XStoreName(g_display, sw->wnd, title);          XStoreName(g_display, sw->wnd, title);
3202            ewmh_set_wm_name(sw->wnd, title);
3203  }  }
3204    
3205    
# Line 3205  ui_seamless_setstate(unsigned long id, u Line 3215  ui_seamless_setstate(unsigned long id, u
3215                  return;                  return;
3216          }          }
3217    
         if (sw->state == SEAMLESSRDP_NOTYETMAPPED)  
         {  
                 XMapWindow(g_display, sw->wnd);  
         }  
   
         sw->state = state;  
   
3218          switch (state)          switch (state)
3219          {          {
3220                  case SEAMLESSRDP_NORMAL:                  case SEAMLESSRDP_NORMAL:
3221                  case SEAMLESSRDP_MAXIMIZED:                  case SEAMLESSRDP_MAXIMIZED:
3222                          ewmh_change_state(sw->wnd, state);                          ewmh_change_state(sw->wnd, state);
3223                            XMapWindow(g_display, sw->wnd);
3224                          break;                          break;
3225                  case SEAMLESSRDP_MINIMIZED:                  case SEAMLESSRDP_MINIMIZED:
3226                          /* EWMH says: "if an Application asks to toggle _NET_WM_STATE_HIDDEN                          /* EWMH says: "if an Application asks to toggle _NET_WM_STATE_HIDDEN
# Line 3224  ui_seamless_setstate(unsigned long id, u Line 3228  ui_seamless_setstate(unsigned long id, u
3228                             _NET_WM_STATE_HIDDEN is a function of some other aspect of the window                             _NET_WM_STATE_HIDDEN is a function of some other aspect of the window
3229                             such as minimization, rather than an independent state." Besides,                             such as minimization, rather than an independent state." Besides,
3230                             XIconifyWindow is easier. */                             XIconifyWindow is easier. */
3231                          XIconifyWindow(g_display, sw->wnd, DefaultScreen(g_display));                          if (sw->state == SEAMLESSRDP_NOTYETMAPPED)
3232                            {
3233                                    sw->hints->flags |= StateHint;
3234                                    sw->hints->initial_state = IconicState;
3235                                    XSetWMHints(g_display, sw->wnd, sw->hints);
3236                                    XMapWindow(g_display, sw->wnd);
3237                            }
3238                            else
3239                                    XIconifyWindow(g_display, sw->wnd, DefaultScreen(g_display));
3240                          break;                          break;
3241                  default:                  default:
3242                          warning("SeamlessRDP: Invalid state %d\n", state);                          warning("SeamlessRDP: Invalid state %d\n", state);
3243                          break;                          break;
3244          }          }
3245    
3246            /* Handle popups without parents through some ewm hints */
3247            if ((sw->state == SEAMLESSRDP_NOTYETMAPPED) && (sw->parent == 0xFFFFFFFF))
3248                    ewmh_set_window_popup(sw->wnd);
3249    
3250            sw->state = state;
3251  }  }
3252    
3253    

Legend:
Removed from v.1133  
changed lines
  Added in v.1143

  ViewVC Help
Powered by ViewVC 1.1.26