/[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 1154 by ossman_, Fri Mar 17 09:56:20 2006 UTC revision 1155 by ossman_, Fri Mar 17 10:48:11 2006 UTC
# Line 55  typedef struct _seamless_window Line 55  typedef struct _seamless_window
55          Window wnd;          Window wnd;
56          unsigned long id;          unsigned long id;
57          unsigned long parent;          unsigned long parent;
58            unsigned long behind;
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 62  typedef struct _seamless_window Line 63  typedef struct _seamless_window
63          struct _seamless_window *next;          struct _seamless_window *next;
64  } seamless_window;  } seamless_window;
65  static seamless_window *g_seamless_windows = NULL;  static seamless_window *g_seamless_windows = NULL;
66    static unsigned long g_seamless_focused = 0;
67  static BOOL g_seamless_started = False; /* Server end is up and running */  static BOOL g_seamless_started = False; /* Server end is up and running */
68  static BOOL g_seamless_active = False;  /* We are currently in seamless mode */  static BOOL g_seamless_active = False;  /* We are currently in seamless mode */
69  extern BOOL g_seamless_rdp;  extern BOOL g_seamless_rdp;
# Line 324  seamless_all_to_desktop(Window wnd, unsi Line 326  seamless_all_to_desktop(Window wnd, unsi
326    
327    
328  static void  static void
329    seamless_restack_window(seamless_window * sw, unsigned long behind)
330    {
331            seamless_window *sw_above;
332    
333            /* Remove window from stack */
334            for (sw_above = g_seamless_windows; sw_above; sw_above = sw_above->next)
335            {
336                    if (sw_above->behind == sw->id)
337                            break;
338            }
339    
340            if (sw_above)
341                    sw_above->behind = sw->behind;
342    
343            /* And then add it at the new position */
344    
345            for (sw_above = g_seamless_windows; sw_above; sw_above = sw_above->next)
346            {
347                    if (sw_above->behind == behind)
348                            break;
349            }
350    
351            if (sw_above)
352                    sw_above->behind = sw->id;
353    
354            sw->behind = behind;
355    }
356    
357    
358    static void
359  mwm_hide_decorations(Window wnd)  mwm_hide_decorations(Window wnd)
360  {  {
361          PropMotifWmHints motif_hints;          PropMotifWmHints motif_hints;
# Line 1774  ui_seamless_handle_restack(seamless_wind Line 1806  ui_seamless_handle_restack(seamless_wind
1806                          break;                          break;
1807          }          }
1808    
1809            if (!sw_below && !sw->behind)
1810                    return;
1811            if (sw_below && (sw_below->id == sw->behind))
1812                    return;
1813    
1814          if (sw_below)          if (sw_below)
1815            {
1816                  seamless_send_zchange(sw->id, sw_below->id, 0);                  seamless_send_zchange(sw->id, sw_below->id, 0);
1817                    seamless_restack_window(sw, sw_below->id);
1818            }
1819          else          else
1820            {
1821                  seamless_send_zchange(sw->id, 0, 0);                  seamless_send_zchange(sw->id, 0, 0);
1822                    seamless_restack_window(sw, 0);
1823            }
1824  }  }
1825    
1826  /* Process events in Xlib queue  /* Process events in Xlib queue
# Line 1917  xwin_process_events(void) Line 1960  xwin_process_events(void)
1960                                  if (!sw)                                  if (!sw)
1961                                          break;                                          break;
1962    
1963                                  seamless_send_focus(sw->id, 0);                                  if (sw->id != g_seamless_focused)
1964                                    {
1965                                            seamless_send_focus(sw->id, 0);
1966                                            g_seamless_focused = sw->id;
1967                                    }
1968                                  break;                                  break;
1969    
1970                          case FocusOut:                          case FocusOut:
# Line 3173  ui_seamless_create_window(unsigned long Line 3220  ui_seamless_create_window(unsigned long
3220          sw->wnd = wnd;          sw->wnd = wnd;
3221          sw->id = id;          sw->id = id;
3222          sw->parent = parent;          sw->parent = parent;
3223            sw->behind = 0;
3224          sw->xoffset = 0;          sw->xoffset = 0;
3225          sw->yoffset = 0;          sw->yoffset = 0;
3226          sw->width = 0;          sw->width = 0;
# Line 3284  ui_seamless_restack_window(unsigned long Line 3332  ui_seamless_restack_window(unsigned long
3332          {          {
3333                  XRaiseWindow(g_display, sw->wnd);                  XRaiseWindow(g_display, sw->wnd);
3334          }          }
3335    
3336            seamless_restack_window(sw, behind);
3337  }  }
3338    
3339  void  void

Legend:
Removed from v.1154  
changed lines
  Added in v.1155

  ViewVC Help
Powered by ViewVC 1.1.26