projects
/
goodguy
/
history.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
audio chan pos rework, batchrender deadlock, titler/crikey grab_event tweak, thread...
[goodguy/history.git]
/
cinelerra-5.1
/
guicast
/
bcwindowbase.C
diff --git
a/cinelerra-5.1/guicast/bcwindowbase.C
b/cinelerra-5.1/guicast/bcwindowbase.C
index 12e6c34a6faf3645f36f5aa394f74a7b753f9555..597a0ec99c2f9e265790fa16ee5a8104006b041d 100644
(file)
--- a/
cinelerra-5.1/guicast/bcwindowbase.C
+++ b/
cinelerra-5.1/guicast/bcwindowbase.C
@@
-85,9
+85,8
@@
Window XGroupLeader = 0;
Mutex BC_KeyboardHandlerLock::keyboard_listener_mutex("keyboard_listener",0);
ArrayList<BC_KeyboardHandler*> BC_KeyboardHandler::listeners;
Mutex BC_KeyboardHandlerLock::keyboard_listener_mutex("keyboard_listener",0);
ArrayList<BC_KeyboardHandler*> BC_KeyboardHandler::listeners;
-BC_WindowBase::BC_WindowBase(
int opts
)
+BC_WindowBase::BC_WindowBase()
{
{
- this->options = opts;
//printf("BC_WindowBase::BC_WindowBase 1\n");
BC_WindowBase::initialize();
}
//printf("BC_WindowBase::BC_WindowBase 1\n");
BC_WindowBase::initialize();
}
@@
-147,13
+146,13
@@
BC_WindowBase::~BC_WindowBase()
delete pixmap;
delete pixmap;
+//printf("delete glx=%08x, win=%08x %s\n", (unsigned)glx_win, (unsigned)win, title);
#ifdef HAVE_GL
#ifdef HAVE_GL
- if( get_resources()->get_synchronous() &&
- (top_level->options & GLX_WINDOW) && glx_win != 0 )
+ if( get_resources()->get_synchronous() && glx_win != 0 ) {
get_resources()->get_synchronous()->delete_window(this);
get_resources()->get_synchronous()->delete_window(this);
- else
+ }
#endif
#endif
-
XDestroyWindow(top_level->display, win);
+ XDestroyWindow(top_level->display, win);
if(bg_pixmap && !shared_bg_pixmap) delete bg_pixmap;
if(icon_pixmap) delete icon_pixmap;
if(bg_pixmap && !shared_bg_pixmap) delete bg_pixmap;
if(icon_pixmap) delete icon_pixmap;
@@
-177,6
+176,7
@@
BC_WindowBase::~BC_WindowBase()
&BC_WindowBase::mediumfont,
&BC_WindowBase::largefont,
&BC_WindowBase::bigfont,
&BC_WindowBase::mediumfont,
&BC_WindowBase::largefont,
&BC_WindowBase::bigfont,
+ &BC_WindowBase::clockfont,
};
for( int i=sizeof(xfont)/sizeof(xfont[0]); --i>=0; )
XFreeFont(display, this->*xfont[i]);
};
for( int i=sizeof(xfont)/sizeof(xfont[0]); --i>=0; )
XFreeFont(display, this->*xfont[i]);
@@
-193,6
+193,7
@@
BC_WindowBase::~BC_WindowBase()
&BC_WindowBase::bold_smallfont_xft,
&BC_WindowBase::bold_mediumfont_xft,
&BC_WindowBase::bold_largefont_xft,
&BC_WindowBase::bold_smallfont_xft,
&BC_WindowBase::bold_mediumfont_xft,
&BC_WindowBase::bold_largefont_xft,
+ &BC_WindowBase::clockfont_xft,
};
for( int i=sizeof(xft_font)/sizeof(xft_font[0]); --i>=0; ) {
XftFont *xft = (XftFont *)(this->*xft_font[i]);
};
for( int i=sizeof(xft_font)/sizeof(xft_font[0]); --i>=0; ) {
XftFont *xft = (XftFont *)(this->*xft_font[i]);
@@
-211,28
+212,15
@@
BC_WindowBase::~BC_WindowBase()
XvUngrabPort(display, xvideo_port_id, CurrentTime);
unlock_window();
XvUngrabPort(display, xvideo_port_id, CurrentTime);
unlock_window();
-// Can't close display if another thread is waiting for events.
-// Synchronous thread must delete display it owns a GLX_WINDOW
// Must be last reference to display.
// Must be last reference to display.
-#ifndef SINGLE_THREAD
-#ifdef HAVE_GL
- if( (options & GLX_DISPLAY) != 0 && get_resources()->get_synchronous() ) {
- printf(_("BC_WindowBase::~BC_WindowBase window deleted but opengl deletion is not\n"
- "implemented for BC_Pixmap.\n"));
- get_resources()->get_synchronous()->delete_display(this);
- }
- else
-#endif
- {
// _XftDisplayInfo needs a lock.
// _XftDisplayInfo needs a lock.
-
get_resources()->create_window_lock->lock("BC_WindowBase::~BC_WindowBase");
-
XCloseDisplay(display);
-
get_resources()->create_window_lock->unlock();
- }
+ get_resources()->create_window_lock->lock("BC_WindowBase::~BC_WindowBase");
+ XCloseDisplay(display);
+ get_resources()->create_window_lock->unlock();
+
// clipboard uses a different display connection
clipboard->stop_clipboard();
delete clipboard;
// clipboard uses a different display connection
clipboard->stop_clipboard();
delete clipboard;
-#endif // SINGLE_THREAD
}
resize_history.remove_all_objects();
}
resize_history.remove_all_objects();
@@
-429,7
+417,7
@@
int BC_WindowBase::create_window(BC_WindowBase *parent_window, const char *title
else
this->display_name[0] = 0;
else
this->display_name[0] = 0;
- put_title(
_(title)
);
+ put_title(
title
);
if(bg_pixmap) shared_bg_pixmap = 1;
subwindows = new BC_SubWindowList;
if(bg_pixmap) shared_bg_pixmap = 1;
subwindows = new BC_SubWindowList;
@@
-1031,6
+1019,10
@@
locking_message = event->xclient.message_type;
break;
case ButtonPress:
break;
case ButtonPress:
+ if(motion_events)
+ {
+ dispatch_motion_event();
+ }
get_key_masks(event->xbutton.state);
cursor_x = event->xbutton.x;
cursor_y = event->xbutton.y;
get_key_masks(event->xbutton.state);
cursor_x = event->xbutton.x;
cursor_y = event->xbutton.y;
@@
-1075,6
+1067,10
@@
locking_message = event->xclient.message_type;
break;
case ButtonRelease:
break;
case ButtonRelease:
+ if(motion_events)
+ {
+ dispatch_motion_event();
+ }
get_key_masks(event->xbutton.state);
button_number = event->xbutton.button;
event_win = event->xany.window;
get_key_masks(event->xbutton.state);
button_number = event->xbutton.button;
event_win = event->xany.window;
@@
-1812,7
+1808,7
@@
int BC_WindowBase::show_tooltip(const char *text, int x, int y, int w, int h)
if( wy >= (y1-=h) ) wy = y1;
// avoid tip under cursor (flickers)
int abs_x, abs_y;
if( wy >= (y1-=h) ) wy = y1;
// avoid tip under cursor (flickers)
int abs_x, abs_y;
- get_abs_cursor
_xy
(abs_x,abs_y, 0);
+ get_abs_cursor(abs_x,abs_y, 0);
if( wx < abs_x && abs_x < wx+w && wy < abs_y && abs_y < wy+h ) {
if( wx-abs_x < wy-abs_y )
wx = abs_x+1;
if( wx < abs_x && abs_x < wx+w && wy < abs_y && abs_y < wy+h ) {
if( wx-abs_x < wy-abs_y )
wx = abs_x+1;
@@
-3361,6
+3357,14
@@
int BC_WindowBase::ungrab(BC_WindowBase *window)
this->grab_active = 0;
return 1;
}
this->grab_active = 0;
return 1;
}
+int BC_WindowBase::grab_event_count()
+{
+ int result = 0;
+#ifndef SINGLE_THREAD
+ result = grab_active->get_event_count();
+#endif
+ return result;
+}
int BC_WindowBase::grab_buttons()
{
XSync(top_level->display, False);
int BC_WindowBase::grab_buttons()
{
XSync(top_level->display, False);
@@
-3740,13
+3744,13
@@
int BC_WindowBase::dispatch_selection_clear()
}
}
-void BC_WindowBase::get_relative_cursor
_xy
(int &x, int &y, int lock_window)
+void BC_WindowBase::get_relative_cursor(int &x, int &y, int lock_window)
{
int abs_x, abs_y, win_x, win_y;
unsigned int temp_mask;
Window temp_win;
{
int abs_x, abs_y, win_x, win_y;
unsigned int temp_mask;
Window temp_win;
- if(lock_window) this->lock_window("BC_WindowBase::get_relative_cursor
_xy
");
+ if(lock_window) this->lock_window("BC_WindowBase::get_relative_cursor");
XQueryPointer(top_level->display, top_level->win,
&temp_win, &temp_win, &abs_x, &abs_y, &win_x, &win_y,
&temp_mask);
XQueryPointer(top_level->display, top_level->win,
&temp_win, &temp_win, &abs_x, &abs_y, &win_x, &win_y,
&temp_mask);
@@
-3758,23
+3762,23
@@
void BC_WindowBase::get_relative_cursor_xy(int &x, int &y, int lock_window)
int BC_WindowBase::get_relative_cursor_x(int lock_window)
{
int x, y;
int BC_WindowBase::get_relative_cursor_x(int lock_window)
{
int x, y;
- get_relative_cursor
_xy
(x, y, lock_window);
+ get_relative_cursor(x, y, lock_window);
return x;
}
int BC_WindowBase::get_relative_cursor_y(int lock_window)
{
int x, y;
return x;
}
int BC_WindowBase::get_relative_cursor_y(int lock_window)
{
int x, y;
- get_relative_cursor
_xy
(x, y, lock_window);
+ get_relative_cursor(x, y, lock_window);
return y;
}
return y;
}
-void BC_WindowBase::get_abs_cursor
_xy
(int &abs_x, int &abs_y, int lock_window)
+void BC_WindowBase::get_abs_cursor(int &abs_x, int &abs_y, int lock_window)
{
int win_x, win_y;
unsigned int temp_mask;
Window temp_win;
{
int win_x, win_y;
unsigned int temp_mask;
Window temp_win;
- if(lock_window) this->lock_window("BC_WindowBase::get_abs_cursor
_xy
");
+ if(lock_window) this->lock_window("BC_WindowBase::get_abs_cursor");
XQueryPointer(top_level->display, top_level->win,
&temp_win, &temp_win, &abs_x, &abs_y, &win_x, &win_y,
&temp_mask);
XQueryPointer(top_level->display, top_level->win,
&temp_win, &temp_win, &abs_x, &abs_y, &win_x, &win_y,
&temp_mask);
@@
-3783,20
+3787,20
@@
void BC_WindowBase::get_abs_cursor_xy(int &abs_x, int &abs_y, int lock_window)
int BC_WindowBase::get_abs_cursor_x(int lock_window)
{
int abs_x, abs_y;
int BC_WindowBase::get_abs_cursor_x(int lock_window)
{
int abs_x, abs_y;
- get_abs_cursor
_xy
(abs_x, abs_y, lock_window);
+ get_abs_cursor(abs_x, abs_y, lock_window);
return abs_x;
}
int BC_WindowBase::get_abs_cursor_y(int lock_window)
{
int abs_x, abs_y;
return abs_x;
}
int BC_WindowBase::get_abs_cursor_y(int lock_window)
{
int abs_x, abs_y;
- get_abs_cursor
_xy
(abs_x, abs_y, lock_window);
+ get_abs_cursor(abs_x, abs_y, lock_window);
return abs_y;
}
return abs_y;
}
-void BC_WindowBase::get_pop_cursor
_xy
(int &px, int &py, int lock_window)
+void BC_WindowBase::get_pop_cursor(int &px, int &py, int lock_window)
{
int margin = 100;
{
int margin = 100;
- get_abs_cursor
_xy
(px, py, lock_window);
+ get_abs_cursor(px, py, lock_window);
if( px < margin ) px = margin;
if( py < margin ) py = margin;
int wd = get_screen_w(lock_window,-1) - margin;
if( px < margin ) px = margin;
if( py < margin ) py = margin;
int wd = get_screen_w(lock_window,-1) - margin;
@@
-3807,13
+3811,13
@@
void BC_WindowBase::get_pop_cursor_xy(int &px, int &py, int lock_window)
int BC_WindowBase::get_pop_cursor_x(int lock_window)
{
int px, py;
int BC_WindowBase::get_pop_cursor_x(int lock_window)
{
int px, py;
- get_pop_cursor
_xy
(px, py, lock_window);
+ get_pop_cursor(px, py, lock_window);
return px;
}
int BC_WindowBase::get_pop_cursor_y(int lock_window)
{
int px, py;
return px;
}
int BC_WindowBase::get_pop_cursor_y(int lock_window)
{
int px, py;
- get_pop_cursor
_xy
(px, py, lock_window);
+ get_pop_cursor(px, py, lock_window);
return py;
}
return py;
}
@@
-3851,7
+3855,7
@@
int BC_WindowBase::get_cursor_over_window()
int BC_WindowBase::cursor_above()
{
int rx, ry;
int BC_WindowBase::cursor_above()
{
int rx, ry;
- get_relative_cursor
_xy
(rx, ry);
+ get_relative_cursor(rx, ry);
return rx < 0 || rx >= get_w() ||
ry < 0 || ry >= get_h() ? 0 : 1;
}
return rx < 0 || rx >= get_w() ||
ry < 0 || ry >= get_h() ? 0 : 1;
}
@@
-4138,7
+4142,7
@@
void BC_WindowBase::put_title(const char *text)
void BC_WindowBase::set_title(const char *text, int utf8)
{
// utf8>0: wm + net_wm, utf8=0: wm only, utf<0: net_wm only
void BC_WindowBase::set_title(const char *text, int utf8)
{
// utf8>0: wm + net_wm, utf8=0: wm only, utf<0: net_wm only
- put_title(
_(text)
);
+ put_title(
text
);
const unsigned char *wm_title = (const unsigned char *)title;
int title_len = strlen((const char *)title);
if( utf8 >= 0 ) {
const unsigned char *wm_title = (const unsigned char *)title;
int title_len = strlen((const char *)title);
if( utf8 >= 0 ) {