/[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 1118 by astrand, Tue Mar 14 13:56:50 2006 UTC revision 1123 by astrand, Wed Mar 15 08:41:48 2006 UTC
# Line 57  typedef struct _seamless_window Line 57  typedef struct _seamless_window
57          int xoffset, yoffset;          int xoffset, yoffset;
58          int width, height;          int width, height;
59          unsigned int state;     /* normal/minimized/maximized */          unsigned int state;     /* normal/minimized/maximized */
60            unsigned int desktop;
61          struct _seamless_window *next;          struct _seamless_window *next;
62  } seamless_window;  } seamless_window;
63  static seamless_window *g_seamless_windows = NULL;  static seamless_window *g_seamless_windows = NULL;
# Line 85  static Cursor g_current_cursor; Line 86  static Cursor g_current_cursor;
86  static HCURSOR g_null_cursor = NULL;  static HCURSOR g_null_cursor = NULL;
87  static Atom g_protocol_atom, g_kill_atom;  static Atom g_protocol_atom, g_kill_atom;
88  extern Atom g_net_wm_state_atom;  extern Atom g_net_wm_state_atom;
89    extern Atom g_net_wm_desktop_atom;
90  static BOOL g_focused;  static BOOL g_focused;
91  static BOOL g_mouse_in_wnd;  static BOOL g_mouse_in_wnd;
92  /* Indicates that:  /* Indicates that:
# Line 300  seamless_remove_window(seamless_window * Line 302  seamless_remove_window(seamless_window *
302  }  }
303    
304    
305    /* Move all windows except wnd to new desktop */
306    static void
307    seamless_all_to_desktop(Window wnd, unsigned int desktop)
308    {
309            seamless_window *sw;
310            for (sw = g_seamless_windows; sw; sw = sw->next)
311            {
312                    if (sw->wnd == wnd)
313                            continue;
314                    if (sw->desktop != desktop)
315                    {
316                            ewmh_move_to_desktop(sw->wnd, desktop);
317                            sw->desktop = desktop;
318                    }
319            }
320    }
321    
322    
323  static void  static void
324  mwm_hide_decorations(Window wnd)  mwm_hide_decorations(Window wnd)
325  {  {
# Line 1957  xwin_process_events(void) Line 1977  xwin_process_events(void)
1977                                          sw->state = ewmh_get_window_state(sw->wnd);                                          sw->state = ewmh_get_window_state(sw->wnd);
1978                                          seamless_send_state(sw->id, sw->state, 0);                                          seamless_send_state(sw->id, sw->state, 0);
1979                                  }                                  }
1980    
1981                                    if ((xevent.xproperty.atom == g_net_wm_desktop_atom)
1982                                        && (xevent.xproperty.state == PropertyNewValue))
1983                                    {
1984                                            sw->desktop = ewmh_get_window_desktop(sw->wnd);
1985                                            seamless_all_to_desktop(sw->wnd, sw->desktop);
1986                                    }
1987    
1988                                  break;                                  break;
1989                          case MapNotify:                          case MapNotify:
1990                                  if (!g_seamless_rdp)                                  if (!g_seamless_rdp)
# Line 3019  ui_seamless_create_window(unsigned long Line 3047  ui_seamless_create_window(unsigned long
3047          long input_mask;          long input_mask;
3048          seamless_window *sw, *sw_parent;          seamless_window *sw, *sw_parent;
3049    
3050          get_window_attribs(&attribs);          /* Ignore CREATEs for existing windows */
3051            sw = seamless_get_window_by_id(id);
3052            if (sw)
3053                    return;
3054    
3055            get_window_attribs(&attribs);
3056          attribs.override_redirect = False;          attribs.override_redirect = False;
3057    
3058          /* FIXME: Do not assume that -1, -1 is outside screen Consider          /* FIXME: Do not assume that -1, -1 is outside screen Consider
# Line 3182  ui_seamless_setstate(unsigned long id, u Line 3214  ui_seamless_setstate(unsigned long id, u
3214                          break;                          break;
3215          }          }
3216  }  }
3217    
3218    
3219    void
3220    ui_seamless_syncbegin(unsigned long flags)
3221    {
3222            /* Destroy all seamless windows */
3223            while (g_seamless_windows)
3224            {
3225                    XDestroyWindow(g_display, g_seamless_windows->wnd);
3226                    seamless_remove_window(g_seamless_windows);
3227            }
3228    }

Legend:
Removed from v.1118  
changed lines
  Added in v.1123

  ViewVC Help
Powered by ViewVC 1.1.26