if( !vicon_thread->interrupted ) return;
switch( vicon_drawing ) {
case AVICON_FULL_PLAY: // all vicons, viewing, target
- case AVICON_MOUSE_OVER: // one vicon, viewing, target
break;
+ case AVICON_MOUSE_OVER: // one vicon, viewing, target
+ if( vicon_thread->solo ) break;
+ // fall thru
case AVICON_SRC_TARGET: // no vicons, no view, target
case AVICON_NO_PLAY: // no vicons, no view, no target
return;
deactivate_selection();
}
- else if( get_button_down() ) {
+ else if( get_button_down() &&
+ mwindow->edl->session->assetlist_format != ASSETS_TEXT ) {
if( (item = (AssetPicon*)get_selection(0, 0)) != 0 ) {
switch( folder ) {
case AW_MEDIA_FOLDER:
return 1;
}
-int AWindowAssets::focus_in_event()
+int AWindowAssets::cursor_enter_event()
{
- int ret = BC_ListBox::focus_in_event();
+ int ret = BC_ListBox::cursor_enter_event();
switch( gui->vicon_drawing ) {
case AVICON_FULL_PLAY:
gui->start_vicon_drawing();
return ret;
}
+int AWindowAssets::cursor_leave_event()
+{
+ if( !gui->vicon_thread->viewing )
+ gui->stop_vicon_drawing();
+ return BC_ListBox::cursor_leave_event();
+}
+
int AWindowAssets::focus_out_event()
{
gui->stop_vicon_drawing();
case AVICON_MOUSE_OVER:
if( !vicon ) break;
gui->vicon_thread->solo = vicon;
+ gui->start_vicon_drawing();
+ // fall thru
+ case AVICON_SRC_TARGET:
+ if( !vicon ) break;
if( gui->vicon_thread->viewing )
gui->vicon_thread->set_view_popup(vicon);
break;
- case AVICON_SRC_TARGET:
case AVICON_NO_PLAY:
default:
break;
AWindowGUI *agui = avicon->agui;
agui->stop_vicon_drawing();
agui->vicon_thread->set_view_popup(0);
+ agui->vicon_thread->solo = 0;
agui->vicon_drawing = id;
agui->start_vicon_drawing();
return 1;
int drag_stop_event();
int button_press_event();
int column_resize_event();
- int focus_in_event();
+ int cursor_enter_event();
+ int cursor_leave_event();
int focus_out_event();
void update_vicon_area();
int mouse_over_event(int no);
int border_bottom = display_info.get_bottom_border();
int dual_head = screens > 1 ? 1 : 0;
- int right_w = root_w;
+ int left_w = 0, right_w = root_w;
+ int xin_screens = display_info.get_xinerama_screens();
+ if( xin_screens > 1 ) {
+ dual_head = 1;
+ int x, y, w, h;
+ for( int s=0; s<xin_screens; ++s ) {
+ if( display_info.xinerama_geometry(s, x, y, w, h) )
+ continue;
+ if( !y && !x ) {
+ left_w = w;
+ break;
+ }
+ }
+ if( left_w > 0 ) {
+ for( int s=0; s<xin_screens; ++s ) {
+ if( display_info.xinerama_geometry(s, x, y, w, h) )
+ continue;
+ if( !y && x == left_w ) {
+ right_w = w;
+ screens = 2;
+ break;
+ }
+ }
+ if( window_config == 1 ) {
+ root_x = left_w;
+ root_w = right_w;
+ }
+ else {
+ // use same aspect ratio to compute left height
+ root_w = left_w;
+ root_h = (root_w*root_h) / right_w;
+ }
+ }
+ }
// Wider than 16:9, narrower than dual head
- if( screens < 2 && (float)root_w / root_h > 1.8) {
+ if( screens < 2 && (float)root_w / root_h > 1.8 ) {
dual_head = 1;
switch( root_h ) {
case 600: right_w = 800; break;
BC_DisplayInfo::BC_DisplayInfo(const char *display_name, int show_error)
{
screen = -1;
+ xinerama_screens = -1;
+ xinerama_info = 0;
init_window(display_name, show_error);
}
BC_DisplayInfo::~BC_DisplayInfo()
{
+ if( xinerama_info ) XFree(xinerama_info);
#ifndef SINGLE_THREAD
XCloseDisplay(display);
#endif
XParseGeometry(geom, x, y, (unsigned int*)width, (unsigned int*)height);
}
+
+int BC_DisplayInfo::get_xinerama_screens()
+{
+ if( xinerama_screens < 0 ) {
+ xinerama_screens = 0;
+ if( XineramaIsActive(display) )
+ xinerama_info = XineramaQueryScreens(display, &xinerama_screens);
+ }
+ return xinerama_screens;
+}
+
+int BC_DisplayInfo::xinerama_geometry(int screen, int &x, int &y, int &w, int &h)
+{
+ int screens = get_xinerama_screens();
+ if( !screens ) return 1;
+ if( screen >= 0 ) {
+ int k = screens;
+ while( --k >= 0 && xinerama_info[k].screen_number != screen );
+ if( k < 0 ) return 1;
+ x = xinerama_info[k].x_org; w = xinerama_info[k].width;
+ y = xinerama_info[k].y_org; h = xinerama_info[k].height;
+ }
+ else {
+ int sx0 = INT_MAX, sx1 = INT_MIN;
+ int sy0 = INT_MAX, sy1 = INT_MIN;
+ for( int i=0; i<screens; ++i ) {
+ int x0 = xinerama_info[i].x_org;
+ int x1 = x0 + xinerama_info[i].width;
+ if( sx0 > x0 ) sx0 = x0;
+ if( sx1 < x1 ) sx1 = x1;
+ int y0 = xinerama_info[i].y_org;
+ int y1 = y0 + xinerama_info[i].height;
+ if( sy0 > y0 ) sy0 = y0;
+ if( sy1 < y1 ) sy1 = y1;
+ }
+ x = sx0; w = sx1 - sx0;
+ y = sy0; h = sy1 - sy0;
+ }
+ return 0;
+}
+
static void get_top_coords(Display *display, Window win, int &px,int &py, int &tx,int &ty)
{
Window *pcwin = 0; unsigned int ncwin = 0;
#include <stdio.h>
#include <stdlib.h>
#include <X11/Xlib.h>
+#include <X11/extensions/Xinerama.h>
class BC_DisplayInfo
{
static const char *host_display_name(const char *name);
void init_window(const char *display_name, int show_error=0);
int get_screen() { return screen; }
+ int get_xinerama_screens();
+ int xinerama_geometry(int screen, int &x, int &y, int &w, int &h);
private:
static void init_borders();
static int auto_reposition_y;
int default_depth;
char *display_name;
+ XineramaScreenInfo *xinerama_info;
+ int xinerama_screens;
};
#endif
#if __i386__
#define IP eip
+#define sigregs_t sigcontext
#endif
+
#if __x86_64__
#define IP rip
+#define sigregs_t sigcontext
+#endif
+
+#if __powerpc__ || __powerpc64__ || __powerpc64le__
+#include <asm/ptrace.h>
+#define IP nip
+#define sigregs_t pt_regs
#endif
+
#ifndef IP
#error gotta have IP
#endif
// if( uid != 0 ) return;
ucontext_t *uc = (ucontext_t *)sc;
int pid = getpid(), tid = gettid();
- struct sigcontext *c = (struct sigcontext *)&uc->uc_mcontext;
+ struct sigregs_t *c = (struct sigregs_t *)&uc->uc_mcontext;
uint8_t *ip = (uint8_t *)c->IP;
fprintf(stderr,"** %s at %p in pid %d, tid %d\n",
n==SIGSEGV? "segv" : n==SIGINT? "intr" : "trap",
switch(event->type) {
case ClientMessage:
// Clear the resize buffer
- if(resize_events) dispatch_resize_event(last_resize_w, last_resize_h);
+ if( resize_events )
+ dispatch_resize_event(last_resize_w, last_resize_h);
// Clear the motion buffer since this can clear the window
- if(motion_events)
- {
+ if( motion_events )
dispatch_motion_event();
- }
ptr = (XClientMessageEvent*)event;
-
-
- if(ptr->message_type == ProtoXAtom &&
- (Atom)ptr->data.l[0] == DelWinXAtom)
- {
+ if( ptr->message_type == ProtoXAtom &&
+ (Atom)ptr->data.l[0] == DelWinXAtom ) {
close_event();
}
- else
- if(ptr->message_type == RepeaterXAtom)
- {
+ else if( ptr->message_type == RepeaterXAtom ) {
dispatch_repeat_event(ptr->data.l[0]);
-// Make sure the repeater still exists.
-// for(int i = 0; i < repeaters.total; i++)
-// {
-// if(repeaters.values[i]->repeat_id == ptr->data.l[0])
-// {
-// dispatch_repeat_event_master(ptr->data.l[0]);
-// break;
-// }
-// }
}
- else
- if(ptr->message_type == SetDoneXAtom)
- {
+ else if( ptr->message_type == SetDoneXAtom ) {
done = 1;
- } else
- { // We currently use X marshalling for xatom events, we can switch to something else later
- receive_custom_xatoms((xatom_event *)ptr);
+ }
+ else {
+ receive_custom_xatoms((xatom_event *)ptr);
}
break;